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