msyoun

I am trying to create a basicHTTPBinding and a wsHttpBinding for my service. The endpoints are

1. for the basic: http://{baseaddress}/myservice.svc/basic

2. and for the ws: http://{baseaddress}/myservice.svc

The ws binding works fine, but the basic gives and error that there is no enpoint listening that could accept the message at http://{baseaddress}/myservice.svc/basic. It seems that if I have added anything to the end of the base address, wcf will not work.

I have followed the examples on MSDN and in forums. What seems to work for others, just isn't hacking it for me.

What am I missing here



Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

Carlos Figueira - MSFT

I just tried the example below, and it worked fine. Can you check if there are any differences between what we have

Service:

namespace WCFTestModule

{

[ServiceContract]

interface ITest

{

[OperationContract]

string Echo(string str);

}

public class Service : ITest

{

public string Echo(string str)

{

return str;

}

}

}

Web.config:

<system.serviceModel>

<behaviors>

<serviceBehaviors>

<behavior name="MyBehavior">

<serviceMetadata httpGetEnabled="true" />

</behavior>

</serviceBehaviors>

</behaviors>

<services>

<service behaviorConfiguration="MyBehavior" name="WCFTestModule.Service">

<endpoint address="" binding="wsHttpBinding" bindingConfiguration=""

contract="WCFTestModule.ITest" />

<endpoint address="basic" binding="basicHttpBinding" contract="WCFTestModule.ITest" />

</service>

</services>

</system.serviceModel>

After generating the client/config via svcutil, this client code below was able to successfully call the services:

namespace WCFTestApp

{

class Program

{

static void Test(TestClient client, string test)

{

Console.WriteLine(test);

Console.WriteLine(" Server address: " + client.Endpoint.Address.Uri);

Console.WriteLine(" Calling Echo: " + client.Echo("Hello world"));

}

static void Main(string[] args)

{

TestClient ws = new TestClient("WSHttpBinding_ITest");

TestClient basic = new TestClient("BasicHttpBinding_ITest");

Test(basic, "BasicHttpBinding");

Test(ws, "WSHttpBinding");

ws.Close();

basic.Close();

}

}

}





Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

msyoun

I can get this to work if my host and client are console apps. But if my host is IIS, I get the error "there is no endpoint listening at {baseaddress}/basic that could accept the message." The inner exception indicates a 404 error.




Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

Carlos Figueira - MSFT

Are you using svcutil/add service reference to create a proxy to talk to the server, or are you using the ChannelFactory<> directly The example that I posted before worked fine on IIS.

Can you post the web.config file you're using inside the vdir





Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

msyoun

I am just using the "AddServiceReference" from VS menu. However, I have also used the svcutil from command line and got the same results. I have tried this with a couple of different projects, and all have the same result.
//***********************************

Here is the code in my vdir web config:
//***********************************
Code Snippet

< xml version="1.0" >
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="false">
<assemblies>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.Transactions.Bridge, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.IdentityModel.Selectors, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>

<authentication mode="Windows"/>
</system.web>
<system.serviceModel>
<services>
<!-- Before deployment, you should remove the returnFaults behavior configuration to avoid disclosing information in exception messages -->
<service name="EndpointSample.service1"
behaviorConfiguration="metadataSupport">
<endpoint address="" contract="EndpointSample.IService1" binding="wsHttpBinding"/>
<endpoint address="basic" binding="basicHttpBinding" contract="EndpointSample.IService1" />
<endpoint address="mex" binding="mexHttpBinding" name="Mex" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<!-- Enables the IMetadataExchange endpoint in services that -->
<!-- use "metadataSupport" in their behaviorConfiguration attribute. -->
<!-- In addition, the httpGetEnabled and httpGetUrl attributes publish -->
<!-- Service metadata for retrieval by HTTP/GET at the address -->
<!-- "http://localhost:8080/SampleService wsdl" -->
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>

</system.serviceModel>
</configuration>



//***********************************

And here is my client app.config

//***********************************


Code Snippet

< xml version="1.0" encoding="utf-8" >
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://THEMACHINENAME.THEDOMAIN.com/endpointTest/service.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
contract="WebClient.webservice.IService1" name="WSHttpBinding_IService1">
<identity>
<userPrincipalName value="THEMACHINENAME\ASPNET" />
</identity>
</endpoint>
<endpoint address="http://THEMACHINENAME.THEDOMAIN.com/endpointTest/service.svc/basic"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="WebClient.webservice.IService1" name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>









Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

Carlos Figueira - MSFT

I had the same problem when used your web.config file, and by removing the httpGetUrl="" from the serviceMetadata element in the behaviors section, the problem went away. Can you try it

<system.serviceModel>
<services>

...
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>






Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

msyoun

I tried, but still get the same error.




Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

David Kreutz - MSFT

This post might help you, i'm not sure its exactly the same situation but it might be related:

http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,9e0d8d1e-ac7c-49b5-8072-bde42609f5db.aspx

Also consider this post on HostName Comparison Mode

http://kennyw.com/indigo/109






Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

msyoun

Well... an update for those curious about the solution.
Here is what I have determined. The problem seems to lie with IIS 5.1.
IIS 5.1 will not resolve the url correctly and returns a 404 error. IIS is responsible for the 404 error.
The same code works fine on IIS 6.0.




Re: Windows Communication Foundation (Indigo) multiple endpoint bindings fail

Vaassu

hi,

It seems your client app.config ( or web.config) end point doesn't have appropriate name. Try to add name="basic" to the end point which is associated with basicHttpBinding.

-vasu