+ Start a Discussion
vinit_sfvinit_sf 

Need help with SOAP request

Currently I am able to send the Header in the Soap request in 2 ways as shown below:

 

1st way

<env:Header>

            <Security xmlns ="http://schemas.xmlsoap.org/ws/2003/06/secext">

                        <UsernameToken>

                                    <Username>abcde</Username>

                                    <Password>abc123</Password>            (Password here is simple xsd:string type)

                        </UsernameToken>

            </ Security>

</env:Header>

 

And like this:

2nd way

<env:Header>

            <Security xmlns ="http://schemas.xmlsoap.org/ws/2003/06/secext">

                        <UsernameToken>

                                    <Username>abcde</Username>

                                    <Password Type=”PasswordText” />

                        </UsernameToken>

            </ Security>

</env:Header>

 

 

But this is the header that I require (marked in Red):

<env:Header>

            <Security xmlns ="http://schemas.xmlsoap.org/ws/2003/06/secext" soapenv:mustUnderstand="1">

                        <UsernameToken>

                                    <Username>abcde</Username>

                                    <Password Type= “PasswordText”>abc123</Password>

                        </UsernameToken>

            </ Security>

</env:Header>

 

 

What I am unable to create 2 things as shown above:

  1. I can send either password type or password value, but not both together.
  2. I cannot add soapenv:mustUnderstand="1" in Security tag.

Is there way to achieve it by making modification in the Apex class or any other way?

 

Thank you.



sdetweilsdetweil

what does the class definition look like?  did you use the generated wsdl to build your client?

 

Sam

vinit_sfvinit_sf

Hi Sam,

 

The class is generated by WSDL2Apex.

 

Thank you..

Imran MohammedImran Mohammed

Hi Vinit,

 

Were you able to resolve the issue. If yes, please share what you have done to achieve this.