cjwoolard

I am trying to run one of the WCF Samples illustrating how to configure multiple endpoints, (located at TechnologySamples\Basic\Service\MultipleEndpoints), however I receive the following error when it tries to reference the second endpoint:

{"There was no endpoint listening at http://localhost/servicemodelsamples/service.svc/secure that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."}

I've tried for several days to get a simple example to work but I've noticed that the client is never able to find any of the non-default endpoints (those with relative addresses, 'secure' in the sample mentioned above).

Here is a copy of the web.config that I am trying to use:

...

<services>

<service name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="CalculatorServiceBehavior">

<!-- this endpoint is exposed at the base address provided by host: http://localhost/servicemodelsamples/service.svc -->

<endpoint address="" binding="basicHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator" />

<!-- secure endpoint exposed at {base address}/secure: http://localhost/servicemodelsamples/service.svc/secure -->

<endpoint address="secure" binding="wsHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator" />

<!-- the mex endpoint is exposed at http://localhost/servicemodelsamples/service.svc/mex -->

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

</service>

</services>

...

This seems like it should should work (according to all the documentation I've seen), so I was wondering if there was perhaps something that I was missing Any help would be greatly appreciated.



Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

akdpr

try to copy service address to address place as bellow and try.

<endpoint address="" binding="basicHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator" />

change this to

<endpoint address="http://localhost/servicemodelsamples/service.svc " binding="basicHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator" />

and make sure that your client program connects to this end point properly. may be your client is not configured properly as well.





Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

ChiomaOs - MSFT

Are you using the client files that are in the sample as well If so, could you modify the binding for the endpoint named "secure" to BasicHttpBinding and try it that way instead That way, the we can narrow down the error to either the binding or the address.

If not, could you post a copy of the client code you are using to access the service

Thanks.





Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

bajatodd

Thank you for the reply, I tried switching the endpoint to use BasicHttpBinding as you mentioned, but unfortunately it had no effect. I am simply trying to run the Microsoft sample as is, below are the two supplied config files, if they help at all. Again we are just looking for any working example of using two endpoints within an IIS hosted service. (We have been working on this for over a week now and have not been able to reference any endpoint with a relative address, such as the "secure" endpoint). Any help would be greatly appreciated.

Web.Config:

< xml version="1.0" encoding="utf-8" >

<configuration>

<system.serviceModel>

<services>

<service

name="Microsoft.ServiceModel.Samples.CalculatorService"

behaviorConfiguration="CalculatorServiceBehavior">

<!-- this endpoint is exposed at the base address provided by host: http://localhost/servicemodelsamples/service.svc -->

<endpoint address=""

binding="basicHttpBinding"

contract="Microsoft.ServiceModel.Samples.ICalculator" />

<!-- secure endpoint exposed at {base address}/secure: http://localhost/servicemodelsamples/service.svc/secure -->

<endpoint address="secure"

binding="wsHttpBinding"

contract="Microsoft.ServiceModel.Samples.ICalculator" />

<!-- the mex endpoint is exposed at http://localhost/servicemodelsamples/service.svc/mex -->

<endpoint address="mex"

binding="mexHttpBinding"

contract="IMetadataExchange" />

</service>

</services>

<!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->

<behaviors>

<serviceBehaviors>

<behavior name="CalculatorServiceBehavior">

<serviceMetadata httpGetEnabled="True"/>

<serviceDebug includeExceptionDetailInFaults="False" />

</behavior>

</serviceBehaviors>

</behaviors>

</system.serviceModel>

</configuration>

App.config:

< xml version="1.0" encoding="utf-8" >

<configuration>

<system.serviceModel>

<client>

<!-- passing "basic" into the constructor of the CalculatorClient class selects this endpoint-->

<endpoint name="basic"

address="http://localhost/servicemodelsamples/service.svc"

binding="basicHttpBinding"

contract="Microsoft.ServiceModel.Samples.ICalculator" />

<!-- passing "secure" into the constructor of the CalculatorClient class selects this endpoint-->

<endpoint name="secure"

address="http://localhost/servicemodelsamples/service.svc/secure"

binding="wsHttpBinding"

contract="Microsoft.ServiceModel.Samples.ICalculator" />

</client>

</system.serviceModel>

</configuration>

 





Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

akdpr

In your Client configuration address is defined but not in the Service.

When client is trying to connect to server the end point address is not defined in there.

in client address="http://localhost/servicemodelsamples/service.svc"

but in server address="" ( server is not configuring any address, so can client connect )

so this must be address ="http://localhost/servicemodelsamples/service.svc" .





Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

Michael Green - MSFT

The multiple endpoint sample works for me as-is. There is no problem with the first endpoint specifying an address of "" since the service will use the address of the virtual directory for that endpoint (http://localhost/ServiceModelSamples/Service.svc). Since the first endpoint appears to be working correctly that would suggest some sort of configuration problem. The service side configuration you typed into your post looks good. So it would make sense that the problem may be in the client configuration.

It may be worthwhile to re-download the sample to make sure no typo's have been introduced while you've been trying to get this to work. You can download the sample from: http://msdn2.microsoft.com/en-us/library/ms751515.aspx. I've worked with samples trying to get them to work in the past and wound up making some typo that caused me much frustration. Try downloading the sample again to start from scratch and let me know what happens.

Thanks,

Michael Green [MSFT]





Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

Ed Pinto - MSFT

Given the trouble you are having with relative addresses, I suspect that the handler configuration for .svc files in IIS is configured to check that the file exists - when your client requests http://localhost/servicemodelsamples/service.svc/secure IIS can't find a file service.svc/secure so - it bounces the request. http://msdn2.microsoft.com/en-us/library/ms752252.aspx has details.

Cheers,

Ed





Re: Windows Communication Foundation (Indigo) Multiple Endpoints Sample Broken

cjwoolard

Ed,

Thank you very much, yes that was the issue. I had originally verified that setting on the default directory only, but for some reason just on the samples virtual directory it had been configured to check that the file existed, as you suspected. Thanks again for the help.