Thomas
Thomas

Reputation: 34198

Cannot obtain Metadata from http://localhost:12659

in my config my address details as follows net.tcp://127.0.0.1:1127/CalculatorService but when the error message is showing Cannot obtain Metadata from http://localhost:12659

i have simple service with tcp binding and i am running my service from VS2010 IDE with wcf test client and then i am getting this error Cannot obtain Metadata from http://localhost:12659

here is my config file details

<?xml version="1.0"?>
<!--Copyright (c) Microsoft Corporation.  All Rights Reserved.-->
<configuration>
    <system.serviceModel>
        <services>
            <service name="MyTcpActivation.CalculatorService" behaviorConfiguration="CalculatorServiceBehavior">

                <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://127.0.0.1:1127/CalculatorService/"/>
                    </baseAddresses>
                </host>

                <endpoint address=""
                binding="netTcpBinding" bindingConfiguration="PortSharingBinding"
                contract="MyTcpActivation.ICalculator"/>

                <endpoint address="mex"
                binding="mexTcpBinding" 
                contract="IMetadataExchange"/>
            </service>
        </services>

        <bindings>
            <netTcpBinding>
                <binding name="PortSharingBinding" portSharingEnabled="true">
                    <security mode="None"/>
                </binding>
            </netTcpBinding>
        </bindings>
        <!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
        <behaviors>
            <serviceBehaviors>
                <behavior name="CalculatorServiceBehavior">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
    <system.web>
        <compilation debug="true"/></system.web>

</configuration>

please help me to run my service from wcf test client from VS2010 IDE. thanks

Upvotes: 2

Views: 11973

Answers (1)

Cybermaxs
Cybermaxs

Reputation: 24556

This suggests an activation problem on WCF. Metadata are not exposed when there is a problem in your service/config/env.

To get the error message try to open http://localhost:12659 in your browser and/or check event logs.

As it's a nettcpbinding, the config is a little more complex especially if your are hosting the service under IIS : check that WAS Service is started, Net Tcp Listener Service is Started, net.tcp is in Activated protocols for your web site, configured bindings conftoins ntc.tcp on port 1127 , ...). You may also try a basicHttpBinding first.

For debugging purposes set the includeExceptionDetailInFaults attribute to true

  <behaviors>
        <serviceBehaviors>
            <behavior name="CalculatorServiceBehavior">
                <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>

Upvotes: 4

Related Questions