2012-03-30 5 views
0

私のサービス(ExternalOrderService.svc)から単一のファイルWSDLを取得するためにWCFExtrasを使用しようとしています。WCFExtras web.config(外部)

WCFExtras SampleServerプロジェクトから元のweb.configを変更して、自分のサービスへの参照を追加しました。 ServerSampleは正常に動作し、Sample.WsdlSample wsdlファイルを呼び出すことに成功しましたが、私のサービスwsdlを呼び出すには成功しませんでした。 以下の設定で何が問題になっていますか?

<system.serviceModel> 
    <services> 
     <service behaviorConfiguration="Sample.WsdlSampleBehavior" name="Sample.WsdlSample"> 
     <endpoint address="" behaviorConfiguration="Sample.WsdlSampleEndpointBehavior" binding="basicHttpBinding" contract="Sample.IWsdlSample"/> 
     </service> 
     <service behaviorConfiguration="Sample.SoapHeadersSampleBehavior" name="Sample.SoapHeadersSample"> 
     <endpoint address="" behaviorConfiguration="Sample.SoapHeadersSampleEndpointBehavior" binding="basicHttpBinding" contract="Sample.ISoapHeadersSample"/> 
     </service> 
     <service behaviorConfiguration="ExternalOrderServiceBehavior" name="ExternalOrderService"> 
     <endpoint address="" binding="basicHttpBinding" contract="Monclick.MVC2.Services.External.IExternalOrderService" /> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="Sample.WsdlSampleEndpointBehavior"> 
      <wsdlExtensions location="http://127.0.0.1/Sample/WsdlSample.svc" singleFile="True"/> 
     </behavior> 
     <behavior name="Sample.SoapHeadersSampleEndpointBehavior"> 
      <wsdlExtensions location="http://127.0.0.1/Sample/SoapHeadersSample.svc"/> 
     </behavior> 
     <behavior name="ExternalOrderServiceBehavior"> 
      <wsdlExtensions location="http://api.local/Services/ExternalOrderService.svc" singleFile="true" /> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="Sample.WsdlSampleBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="false"/> 
     </behavior> 
     <behavior name="Sample.SoapHeadersSampleBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     <behavior name="ExternalOrderServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <extensions> 
     <behaviorExtensions> 
     <!-- Declare that we have an extension called WSDL Extras--> 
     <add name="wsdlExtensions" type="WCFExtras.Wsdl.WsdlExtensionsConfig, WCFExtras, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> 
     </behaviorExtensions> 
    </extensions> 
    </system.serviceModel> 

答えて

0

問題は、コードのこのセクションにあります。

<service behaviorConfiguration="ExternalOrderServiceBehavior" name="ExternalOrderService"> 
    <endpoint address="" binding="basicHttpBinding" contract="Monclick.MVC2.Services.External.IExternalOrderService" /> 
    </service> 

あなたはあなたのサービスのエンドポイントのbehaviorConfigurationを定義していません。これに変更し、それが動作するはずです:

<service behaviorConfiguration="ExternalOrderServiceBehavior" name="ExternalOrderService"> 
    <endpoint address="" behaviorConfiguration="ExternalOrderServiceBehavior" binding="basicHttpBinding" contract="Monclick.MVC2.Services.External.IExternalOrderService" /> 
    </service> 
0

違いはアドレスです。 "127.0.0.1"が動作しているサービスは "api.local"を持っています。

「api.local」を「127.0.0.1」に置き換えてください。

私が見る他のことは、mexエンドポイントが定義されていないことです。

+0

リモートサービスを参照することはできませんか? api.localとしましょう。 –

+0

yes api.localが登録されたDNS名ですが、DNS名のようには見えませんが、そうであってもかまいません。 –

関連する問題