本帖最后由 xiezhang6263 于 2012-7-29 15:36 编辑
用C#发布的webservice。
SOAP 1.1
以下是SOAP 1.2请求和响应示例。所显示的占位符需替换为实际值。
代码如下:Post /WebService/Sus.asmx HTTP/1.1
Host:192.168.0.1
Content-Length:length
SOAPAction:"http://192.168.0.1/WebService/Sus/Getsus"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns"soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Getsus xmlns="http://192.168.0.1/Webservice/Sus/">
<BH>string<BH>
</Getsus>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type:text/xml;charset=utf-8
Content-Length:length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns"soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetsusResponse xmlns="http://192.168.0.1/Webservice/Sus/">
<GetSusResult>
<SusArchives>
<BH>string<BH>
<Name>string</Name>
<Phone>string</Phone>
</SusArchives>
<SusArchives>
<BH>string<BH>
<Name>string</Name>
<Phone>string</Phone>
</SusArchives>
</GetSusResult>
</GetsusResponse>
</soap:Body>
</soap:Envelope>
我用了以下的代码可以提取信息,不过有乱码,不知道怎么POST
MsgBox(0,0,_XmlHttp("http://192.168.0.1/Webservice/Sus/"))
Func _XmlHttp($url)
Local $oHTTP,$sReturn
$oHTTP = objcreate("winhttp.winhttprequest.5.1")
$oHTTP.open("post" ,$url , False)
$oHTTP.Send()
$sReturn = BinaryToString($oHTTP.responseBody)
Return $sReturn
EndFunc
请有这方面经验的高手帮忙下。一起交流。send(BH)得到[name],[phone]信息。 |