• qcmike
  • 0 Points
  • Member since 2010

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2

I'm trying to connect to a soap web service which implicitly defines a required soap header. That part of the WSDL looks like this:
 <s0:Policy s1:Id="Auth.xml">
    <wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy">
  <wsp:UsingPolicy s2:Required="true"/>
In order to call this service, I need to set my soap header to look like this:
<wsse:UsernameToken wsu:Id="UsernameToken-3" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
So, wsdl2apex doesn't create these elements when generating the apex class. As far as I can see its not possible to set arbitrary soap headers from within apex. At this point I've tried to modify the WSDL to make this explicit and I've tried to modify the generated class to produce the proper header but I've had no luck up to this point. Anyone have any ideas? Is this possible from within apex?

  • September 13, 2010
  • Like
  • 0

Currently, I am working on a POV for one of my customer.

I have a webservice hosted by a third party provider and I try to invoke this web service. So I have loaded the WSDL into Force.com (including SOAP Headers and SOAP Faults) and the APEX calsses has been created. This is working fine as long as I do not recieved a SOAP fault.


When the Web Service is returning a SOAP Fault, a callout exception is generated. I try to find a way to get that SOAP fault in the associated object genereted automatically but I cannot find how.


Is there a way to get the SOAP Fault into the SOAP Fault object generated when importing the WSDL? If not is there at least a way to retrieve to full SOAP message that was recieved?



Karolinski Stéphane