Any chance you could create a simple testcase that shows this. It should definitely be allowed to define (or redefine) the namespace there. The output may not be perfectly what you want, but it should work.
Dan On Thursday 01 July 2010 10:50:50 am Vanore, Gregory wrote: > I see in the documentation how to use a JAXBDataBinding to customize > namespace prefixes for endpoints that I enumerate through the Spring > configuration mechanism. I have a client that is strictly using the > JAX-WS API to create services: Service.create(...) and then > service.getPort(...). > > When I create a W3CEndpointReference, extra namespaces are injected into > it: > > <EndpointReference xmlns="http://www.w3.org/2005/08/addressing"> > <Address>http://localhost:8888/test</Address> > <ReferenceParameters> > <elem xmlns="" > xmlns:ns2="http://www.w3.org/2005/08/addressing" > xmlns:wsa="http://www.w3.org/2005/08/addressing">test</elem> > </ReferenceParameters> > <Metadata/> > </EndpointReference> > > The problem comes when I set this into my request message. JAXB tries > to utilize ns2, and then declares a collision when it encounters the > endpoint reference, such as: > > W3CEndpointReference epr = > eprBuilder.address("http://localhost:8888/test").referenceParameter(e).b > uild(); > SubscribeService request = new SubscribeService(); > request.setTopic("theTopic"); > request.setConsumerReference(epr); > ServiceResponse response = service().subscribeTo(request); //no > luck > > javax.xml.ws.soap.SOAPFaultException: The namespace > xmlns:ns2="http://service.com/service" could not be added as a namespace > to "elem": The namespace prefix "ns2" > > I feel the best strategy is to use the namespace mapping to fix certain > common URLs to specific prefixes. If you have other ideas I'll > certainly listen... > > Thanks, > Greg -- Daniel Kulp [email protected] http://dankulp.com/blog
