Forum OpenACS Development: Tclsoap - stuck on error

Posted by Andrew T on
After finally getting package require to work, and successfully importing the SOAP package.... i am now getting this error when i try to do execute a procedure that does a soap call..... if anyone has any ideas how to fix it please reply asap.

invalid command name "::http::config"
    while executing
"::http::config -useragent "TclSOAP/$version ($::tcl_platform(os))""
    (procedure "::SOAP::Transport::http::xfer" line 10)
    invoked from within
"$transport $procVarName $url $req"
    (procedure "::SOAP::invoke" line 18)

Posted by Randy O'Meara on
From 'man n http' on my RH system...

Http(n)                      Tcl Built-In Commands                     
       Http - Client-side implementation of the HTTP/1.0 protocol.
       package require http ?2.4?

BTW, could you show the code required to 'require' Tclsoap?

Posted by Andrew T on
.. do u think its a namespace issue? tclsoap works fine outside of oacs.. any clues what i can try and tinker with to get it to work?

I did this to get package require to work for me...

global tcl_version
global tcl_library
global tcl_platform
global auto_path
set tcl_pkgPath /usr/share
set tcl_library [file join $tcl_pkgPath tcl${tcl_version}]
set tcl_platform(platform) "unix"
set auto_path [list /usr/share/tcl8.3 /usr/lib]
source [file join $tcl_library init.tcl]

package require SOAP

PLUS I had to edit the init.tcl file and remove set errorCode "" and set errorInfo "" (or wrap them in an if !info exists etc)

Posted by Andrew T on
Ok i fixed it .. i had to manually call http::configure from my tcl script... now i have another problem. I can do the soap call but i get a Request Error:

Server response is not well-formed XML.
response was <?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsi="" xmlns:xsd="">
<ns1:doGoogleSearchResponse xmlns:ns1="urn:GoogleSearch" SOAP-ENV:encodingStyle="">
<return xsi:type="ns1:GoogleSearchResult">
<documentFiltering xsi:type="xsd:boolean">false</documentFiltering>
<estimatedTotalResultsCount xsi:type="xsd:int">4430000</estimatedTotalResultsCount>
<directoryCategories xmlns:ns2="" xsi:type="ns2:Array" ns2:arrayType="ns1:DirectoryCategory[2]">
<item xsi:type="ns1:DirectoryCategory">
<specialEncoding xsi:type="xsd:string"></specialEncoding>
<fullViewableName xsi:type="xsd:string">Top/Regional/Middle_East/Cyprus/Recreation_and_Sports</fullViewableName>

............ ie the whole google response was outputted ...

  while executing
"$parseProc $procVarName $reply"
    (procedure "invoke2" line 17)
    invoked from within
"invoke2 $procVarName $reply"
    (procedure "::SOAP::invoke" line 25)
    invoked from within
"::SOAP::invoke ::SOAP::_doGoogleSearch

Posted by Claudio Pasolini on
Hi Andrew,

I'm trying tclsoap with aolserver 4 and fortunately I have not had any problem with "package require SOAP". I simply put this command in one sourced tcl file:

ns_eval package require SOAP
but I'm getting the same problem invoking a web service that works just fine with tclsh, i.e. "Server response is not well-formed XML."

I tracked down the problem to the parse_soap_response proc, but before hacking it I wonder if you have already foun a solution.

Posted by Nick Carroll on
Hi Claudio,

Did you manage to get tclsoap working in aolserver?


Posted by Claudio Pasolini on
Hi Nick,

I didn't have the time to experiment tclsoap, but I'm succesfully using the excellent William Byrne's soap-gateway in a couple of sites.