tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreessen <andrees...@list.ru>
Subject Re: SOAP HEADERS with OpenEJB
Date Fri, 25 Dec 2009 11:59:17 GMT

Hi Jean-Louis,

Thanks a lot for your reply.. 
The thing is that I could not use token as a parameter for method
invocation.. I use it for SSO and it should be put into headers in the
manner I described early (something like this - 
WSBindingProvider wsPort = (WSBindingProvider) provider;
        wsPort.setOutboundHeaders(Headers.create(new
QName("http://my.service.com/", "token"),token));
)..
if you could add example about first way you suggested it would be great!

Appreciate your help and Merry Christmas, Happy New Year!!



Jean-Louis MONTEIRO wrote:
> 
> Hi,
> 
> i finally got enough time to dig into.
> 
> It seems to me your are using a SUN API in the client side to add SOAP
> Headers.
> If you use a standalone client outside OpenEJB, you can definitely use
> another JAX-WS implementation (RI if you want).
> 
> If you are in OpenEJB, i strongly advice to use our JAX-WS implementation
> (CXF).
> 
> By the way, what is the real need?
> AFAIK, you want to add some SOAP Headers you want to recover in the server
> side.
> If i'm right, i see 2 ways to do such:
> - using a SOAP handler both in the client side and the server side. It's a
> standard way you can use with the SUN, CXF, ... API
> - using the JAX-WS annotation (@WebParam(header=true)) in the SEI. In the
> server side, you can directly access the value.
> 
> In the simple-webservice sample, i used the second way (@WebParam
> annotation).
> If you need some inputs for the first one, i can definitely add it to the
> same sample.
> 
> Hope it helps.
> Jean-Louis
> 
> 
> 
> 
> 
> andreessen wrote:
>> 
>> Hi there,
>> 
>> Would you be so kind to help me with a problem I met.. I am currently
>> using Openejb to test my app during maven build and I need to send xml
>> token in SOAP Headers so I put it there in this way:
>> 
>> WSBindingProvider wsPort = (WSBindingProvider) provider;
>>         wsPort.setOutboundHeaders(Headers.create(new
>> QName("http://my.service.com/", "token"),token));
>> 
>> Initially I tried to get it from WebServiceContext injected into my
>> service (@Resource WebServiceContext wctx:
>> 
>> String test =
>> wctx.getMessageContext().get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY)
>> 
>> it did not help... then I created ejb handler: public class MyHandler
>> implements SOAPHandler<SOAPMessageContext> and I tried to extract headers
>> from envelope as described there:
>> http://www.docjar.com/html/api/org/apache/cxf/jaxws/handler/soap/SOAPMessageContextImpl.java.html
>> 
>> public boolean handleMessage(SOAPMessageContext context) {
>>    SOAPHeader header = message.getSOAPPart().getEnvelope().getHeader();
>>    LOG.log(Level.INFO, "Handler MessageContext SOAPHeader: " +
>> header.toString(), "");
>> }
>> 
>> ..but it just empty.. - so does SOAP envelope...
>> 
>> Could you give me a hint what I am doing wrong and is it possible to do
>> it altogether?
>> 
>> Appreciate your help, thanks!
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/SOAP-HEADERS-with-OpenEJB-tp26412403p26920344.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message