我用gsoap生成的客户端webservice为什么没有Envelope和Body元素 如下: ?xml version="1.0" encoding="UTF-8"?ns1:GetTime xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-enco
如下:
<?xml version="1.0" encoding="UTF-8"?> <ns1:GetTime xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:ns1="http://marchnetworks.com/device_ws/"> </ns1:GetTime>我希望需要这样的
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetTime xmlns:d3p1="http://schemas.datacontract.org/2004/07/MarchNetworks.VideoSphere.Protocol.Agent" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://marchnetworks.com/device_ws/"/> </s:Body> </s:Envelope>
最后发现是wsdl文件里的一个元素做如下修改就可以达到目的
<soap:binding transport="http://schemas.xmlsoap.org/soap/https" /> 改为
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
这应该是http 和https 的问题导致的,先做一个记录,以后再深入了解一下