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

发布于 2024-09-15 16:50:24 字数 2016 浏览 2 评论 0原文

所以我有这个新的 Axis2 MTOM Web 服务正确地为基于 java 的 Web 服务客户端提供服务。

当我尝试将服务(或 Web)引用添加到 vs2008 并使用生成的代码使用它时,问题就出现了。到目前为止,一切都还好吗......这就是发生的事情:

  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

或者问题将是

¿How to set the axis2 webservice's response to be non mimetype?

So i have this new Axis2 MTOM Webservice serving correctly to a java based webservice client.

The problem comes around when i try to add the service (or web) reference to the vs2008 and consume it with the generated code. 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:[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

Or the question will be

¿How to set the the axis2 webservice's response to be non mimetype?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

养猫人 2024-09-22 16:50:24

您需要在配置中使用 MTOM 编码。请参阅 MSDN 中的简单示例来使用它与 wsHttpBinding 一起使用(也应该可以与 basicHttpBinding 一起使用)。检查此文章,描述使用自定义绑定使用 Oracle Web 服务。如果您想尝试示例中给出的自定义绑定,您可能需要将 messageVersion 设置为 Soap11 而不是 Soap12。

You need to use MTOM encoding in the configuration. See simple example from MSDN to use it with wsHttpBinding (should also be possible with basicHttpBinding). Check this article that describes consuming oracle web service using custom binding. If you want to try custom binding as given in example, you probably need to set messageVersion to Soap11 rather than Soap12.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文