Skip to main content

Metro interoperates with .NET wsDualHttpBinding

Posted by haroldcarr on April 9, 2009 at 10:36 AM PDT

In August 2007 Arun Gupta wrote a blog entry with the title

"wsHttpDualBinding - a non-interoperable binding"
That was written during our learning curve. It turns out that
the wsDualHttpBinding (which is the correct name, the title reversed
two words) is interoperable. The details are somewhat subtle, as
I explain below.

wsDualHttpBinding is .NET's name for addressable client
interactions. "Addressable clients" means that responses are sent to
a service, logically on the client side, which receives the responses
as requests, rather than sending the response on the connection that
made the request

wsDualHttpBinding is a .NET declaration that can be applied to any
.NET contract (not just the duplex contract discussed in Arun's blog,
which I will say more about below). WSDLs generated from
wsDualHttpBinding are standard. They contain addressing assertions
that indicate responses are "nonanonymous"---in other words, sent to a
specific address, rather than sent on the "backchannel" (the
connection on which the request was made).

When a client invokes an operation of a wsDualHttpBinding-based
service, the client side web service stack will provide a
"replyTo" address that is nonanonymous. .NET has automated this process,
so the client will automatically have a "response receiving" endpoint
ready. In Metro, one would build such an endpoint by hand.

Since we are talking about responses that implies that
wsDualHttpBinding is suited for two-way messages (even though
Arun's entry shows one-way message, which might confuse the issue).

Arun's blog example uses .NET duplex contract. That contract is
non-interoperable. The WSDL generated from duplex contract contains
output only operations. This is incompletely specified in the WSDL
1.1 specification (i.e., the specification mentions output-only but
does not give enough specifics to be normative). The .NET duplex
contract is basically a link between two one-way contracts. It
enables the service to decide which method on the callback interface
to invoke.

The confusion in Arun's entry arises because it is mixing
two things: wsDualHttpBinding and duplex contract

The above should clarify that wsDualHttpBinding is

ps: One-way messages are a necessary ingredient in the duplex
contract. Also, the callback contract half of a duplex contract must
have the IsOneWay attribute.

pps: One of the MSFT assertions for the wsDualHttpBinding is named
ow:OneWay and the customBinding equivalent of wsDualHttpBinding
includes <oneWay/>.

ppps: All the one-way mentions in the original blog might obscure
the real issue: the difference between wsDualHttpBinding and duplex


Related Topics >>


This all sounds great in theory. I'd love to see some sample ...

This all sounds great in theory. I'd love to see some sample code as well. My company is stuck with a WCF service from a vendor that uses wsDualHttpBinding for which we need to create a client in Java to consume the service.

sample code for using callback with wsdualhttpbinding

Harold i have a WCF webservice which i am consuming using a Java WSIT WebApplication Client. I want to wsdualhttpbinding to enable server to do callback to client. I have been able to use wshttpbinding without any problem but when i am trying to issue a callback using wsdualhttpbinding i am getting an error. "Failed to access the WSDL at: http://localhost:15464/ClientRegistrationService.svc?wsdl. It failed with: Connection refused: connect." SEVERE: Failed to access the WSDL at: http://localhost:15464/ClientRegistrationService.svc?wsdl. It failed with: Connection refused: connect. at at at at at at at at at com.sdx.server.registration.ClientRegistrationService.( at com.sdx.server.ClientServlet.processRequest( at com.sdx.server.ClientServlet.doGet( at javax.servlet.http.HttpServlet.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.StandardWrapper.service( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.core.StandardPipeline.invoke( at com.sun.enterprise.web.WebPipeline.invoke( at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke( at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.doService( at org.apache.catalina.connector.CoyoteAdapter.service( at at com.sun.grizzly.http.ProcessorTask.invokeAdapter( at com.sun.grizzly.http.ProcessorTask.doProcess( at com.sun.grizzly.http.ProcessorTask.process( at com.sun.grizzly.http.DefaultProtocolFilter.execute( at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter( at com.sun.grizzly.DefaultProtocolChain.execute( at com.sun.grizzly.DefaultProtocolChain.execute( at com.sun.grizzly.http.HttpProtocolChain.execute( at com.sun.grizzly.ProtocolChainContextTask.doCall( at at at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork( at com.sun.grizzly.util.AbstractThreadPool$ at Caused by: Connection refused: connect at Method) at at at at at at at at at at at at at at at at at at at at ... 35 more Do you have a sample code that you can share where you have successfully used wsdualhttpbinding. Thx!