Forum OpenACS Development: Tclsoap - stuck on error

Collapse
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)

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

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

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

Collapse
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)

Collapse
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:doGoogleSearchResponse xmlns:ns1="urn:GoogleSearch" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="ns1:GoogleSearchResult">
<documentFiltering xsi:type="xsd:boolean">false</documentFiltering>
<estimatedTotalResultsCount xsi:type="xsd:int">4430000</estimatedTotalResultsCount>
<directoryCategories xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" 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>
</item>

............ 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

Collapse
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.

Collapse
Posted by Nick Carroll on
Hi Claudio,

Did you manage to get tclsoap working in aolserver?

Nick.

Collapse
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.