2

I have an application that needs to consume an asynchronous web service that requires wsa:MesssageId, wsa:ReplyTo wsa:address, and ws:To in the header. While wsa:MessageId and wsa:To are quite straightforward, I am stump on wsa:ReplyTo. I understand that ReplyTo address is where the async web service will send the response to but how does my application get notify of the response and retrieve it? Do I need host a httplisterner or a web service to listen on the address and port I specify in wsa:ReplyTo address? I have already added code to BeforeSendRequest(...) to add the wsa:messageId, wsa:replyto, and wsa:to to the header but I don't know what address to put into the ReplyTo address. Please advise. Thanks.

1 Answers1

1

In order to set the WS-Addressing header elements, such as wsa:To, wsa:ReplyTo, you don't really need to use a message inspector as you can set the elements via the OutgoingMessageHeaders. The following link provides a good reference:

http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.outgoingmessageheaders.aspx

In any event, to receive the service callback, you must have an active service listening at the EndpointReference.
If you need help setting up a WCF service listener, the following link provides a good overview:

http://msdn.microsoft.com/en-us/library/ms733766.aspx

Regards,

Seymour
  • 7,043
  • 12
  • 44
  • 51
  • Thanks for the quick response. About the service callback, I have an IIS hosted WCF service I want to use to receive the service callback. My WCF service is at https://xx.xx.xx.xx:444/StatsInfo.svc and the method I want to use to process the service callback response is processResponse(). What do I enter as the wsa:ReplyTo address? Should the wsa:ReplyTo address be https://xx.xx.xx.xx:444/StatsInfo.svc"? Should the response processing method be part of wsa:ReplyTo address and if not how does the service callback response find its way to the method I want to use to process the response? – user2845501 Oct 04 '13 at 14:53
  • The following link may help clarify ... http://stackoverflow.com/questions/9129750/how-do-i-use-ws-addressing-in-wcf-and-set-the-wsareplyto-header – Seymour Oct 04 '13 at 16:11
  • That article says: OperationContext.Current.OutgoingMessageHeaders.ReplyTo = new EndpointAddress("http://client/callback"); My wcf that handles the callback response is hosted at "https://xx.xx.xx.xx:444/StatsInfo.svc" and the method is "processResponse". Does that mean wsa:ReplyTo should be set to "https://xx.xx.xx.xx:444/processResponse" or should it be "https://xx.xx.xx.xx:444/StatsInfo.svc/processResponse"? How does my client application get notfiy when processResponse is invoked? – user2845501 Oct 04 '13 at 17:18