我正在处理一个遗留的 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 Service项目开始,想知道是否有一种方法可以将soap前缀替换为soapenv?另外,是否有任何方法可以强制Web服务添加xsi:type声明?