0

The Wikipedia page for WS-Addressing states:

WS-Addressing supports the use of asynchronous interactions by specifying a common SOAP header (wsa:ReplyTo) that contains the endpoint reference

I have a simple WCF service that I'm exposing via SOAP. I can see the WSDL and there are XML Namespaces in the root node that mentions addressing:

<wsdl:definitions ...
      xmlns:wsa10="http://www.w3.org/2005/08/addressing"  
      xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"    
      xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"  
      xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"   
      ... 
 >

Can I create an asynchronous WCF (or other .NET, but not from scratch) client that makes use of WS-Addressing?

I've added a service reference to a console app and the proxy class looks correct, but how do I know I'm taking advantage of the WS-Addressing? I know I can watch the HTTP requests to see it making asynchronous calls but that's a bit trial and error.

I know there is the "Generate asynchronous operations" checkbox, I assume this utilizes the usual Begin/End pattern found in .NET and not WS-Addressing?

Greg B
  • 14,597
  • 18
  • 87
  • 141

1 Answers1

1

Asynchronous operations and the use of WS-Addressing are orthogonal. The use of addressing is determined based on the binding used in the endpoint, and and defines the format of the message exchanged between the client and the server.

The fact that the operation is synchronous or asynchronous doesn't have an impact on the message on the wire - you can have the same message defined as both synchronous and asynchronous and they should work just as well.

carlosfigueira
  • 85,035
  • 14
  • 131
  • 171
  • Am I right in thinking WS-Addressing enables asynchronous? If so, how can I prove the service supports asynchronous calls? – Greg B Jun 12 '12 at 14:15
  • And when I tick "Generate asynchronous operations", is that done in the .NET client or does it make use of the underlying infrastructure (i.e. WS-Addressing)? – Greg B Jun 12 '12 at 14:16
  • You can have asynchronous operations even without WS-Addressing. As far as the client goes, the main difference between synchronous and asynchronous operations is that for the former the network request will block until the response arrives, while for the latter it won't - i.e., if you think in a parallel to HttpWebRequest, sync operations call `GetResponse`, while async operations call `BeginGetResponse` / `EndGetResponse`. That's pretty much all that is, and it's independent of WS-Addressing. – carlosfigueira Jun 12 '12 at 16:15
  • I understand that, but what about clients other than .NET? – Greg B Jun 13 '12 at 07:38
  • That will depend on which client you're talking about. As can be seen in the .NET case, one client can be asynchronous even without WS-Addressing (or synchronous with it), so there are no technical reasons why one client stack would tie one to the other. – carlosfigueira Jun 13 '12 at 15:44
  • Agreed. But assuming the following (from Wikipedia) "WS-Addressing supports the use of asynchronous interactions by specifying a common SOAP header (wsa:ReplyTo) that contains the endpoint reference". How can I demonstrate a client is utilizing this functionality and is it possible to build such a client using WCF? – Greg B Jun 13 '12 at 20:44
  • I think that's referring not to asynchronous vs. synchronous in a "call a method" sense, but to "request/reply vs. duplex". WS-Addressing enables a service to effectively "call" a client (via the address specified on that header). So the server can, without being prompted by the client via a request (which you could say, "asynchronously"), send a request to the client. – carlosfigueira Jun 13 '12 at 21:00