none
WCF Routing Service RRS feed

  • Question

  • I am creating simple Routing service getting error:

    Could not find endpoint element with name 'WeatherSoap' and contract '*' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

    Please any body can tell me where it went wrong. my web.config file is

    <?xml version="1.0"?>
    <configuration>
      <appSettings/>
      <system.web>
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
            <add assembly="System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          </assemblies>
        </compilation>
      </system.web>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="WeatherSoap" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://wsf.cdyne.com/WeatherWs/Weather.asmx"
            binding="basicHttpBinding" bindingConfiguration="WeatherSoap"
            contract="WeatherService.WeatherSoap" name="WeatherSoap" />
        </client>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
            <behavior name="RoutingConfig">
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <serviceMetadata httpGetEnabled="true"/>
              <routing filterTableName="filters" soapProcessingEnabled="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="System.ServiceModel.Routing.RoutingService" behaviorConfiguration="RoutingConfig">
            <endpoint bindingConfiguration="WeatherSoap" address="http://localhost:50624/Routing.svc" binding="basicHttpBinding" contract="System.ServiceModel.Routing.IRequestReplyRouter" name="RoutingEndPoint"/>
          </service>
        </services>
        <routing>
          <filters>
            <filter name="MatchAllFilter" filterType="MatchAll"/>
          </filters>
          <filterTables>
            <filterTable name="filters">
              <add filterName="MatchAllFilter" endpointName="WeatherSoap"/>
            </filterTable>
          </filterTables>
        </routing>
      </system.serviceModel>
    </configuration>


    Friday, December 13, 2013 6:06 AM

Answers

  • Hi Pago,

    - try the following updated config:

    <configuration>
      <appSettings />
      <system.web>
        <compilation debug="true" targetFramework="4.0"></compilation>
      </system.web>
      <system.serviceModel>
        <serviceHostingEnvironment>
          <serviceActivations>
            <add relativeAddress="~/router.svc" service="System.ServiceModel.Routing.RoutingService, System.ServiceModel.Routing,Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 " />
          </serviceActivations>
        </serviceHostingEnvironment>
        <bindings>
          <basicHttpBinding>
            <binding name="WeatherSoap" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://wsf.cdyne.com/WeatherWs/Weather.asmx" binding="basicHttpBinding" bindingConfiguration="WeatherSoap" contract="*" name="WeatherSoap" />
        </client>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
            <behavior name="RoutingConfig">
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceMetadata httpGetEnabled="true" />
              <routing filterTableName="filters" soapProcessingEnabled="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="System.ServiceModel.Routing.RoutingService" behaviorConfiguration="RoutingConfig">
            <endpoint bindingConfiguration="WeatherSoap" address="" binding="basicHttpBinding" contract="System.ServiceModel.Routing.IRequestReplyRouter" name="RoutingEndPoint" />
          </service>
        </services>
        <routing>
          <filters>
            <filter name="MatchAllFilter" filterType="MatchAll" />
          </filters>
          <filterTables>
            <filterTable name="filters">
              <add filterName="MatchAllFilter" endpointName="WeatherSoap" />
            </filterTable>
          </filterTables>
        </routing>
      </system.serviceModel>
    </configuration>

    Note, that the router outbound client contract must be "*" (untyped contract).

    Thanks

    Roman


    Roman Kiss, MVP Microsoft Integration: Development

    Saturday, December 14, 2013 5:37 AM
  • Please cross check if you have the config in the main application from which you are calling the service. I know this is a silly thing to say but I have seen people calling the service in a class library and calling that class library from some other main project. In that case app.config should be in that main project. 


    Kunal G

    Friday, December 13, 2013 11:30 AM

All replies

  • Please cross check if you have the config in the main application from which you are calling the service. I know this is a silly thing to say but I have seen people calling the service in a class library and calling that class library from some other main project. In that case app.config should be in that main project. 


    Kunal G

    Friday, December 13, 2013 11:30 AM
  • I am consuming online free web serivce. This is my main WCF web serivce.

    I really appriciate if you could help me with this.

    Thanks,

    Pago

    Friday, December 13, 2013 7:32 PM
  • Hi Pago,

    - try the following updated config:

    <configuration>
      <appSettings />
      <system.web>
        <compilation debug="true" targetFramework="4.0"></compilation>
      </system.web>
      <system.serviceModel>
        <serviceHostingEnvironment>
          <serviceActivations>
            <add relativeAddress="~/router.svc" service="System.ServiceModel.Routing.RoutingService, System.ServiceModel.Routing,Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 " />
          </serviceActivations>
        </serviceHostingEnvironment>
        <bindings>
          <basicHttpBinding>
            <binding name="WeatherSoap" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://wsf.cdyne.com/WeatherWs/Weather.asmx" binding="basicHttpBinding" bindingConfiguration="WeatherSoap" contract="*" name="WeatherSoap" />
        </client>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
            <behavior name="RoutingConfig">
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceMetadata httpGetEnabled="true" />
              <routing filterTableName="filters" soapProcessingEnabled="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="System.ServiceModel.Routing.RoutingService" behaviorConfiguration="RoutingConfig">
            <endpoint bindingConfiguration="WeatherSoap" address="" binding="basicHttpBinding" contract="System.ServiceModel.Routing.IRequestReplyRouter" name="RoutingEndPoint" />
          </service>
        </services>
        <routing>
          <filters>
            <filter name="MatchAllFilter" filterType="MatchAll" />
          </filters>
          <filterTables>
            <filterTable name="filters">
              <add filterName="MatchAllFilter" endpointName="WeatherSoap" />
            </filterTable>
          </filterTables>
        </routing>
      </system.serviceModel>
    </configuration>

    Note, that the router outbound client contract must be "*" (untyped contract).

    Thanks

    Roman


    Roman Kiss, MVP Microsoft Integration: Development

    Saturday, December 14, 2013 5:37 AM