dev@jax-ws.java.net

SOAP/TCP single vs. additional binding <was> WSDL generation with SOAP/TCP binding

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Tue, 12 Sep 2006 16:53:12 +0200

Hi.

to complete discussion about "WSDL generation with SOAP/TCP binding"
want to say that using of BindingType annotation with BindingID like
"http://schemas.xmlsoap.org/wsdl/soap/http?tcp" is ok for me if its ok
for jax-ws and tooling (im not sure)

but now we have another feature that it will be good to have is
automatic switch to best transport/encoding on client side.
in other words if WS is able to communicate with TCP and HTTP - TCP
should be chosen, same with message encoding.

So in wsit-client.xml we can have policy applied to PortType
<chooseBestTransport/>
And that should mean for JAX-WS WS stub to return only tcp port for
corresponding WS.

But if WS has 2 ports TCP and HTTP then WsImport will generate stub with
2 different methods, for example:
getServiceHttpPort();
getServiceTcpPort();
In that case getServiceHttpPort() (if <chooseBestTransport/> exists)
should actually return tcp port? Or WsImport should generate different
stub methods?

But have scenario with single binding (just http) and policy assertion
applied to it.
.................... WSDL part ..................
/ <binding name="AddNumbersBinding" type="tns:AddNumbersPortType">
            <soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document" />
            *<enableTCP/>
            */.........../*
* </binding>/
..........................................................
this will mean WsImport create just single binding and be consistent in
method name and port it returns. What we will need in that case on
client - is just plug tcp transport pipe as reaction to servler's
<enableTCP/> and client's assertion <chooseBestTransport/>
(In this situation we can assume tcp endpoint has same form as http,
just changing transport schema http:// -> x-tcp://.)

So, we can have 2 different scenarios:
1) Separate binding for Http and Tcp and dont have any client side
preferences in transport, as they look not consistent. (getHttpPort()
should return Tcp port)
2) Have single binding with policy assertion propogated from server
<enableTcp/> which looks ok with client's <chooseBestTransport/> assertion.

Personally i like 2nd scenario more... it will require less changes to
jax-ws (at least looks so... no several binding WSDL, no endpoint
AddressResolver, but client side changes) and looks more featured.
1st scenario looks standard and also MS has it implemented.

WBR,
Alexey.