aspose file tools
The moose likes Web Services and the fly likes Axis and HTTP Header Info Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Axis and HTTP Header Info" Watch "Axis and HTTP Header Info" New topic
Author

Axis and HTTP Header Info

Rob Keefer
Greenhorn

Joined: Feb 18, 2002
Posts: 26
I want to get information out of the HTTP Header using Axis. I used the WSDLtoJava program to generate a SoapBindingStub, so now I want to get a username and password that is being sent in the HTTP Header to use for authentication. How do I do that?

- Rob
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
The Web Services FAQ -linked in my signature- shows how to do this.


Android appsImageJ pluginsJava web charts
Rob Keefer
Greenhorn

Joined: Feb 18, 2002
Posts: 26
Thanks for the reply, but I guess I'm not following all the way with the FAQ...

In my FooServiceTestCase.java program, I have



Then in my FooSoapBindingStub.java program, I have



and context is null when I debug.

Am I not setting something correctly in my FooServiceTestCase?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
FooSoapBindingStub is a class that's used on the client - you can get at HTTP headers on the server only. Add the code to the class implementing the actual WS method, or -much better- use a JAX-RPC handler on the server.
Rob Keefer
Greenhorn

Joined: Feb 18, 2002
Posts: 26
Ok, I'm just now getting around to looking into this again. Do you know of a good example of using a JAX-RPC handler on the server? I'm seeing references to the org.apache.axis.handlers.SimpleAuthenticationHandler and incorporating this into the wsdd file, but am not clear on how all this is working.

Thanks again for your help.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
If you search the Web Services FAQ for "handler", you'll find a nice introductory article linked that explains how to write a server-side handler that intercepts request and response.
Rob Keefer
Greenhorn

Joined: Feb 18, 2002
Posts: 26
Perfect. Thanks ...
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Axis and HTTP Header Info
 
Similar Threads
How do i correct this error
Need some explanations about web-services basics.
Set custom HTTP header in Axis 1.4 request
Axis and JBOSS
Axis 1.0 w/o SOAPAction HTTP Header?