• Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis and HTTP Header Info

 
Rob Keefer
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Web Services FAQ -linked in my signature- shows how to do this.
 
Rob Keefer
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect. Thanks ...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!