You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ma...@t-systems.com on 2008/09/17 11:59:14 UTC
soap headers not present in handler
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
RE: soap headers not present in handler
Posted by Martin Gainty <mg...@hotmail.com>.
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: deepalk@gmail.com
> To: axis-user@ws.apache.org
> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
_________________________________________________________________
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
AW: soap headers not present in handler
Posted by Ma...@t-systems.com.
I solved it and it is just a stupid fault.
I forgot to declare the wsa namespace and just used the prefix. The usual copy&paste- problem. :)
Maybe there could be an error message from Axis telling me that a prefix isn't declared in the request message. That would be very helpful.
Hope this helps anybody else as well,
Matthias.
> -----Ursprüngliche Nachricht-----
> Von: Gaiser, Matthias
> Gesendet: Donnerstag, 18. September 2008 09:33
> An: axis-user@ws.apache.org
> Betreff: AW: soap headers not present in handler
>
> Thanky you for your answer Deepal.
>
> I understand this. That's why I add the wsa-headers before the wsa-
> headers are handled which works quite good.
> But my problem is that when my client sends the wsa-headers, I cannot
> access the headers from my handler. It is just like I won't send it,
> but I definitely do, I have traced it via tcpmon.
>
> An example request is here, maybe something is wrong with this. I want
> to access the someID-header.
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:pwc="http://pwc.t-systems.de/pwc">
> <soapenv:Header>
> <wsa:MessageID>http://example.com/6B29FC40-CA47-1067-B31D-
> 00DD010662DA</wsa:MessageID>
> <wsa:ReplyTo>
>
> <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Addres
> s>
> </wsa:ReplyTo>
> <wsa:To>http://localhost:8080/PWCNG/services/PWCService</wsa:To>
> <wsa:Action>urn:login</wsa:Action>
> <someID xmlns="http://someIDnamespace">12345</someID>
> </soapenv:Header>
> <soapenv:Body>
> <pwc:login>
> <pwc:user>test</pwc:user>
> <pwc:password>test</pwc:password>
> <pwc:languageID>DE</pwc:languageID>
> </pwc:login>
> </soapenv:Body>
> </soapenv:Envelope>
>
> Thanks for any help,
> Matthias.
>
> > -----Ursprüngliche Nachricht-----
> > Von: Deepal jayasinghe [mailto:deepalk@gmail.com]
> > Gesendet: Mittwoch, 17. September 2008 14:48
> > An: axis-user@ws.apache.org
> > Betreff: 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: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
AW: soap headers not present in handler
Posted by Ma...@t-systems.com.
Thanky you for your answer Deepal.
I understand this. That's why I add the wsa-headers before the wsa-headers are handled which works quite good.
But my problem is that when my client sends the wsa-headers, I cannot access the headers from my handler. It is just like I won't send it, but I definitely do, I have traced it via tcpmon.
An example request is here, maybe something is wrong with this. I want to access the someID-header.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pwc="http://pwc.t-systems.de/pwc">
<soapenv:Header>
<wsa:MessageID>http://example.com/6B29FC40-CA47-1067-B31D-00DD010662DA</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://localhost:8080/PWCNG/services/PWCService</wsa:To>
<wsa:Action>urn:login</wsa:Action>
<someID xmlns="http://someIDnamespace">12345</someID>
</soapenv:Header>
<soapenv:Body>
<pwc:login>
<pwc:user>test</pwc:user>
<pwc:password>test</pwc:password>
<pwc:languageID>DE</pwc:languageID>
</pwc:login>
</soapenv:Body>
</soapenv:Envelope>
Thanks for any help,
Matthias.
> -----Ursprüngliche Nachricht-----
> Von: Deepal jayasinghe [mailto:deepalk@gmail.com]
> Gesendet: Mittwoch, 17. September 2008 14:48
> An: axis-user@ws.apache.org
> Betreff: 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: soap headers not present in handler
Posted by Deepal jayasinghe <de...@gmail.com>.
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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org