Home > Article > Backend Development > 直接写soap调用webservice的问题
我有一个 http://192.168.19.134/service/api.php?wsdl
做了简单的两个函数, feedback 和 add
我使用vb调用时,用soap toolkit很容易就可以调用了
Dim ss As New SoapClient30 ss.MSSoapInit "http://192.168.19.134/service/api.php?wsdl"MsgBox ss.feedback("zzzz")MsgBox ss.Add(34, 56)
url = "http://192.168.19.134/service/api.php?wsdl" oXMLHttp.Open "POST", url, False oXMLHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" oXMLHttp.setRequestHeader "Content-length", Len(URLEncode(postData)) oXMLHttp.setRequestHeader "Accept-Language", "zh-CN" oXMLHttp.setRequestHeader "SOAPAction", "http://192.168.19.134/service/api.php?wsdl" oXMLHttp.setRequestHeader "Host", "192.168.19.134" oXMLHttp.Send URLEncode(postData)
postData = "<?xml version=""1.0"" encoding=""utf-8""?>" postData = postData & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" postData = postData & "<soap:Body xmlns:m=""http://192.168.19.134/service/api.php?wsdl"">" postData = postData & "<m:add>" postData = postData & "<m:aa>1</m:aa>" postData = postData & "<m:bb>2</m:bb>" postData = postData + "</m:add>" postData = postData + "</soap:Body>" postData = postData + "</soap:Envelope>"
大哥。这里好像是php的版块。。
你的 soap 服务端支持 get 或 post 方式吗?
支持
你的 soap 服务端支持 get 或 post 方式吗?