aspose file tools*
The moose likes Web Services and the fly likes how do I insert security headers in to soap jax-rcp request using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "how do I insert security headers in to soap jax-rcp request using Java" Watch "how do I insert security headers in to soap jax-rcp request using Java" New topic
Author

how do I insert security headers in to soap jax-rcp request using Java

Nicolaas Loubser
Greenhorn

Joined: Sep 02, 2011
Posts: 3
Hi

Thank you for reading my post Appologies if it should be in the Java forum.

I am using eclipse to import a jax-rpc encoded webservice from a service provider. This part works well, and Eclipse creates all the classes needed, and I get data back. There are however a few calls that needs additional headers, either a session id, or a username and password, which ever is available.

I dont understand why Eclipse doesnt import the security headers as well, as it is clearly defined in the XML and can be viewed in SOAPUI. I went through my project and it doesn't seem as if Eclipse created it somewhere else.

I have tried the following as well, using bindings, and wscompile, but no luck.

Does anyone have any idea how I had security headers(or message layer headers as I believe they are called) to an outgoing SOAP request using JAX RPC?

Thank you very much,

Nico
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I try to stay away from JAX-RPC, but as far as I recall, handlers should be available there too (as they are in JAX-WS).
To add headers, you can write a handler that add them to outgoing SOAP messages. Data to fill in the headers can be stored in the message context (?) and then be inserted in the headers by the handler.
This article may help you: http://www.ibm.com/developerworks/webservices/library/ws-tipjax2/index.html
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Nicolaas Loubser
Greenhorn

Joined: Sep 02, 2011
Posts: 3
Thank you Ivan

I will post an update once I get it working - this article looks much more thorough than the ones I have read previously.




Nicolaas Loubser
Greenhorn

Joined: Sep 02, 2011
Posts: 3
Got it working, inserting the security headers was no problem in the end, since Eclipse indeed generated everything I needed, it just needed a LOT of searching since the webservices is quite big, and a massive amount of code was generated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how do I insert security headers in to soap jax-rcp request using Java
 
Similar Threads
Inicialize variables on axis app inicialization
how to write http header for soap request
Creating Web Services using WSAD
JAX-RPC or SAAJ
How to get SOAP response as XML in Client Struts or Servlet. ?