Endpoint Address in Client with different transport than one in wsdl

View: New views
2 Messages — Rating Filter:   Alert me  

Re: Endpoint Address in Client with different transport than one in wsdl

by Jitendra Kotamraju :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

metro@... wrote:

> I see that with jax-ws/metro, allows using different endpoint addresses through BindingProvider.ENDPOINT_ADDRESS_PROPERTY
> ((BindingProvider)stub).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "...");
>
> But, it seems the endpoint address must have the same transport protocol as specified in the wsdl. If the endpoint transport protocol is changed then, we get a ClientTransportException.
>
> Is there any work around this. See the use case below.
>
> Here the wsdl's soap address location is specified as <soap:address location="http://servername/SanFrancisco-SimpleRoute/MapServer"/>
> But the client code resets the endpoint address to a different transport protocol, which throws a runtime exception.
>
> ((BindingProvider)stub).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"dcom://SanFrancisco-SimpleRoute/MapServer");
>
> com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.lang.NullPointerException
> at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:131)
>
> It seems the TransportFactory is looking for an Http Transport, which is wrong.
>
> If i change the wsdl's soap address it works.
>       <soap:address location="dcom://SanFrancisco-SimpleRoute/MapServer"/>
> Is there any better solution or am i missing any.
>  
You are not missing anything. While creating the proxy, it uses port
address scheme to insert the corresponding transport tube in tubeline.
In this case, it is http, so HttpTransportPipe is inserted. But your
application changes to dcom via request context and http transport tube
doesn't support other protocols.

So how are you supporting dcom, have you written your own transport Tube
and plugging in ?

Based on that there are few options.

Jitu
> [Message sent by forum member 'jos_thomas' (jos_thomas)]
>
> http://forums.java.net/jive/thread.jspa?messageID=280078
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Endpoint Address in Client with different transport than one in wsdl

by Isharo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I ran into similar problem, JAX-WS client retrieves the WSDL at runtime using "Service.create(WSDL_location_URL) of java.net.URL type" with endpointAddress different from the WSDL served web server. JAX-WS soap runtime throws exception saying "Server not available" at to Web Service is NOT running on that host.
To solve this, I used JAX-WS, "Service.create(QName serviceName)", and using "addPort()" method on service instance to set the desired "endpointAddress" at runtime.
Can anyone of you interpret the technical details and differences between choosing "Service.create(WSDL_URL)" and "Service.create(QName serviceName) in conjunction with using addPort()".

Which one is the most desired way ? Are there any implications of using "addPort()" method ?

(Jitendra garu, take time to respond! I know you are the author of JAX-WS RI).
-thanks,
Isharo.
Jitendra Kotamraju wrote:
metro@javadesktop.org wrote:
> I see that with jax-ws/metro, allows using different endpoint addresses through BindingProvider.ENDPOINT_ADDRESS_PROPERTY
> ((BindingProvider)stub).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "...");
>
> But, it seems the endpoint address must have the same transport protocol as specified in the wsdl. If the endpoint transport protocol is changed then, we get a ClientTransportException.
>
> Is there any work around this. See the use case below.
>
> Here the wsdl's soap address location is specified as <soap:address location="http://servername/SanFrancisco-SimpleRoute/MapServer"/>
> But the client code resets the endpoint address to a different transport protocol, which throws a runtime exception.
>
> ((BindingProvider)stub).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"dcom://SanFrancisco-SimpleRoute/MapServer");
>
> com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.lang.NullPointerException
> at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:131)
>
> It seems the TransportFactory is looking for an Http Transport, which is wrong.
>
> If i change the wsdl's soap address it works.
>       <soap:address location="dcom://SanFrancisco-SimpleRoute/MapServer"/>
> Is there any better solution or am i missing any.
>  
You are not missing anything. While creating the proxy, it uses port
address scheme to insert the corresponding transport tube in tubeline.
In this case, it is http, so HttpTransportPipe is inserted. But your
application changes to dcom via request context and http transport tube
doesn't support other protocols.

So how are you supporting dcom, have you written your own transport Tube
and plugging in ?

Based on that there are few options.

Jitu
> [Message sent by forum member 'jos_thomas' (jos_thomas)]
>
> http://forums.java.net/jive/thread.jspa?messageID=280078
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net