1

http://msdn.microsoft.com/en-us/library/ms731774(v=vs.110).aspxの指示に従いましたが、バインディングでエラーが発生しています。設定

    <bindings>
  <wsHttpBinding>
    <binding name="wsHttpBinding_Inventory">
      <security mode="Message">
        <message clientCredentialType="UserName"/>
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="Viopsys.API.V_1_0.Inventory" behaviorConfiguration="MyServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/Viopsys.API/V_1_0/Inventory" />
      </baseAddresses>
    </host>
    <endpoint address="PurchaseOrder" binding="wsHttpBinding_Inventory" contract="Viopsys.API.V_1_0.IPurchaseOrder">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
  </service>
</services>

エラー

System.Configuration.ConfigurationErrorsException: Configuration binding extension 'system.serviceModel/bindings/wsHttpBinding_Inventory' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.
   at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
   at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at System.ServiceModel.Activation.AspNetEnvironment.UnsafeGetSectionFromConfigurationManager(String sectionPath)
   at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath)
   at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName)
   at System.ServiceModel.ServiceHost.ApplyConfiguration()
   at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
   at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
   at Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type, ServiceKind kind)
   at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
4

1 に答える 1

3

リンクされた MSDN の記事に誤りがあると思います。bindingConfiguration を binding 属性に入れます。正しいエンドポイント構成は次のようになります。

<endpoint address="PurchaseOrder" 
          binding="wsHttpBinding" 
          bindingConfiguration="wsHttpBinding_Inventory"
          contract="Viopsys.API.V_1_0.IPurchaseOrder">
  <identity>
    <dns value="localhost" />
  </identity>
</endpoint>

MSDN の記事にはさらに別の欠点があります (既に正しく実行されています): 彼らはバインディングを次のように定義しました。

<bindings>
  <WSHttpBinding>
   ...
  </WSHttpBinding>
</bindings>

しかし、そうでなければなりません

<bindings>
  <wsHttpBinding>
   ...
  </wsHttpBinding>
</bindings>
于 2013-04-04T18:17:58.020 に答える