私は、クラスライブラリ内のWCFサービスと、Webアプリケーション内のそのクラスライブラリを参照しています。私がサービスからメソッドを呼び出そうとすると、私は例外よりも下になります。WCF Webサービスの呼び出し中にエラーが発生しました
"Content Type multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:901bc2e6-6d57-4363-9f99-41ca4884ce16+id=1";start-info="text/xml" was not supported by service https://URL_OF_Service/. The client and service bindings may be mismatched."
は、ここに私の構成
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CoreSoapBinding">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://URL_OF_Service/" binding="customBinding"
bindingConfiguration="CoreSoapBinding" contract="ContractName"
name="CoreSoapPort" />
</client>
</system.serviceModel>
であると私は、アプリケーション内のバインディングオブジェクトを作成し、サービスに渡されました。
BasicHttpBinding binding = new BasicHttpBinding()
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
binding.Name = "CoreSoapPort";
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
binding.BypassProxyOnLocal = false;
binding.UseDefaultWebProxy = true;
binding.MessageEncoding = WSMessageEncoding.Mtom;
binding.AllowCookies = false;
binding.TransferMode = TransferMode.Buffered;
binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
Encoding textencoding = Encoding.UTF8;
binding.TextEncoding = textencoding;
binding.MaxReceivedMessageSize = Int32.MaxValue;
サーバー構成に合わせて構成を複数に変更しようとしました。しかし、運がない。
エラーメッセージは、mtomコンテンツタイプ(multipart/related)がサービスでサポートされていないというエラーメッセージが表示されます。コードで構成されたバインディングでmtomを指定する必要があると思われるのはなぜですか? – MattC
私はあなたのためだと思う[WCFエラー:クライアントとサービスのバインディングが不一致かもしれません](http://stackoverflow.com/questions/2887776/wcf-error-the-client-and-service-bindings-may-be - ミスマッチ)それが助けてくれることを願っています。 –
http://stackoverflow.com/questions/2887776/wcf-error-the-client-and-service-bindings-may-be-mismatched助けてくれると助かります –