2010-08-26 114 views
5

因此,我有這個新的Axis2 MTOM Webservice正確地服務於基於Java的Web服務客戶端。Axis2 MTOM Webservice和.NET客戶端使用它

問題出現了,當我嘗試添加服務(或網絡)引用到vs2008並消耗它與生成的代碼。到現在爲止,一切OK ......這是發生了什麼:

  1. 我們創造了必要的對象 (客戶端,請求與參數 對象)
  2. 我們稱之爲服務
  3. 當接收到響應,它拋出與此消息的異常:

Client found response content type of 'multipart/related; 
    boundary=MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454; 
    type="application/xop+xml"; start=" 
    <0.urn:uuid:[email protected]>"; start-info="text/xml"', 
    but expected 'text/xml'. 

    The request failed with the error message: 


MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454 
Content-Type: application/xop+xml; charset=utf-8; type="text/xml" 
Content-Transfer-Encoding: binary 
Content-ID: <0.urn:uuid:[email protected]> 

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:sendImageResponse xmlns:ns="http://org/company/ws/services/filetransfer/"><ns:return xmlns:ax213="http://filetransfer.objects.ws.company.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax215="http://filetransfer.responses.objects.ws.company.com/xsd" xsi:type="ax215:SendImageResponse"><ax215:errorCode>1060</ax215:errorCode><ax215:errorMessage>Error ejecutando el servicio</ax215:errorMessage><ax215:output>1060</ax215:output></ns:return></ns:sendImageResponse></soapenv:Body></soapenv:Envelope> 
MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454 

ö r的問題將是

¿如何將axis2 webservice的響應設置爲非mimetype?

+0

你使用什麼樣的綁定? – VinayC 2010-08-26 05:32:10

+0

SOAP 1.1 HTTP綁定 – 2010-08-26 05:37:45

回答

4

您需要在配置中使用MTOM編碼。請參閱MSDN中的簡單example以使用它與wsHttpBinding(應該也可以使用basicHttpBinding)。檢查這個描述使用自定義綁定使用oracle web服務的article。如果您想嘗試自定義綁定,如示例中所示,您可能需要將messageVersion設置爲Soap11而不是Soap12。

+0

做到了這一點,並且問題仍然存在......無論如何,我會在幾個小時內再試一次...... – 2010-08-26 05:48:57

+0

在對響應對象(XMLElement)屬性上的元素進行了一些調整並提供了很好的幫助從你...現在正在工作。 謝謝 – 2010-08-26 16:25:16

+0

@GarisMSuero - 你可以發表你已經做了什麼來讓它工作嗎?我遇到了同樣的問題(使用mtom的Axis2 webservice,我正在實現一個c#客戶端),並且您的響應是有希望的。 – djbyter 2013-10-28 01:41:43