2013-11-22 25 views
0

我們正在嘗試使用WCF(添加服務引用)消耗的java web服務,但是在調用如下圖所示讀多重/相關響應交談的Java Web服務

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 ??! [email protected] p9N ?<;`???; ? 3? [email protected]? 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> 

我們應該如何解決這個問題?任何幫助將不勝感激。 謝謝

回答

0

WCF不支持Soap With Attachment(SwA)/ MIME附件開箱即用。您可以試試這個MIME encoder(WCF擴展名)或者實現您自己的自定義message encoder並閱讀附件。