# Help needed with soap/wsdlDriver

**URL:** <https://rubytalk.org/t/help-needed-with-soap-wsdldriver/30318>\
**Category:** ruby-talk\
**Created:** [25 August 2006 13:42 UTC](https://rubytalk.org/t/help-needed-with-soap-wsdldriver/30318 "2006-08-25T13:42:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tadeusz\_Bochan](https://avatars.discourse-cdn.com/v4/letter/t/e19b73/32.png) [@Tadeusz\_Bochan](https://rubytalk.org/u/Tadeusz_Bochan)\
**Post date:** [25 August 2006 13:42 UTC](https://rubytalk.org/t/help-needed-with-soap-wsdldriver/30318/1 "2006-08-25T13:42:41Z")

</div>

Hi,

Perhaps someone can tell me where I can get some help  
with the soap/wsdlDriver module ?  
I have posted my problem on this list before  
under the title SOAP/WSDL/BETFAIR (see below)  
but , responses have been scarce so far.  
Is this the correct list for such problems ?

Regards,  
Tad

Help Needed: SOAP/WSDL/BETFAIR  
Hi,

I have been making a foray into the world of SOAP/WSDL etc and having  
been encouraged with the success of running the googleapi demo code,  
I thought I would have a go with Betfair.

Alas, things are not going well,  
and I'm not sure if I'm doing something wrong  
or if the library module 'soap/wsdlDriver' is faulty  
or does not support the BFService.wsdl document.

The login request sequence works great,  
but any other requests fail (eg., getAllEventTypes, logout)  
because the parameters do not get generated  
in the request document which is sent to Betfair,  
which seems to indicate a bug in soap/wsdlDriver.rb,  
or in the way I have setup the parameters.

I have included the wiredumps for the 'login' and 'getAllEventTypes'  
requests  
as comments in the codefollowing, and you will see that  
the \<n1:request\> element for 'login' is formatted as per the parameters  
passed to login ,  
but the one for 'getAllEventTypes' is empty.

Any suggestions ?  
(I tried to debug the soap code, but it was all beyond my abilities)

Regards,

Tad

#\<Docs\>  
#[http://bdphelp.betfair.com/API4/V1/API4.1aOnlineHelp/wwhelp/wwhimpl/js/html/wwhelp.htm](http://bdphelp.betfair.com/API4/V1/API4.1aOnlineHelp/wwhelp/wwhimpl/js/html/wwhelp.htm)  
#\</Docs\>  
require 'soap/wsdlDriver'  
wsdl\_url="[https://api.betfair.com/betex-api-public-ws/v2/BFService.wsdl](https://api.betfair.com/betex-api-public-ws/v2/BFService.wsdl)"  
puts "\>\>CONNECT\<\<"  
soap = SOAP::WSDLDriverFactory.new( wsdl\_url ).create\_rpc\_driver  
soap.wiredump\_file\_base,soap.wiredump\_dev = "bdp",STDOUT  
puts "------------------------------------------------"  
print "\>\>LOGIN\<\<"  
logindetails={:locationId =\>0,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:password =\>"mypassword",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:productId =\>82,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:username =\>"myusername",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:vendorSoftwareId=\>0  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
response=soap.login(:request=\>logindetails) ;  
exit unless response.result.errorCode=="OK"

# WIREDUMP OUTPUT FROM LOGIN REQUEST :-  
#-\<?xml version="1.0" encoding="utf-8" ?\>  
#-\<env:Envelope xmlns:xsd="[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)"  
#- xmlns:env="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"  
#- xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"\>  
#- \<env:Body\>  
#- \<n1:login  
xmlns:n1="[http://www.betfair.com/publicapi/BFServiceV2/](http://www.betfair.com/publicapi/BFServiceV2/)"\>  
#- \<n1:request\>  
#- \<locationId\>0\</locationId\>  
#- \<password\>mypassword\</password\>  
#- \<productId\>82\</productId\>  
#- \<username\>myusername\</username\>  
#- \<vendorSoftwareId\>0\</vendorSoftwareId\>  
#- \</n1:request\>  
#- \</n1:login\>  
#- \</env:Body\>  
#-\</env:Envelope\>  
puts "------------------------------------------------"

print "\>\>GET ALL EVENT TYPES\<\<"  
apiRequestHeader={:clientStamp =\> 0,:sessionToken =\>  
response.result.header.sessionToken}  
response=soap.getAllEventTypes(:request=\>{:header=\>apiRequestHeader,:locale=\>"en"})  
exit unless response.result.errorCode=="OK"

# WIREDUMP OUTPUT FROM 'getAllEventTypes' REQUEST :-  
#\<?xml version="1.0" encoding="utf-8" ?\>  
#\<env:Envelope xmlns:xsd="[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)"  
# xmlns:env="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"  
# xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"\>  
# \<env:Body\>  
# \<n1:getAllEventTypes  
xmlns:n1="[http://www.betfair.com/publicapi/BFServiceV2/](http://www.betfair.com/publicapi/BFServiceV2/)"\>  
# \<n1:request\>  
# \</n1:request\>  
# \</n1:getAllEventTypes\>  
# \</env:Body\>  
#\</env:Envelope\>

puts "------------------------------------------------"  
print "\>\>LOGOUT\<\<"  
apiRequestHeader={:clientStamp =\> 0,:sessionToken =\>  
response.result.header.sessionToken}  
response=soap.logout(:request=\>{:header=\>apiRequestHeader})  
p [response.result.header.errorCode,response.result.errorCode]  
exit unless response.result.errorCode=="OK"  
puts "------------------------------------------------"  
puts "It all worked OK"

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
