Jump to content

Issue Sending SOAP messages (COM Error 80020009)


Recommended Posts

Hi all,

First post for a newbie..

I am trying to send an xml to an server but i kee getting error 80020009: the system cannot locate the resource specified. error source is msxml3.dll

I have used the example from ptrex

http://www.autoitscript.com/forum/index.ph...904&hl=soap

Here is the code i have:

Dim $objHTTP 
Dim $strEnvelope
Dim $strReturn
Dim $objReturn
Dim $dblTax
Dim $strQuery
Dim $value

; Initialize COM error handler 
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

$objHTTP = ObjCreate("Microsoft.XMLHTTP")
$objReturn = ObjCreate("Msxml2.DOMdocument.3.0")

; Get the Soap message text file for the Ping
$strEnvelope = FileRead("C:\Documents and Settings\salvatore\Desktop\JohnCommings\SOAPBOX\test.txt")

; Set up to post to our b2b test enviroment server
$objHTTP.open ("post", "wgwprdpxy", False)




; Set a standard SOAP/ XML header for the content-type
$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("Debug : "& $strReturn & @CR & @CR)

; Load the return envelope into a DOM
$objReturn.loadXML ($strReturn)

ConsoleWrite("Return of the SOAP Msg : " & @CR & $objReturn.XML & @CR & @CR)

; Query the return envelope
$strQuery = "SOAP:Envelope/SOAP:Body/m:getsalestaxresponse/salestax"

$dblTax = $objReturn.selectSingleNode($strQuery)
$Soap = $objReturn.Text

MsgBox(0,"SOAP Response","Result : " & $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) ; to check for after this function returns
Endfunc

thanks for the help guys!!

AutoIT [L] PlatesI have found these posts really usefull, maybe you will too.Martins Print UDF

Link to comment
Share on other sites

Your COM error handler is set up to give you a lot more information taht the error number. Please give more information (like the command that results in the error). You can also try DebugMode (see my sig).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Your COM error handler is set up to give you a lot more information taht the error number. Please give more information (like the command that results in the error). You can also try DebugMode (see my sig).

Dale

Hi DaleHohm,

thanks for replying!

This is information from the error box "COM Test"

We intercepted a COM error !

err.description is: The system cannot locate the resource specified.

err.number is: 80020009

err.lastdll is: 0

err.scriptline is: 33

err.source is: msxml3.dll

err.helpcontext is: 0

i copied the debug code in to my code but hasn't seem to of had any affect.

AutoIT [L] PlatesI have found these posts really usefull, maybe you will too.Martins Print UDF

Link to comment
Share on other sites

For the DebugMode to work you must be running your script in SciTe (F5) -- are you?

By my counting, this is line 33... is that correct?

$objHTTP.send ($strEnvelope)

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

A google search for

80020009 msxml3 send

will bring you many hits. Many suggest upgrading msxml for V4

see what you find

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...