Forum OpenACS Q&A: TCL RCP and Web services.

Collapse
Posted by Wes Reing on
I am wondering about making Remote Procedure Calls from Tcl.  I would like to use Amazon’s Web Services from openACS.  I have been trying to figure out the best way to do this.  Some research here in the forums has only added to my confusion.  For instance I see that Dave is working on a SOAP implementation of some sort but I get the impression that that might be more for using ACS to provide Web Services instead of just making a few calls to one.  I have also seen some posts referring to Tcl-RCP but this seems to be difficult to get running.  I’d appreciate any advice as to the easiest solution.

Thanks for your help,
Wes

Collapse
Posted by Dan Wickstrom on
I tried a couple of times to get an account from amazon for testing their web services implementation, but I was unsuccessful - I never received a response to my application.  On the other hand, I was able to access google's web services using aolserver/nsjava, and I have created a web services package for openacs that integrates the apache axis web service implementation.  The apache axis package provides support for both client and server web service implementations, and you should be able to use it to access the amazon web services, assuming that you are able to obtain an account.
Collapse
Posted by Bart Teeuwisse on
Wes,

I'm working on an integration with Amazon's web services. My work is based on tDOM, which makes life a lot easier. Take a look at http://www.thecodemill.biz/amazon for an example. This page will show basic book information for a (fixed) book. All the data is obtained through Amazon's web services. At the bottom of the page you'll find a dump from response from Amazon parsed by tDOM. All repsonses from Amazon are cached too! Expect to hear more come January.

/Bart

Collapse
Posted by Dan Wickstrom on
I tried it again, and I am able to get a token now. Here is a sample run, from nscp, where I use nsjava and apache-axis to access the google web service:


openacs4:nscp 3> set service [nsjava::new com.amazon.soap.axis.AmazonSearchServiceLocator]
nsjava0x2
openacs4:nscp 4> set url [nsjava::new {java.net.URL String} "http://soap.amazon.com/onca/soap"]
nsjava0x3
openacs4:nscp 5> set port [$service {getAmazonSearchPort java.net.URL} $url]
nsjava0x4
openacs4:nscp 6> set request [nsjava::new com.amazon.soap.axis.AuthorRequest]
nsjava0x5
openacs4:nscp 7> $request {setAuthor String} "philip greenspun"

openacs4:nscp 8> $request {setPage String} "1"

openacs4:nscp 9> $request {setMode String} "books"

openacs4:nscp 10> $request {setTag String} "webservices-20"

openacs4:nscp 11> $request {setType String} "lite"

openacs4:nscp 12> $request {setDevTag String} "D3XXXXXXXXXXX"

openacs4:nscp 13> set result [$port {authorSearchRequest com.amazon.soap.axis.AuthorRequest} $request]
nsjava0x6
openacs4:nscp 14> set details [$result getDetails]
nsjava0x7
openacs4:nscp 15> set detail0 [$details get 0]
nsjava0x8
openacs4:nscp 16> $detail0 getProductName
Philip and Alex's Guide to Web Publishing
openacs4:nscp 17> set authors [$detail0 getAuthors]
nsjava0x9
openacs4:nscp 18> $authors get 0
Philip Greenspun
openacs4:nscp 19> $detail0 getReleaseDate
April, 1999
openacs4:nscp 20> $detail0 getListPrice
$44.95
openacs4:nscp 21> 
openacs4:nscp 22> set detail1 [$details get 1]
nsjava0xa
openacs4:nscp 23> $detail1 getProductName
Travels with Samantha
openacs4:nscp 24> set detail2 [$details get 2]
nsjava0xb
openacs4:nscp 25> $detail2 getProductName
Database Backed Web Sites: The Thinking Person's Guide to Web Publishing
openacs4:nscp 26> 

It's also interesting to note I was able to access amazon's web service from behind a firewall using the proxy support that is built into apache axis.