Version 15 of WSDL

Updated 2006-02-13 06:05:42 by lexfiend

Web Services Definition Language

http://www.w3.org/TR/wsdl is the official definition for WSDL

Anyone taken the WSDL for google and written a Tcl binding, perhaps making use of TclSOAP?


"A Busy Developers Guide to WSDL 1.1" [L1 ]


A WSDL4TCL binding is available through http://oss.software.ibm.com/developerworks/opensource/wsdl4tcl .

escargo 05/05/05 - Trying to follow that link brought me to this:

 Open source projects
 We have recently made changes to the IBM developerWorks open source site.
 The requested project cannot be found and may no longer be active.
 Please visit the IBM developerWorks open source site at http://www.ibm.com/developerworks/opensource/ for additional information.

So, although I would like to experiment with WSDL4TCL, I cannot until I can find the code somewhere.

CL has also been working on tying WSDL into TclSOAP.


http://www-105.ibm.com/developerworks/education.nsf/webservices-onlinecourse-bytitle/1719A5B5BD1D22B186256A930061B113?open&l=867,t=grws,p=WSDLwTcl

escargo 14 Jul 2005 - Trying to follow that link brought me to an unrelated DeveloperWorks page.

lexfiend 13 Feb 2006 With the disappearance of WSDL4Tcl and the limitations of TclSOAP's WSDL parser (still under development at the time of this writing), I've devised an alternative approach to using WSDL files published by eBay et al. Basically, I run gSOAP's [L2 ] wsdl2h on the WSDL file, then parameterize the sample XML files generated as a side-effect of that run. For example, to create a procedure that gets the official eBay time:

  • Run wsdl2h on eBay's WSDL file:
 wsdl2h -c -o eBaySvc.h http://developer.ebay.com/webservices/latest/eBaySvc.wsdl
  • Run soapcpp2 to generate the corresponding C source code and sample SOAP request and response files (the request files are what we really want):
 soapcpp2 eBaySvc.h
  • Use the XML text in eBayAPISoapBinding.GeteBayOfficialTime.req.xml to create a special wrapProc for TclSOAP:
 #!/usr/bin/env tclsh
 array set a {
   -uriBase https://api.sandbox.ebay.com/wsapi
   -appID <myAppID>
   -devID <myDevID>
   -certID <myAuthCert>
   -siteID 0
   -APIversion 439
   -authToken <myAuthToken>
 }

 if {$argc > 0} {
   array set a $argv
 }

 package require dom 2.0
 package require SOAP
 package require SOAP::https
 package require tls
 http::register https 443 ::tls::socket
 package require rpcvar
 namespace import -force rpcvar::typedef

 proc mkServiceURI {svcName} {
   return "$::a(-uriBase)?callname=${svcName}&siteid=$::a(-siteID)&appid=$::a(-appID)&version=$::a(-APIversion)&routing=default"
 }

 array set xml {
   GeteBayOfficialTime {<?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:ns1="urn:ebay:apis:eBLBaseComponents">
  <SOAP-ENV:Header>
   <ns1:RequesterCredentials>
    <ns1:eBayAuthToken>${eBayAuthToken}</ns1:eBayAuthToken>
    <ns1:Credentials>
     <ns1:AppId>${AppId}</ns1:AppId>
     <ns1:DevId>${DevId}</ns1:DevId>
     <ns1:AuthCert>${AuthCert}</ns1:AuthCert>
    </ns1:Credentials>
   </ns1:RequesterCredentials>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:GeteBayOfficialTimeRequest>
     <ns1:Version>${Version}</ns1:Version>
    </ns1:GeteBayOfficialTimeRequest>
  </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>}
 }

 # Generic eBay XML generation procedure
 proc GeneBayXML {procVarName args} {
   set procName [lindex [split $procVarName {_}] end]
   foreach {key val} $args {
     set $key $val
   }
   return [subst $::xml($procName)]
 }

 SOAP::create GeteBayOfficialTime \
   -proxy [mkServiceURI GeteBayOfficialTime] \
   -wrapProc GeneBayXML \
   -params { AppId string DevId string AuthCert string eBayAuthToken string Version string } \
   -action { }

 proc getEbayTime {} {
   return [GeteBayOfficialTime \
     AppId $::a(-appID) DevId $::a(-devID) AuthCert $::a(-certID) \
     eBayAuthToken $::a(-authToken) \
     Version $::a(-APIversion)]
 }

 puts "getEbayTime = [getEbayTime]" 

Byron Whitlock writes during Jan, 2005 on the tclxml mailing list:

"I've wrote a package that allows wsdl generation from Tcl SOAP. I hope someone finds this usefull. http://www.geocities.com/blackboy9692002/tclsoap/

I based this off the 2.6 version of TCLDOM/TCLXML, (though it should work with 3.x, not tested)"


We learn (among other ways) by reading the works of those who have gone before. Study working WSDL instances at

Analyze your WSDL at


See also tclsoap.


LV Any Tclers make use of the data mentioned at http://www.nws.noaa.gov/forecasts/xml/ to work up some Tcl weather applications?


Category Internet | Category Acronym