This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes problem with jax-ws  trying to overide default callback endpoint address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "problem with jax-ws  trying to overide default callback endpoint address" Watch "problem with jax-ws  trying to overide default callback endpoint address" New topic
Author

problem with jax-ws trying to overide default callback endpoint address

Jeff Gaer
Ranch Hand

Joined: Jun 04, 2001
Posts: 99

I'm having problems trying to implement a callback that has a client defined endpoint. I used wsimport to build the interfaces.
I did a simple implementation of the callback method that just printlns a message. Every thing works fine if I dont try to override the
endpoint and just use the endpoint defined in the wsdl that the code was generated from.

cbService=new AudioStreamCallbackServices();
cbPort=cbService.getAudioStreamCallbackServicesPort();

However if I try to pass in a url the constructor for the service throws an exception


SEVERE: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackServices is not a valid service.
Valid services are: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackPortImplService
javax.xml.ws.WebServiceException: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackServices
is not a valid service. Valid services are: {http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0}AudioStreamCallbackPortImplService
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:233)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:178)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:106)

The url in the wsdl is

<soap:address location="http://localhost:8055/AudioStreamCallback/"/>

I have tried building urls from

http://localhost:8055/AudioStreamCallback/
http://localhost:8055/AudioStreamCallback
http://localhost:8055/AudioStreamCallback?wsdl

I get the same result when I used the contructor that accepts a url , In each case I can see the schemas streaming back to the service that
is calling the callback (using tcpmon).

The annotations in the generated Service proxy are
private final static QName AUDIOSTREAMCALLBACKSERVICES_QNAME =
new QName("http://interfaces.ticomgeo.com/2010/geonet/AudioStream/v0", "AudioStreamCallbackServices");

I grepped my entire source tree for AudioStreamCallbackPortImplService and it doesnt occur, but I do see the sample name as the
service name when I use the Oxygen WSDL soap analyzer so it must be generated by jax-ws based on the schema contents.

find . -exec grep AudioStreamCallbackPortImplService {} \;

Simple question is what is the easiest way for me to dynamically set the service endpoint address at run time.

Sun Certified Java Programmer Java 2<P>Jeff Gaer
Jeff Gaer
Ranch Hand

Joined: Jun 04, 2001
Posts: 99
To answer my own question

Service service = new Service();
port = service.getPort();
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
 
 
subject: problem with jax-ws trying to overide default callback endpoint address