【问题标题】:Read multipart/related response in wcf talking to java web service读取 wcf 中的多部分/相关响应与 java Web 服务对话
【发布时间】:2013-11-22 12:22:19
【问题描述】:

我们正在尝试使用 wcf(添加服务引用)来使用 java webservice,但是在调用服务时会抛出异常,如下所示

The content type multipart/related; type="text/xml"; boundary="----=_Part_113_846920666.1380536491947" of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '------=_Part_113_846920666.1380536491947
Content-Type: text/xml; charset=utf-8

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/>
<SOAP-ENV:Body>
   <brv:GBResponse xmlns:brv="urn:gamma:famma:tamma:brv">
       <gtf:errors xmlns:gtf="urn:gamma:famma:femme">
          <gtf:error>
              <gtf:id>ABCEDFHECIDGJ-1234567890</gtf:id>
              <gtf:text>Letter created.</gtf:text>
              <gtf:num>0</gtf:num>
          </gtf:error>
        </gtf:errors></brv:GBResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------=_Part_113_846920666.1380536491947
Content-Type: application/dlf
Content-ID: ALPHABETA-17FASF-2013-09-30-122130269-68-GF
Content-Transfer-Encoding: binary

PK   \0 \0\b\0?b>C7?qw? \0\0?\b\0\0 \0\0\0DLF/O/29/1.bin?Vg? E ??! b@   p9N  ?<;`???; ?  3? A9@? P??,,????dVT°  sV?YQQQ1?<yX[? ???~5???==3_??
\0? z   :?Oonil?? [Z&L ?R?\b [?? ?+?G?~??<?r}?   ? J ?D C ?$&2?$%?8?IF  ??QN ?TQMcjhBSj???f1???b  ??*?q ?8???q??? C
3?T e???1?I?5?x?1 ;???S??:??3?-?Y?(S??h>??{?y?DX?'.

我们正在使用 basicHttpBinding 和这样的 bindingConfiguration

<binding name="OurBinding"
             closeTimeout="00:01:00"
             openTimeout="00:01:00"
             receiveTimeout="00:10:00"
             sendTimeout="00:01:00"
             allowCookies="false"
             bypassProxyOnLocal="false"
             hostNameComparisonMode="StrongWildcard"
             maxBufferSize="65536"
             maxBufferPoolSize="524288"
             maxReceivedMessageSize="65536"
             messageEncoding="Text"
             textEncoding="utf-8"
             transferMode="Buffered"
             useDefaultWebProxy="true">
      <readerQuotas maxDepth="32"
                    maxStringContentLength="8192"
                    maxArrayLength="16384"
                    maxBytesPerRead="4096"
                    maxNameTableCharCount="16384" />
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows"
                   proxyCredentialType="None"
                   />
      </security>
    </binding>

我们应该如何解决这个问题?任何帮助将不胜感激。 谢谢

【问题讨论】:

    标签: java .net wcf web-services soap


    【解决方案1】:

    WCF 不支持开箱即用的带附件 (SwA) / MIME 附件的肥皂。您可以试试这个MIME encoder(WCF 扩展)或实现您自己的自定义message encoder 并阅读附件。

    【讨论】:

      猜你喜欢
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-29
      • 1970-01-01
      • 2015-11-26
      • 1970-01-01
      • 1970-01-01
      • 2018-06-08
      相关资源
      最近更新 更多