積分 62
最後登入 1970-1-1
閱讀權限 20
積分 62
帖子
精華
升級
24%
本帖最後由 kaihsin1703 於 2023-3-17 08:48 編輯
請問各位大大
錯誤訊息,看不太懂? 該從哪個方向修改呢?
;AutoIT - Getting data from a Web Service
;https://audministrator.wordpress ... 5Rvc837Yu4HqZFpvyUo
Dim $objHTTP
Dim $strEnvelope
Dim $strReturn
Dim $objReturn
Dim $strQuery
Dim $strValue
;~ $strValue = InputBox("Testing", "Enter your new value here.", 60007)
$value1 = "TEST 1"
$value2 = "TEST 2"
$value3 = "TEST 3"
$value4 = "TEST 4"
$value5 = "TEST 5"
; Initialize COM error handler
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$objHTTP = ObjCreate("Microsoft.XMLHTTP")
$objReturn = ObjCreate("Msxml2.DOMDocument.3.0")
; Create the SOAP Envelope 修改碼
$strEnvelope = "<soap:envelope xmlns:soap=""urn:schemas-xmlsoap-org:soap.v1"">" & _
"<soap:Body>" & _
"<insertStatus2DB xmlns=" & "http://10.34.128.182/" & ">" & _
"<product>" & $value1 & "</product>" & _
"<lotno>" & $value2 & "</lotno>" & _
"<cst>" & $value3 & "</cst>" & _
"<step>" & $value4 & "</step>" & _
"<date>" & $value5 & "</date>" & _
"</insertStatus2DB>" & _
"</soap:Body>" & _
"</soap:Envelope>"
; Set up to post to our local server 修改碼
$objHTTP.open ("post", "http://10.34.128.182/Auto_Delivery/WebService/AutoDeliveryData.asmx?op=insertStatus2DB", False)
; Set a standard SOAP/ XML header for the content-type ;為內容類型設置一個標準的 SOAP/XML 標頭
$objHTTP.setRequestHeader ("Content-Type", "text/xml")
; Set a header for the method to be called
$objHTTP.setRequestHeader ("SOAPMethodName", "urn:myserver/soap:TaxCalculator#Getsalestax")
ConsoleWrite("Content of the Soap envelope : "& @CR & $strEnvelope & @CR & @CR)
; Make the SOAP call
$objHTTP.send ($strEnvelope)
; Get the return envelope
$strReturn = $objHTTP.responseText
ConsoleWrite("-----------" & @CRLF)
ConsoleWrite ("Debug Response : "& @CR & $strReturn & @CR & @CR)
ConsoleWrite("-----------" & @CRLF)
; Load the return envelope into a DOM
$objReturn.loadXML ($strReturn)
ConsoleWrite("Return of the SOAP Msg : " & @CR & @CR & $objReturn.XML & @CR & @CR)
; Query the return envelope
$strQuery = "SOAP:Envelope/SOAP:Body"
$objReturn.selectSingleNode($strQuery)
$Soap = $objReturn.Text
MsgBox(0,"SOAP Response","The Response is : " & $Soap)
Func MyErrFunc()
$HexNumber=hex($oMyError.number,8)
Msgbox(0,"COM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & $HexNumber & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
)
SetError(1)
Endfunc
#cs
錯誤訊息
The Sales Tax is : soap:VersionMismatchSystem.Web.Services.Protocols.SoapException:
可能是 SOAP 的版本不符合: 發現未預期的 Envelope 命名空間 urn:schemas-xmlsoap-org:soap.v1。必須是 http://schemas.xmlsoap.org/soap/envelope/ 。
於 System.Web.Services.Protocols.SoapServerProtocol.CheckHelperVersion()
於 System.Web.Services.Protocols.SoapServerProtocol.Initialize()
於 System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
#ce
樓主熱門主題