function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bms270Bms270 

How to send SOAP header info to the Apex class generated with an esternal WSDL file?

In normal usage of webservices I can put soap header info into <soapenv:Header> in the xml request. Now I want to know how I can set those information when using the Apex class that is generated with my WSDL file.

SuperfellSuperfell
the header has to be declared in the WSDL, right now apex does not support arbitrary soap headers.
Bms270Bms270
Thanks so much for prompt reply, would you show me where to put soap header info in the WSDL file? or just point me to a document explaining that? I have never tried this before.

Thanks!
Bms270Bms270
Simon,

I defined the SOAP header in the WSDL but dont know how I can include my custom Tokens in it. my custom tokens are:

<VendorToken xmlns="urn:commerce:vendor">
   <VendorId xmlns="urn:commerce:vendor">xxxx</VendorId>
</VendorToken>
<AuthenticationToken xmlns="urn:commerce:authentication">
   <Username xmlns="urn:commerce:authentication">xxxx</Username>
   <Password xmlns="urn:commerce:authentication">yyyy</Password>
</AuthenticationToken>

I dont know if I have to define this in my wsdl document or I can set the content of the header from the apex class that is generated from the wsdl. I appreciate your help.

Thanks.
sdavidow9sdavidow9

Did you ever get an answer on this?  I'm working on a similar issue and can't seem to get the answer.

Thanks.