configuring wcf endpoints

Hi All,

As I understand, in order to configure a WCFservice endpoint to be interoperable with ASP.NET Web service clients, I must use the BasicHttpBinding type as the binding type for my service endpoint.

but why isn't it possible to add additional endpoints like wsHttpBinding, TcpBinding... (in addition to BasicHttpBinding) ?

Its important for me to expose all types of bindings .

[417 byte] By [Tal88] at [2008-1-8]
# 1

It is possible to add other endpoints.

The issue is that if you add non-interoperable endpoints then your WSDL get 'polluted' whith metadata that cannot be understood by other toolkits - and thus their respective code generation APIs/tools break.

So if you want to expose several endpoint then disable them temporarily and let 'the others' generate code or - better! - give them just the static WSDL.

ChristianWeyer at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2

Hi,

Thanks for the reply.

what do you mean by "static WSDL"?

I tried to add additional endpoints , but I failed to start the com+ components (via the "Components Services").

(my wcf wervice is hosted in complus) .

when I set GetHttpEnabled = "true" only one http endpoint works. (basicHttpBinding or wsHttpBinding)....

Tal88 at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 3

Any exceptions? Event log? Did you enable tracing for the WCF service to see more details?

BTW: why exactly do you want to host in COM+?

ChristianWeyer at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 4

Hi,

Thanks for your reply.

I get the exception from windows "Component Services" when right clicking on a com+ application and clicking "start".

"Error Code 80080005 - Server Execution Failed"

in the Event Viewer I get the following message :

The initialization of the COM+ surrogate failed -- the CApplication object failed to initialize.{89C8E3CC-0C46-4B1E-BE46-EF1E58153E09}

Server Application ID: {89C8E3CC-0C46-4B1E-BE46-EF1E58153E09}

Server Application Instance ID:

{66AAED04-78FE-4EBF-B3A5-9E79EB25DB43}

Server Application Name: ComTest

The serious nature of this error has caused the process to terminate.

Error Code = 0x80131509 :

COM+ Services Internals Information:

File: d:\qxp_slp\com\com1x\src\comsvcs\srgtapi\csrgtserv.cpp, Line: 363

Comsvcs.dll file version: ENU 2001.12.4414.310 shp

in the trace :

A binding instance has already been associated to listen URI 'http://localhost:8080/ComTest/COMTest.clsCOMTest/_clsCOMTest'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.

I decided to host my wcf service in COM+ because I already have all the interfaces i need in an existing dll , so I use comsvcconfig to install all the contracts. (in that way I can expose my dll as a wcf services).

Tal88 at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 5

I guess the exception says it all: you two same endpoint URLs. Either you make them unique or you set a unique ListenUri.

Can you show your endpoint config please?

ChristianWeyer at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 6

here is the application.config:

Code Snippet

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

<configuration>

<system.diagnostics>

<sources>

<source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">

<listeners>

<add type="System.Diagnostics.DefaultTraceListener" name="Default">

<filter type="" />

</add>

<add name="ServiceModelMessageLoggingListener">

<filter type="" />

</add>

</listeners>

</source>

<source name="System.ServiceModel" switchValue="Verbose,ActivityTracing"

propagateActivity="true">

<listeners>

<add type="System.Diagnostics.DefaultTraceListener" name="Default">

<filter type="" />

</add>

<add name="ServiceModelTraceListener">

<filter type="" />

</add>

</listeners>

</source>

</sources>

<sharedListeners>

<add initializeData="C:\Program Files\ComPlus Applications\{89c8e3cc-0c46-4b1e-be46-ef1e58153e09}\application_messages.svclog"

type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">

<filter type="" />

</add>

<add initializeData="C:\Program Files\ComPlus Applications\{89c8e3cc-0c46-4b1e-be46-ef1e58153e09}\application_tracelog.svclog"

type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

name="ServiceModelTraceListener" traceOutputOptions="Timestamp">

<filter type="" />

</add>

</sharedListeners>

<trace autoflush="true" />

</system.diagnostics>

<system.serviceModel>

<diagnostics wmiProviderEnabled="true" performanceCounters="ServiceOnly">

<messageLogging logEntireMessage="true" logMalformedMessages="true"

logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />

</diagnostics>

<bindings>

<netNamedPipeBinding>

<binding name="comNonTransactionalBinding" />

<binding name="comTransactionalBinding" transactionFlow="true" />

</netNamedPipeBinding>

</bindings>

<behaviors>

<serviceBehaviors>

<behavior name="NewBehavior">

<serviceMetadata httpGetEnabled="true" />

</behavior>

</serviceBehaviors>

</behaviors>

<comContracts>

<comContract contract="{E8A95B37-7969-41A3-B644-268C9A9BA968}"

name="_clsCOMTest" namespace="http://tempuri.org/E8A95B37-7969-41A3-B644-268C9A9BA968"

requiresSession="false">

<exposedMethods>

<add exposedMethod="Shay1" />

<add exposedMethod="Shay2" />

<add exposedMethod="Shay3" />

<add exposedMethod="Shay4" />

<add exposedMethod="Shay5" />

<add exposedMethod="Shay6" />

<add exposedMethod="Shay7" />

</exposedMethods>

<persistableTypes>

<clear />

</persistableTypes>

</comContract>

</comContracts>

<services>

<service behaviorConfiguration="NewBehavior" name="{89C8E3CC-0C46-4B1E-BE46-EF1E58153E09},{222B6A80-26A9-4FA4-9A40-8F80B1F8C287}">

<endpoint address="_clsCOMTest" binding="basicHttpBinding" bindingConfiguration=""

contract="{E8A95B37-7969-41A3-B644-268C9A9BA968}" />

<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""

contract="IMetadataExchange" />

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

contract="{E8A95B37-7969-41A3-B644-268C9A9BA968}" />

<host>

<baseAddresses>

<add baseAddress="http://localhost:8080/ComTest/COMTest.clsCOMTest" />

</baseAddresses>

</host>

</service>

</services>

</system.serviceModel>

</configuration>

what is the ListenURI?

before I added to the service behaviour GetHttpEnabled = "true" (in order to consume the wcf service from a web page).

I was able to add any endpoind I wanted (tcp, basic http, ws http...)

Thanks

Tal88 at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 7

Can you please try using these endpoints?

Code Snippet
<service behaviorConfiguration="NewBehavior" name="{89C8E3CC-0C46-4B1E-BE46-EF1E58153E09},{222B6A80-26A9-4FA4-9A40-8F80B1F8C287}">
<endpoint address="_clsCOMTestBASIC" binding="basicHttpBinding" bindingConfiguration=""
contract="{E8A95B37-7969-41A3-B644-268C9A9BA968}" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<endpoint address="_clsCOMTestWS" binding="wsHttpBinding" bindingConfiguration=""
contract="{E8A95B37-7969-41A3-B644-268C9A9BA968}" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/ComTest/COMTest.clsCOMTest" />
</baseAddresses>
</host>
</service>

I.e. unique endpoint addresses.

ChristianWeyer at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 8

Thanks!

It solved the problem :-)

Tal88 at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 9

That worked. Thank you Christian.

NickUk at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified