Kirk Lipscomb

I am struggling with svcutil (or "Add Service Reference") usage on a msmq service. I see examples with two endpoints, one for net.msmq and one for mex. When I try this, then hit the service.svc using a browser, I get an error of: "The protocol 'net.msmq' is not supported".

What is the best way to expose the metadata on an MSMQ service so that I can generate the code that I need for the client



Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Michele Leroux Bustamante

You have to enable metadata exchange. That means provide a mex endpoint and enable the metadata behavior. Then use SvcUtil or add service reference to generate the proxy. You can't hit the msmq endpoint to generate a proxy.






Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

I have both endpoints, one mex and one msmq.



Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Brian McNamara - MSFT

You should be able to hit <the address of your mex endpoint> with svcutil, then.

If you want to see it in the browser, too, then you need to add an http base address to the service, and ensure that ServiceMetadataBehavior has enableHttpGet=true.






Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

Yes, I have done that but I cannot seem to use that mex endpoint. That's the problem.

I am sure that there is something simple that I'm doing wrong, but I can't seem to find it. WCF is working great for me on web services, but on the MSMQ stuff, I cannot seem to get it to publish the metadata and therefore can't create a client to use it. Very frustrating.





Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Brian McNamara - MSFT

Can you share the config file you are using

Is this WAS hosted or self-hosted






Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

Self-hosting.

Here is my config file.

< xml version="1.0" >

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.serviceModel>
<services>
<service
name="WEdge.Repository.MsgServices.MessagingServices"
behaviorConfiguration="WEdgeServiceBehavior">
<!-- MSMQ endpoint -->
<endpoint address="net.msmq://localhost/private/tst1"
binding="netMsmqBinding"
bindingConfiguration="NoMSMQSecurity"
contract="af.mil.WEdge.Repository.MsgServices.IMessagingServices" />
<!-- the mex endpoint is exposed at http://localhost/WEdgeServices/service.svc/mex -->
<!--endpoint address="http://localhost/WEdgeMessaging/MEX"
binding="mexHttpBinding"
contract="IMetadataExchange" /-->
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>

<bindings>
<netMsmqBinding>
<binding name="NoMSMQSecurity">
<security mode="None"></security>
</binding>
</netMsmqBinding>

</bindings>

<behaviors>
<serviceBehaviors>
<behavior name="returnFaults" >
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="WEdgeServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>





Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Michele Leroux Bustamante

You are missing a base address for your service, for the mex endpoint. Inside the <service> section provide a <host> section with a base HTTP address to generate metadata from. Then, use this address to generate the proxy. For example:

<host>

<baseAddresses>

<add baseAddress="http://localhost:8000"/>

</baseAddresses>

</host>






Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

Thanks, Michele.

I had that at one time, and took it out when I saw some example that did not have it. I put it back in, but I still get the same message: The protocol 'net.msmq' is not supported.





Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Brian McNamara - MSFT

Is that the error you get when you run "svcutil http://localhost:8000/mex" Can you show the complete svcutil output

What happens when you hit http://localhost:8000/ in a browser Can you see the help page Does the link to wsdl there work and show you the metadata

(Long shot: Can you also try adding a net.msmq base address to the service config )






Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

No, I don't get anything - but I assume that the http://localhost:8000 is just an example - my address would be different

I already have a virtual directory set up for my web services project, named WEdgeServices. For my web services client code I can use:

svcutil.exe http://b85blb1/WEdgeServices/WEdge.Repository.CommServices.svc wsdl /language:vb /out:client.vb /config:app.config

Then I set up a new project and virtual directory for my web services. So I would expect it to look like:

svcutil.exe http://b85blb1/WEdgeMessaging/WEdge.Repository.MsgServices.svc wsdl /language:vb /out:client.vb /config:app.config

And that is where I get the error.





Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Brian McNamara - MSFT

I'm very confused. You said this was self-hosted, and you added the http://localhost:8000 as a base address, but now you're talking about virtual directories and svc files. Which is it




Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

Could be I just don't know what I'm doing.

I plan to make it self-hosted. But I need some way to publish the info so that I can generate the client files. I'm trying to do that with a virtual directory and svc file because I don't know any other way to do so.





Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Brian McNamara - MSFT

We're trying to tell you the way.

If you take your self-hosted service, add the http base address to the config, and start up the service, you should be able to hit the http base address in the browser, get the wsdl, etc. That is, with the config file set up right (serviceMetdataBehavior as you've configured it, and an http base address as the 'root' of the http-y stuff like the help page, wsdl, and /mex endpoint), things should work.






Re: Windows Communication Foundation (Indigo) Generating client proxy for msmq service

Kirk Lipscomb

I get it now!

Now it's starting to come together in my head what these config parameters are doing. I got my client files generated and on Monday I can move on to my next self-imposed roadblock!

Brian and Michele, thank you both very much for patiently walking me through this.