SOAP4R and WSDL

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}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {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 | T. Stone
http://www.caliban.org |
>

Hi,

From: “Ian Macdonald” 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}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {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

From: “Ian Macdonald” 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}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Unknown element {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 |
http://www.caliban.org |
>

Hi,

From: “Ian Macdonald” 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 (2.66 KB)

From: “Ian Macdonald” 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 {http://www.w3.org/2001/XMLSchema}simpleType.
Restriction of basetype with simpleType definition is ignored for now.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Restriction of basetype with simpleType definition is ignored for now.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Restriction of basetype with simpleType definition is ignored for now.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Restriction of basetype with simpleType definition is ignored for now.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Restriction of basetype with simpleType definition is ignored for now.
Unknown element {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 | who has not found that he is stupid. –
http://www.caliban.org | Gilbert K. Chesterson
>

Hi,

From: “Ian Macdonald” 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}simpleType.
[snip]
Restriction of basetype with simpleType definition is ignored for now.
Unknown element {XML Schema}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

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
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

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 | about what’s happening now. – Lauren
http://www.caliban.org | Bacall
>

Hi,

From: “Ian Macdonald” 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

From: “Ian Macdonald” 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 |
http://www.caliban.org |
>