# Wsdl2ruby generating broken ruby code

**URL:** <https://www.ruby-forum.com/t/wsdl2ruby-generating-broken-ruby-code/162007>\
**Category:** Ruby\
**Created:** [March 4, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/wsdl2ruby-generating-broken-ruby-code/162007 "2009-03-04T19:25:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_J.on](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8797f3/32.png) [@David\_J.on](https://www.ruby-forum.com/u/David_J.on)\
**Post date:** [March 4, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/wsdl2ruby-generating-broken-ruby-code/162007/1 "2009-03-04T19:25:56Z")

</div>

The piece of schema below is producing a broken ruby class (further  
below) — note that the fields messageResourceFactory and  
propertyMessageResourcesFactory (from the xs:choice elements above) are  
defined multiple times both as fields and in the parameter list for the  
initialize method. It looks like no changes have been made to soap4r  
since  
2007 — I’m wondering if anyone knows how to deal with this problem,  
it’s a  
showstopper issue for us — means we can’t support ruby, which we  
really  
want to do.

Thanks in advance,  
David J.on

* * *

\<xs:complexType name=“messageResources” abstract=“true”\>  
xs:sequence  
xs:choice  
\<xs:element ref=“tns:messageResourcesFactory”/\>  
\<xs:element ref=“tns:propertyMessageResourcesFactory”/\>  
\</xs:choice\>  
\<xs:element name=“config” type=“xs:string” minOccurs=“0”/\>  
xs:choice  
\<xs:element ref=“tns:messageResourcesFactory”/\>  
\<xs:element ref=“tns:propertyMessageResourcesFactory”/\>  
\</xs:choice\>  
\<xs:element name=“formats” type=“ns1:slGenericHashMap”  
minOccurs=“0”/\>  
\<xs:element name=“returnNull” type=“xs:boolean”/\>  
\<xs:element name=“escape” type=“xs:boolean”/\>  
\</xs:sequence\>  
\</xs:complexType\>

* * *

class MessageResources  
attr\_accessor :messageResourcesFactory  
attr\_accessor :propertyMessageResourcesFactory  
attr\_accessor :config  
attr\_accessor :messageResourcesFactory  
attr\_accessor :propertyMessageResourcesFactory  
attr\_accessor :formats  
attr\_accessor :returnNull  
attr\_accessor :escape

# def initialize(messageResourcesFactory = nil, propertyMessageResourcesFactory = nil, config = nil, messageResourcesFactory = nil, propertyMessageResourcesFactory = nil, formats = nil, returnNull

nil, escape = nil)  
@messageResourcesFactory = messageResourcesFactory  
@propertyMessageResourcesFactory = propertyMessageResourcesFactory  
@config = config  
@messageResourcesFactory = messageResourcesFactory  
@propertyMessageResourcesFactory = propertyMessageResourcesFactory  
@formats = formats  
@returnNull = returnNull  
@escape = escape  
end  
end

---

<div class="post-metadata">

**Author:** ![David\_J.on](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8797f3/32.png) [@David\_J.on](https://www.ruby-forum.com/u/David_J.on)\
**Post date:** [March 4, 2009, 7:34pm UTC](https://www.ruby-forum.com/t/wsdl2ruby-generating-broken-ruby-code/162007/2 "2009-03-04T19:34:10Z")

</div>

On Mar 4, 2009, at 10:23, David J.on wrote:

> showstopper issue for us — means we can’t support ruby, which we  
> really  
> want to do.

Did you file a bug or check the tracker to see if it has been fixed?

$ gem list -dr soap4r

\*\*\* REMOTE GEMS \*\*\*

soap4r (1.5.8)  
Author: NAKAMURA, Hiroshi  
Homepage: [http://dev.ctor.org/soap4r](http://dev.ctor.org/soap4r)

```
 An implementation of SOAP 1.1 for Ruby.

```

Try that link

---

<div class="post-metadata">

**Author:** ![David\_J.on](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8797f3/32.png) [@David\_J.on](https://www.ruby-forum.com/u/David_J.on)\
**Post date:** [March 5, 2009, 10:10pm UTC](https://www.ruby-forum.com/t/wsdl2ruby-generating-broken-ruby-code/162007/3 "2009-03-05T22:10:50Z")

</div>

Thanks for responding — the first thing I did was go to that page (I  
was  
already using 1.5.8) and noted that (a) there were quite a few bug  
reports  
there and (b) there have been no updates since 2007. I did not file a  
bug  
immediately because (since I’m not an expert), I wanted to first check  
within the community to see if this was something already know, or  
whether I  
was doing something wrong (Always a possibilty).

D

“Eric H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in message  
news:removed\_email\_address@domain.invalid…
