找回密码
 加入
搜索
查看: 2577|回复: 1

[IE类操作] webservice如何调用?

[复制链接]
发表于 2012-7-27 17:15:47 | 显示全部楼层 |阅读模式
本帖最后由 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]信息。
 楼主| 发表于 2012-7-29 15:38:17 | 显示全部楼层
有没有谁有相关的demo呀,或者有谁对此有相关的操作,给点思路。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-16 21:29 , Processed in 0.070308 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表