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
posted
0
The Web Services FAQ -linked in my signature- shows how to do this.
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
posted
0
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
posted
0
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
posted
0
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
posted
0
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.