wsHttpとJSONエンドポイントを使用してWebサービスを作成しています。以下の設定はウェブサイトプロジェクトでホストされ、ウェブサイト内でサービス参照を作成しようとする場合を除いて正常に動作します。エンドポイントの動作によってエラーが発生するようです。WebHttpとwsHttpを含むVS2010のサービス参照を追加する際のエラー
"Extension Error 'webHttp' cannot be added to this element. Verify the exception is registered in the extension collection at system.servicemode/extensions/behaviorExtensions"
svcUtil.exeでエラーは発生しません。それはVS特有のようですが、私はそれの底を取得したいと思います。
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="JSON">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="HelloWorldBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="HelloWorldBehavior" name="HelloWorld">
<endpoint address="/json" behaviorConfiguration="JSON"
binding="webHttpBinding" contract="IHelloWorld" >
</endpoint>
<endpoint name="wcf" address="" binding="wsHttpBinding"
contract="IHelloWorld" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
IEを使用してサービスを参照しようとしましたか?もしそうなら、何かエラーがありましたか? – Rajesh
はい、問題なく動作します。 – Chris
使用しているフレームワークは何ですか?また、プロジェクトはVS2008からVS2010に移行されました。その場合は、サービス参照を削除してもう一度追加してください。 – Rajesh