Oleksiy Stashok wrote:
> 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)
Here the getXYZPort() methods names are derived from the wsdl:port_at_name
value and will happen automatically.
> 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.
>
Yes, I like this approach too, it looks simpler. But the question I have
in this approach is - who would generate <useBestTransport/> policy
assertion and in what circumstances. What if there are transports other
than tcp and http, lets say UDP, which one gets chosen? Should user have
control over which one gets used?
-vivek.
> WBR,
> Alexey.