简体   繁体   English

Axis2 MTOM Web服务和.NET客户端使用它

[英]Axis2 MTOM Webservice and a .NET Client to consume it

So i have this new Axis2 MTOM Webservice serving correctly to a java based webservice client. 所以我有这个新的Axis2 MTOM Web服务正确地服务于基于Java的Web服务客户端。

The problem comes around when i try to add the service (or web) reference to the vs2008 and consume it with the generated code. 当我尝试将服务(或Web)引用添加到vs2008并将其与生成的代码一起使用时,问题就出现了。 Until now, is everything OK... this is what happens: 到现在为止,一切都好......这就是发生的事情:

  1. We create the necessary objects (client, request and parameter object) 我们创建必要的对象(客户端,请求和参数对象)
  2. We call the service 我们称之为服务
  3. When receiving the response, it throws an exception with this message: 收到响应时,它会抛出此消息的异常:

  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

Or the question will be 或者问题是

¿How to set the the axis2 webservice's response to be non mimetype? ¿如何将axis2 webservice的响应设置为非mimetype?

You need to use MTOM encoding in the configuration. 您需要在配置中使用MTOM编码。 See simple example from MSDN to use it with wsHttpBinding (should also be possible with basicHttpBinding). 请参阅MSDN中的简单示例以将其与wsHttpBinding一起使用(也应该可以使用basicHttpBinding)。 Check this article that describes consuming oracle web service using custom binding. 查看本文介绍如何使用自定义绑定来使用oracle Web服务。 If you want to try custom binding as given in example, you probably need to set messageVersion to Soap11 rather than Soap12. 如果您想尝试示例中给出的自定义绑定,您可能需要将messageVersion设置为Soap11而不是Soap12。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM