RESTful WCFサービスを作成しました(StackOverflowに感謝します)。テストクライアントを作成しました。これは、5つのテキストボックスと送信ボタンを備えたシンプルな.aspxページです。データをテキストボックスに入力して[送信]ボタンをクリックすると、データがWCFサービスに送信されます。
私のWCFサービスはVisualStudio開発サーバーで実行されており、正常に機能しました。データをWCFサービスに正常に送信できます。今日、このWCFサービスをローカルIISに展開しました。クライアントアプリケーション(.aspxページ)でサービスURLを参照しようとすると、このエラーが発生します。
「メタデータに解決できない参照が含まれています。クライアントとサービスのバインディングが一致していない可能性があります。コンテンツタイプ'application/ soap + xml; charset=utf-8'が予期されたタイプ'text/ xml;ではなかったため、メッセージを処理できません。 「」
問題が何であるかについて何か考えはありますか?これが私のweb.configです
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="RESTService1">
<endpoint address="http://localhost:420/WCFRESTService100/RESTService1.svc" binding="webHttpBinding" name="MainHttpPoint" contract="RESTService1" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:420/WCFRESTService100/RESTService1.svc" />
</baseAddresses>
</host>
</service>
</services>
<!--<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>-->
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>