WSIF hasn't yet implemented support for SOAP headers defined in WSDL, its
on a todo list though. For now you have to manually get/set them using the
context message.

You do that with code something like the following:

    ArrayList al = makeSOAPHeaders();
    WSIFMessage context = operation.getContext();
    context.setObjectPart(
        WSIFConstants.CONTEXT_REQUEST_SOAP_HEADERS,
        al);
    operation.setContext(context);

Where makeSOAPHeaders returns an ArrayList containing DOM Element objects
for each header. After the operation has been invoked you can retrieve the
response SOAP headers with:

    context = operation.getContext();
    ArrayList al = (ArrayList) context.getObjectPart(
        WSIFConstants.CONTEXT_RESPONSE_SOAP_HEADERS);


       ...ant

Anthony Elder
[EMAIL PROTECTED]
Web Services Development
IBM UK Laboratories,  Hursley Park
(+44) 01962 818320, x248320, MP208.


"Simon Solomon" <[EMAIL PROTECTED]> on 02/04/2003 23:16:14

Please respond to [EMAIL PROTECTED]

To:    [EMAIL PROTECTED]
cc:
Subject:    WSIF And Soap Headers







Greetings!

     I am successfully setting HTTP headers for SOAP over HTTP requests.

     However, I would like to know if there is an easier way(Recommended
Way)
     to SET and GET SOAP headers.
     We have a service that implements soap headers for the communication
     between various operations defined for the service.

     As shown in the attached sample binding, the "init" operation creates
the soap header,
     and the "getRoles" operation requires the soap header. In this sample,
the soap header
     is used to track initialization information. The client must attach
this header for all other
     subsequent operation calls.

Thanks!

     Sample Service Binding Section:

     <binding name="RoleManagerSvcSoap" type="s0:RoleManagerSvcSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style
="document" />
    <operation name="init">
      <soap:operation soapAction="http://sde.fds.com/init"; style="document"
/>
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
        <soap:header d5p1:required="true" message
="s0:initDirProviderSoapHeader" part="DirProviderSoapHeader" use="literal"
xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/"; />
      </output>
    </operation>
    <operation name="getAllRoles">
      <soap:operation soapAction="http://sde.fds.com/getAllRoles"; style
="document" />
      <input>
        <soap:body use="literal" />
        <soap:header d5p1:required="true" message
="s0:getAllRolesDirProviderSoapHeader" part="DirProviderSoapHeader" use
="literal" xmlns:d5p1="http://schemas.xmlsoap.org/wsdl/"; />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>


Simon Solomon
[EMAIL PROTECTED]




Reply via email to