要件は、WCF サービスを使用して大きなファイル (~2GB) をアップロードできるようにすることであり、次のように messageContract クラスを作成しました。
[MessageContract]
public class TestMessageContract
{
[MessageHeader]
public string FileName { get; set; }
[MessageBodyMember]
public byte[] UploadedFileContent { get; set; }
}
そして、これがサービス側の私のWeb構成です
<wsHttpBinding>
<binding name="wsHttpFileSize" closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="1073741824" maxReceivedMessageSize="1073741824"
messageEncoding="Mtom"
useDefaultWebProxy="true">
<readerQuotas maxDepth="1073741824" maxArrayLength="1073741824" maxBytesPerRead="1073741824"/>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="WcfService1.IService1">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpNormal" contract="WcfService1.IService1"/>
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpFileSize" contract="WcfService1.IFileUploadService"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:909/"/>
</baseAddresses>
</host>
</service>
</services>
クライアント側でも同じバインディング構成が使用されています。これは、過去 4 時間に発生した例外です。私は問題を理解できませんでした..
例外内容
multipart/related と入力します。type="application/xop+xml";start=" http://tempuri.org/0 ";boundary="uuid:382b5a40-f4f2-4399-9e63-b3f9e81227a5+id=2";start-info="アプリケーション/soap+xml" はサービスhttp://localhost:909/Service1.svcでサポートされていませんでした。クライアントとサービスのバインディングが一致していない可能性があります。