users@jax-ws.java.net

RE: RE: How do I attach soap header?

From: Murali Gunasekaran <Murali_Gunasekaran_at_webMethods.com>
Date: Wed, 2 May 2007 12:44:41 -0400

Dean,
You can try adding handlers programmatically by either,
1. Implementing the HandlerResolver interface and adding your soap
message custom headers via a handler... and setting your handler
resolver to the service instance, or
2. Set a handler chain (list of handlers) with your handler to the
Binding obtained from the port/dispatch

You should be able to use the SAAJ api to add your soap headers in the
handleMessage(SOAPMessageContext) of your soap handler...

Hope it helps,
Murali


-----Original Message-----
From: ddelponte_at_wi.rr.com [mailto:ddelponte_at_wi.rr.com]
Sent: Wednesday, May 02, 2007 12:22 PM
To: users_at_jax-ws.dev.java.net
Subject: Re: RE: How do I attach soap header?

Murali,

Thank you for your help. The problem I'm having is that I need to use
JAX-WS 2.0... not 2.1 so the information in the link is not relative.

The web service to which I am trying to connect is protected by:
1. Custom soap header which must be validated before access to the
service is granted
2. NTLM

I can never get to the web service because I am failing the initial
validation which requires a custom header be in place.


The code generated by Netbeans goes through the following steps:
1. Instantiate the service object
2. Instantiate the port object
    - It is in this step that (I think) it attempts to validate the wsdl
and cannot
      because it is not allowed access to the web service because the
request does
      not contain the proper soap header information.
3. Request is sent to the web service, but intercepted by the handler.
 I wish to add soap headers at this point, but have been unable too.

Does this make sense or is clarification needed?

Thanks again,

Dean

----- Original Message -----
From: Murali Gunasekaran <Murali_Gunasekaran_at_webMethods.com>
Date: Wednesday, May 2, 2007 9:48 am
Subject: RE: How do I attach soap header?
To: users_at_jax-ws.dev.java.net

> Dean,
> Check this article
>
http://weblogs.java.net/blog/kohsuke/archive/2006/11/adding_soap_hea.htm
> l
>
> If portability is not a problem you can try this approach...
>
> Murali
>
> -----Original Message-----
> From: ddelponte_at_wi.rr.com [mailto:ddelponte_at_wi.rr.com]
> Sent: Tuesday, May 01, 2007 5:09 PM
> To: users_at_jax-ws.dev.java.net
> Subject: How do I attach soap header?
>
> Hi everyone,
>
> I'm using Netbeans 5.5 to generate a web service client from a wsdl
> (this is a Swing app). I need to add a custom soap header to the web
> service request. Without this information, my request will be
> rejectedby the web service. How do I do this???? I've found some
> scatteredinformation talking about Handlers, but haven't found any
> good (simple
> :) ) examples to assist me.
>
> Any and all help would be greatly appreciated.
>
> Thanks,
>
> Dean
>
> --------------------------------------------------------------------
> -
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>
> --------------------------------------------------------------------
> -
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: users-help_at_jax-ws.dev.java.net