# Ruby client for a Java webservice

**URL:** <https://rubytalk.org/t/ruby-client-for-a-java-webservice/36307>\
**Category:** ruby-talk\
**Created:** [20 March 2007 20:55 UTC](https://rubytalk.org/t/ruby-client-for-a-java-webservice/36307 "2007-03-20T20:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@srikanth](https://rubytalk.org/u/srikanth)\
**Post date:** [20 March 2007 20:55 UTC](https://rubytalk.org/t/ruby-client-for-a-java-webservice/36307/1 "2007-03-20T20:55:13Z")

</div>

Hi

I am accessing a webservice ( written in Java ) .  
below is the code I have written, to access a login method that takes  
a

String,String,ArrayofString as param.

require 'soap/wsdlDriver'

wsdl = '[http://abc.com:80/cwpidws/cwpidws?WSDL](http://abc.com:80/cwpidws/cwpidws?WSDL)'  
driver = SOAP::WSDLDriverFactory.new(wsdl).create\_rpc\_driver  
driver.wiredump\_file\_base = "soapresult"  
param3 = Array.new(25,String)  
&nbsp;&nbsp;driver.login( "abcd", "efgh", param3)

however the input message does not set the params the right way.

\<?xml version="1.0" encoding="utf-8" ?\>  
\<env:Envelope xmlns:xsd="[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)"  
&nbsp;&nbsp;&nbsp;&nbsp;xmlns:env="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)"  
&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"\>  
&nbsp;&nbsp;\<env:Body\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<n1:login xmlns:n1="urn:com.sun.wpe.cwp.cwpidws/wsdl/cwpidws"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env:encodingStyle="[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<String\_1 xsi:nil="true"\>\</String\_1\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<String\_2 xsi:nil="true"\>\</String\_2\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<arrayOfString\_3 xsi:type="n2:Array"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n2:arrayType="xsd:string[25]"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:n2="[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<item href="#id52"\>\</item\>

The two strings ( String\_1 and String\_2) are not part of the message .  
how do i set the parameters to the function.

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