can we override ws-addressing with SOAP_ROLE_FOR_ADDRESSING_HEADERS msgContext 
property
e.g. AddressingOutHandlerTest.java
//test-harness

        ConfigurationContext cfgCtx = 
ConfigurationContextFactory.createDefaultConfigurationContext();
        msgCtxt = cfgCtx.createMessageContext();

        
msgCtxt.setProperty(AddressingConstants.SOAP_ROLE_FOR_ADDRESSING_HEADERS,
                            "urn:test:role");

        EndpointReference epr = new 
EndpointReference("http://www.from.org/service/";);
        epr.addReferenceParameter(new QName("Reference2"),
                                  "Value 200");
        msgCtxt.setFrom(epr);

        epr = new EndpointReference("http://www.to.org/service/";);
        epr.addReferenceParameter(
                new QName("http://reference.org";, "Reference4", "myRef"),
                "Value 400");
        epr.addReferenceParameter(
                new QName("http://reference.org";, "Reference3", "myRef"),
                "Value 300");

        msgCtxt.setTo(epr);
        msgCtxt.setProperty(WS_ADDRESSING_VERSION, Submission.WSA_NAMESPACE);
        msgCtxt.setProperty(REPLACE_ADDRESSING_HEADERS, Boolean.TRUE);
        
msgCtxt.setProperty(AddressingConstants.ADD_MUST_UNDERSTAND_TO_ADDRESSING_HEADERS,
 Boolean.TRUE);

        epr = new EndpointReference("http://www.replyTo.org/service/";);
        msgCtxt.setReplyTo(epr);

        msgCtxt.setMessageID("123456-7890");
        msgCtxt.setWSAAction("http://www.actions.org/action";);

        org.apache.axis2.addressing.RelatesTo relatesTo = new 
org.apache.axis2.addressing.RelatesTo(
                "http://www.relatesTo.org/service/";, "TestRelation");
        msgCtxt.addRelatesTo(relatesTo);

        
msgCtxt.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
        outHandler.invoke(msgCtxt);

//AXIS code: must resolve to true to replace addressing
  boolean replaceHeaders = 
msgContext.isPropertyTrue(REPLACE_ADDRESSING_HEADERS);
        
// Allow the user to specify the role these WS-Addressing headers should be 
targetted
//at this must resolve to non null to rewrite the SOAP Header
  String role = (String) 
msgContext.getProperty(SOAP_ROLE_FOR_ADDRESSING_HEADERS);
 
  WSAHeaderWriter writer = new WSAHeaderWriter(msgContext, 
isSubmissionNamespace,
                                                      
addMustUnderstandAttribute, replaceHeaders,
                                                     includeOptionalHeaders, 
role);
  writer.writeHeaders();
?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Date: Wed, 17 Sep 2008 08:48:19 -0400
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: Re: soap headers not present in handler
> 
> The problem is Axis2 server only send the wsa- headers if any only if
> you send request with wsa.
> 
> Thank you!
> Deepal
> >
> > Hi group,
> >
> > I have a weird phenomenon.
> >
> > I have implemented a compatibility header which adds the ws-adressing
> > headers to non-ws-adressing-requests. I need this in order to use the
> > soapsession id (servicegroupid) for my soapsession based service.
> >
> > Now I can call my service with a request without the wsa-headers and
> > it works, I can find my additional headers in the request and process
> > them.
> >
> > When I send a wsa request, I am not able to access the soap headers
> > from a handler. In the handler I can’t find any soap headers in the
> > request message.
> >
> > Can somebody give me a hint what the reason might be? I’d be very glad
> > about it..
> >
> > Thank you,
> >
> > Matthias Gaiser
> >
> 
> 
> -- 
> Thank you!
> 
> 
> http://blogs.deepal.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Reply via email to