Skip to main content

Changing was:To to an address other than the service endpoint

1 reply [Last post]
yuryu
Offline
Joined: 2007-10-12
Points: 0

Hello,

I created a service with wsimport (launched by NetBeans 6 Beta) from a WSDL file which contains .

On the server side, I can get the soap headers from
HeaderList headers = (HeaderList) context.get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY);
String to = headers.getTo(AddressingVersion.W3C, SOAPVersion.SOAP_11);
and seems working ok.

However, on the client side, I cannot find an API to add a wsa:To header other than the service endpoint.
provider.setAddress("http://tempuri.org/foo/ds") changes the service endpoint address too so I get 404 not found error.
provider.setOutboundHeaders(Headers.create(new QName("http://www.w3.org/2005/08/addressing", "To"), "http://tempuri.org/foo/ds"));
simply adds a new header so I get two To headers resulting error.

How can I change the header? or can I change the server(glassfish bundled with netbeans) settings to remap all requests to a single endpoint?

I attached the service wsdl file.
JAX-WS version is JAX-WS RI 2.1.2-hudson-182-RC1.

thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
manojbmsce1
Offline
Joined: 2013-02-04
Points: 0

I am facing a similar problem here :
http://www.java.net/forum/topic/glassfish/metro-and-jaxb/how-change-end-...

This problem was there since 2007 and there is no solution yet !