xsd2ruby

A

aoco

I have a question on xsd2ruby. I am attempting to implement portions of
the PayPal WebServices API feature set. There are two XSD files and one
WSDL file. I've put all three files through xsd2ruby and wsdl2ruby
respectively. I have had no problems at all in using the classes that
it generates with one exception - setting the BasicAmountType. The
BasicAmountType has two requisites: a CurrencyCode and an amount. The
XSD from the CoreComponentTypes is:

{<code>}

<xs:complexType name="BasicAmountType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="currencyID" type="ebl:CurrencyCodeType"
use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

{</code>}

Where I am getting stuck is that in PHP and Java, I create an object
for BasicAmountType, set the attribute with the attribute name and set
the CurrencyCodeType the appropriate currency code and pass this object
to another object that requires the specific formatting that the
BasicAmountType does.

In my Ruby class for BasicAmountType was generated as:

# {urn:ebay:apis:CoreComponentTypes}BasicAmountType
class BasicAmountType < String
end

Do I have to go in and add my methods to this class? Should these
methods have been generated by xsd2ruby? This is really the only
problem I have had trying to figure out how ruby works.

link to the WSDL files:

www.paypal.com/wsdl/PayPalSvc.wsdl
www.paypal.com/wsdl/eBLBaseComponents.xsd
www.paypal.com/wsdl/CoreComponentTypes.xsd

Any help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top