Axis2 MTOM Web 服务和使用它的 .NET 客户端
所以我有这个新的 Axis2 MTOM Web 服务正确地为基于 java 的 Web 服务客户端提供服务。
当我尝试将服务(或 Web)引用添加到 vs2008 并使用生成的代码使用它时,问题就出现了。到目前为止,一切都还好吗......这就是发生的事情:
- 我们创建必要的对象 (客户端、请求和参数 对象)
- 我们调用该服务
- ,当收到响应时,它会抛出异常并显示以下消息:
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:
- We create the necessary objects
(client, request and parameter
object) - We call the service
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在配置中使用 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.