5

I have an svc that is auto-started using AppFabric. What I want to do is expose the wsdl for my service over the bus. Internally the service and the wsdl work fine of course, I can also consume the service over the bus with no issue. The only thing I can't configure properly is viewing the wsdl over the relay.

The ServiceHostFactory creates default endpoints and also adds an Azure Endpoint along with a mex endpoint in hopes to expose the wsdl over the relay. When I try to view the wsdl from the service bus url, I get the mismatch fault, probably due to ACS authentication failing?

...cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree

Do I need to set the mex endpoint up as anonymous authentication so I can go to a browser and view the wsdl? Just not sure what else to try... Any help would be appreciated!

Example url:

http://myservicebusexample.servicebus.windows.net/MyService/AService.svc?wsdl

or

http://myservicebusexample.servicebus.windows.net/MyService/AService.svc/mex

<serviceBehaviors>
   <behavior>
      <serviceMetadata httpGetEnabled="true" />
   </behavior>
</serviceBehaviors>

So here is my ServiceHostFactory

// Create host with default endpoints
ServiceHost host = new ServiceHost(serviceType, baseAddresses);
host.AddDefaultEndpoints();

// Create Relay Endpoint for Azure
ServiceEndpoint relayEndpoint = host.AddServiceEndpoint(typeof(IMyContract), new BasicHttpRelayBinding("MyAzureBindingConfiguration"), relayAddress);

// Apply ACS Credentials for the relay endpoint
relayEndpoint.ApplyEndpointBehaviorConfig("MyAzureACSCredentials");

// Create mex Endpoint to expose wsdl over the relay
ServiceEndpoint mexEndpoint = host.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName,
                       new BasicHttpRelayBinding("MyAzureBindingConfiguration"),
                       "mex");

// Apply ACS Credentials for the mex endpoint
mexEndpoint.ApplyEndpointBehaviorConfig("MyAzureACSCredentials");
Gabe
  • 49,577
  • 28
  • 142
  • 181
  • Gabe - did you every figure this out? I have a netTcpRelay binding and I'm trying to expose metadata with basicHttpRelay and netTcpRelay and haven't had success with either. – viperguynaz Sep 20 '13 at 00:17
  • No, never found a way around it. I ended up having to make a service agent for the consumer. – Gabe Sep 20 '13 at 14:46

1 Answers1

0

Try adding the serviceBehavior which enables the metadata behavior:

 <behavior>
    <serviceMetadata />
 </behavior>
Sandrino Di Mattia
  • 24,739
  • 2
  • 60
  • 65