# SOAP4R and WSDL

**URL:** <https://rubytalk.org/t/soap4r-and-wsdl/9720>\
**Category:** ruby-talk\
**Created:** [17 January 2004 09:02 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720 "2004-01-17T09:02:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [17 January 2004 09:02 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/1 "2004-01-17T09:02:13Z")

</div>

Hello,

I’m using SOAP4R and trying to parse a WSDL file. However, I get this  
error:

[ianmacd@sagan]$ ./test3  
Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
/usr/lib/ruby/1.8/wsdl/soap/operation.rb:107:in `param\_info’: soap:body parts (NotImplementedError)

There seems to be something in the WSDL that SOAP4R doesn’t like. AFAIK,  
the same file works fine with other languages’ WSDL parsers.

Is there a way around this kind of thing?

Ian

> **···**
>
> –  
> Ian Macdonald | I try to keep an open mind, but not so open  
> System Administrator | that my brains fall out. – Judge Harold  
> [ian@caliban.org](mailto:ian@caliban.org) | T. Stone  
> [http://www.caliban.org](http://www.caliban.org) |  
> \>

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi4](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@NAKAMURA\_Hiroshi4](https://rubytalk.org/u/NAKAMURA_Hiroshi4)\
**Post date:** [17 January 2004 12:26 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/2 "2004-01-17T12:26:35Z")

</div>

Hi,

> From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> Sent: Saturday, January 17, 2004 6:02 PM

> I’m using SOAP4R and trying to parse a WSDL file. However, I get this  
> error:
> 
> [ianmacd@sagan]$ ./test3  
> Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> Unknown element {[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> /usr/lib/ruby/1.8/wsdl/soap/operation.rb:107:in `param\_info’: soap:body parts (NotImplementedError)

Can I see the WSDL?

> Is there a way around this kind of thing?

Could be. If “part” attribute of soap:body element lists all parts  
of the message defined, it can be ignored…

Regards,  
// NaHi

---

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [17 January 2004 19:14 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/3 "2004-01-17T19:14:33Z")

</div>

> > From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> > Sent: Saturday, January 17, 2004 6:02 PM
> 
> > I’m using SOAP4R and trying to parse a WSDL file. However, I get this  
> > error:
> > 
> > [ianmacd@sagan]$ ./test3  
> > Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> > Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> > Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> > Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> > Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> > Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> > /usr/lib/ruby/1.8/wsdl/soap/operation.rb:107:in `param\_info’: soap:body parts (NotImplementedError)
> 
> Can I see the WSDL?

I’ve sent it to you privately, as it’s too big for the mailing list.

> > Is there a way around this kind of thing?
> 
> Could be. If “part” attribute of soap:body element lists all parts  
> of the message defined, it can be ignored…

I’m anything but an expert when it comes to SOAP, so, if after looking  
at the WSDL you think this can be done, can you give me a clue how to  
do it?

Thank you.

Ian

> **···**
>
> ## On Sat 17 Jan 2004 at 21:26:35 +0900, NAKAMURA, Hiroshi wrote:
> 
> Ian Macdonald | QOTD: “Our parents were never our age.”  
> System Administrator |  
> [ian@caliban.org](mailto:ian@caliban.org) |  
> [http://www.caliban.org](http://www.caliban.org) |  
> \>

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi4](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@NAKAMURA\_Hiroshi4](https://rubytalk.org/u/NAKAMURA_Hiroshi4)\
**Post date:** [18 January 2004 14:28 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/4 "2004-01-18T14:28:22Z")

</div>

Hi,

> From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> Sent: Sunday, January 18, 2004 4:14 AM

> > Can I see the WSDL?
> 
> I’ve sent it to you privately, as it’s too big for the mailing list.

Thanks. I implemented this feature.

I’ve commited the change. Main trunk (1.9) of the CVS of ruby and  
the CVS of soap4r are updated. Attached patch should be able to  
applied to ruby\_1\_8 branch of the CVS of ruby and released 1.8.1.

By the way, the WSDL you sent includes soap:header definition  
for session management. Soap4r now only offers very low level API  
for SOAP header handling. The developing code of high level API  
for easy use is in the CVS of soap4r (not in the CVS of ruby).  
I’ll be able to post a sample usage of this API within this week.

Regards,  
// NaHi

[parts.diff.txt](https://rubytalk.org/uploads/short-url/7fCvB1BrufWf8ZhCnMabUuORNoC.txt) (2.66 KB)

---

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [19 January 2004 00:44 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/5 "2004-01-19T00:44:56Z")

</div>

> > From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> > Sent: Sunday, January 18, 2004 4:14 AM
> 
> > > Can I see the WSDL?
> > 
> > I’ve sent it to you privately, as it’s too big for the mailing list.
> 
> Thanks. I implemented this feature.

Thank you.

> I’ve commited the change. Main trunk (1.9) of the CVS of ruby and  
> the CVS of soap4r are updated. Attached patch should be able to  
> applied to ruby\_1\_8 branch of the CVS of ruby and released 1.8.1.

I’ve applied it to the latest stable snapshot of 1.8.1.

> By the way, the WSDL you sent includes soap:header definition  
> for session management. Soap4r now only offers very low level API  
> for SOAP header handling. The developing code of high level API  
> for easy use is in the CVS of soap4r (not in the CVS of ruby).  
> I’ll be able to post a sample usage of this API within this week.

OK, but I’m not sure exactly how this applies to me.

If I try to run my test script with the patched SOAP4R, I now get this:

[ianmacd@sagan]$ ./test3  
Restriction of basetype with simpleType definition is ignored for now.  
Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Restriction of basetype with simpleType definition is ignored for now.  
Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Restriction of basetype with simpleType definition is ignored for now.  
Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Restriction of basetype with simpleType definition is ignored for now.  
Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Restriction of basetype with simpleType definition is ignored for now.  
Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
Restriction of basetype with simpleType definition is ignored for now.  
Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.

Is that the same thing you’re talking about? Is there any way I can  
modify the WSDL file to work around this issue?

Ian

> **···**
>
> ## On Sun 18 Jan 2004 at 23:28:22 +0900, NAKAMURA, Hiroshi wrote:
> 
> Ian Macdonald | The doctrine of human equality reposes on  
> System Administrator | this: that there is no man really clever  
> [ian@caliban.org](mailto:ian@caliban.org) | who has not found that he is stupid. –  
> [http://www.caliban.org](http://www.caliban.org) | Gilbert K. Chesterson  
> \>

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi1](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NAKAMURA\_Hiroshi1](https://rubytalk.org/u/NAKAMURA_Hiroshi1)\
**Post date:** [19 January 2004 01:27 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/6 "2004-01-19T01:27:48Z")

</div>

Hi,

> From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> Sent: Monday, January 19, 2004 9:44 AM

> If I try to run my test script with the patched SOAP4R, I now get this:
> 
> [ianmacd@sagan]$ ./test3  
> Restriction of basetype with simpleType definition is ignored for now.  
> Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.  
> [snip]  
> Restriction of basetype with simpleType definition is ignored for now.  
> Unknown element {[XML Schema](http://www.w3.org/2001/XMLSchema)}simpleType.
> 
> Is that the same thing you’re talking about?

No. Sorry for the unclear explanation. Above messages warns that  
wsdl4r just ignored “simpleType” definition in the WSDL. Just  
ignore these warning for now…

For example, “simpleType” is for restricting lexical space of the  
user-defined type.

\<?xml version="1.0"?\>

With this WSDL, bin/wsdl2ruby.rb generates following class  
definition.

# urn:www.example.com:rotr

class Order  
@@schema\_type = “Order”  
@@schema\_ns = “urn:www.example.com:rotr”

def item  
@item  
end

def item=(value)  
@item = value  
end

def quantity  
@quantity  
end

def quantity=(value)  
@quantity = value  
end

def initialize(item = nil,  
quantity = nil)  
@item = item  
@quantity = quantity  
end  
end

But item value should be restricted that it is one of “fotr”,  
“ttt”, and “rotk” in the future.

OT: The 3rd movie is screened from Feb. 14 in Japan.

Regards,  
// NaHi

---

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [19 January 2004 02:04 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/7 "2004-01-19T02:04:50Z")

</div>

OK. I now understand that it’s just for enumeration types.

Well, it seems that the WSDL now parses correctly. However, with this  
code:

wsdl = ‘partner.wsdl’  
soap = SOAP::WSDLDriverFactory.new(wsdl).createDriver

username = “[ian@caliban.org](mailto:ian@caliban.org)”  
password = “xxxxxx”

soap = soap.login(username, password)

I now get this:

/usr/lib/ruby/1.8/soap/wsdlDriver.rb:307:in `header_from_obj': No header definition in schema. (RuntimeError) from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:246:in `document\_send’  
from (eval):2:in `login’  
from ./test3:15

Sorry to keep bugging you about this stuff. Any ideas?

Ian

> **···**
>
> On Mon 19 Jan 2004 at 10:27:48 +0900, NAKAMURA, Hiroshi wrote:
> 
> > > From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)
> > > 
> > > Is that the same thing you’re talking about?
> > 
> > No. Sorry for the unclear explanation. Above messages warns that  
> > wsdl4r just ignored “simpleType” definition in the WSDL. Just  
> > ignore these warning for now…
> 
> –  
> Ian Macdonald | You can’t start worrying about what’s going  
> System Administrator | to happen. You get spastic enough worrying  
> [ian@caliban.org](mailto:ian@caliban.org) | about what’s happening now. – Lauren  
> [http://www.caliban.org](http://www.caliban.org) | Bacall  
> \>

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi4](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@NAKAMURA\_Hiroshi4](https://rubytalk.org/u/NAKAMURA_Hiroshi4)\
**Post date:** [19 January 2004 02:11 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/8 "2004-01-19T02:11:01Z")

</div>

Hi,

> From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> Sent: Monday, January 19, 2004 11:04 AM

> /usr/lib/ruby/1.8/soap/wsdlDriver.rb:307:in `header_from_obj': No header definition in schema. (RuntimeError) from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:246:in `document\_send’  
> from (eval):2:in `login’  
> from ./test3:15

It’s the bug and the notimplemented feature I wrote…  
I hope it will work in this week. Please wait.

Sorry for your inconvenience. WSDL4R is still not tested  
via various WSDL files.

Regards,  
// NaHi

---

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [19 January 2004 02:15 UTC](https://rubytalk.org/t/soap4r-and-wsdl/9720/9 "2004-01-19T02:15:15Z")

</div>

> > From: “Ian Macdonald” [ian@caliban.org](mailto:ian@caliban.org)  
> > Sent: Monday, January 19, 2004 11:04 AM
> 
> > /usr/lib/ruby/1.8/soap/wsdlDriver.rb:307:in `header_from_obj': No header definition in schema. (RuntimeError) from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:246:in `document\_send’  
> > from (eval):2:in `login’  
> > from ./test3:15
> 
> It’s the bug and the notimplemented feature I wrote…  
> I hope it will work in this week. Please wait.

OK. Thank you very much for your fixes and help so far.

> Sorry for your inconvenience. WSDL4R is still not tested  
> via various WSDL files.

No problem. I appreciate your hard work and patience with my questions.

Ian

> **···**
>
> ## On Mon 19 Jan 2004 at 11:11:01 +0900, NAKAMURA, Hiroshi wrote:
> 
> Ian Macdonald | SIMM crosstalk.  
> System Administrator |  
> [ian@caliban.org](mailto:ian@caliban.org) |  
> [http://www.caliban.org](http://www.caliban.org) |  
> \>
