代码之家  ›  专栏  ›  技术社区  ›  Garis M Suero

Axis2 MTOM Webservice和使用它的.NET客户端

  •  5
  • Garis M Suero  · 技术社区  · 15 年前

    因此,我有了这个新的Axis2 MTOM Web服务,可以正确地服务于基于java的Web服务客户机。

    1. 我们创建必要的对象 (客户端、请求和参数) 对象)
    2. 我们称之为服务
    3. 当接收到响应时,它抛出一个异常消息:

      Client found response content type of 'multipart/related; 
      boundary=MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454; 
      type="application/xop+xml"; start="
      <0.urn:uuid:6C47CADDECCCB90D951282776406455@apache.org>"; 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:6C47CADDECCCB90D951282776406455@apache.org>
    
    <?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
    

    如何将axis2 Web服务的响应设置为非mimetype?

    1 回复  |  直到 15 年前
        1
  •  4
  •   VinayC    15 年前

    您需要在配置中使用MTOM编码。请参见“简单” example 从MSDN将其与wsHttpBinding一起使用(也可以与basichttppbinding一起使用)。看看这个 article

    推荐文章