I'm not sure I follow, given these fragments, why don't any of the
headers specified in the binding appear in the method signature ? Is
this another JAX-RPC snafu ?

Cheers
Simon

    <message name="resetPasswordRequest">
        <part element="tns:resetPassword" name="parameters"/>
    </message>
    <message name="resetPasswordResponse">
        <part element="tns:resetPasswordResponse" name="parameters"/>
    </message>
    <message name="Header">
        <part element="tns:SessionHeader"
name="SessionHeader"/>
        <part element="tns:CallOptions"
name="CallOptions"/>
        <part element="tns:QueryOptions"
name="QueryOptions"/>
        <part element="tns:AssignmentRuleHeader"
name="AssignmentRuleHeader"/>
        <part element="tns:MruHeader"
name="MruHeader"/>
        <part element="tns:ifModifiedBefore"
name="ifModifiedBefore"/>
        <part element="tns:ifModifiedSince"
name="ifModifiedSince"/>

    </message>

<!-- portType -->
        <operation name="resetPassword">
            <documentation>Reset a user's password</documentation>
            <input  message="tns:resetPasswordRequest"/>
            <output message="tns:resetPasswordResponse"/>
            <fault  message="tns:InvalidIdFault" name="InvalidIdFault"/>
            <fault  message="tns:UnexpectedErrorFault"
name="UnexpectedErrorFault"/>
        </operation>

<!-- binding -->
        <operation name="resetPassword">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" message="tns:Header"
part="SessionHeader"/>
                <soap:header use="literal" message="tns:Header"
part="CallOptions"/>
                <soap:body parts="parameters" use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="InvalidIdFault">
                <soap:fault name="InvalidIdFault" use="literal"/> 
            </fault>
            <fault name="UnexpectedErrorFault">
                <soap:fault name="UnexpectedErrorFault" use="literal"/> 
            </fault>
        </operation> 

-----Original Message-----
From: Hans Planting (CWEU-USERS/CWNL)
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 24, 2005 2:25 AM
To: axis-user@ws.apache.org
Subject: Re: soap:headers and explicit service context

Hi,

> But it doesn't expose these headers are part of the method signature.


This is what I thought as well, hence my question, but it turns out my
wsdl was incorrect.

If you want your soap:headers be part of the method signature (explicit
service context) then as far as I understand it you need to set the part
attribute of the soap:header to a wsdl:part in the wsdl:message that is
refered to by the wsdl:input/wsdl:output of the wsdl:operation.

If the part attribute refers to a part in a message not refered to by
the input or output of the message then the header parts will not be
part of the method signature and you need to write custom handlers in
order to deal with headers (implicit service context).

However there are still a couple of strange things I encountered when
using soap:headers in document/literal style documents:
- the parameters generated from the wsdl:input parts are wrapped in a
java object, while when not using headers they are not;
- when combining explicit and implicit soap:headers in one wsdl document
the wrapped java object mentioned above is not generated but is actually
refered to by the generated stub.

Regards,
Hans


>But it doesn't expose these headers are part of the method signature.
>You're left to call setHeader yourself (and therefore have to manualy 
>copy over the element names & namespaces from the WSDL, which is error 
>prone). I think I logged a bug for this a while back.
>
>Cheers
>Simon
>
>-----Original Message-----
>From: Davanum Srinivas [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 23, 2005 7:35 AM
>To: axis-user@ws.apache.org
>Subject: Re: soap:headers and explicit service context
>
>If you set up the wsdl correctly, then the generated code has the 
>addition java objects for the stuff in soap headers.
>
>-- dims
>
>On 8/23/05, Hans Planting (CWEU-USERS/CWNL) 
><[EMAIL PROTECTED]> wrote:
>  
>
>>Hi there,
>>
>>Is there support planned for explicit soap headers as described in 
>>JAX-RPC 1.1 chapter 11.2.2?
>>With explicit soap headers I'd expect Axis to append additional 
>>parameters for soap:headers following the service endpoint defined 
>>paramers in the remote method signature. Also no custom 
>>parsing/deserialization would need to be implemented.
>>Currently in order to process soap:headers you need to implement a 
>>handler or use the setHeader and getHeader methods in 
>>org.apache.axis.client.Stub and in both cases implement code to 
>>parse/deserialize the soap elements; Axis does not deserialize the 
>>contents of soap:headers to Java objects (correct me if I'm wrong - is
>>    
>>
>
>  
>
>>there a way to do this?).
>>
>>Thanx!
>>
>>Hans
>>
>>    
>>
>
>
>--
>Davanum Srinivas : http://wso2.com/ - Oxygenating The Web Service 
>Platform
>
>  
>



Reply via email to