# Wsdl problem

**URL:** <https://www.ruby-forum.com/t/wsdl-problem/72791>\
**Category:** Ruby\
**Created:** [February 24, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/wsdl-problem/72791 "2006-02-24T13:50:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![haakon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@haakon](https://www.ruby-forum.com/u/haakon)\
**Post date:** [February 24, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/wsdl-problem/72791/1 "2006-02-24T13:50:08Z")

</div>

Hi!

I used wsdl2ruby to generate classes and methods.  
But I have a broblem with one of the methods and its arguments

method in driver.rb:

class EndUserIdentifier  
@@schema\_type = “EndUserIdentifier”  
@@schema\_ns = “[Loading...](http://www.csapi.org/schema/parlayx/common/v1_0)”  
@@schema\_element = [[“value”, [“SOAP::SOAPAnyURI”, XSD::QName.new(nil,  
“value”)]]]

attr\_accessor :value

def initialize(value = nil)  
@value = value  
end  
end

* * *

method in defaltDriver.rb  
Methods = [  
[XSD::QName.new(“[Loading...](http://www.csapi.org/wsdl/parlayx/sms/v1.0)”,  
“sendSms”),  
“”,  
“sendSms”,  
[[“in”, “destinationAddressSet”, [“EndUserIdentifier[]”,  
“[Loading...](http://www.csapi.org/schema/parlayx/common/v1_0)”,  
“EndUserIdentifier”]],  
[“in”, “senderName”, [“:🧼:SOAPString”]],  
[“in”, “charging”, [“:🧼:SOAPString”]],  
[“in”, “message”, [“:🧼:SOAPString”]],  
[“retval”, “result”, [“:🧼:SOAPString”]] ],  
{ :request\_style =\> :rpc, :request\_use =\> :encoded,  
:response\_style =\> :rpc, :response\_use =\> :encoded }  
],

* * *

this is my client.rb file

smswsdl = ‘[http://x.x.x.x/parlayx/services/SendSmsPort](http://x.x.x.x/parlayx/services/SendSmsPort)’  
obj2 = SendSmsPort.new(smswsdl)

#sendSms (EndUserIdentifier[] destinationAddressSet, String senderName,  
String charging, String message, out String requestIdentifier)

smsId =(???, ‘some\_nr’, ‘some\_string’, ‘some\_message’)  
)  
I want to run the sendSms method but I get error from the server

#SOAP::Mapping::Object:0x2bf6868: java.lang.IllegalArgumentException:  
java.lan  
g.ClassCastException@d8a125 (SOAP::FaultError)

How to I create a new EndUserIdentifier object?  
Any help will be greatly appreciated.  
–haakon

---

<div class="post-metadata">

**Author:** ![haakon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@haakon](https://www.ruby-forum.com/u/haakon)\
**Post date:** [February 24, 2006, 3:24pm UTC](https://www.ruby-forum.com/t/wsdl-problem/72791/2 "2006-02-24T15:24:49Z")

</div>

eui = EndUserIdentifier.new(some\_value) - not sure what value is  
intended, but your service definition should tell you that?

I found that there are a lot of improvements in the latest Subversion  
code over the last release. This is especially true with Document  
Literal service support. So, you might want to try that.

The other thing I found using SOAP4R is that the wsdl2ruby didn’t always  
behave well. I used the xsd2ruby to generate classes, but then used  
those classes in some manually constructed code.

soap =  
SOAP::WSDLDriverFactory.new(‘[http://example.com/services/ContactsService?WSDL](http://example.com/services/ContactsService?WSDL)’).create\_rpc\_driver  
soap.generate\_explicit\_type = true  
soap.wiredump\_dev = STDOUT if $DEBUG  
result = soap.GetContacts(ContactsRequest.new())  
result.contacts.each { |c| print\_contact(c) }

The soap.wiredump\_dev = STDOUT will print out all of the SOAP messages  
to standard output which is really nice for debugging.

---

<div class="post-metadata">

**Author:** ![haakon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@haakon](https://www.ruby-forum.com/u/haakon)\
**Post date:** [March 1, 2006, 10:58am UTC](https://www.ruby-forum.com/t/wsdl-problem/72791/3 "2006-03-01T10:58:48Z")

</div>

Hi!

The line  
smsId =(???, ‘some\_nr’, ‘some\_string’, ‘some\_message’)

was supposed to look like:  
smsId = sendSms(???, ‘some\_nr’, ‘some\_string’, ‘some\_message’)

The first argument is a EndUserIdentifierObject?

eu = EndUserIdentifier(‘what\_value?’)

Geoff L. wrote:

> eui = EndUserIdentifier.new(some\_value) - not sure what value is  
> intended, but your service definition should tell you that?

From the wsdl file? how?

> I found that there are a lot of improvements in the latest Subversion  
> code over the last release. This is especially true with Document  
> Literal service support. So, you might want to try that.
> 
> The other thing I found using SOAP4R is that the wsdl2ruby didn’t always  
> behave well. I used the xsd2ruby to generate classes, but then used  
> those classes in some manually constructed code.
> 
> soap =  
> SOAP::WSDLDriverFactory.new(‘[http://example.com/services/ContactsService?WSDL](http://example.com/services/ContactsService?WSDL)’).create\_rpc\_driver  
> soap.generate\_explicit\_type = true  
> soap.wiredump\_dev = STDOUT if $DEBUG  
> result = soap.GetContacts(ContactsRequest.new())  
> result.contacts.each { |c| print\_contact(c) }
> 
> The soap.wiredump\_dev = STDOUT will print out all of the SOAP messages  
> to standard output which is really nice for debugging.

If I use soap.wiredump I get the following error from the axis server:

#SOAP::Mapping::Object:0x2bf5f68: java.lang.IllegalArgumentException:  
java.lang.ClassCastException@cc17f1 (SOAP::FaultError)

–haakon
