StockService samples and the MSMQ transport provider

I had some traveling time this week and was able to get back into the MSMQ transport for WSE 2.0.  After making sure the transport provider continued to work as expected with the latest build and my shim of a test harness, I tackled the modification of the TcpAsyncStockService sample from WSE 2.0 to use the MSMQ provider.

Presently, the provider only supports friendly names for queues, MachineName\QueueName and its variants.  I need to do some work to also support the format name to enable an offline model.  Its grunge work to parse and validate the incoming endpoint reference that I’d rather not do, but in the interest of being complete and providing a broadly usable transport, I feel it’s important and will be tackling that shortly.

Another outstanding item that I need to address is the support of transactional queues.  Currently, the provider doesn’t worry about transactions at all, though my plan is to have this done as well within the next week or so.

The great thing about the transport model in WSE 2.0 is that the higher-level service code really doesn’t care about the underlying transport, resulting in a whopping addition of one line of code to each of the StockService and StockServiceClient files, and a simple modification of the EndpointReferences being used. All that’s required to register the transport for use is:

            SoapMsmqTransport.UriScheme, new SoapMsmqTransport());

With that in place, it becomes pretty easy to wire up a URI for the SoapReceiver to listen on:

Uri uri = new Uri("soap.msmq://" + System.Net.Dns.GetHostName() + "/private$/StockService");
SoapReceivers.Add(uri, typeof(StockServiceRequestReceiver));

If you’ve looked at the Tech Preview samples, the above two lines of code should look familiar, with the change being the URI is soap.msmq://hostname/private$/StockService as opposed to soap.tcp://hostname/StockService.

Done right, the above can also be eliminated with configuration files making the registration and use of the transport quite transparent.

When a build of WSE with the current changes becomes broadly available, I’ll be looking for a few folks interested in pounding on the provider a bit and providing feedback.  Holler if you’re interested in playing around a bit.

Lastly, if you’re interested in what the underlying transport model looks like in the current iterations of WSE 2.0, take a look at Hervey’s entry on Channels.

Comments (9)

  1. Philip Rieck says:

    I’ve just switched from trying to use WSE2.0TP (the current publicly available one) to going back to straight MSMQ for two reasons

    1) Reading herveyw makes me wonder how much of the effort is wasted (since he talks about some pretty big changes)

    2) Lack of WS-ReliableMessaging support.

    I’m looking forward to being able to use soap over MSMQ easily.

    * If you want someone to hack randomly on the provider you’ve got (your last invite), I’d love to be one of those someones. Can’t guarantee I’ll be able to give usefull feedback, but I can try.

  2. Christian Weyer: Web Services says:
  3. Christian Weyer: Web Services says:
  4. I would reallly like to try out the MSMQSoapProvider. I have a direct need for it and would be able to give good feedback.


  5. Just got back from endless travel.  I have not been posting while away, seems like I’ve been really…

  6. Just got back from endless travel.  I have not been posting while away, seems like I’ve been really…

  7. Just got back from endless travel.  I have not been posting while away, seems like I’ve been really…

  8. Just got back from endless travel. I have not been posting while away, seems like I’ve been really really

Skip to main content