【发布时间】:2014-09-16 18:26:45
【问题描述】:
我正在开发一个旧版 Web 服务,该服务最初是使用 Axis 在 Java 中开发的,它的响应是:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:TransaccionResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://DefaultNamespace">
<TransaccionReturn xsi:type="xsd:string"><!-- info --></TransaccionReturn>
</ns1:TransaccionResponse>
</soapenv:Body>
</soapenv:Envelope>
我正在制作一个应该与所有当前客户端兼容的 .NET Web 服务,但到目前为止我有:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ns1:TransaccionResponse xmlns:ns1="http://DefaultNamespace">
<TransaccionReturn><!-- info --></TransaccionReturn>
</ns1:TransaccionResponse>
</soap:Body>
</soap:Envelope>
我从一个旧的 ASP.NET Web 服务项目开始,我想知道是否有办法将 soap 前缀替换为 soapenv?还有什么方法可以强制 Web 服务添加 xsi:type 声明?
【问题讨论】:
-
我也有同样的问题??有什么解决办法吗??
-
@VishwanathMishra 检查我的答案我能够解决问题。
-
将soap转换为soapenv的地方是哪里写的??
-
实际上,该前缀没有添加到响应中,但它实际上是有效的,Java 客户端可以毫无问题地识别它。
标签: asp.net vb.net web-services soap axis