Hi RobertUsing contract first with ADB, I continue to check feasibility to 
amend our existing service with JSON support (based on XML Stream API with 
moshi).
I'm currently struggling with xml types that include attributes. To reproduce 
the issue I have amended the wsdl in the samples.quickstartadb to include an 
attribute in the getPrice element:

 <xs:element name="getPrice">

     <xs:complexType>

         <xs:sequence>
            <xs:element name="symbol"                 nillable="true" 
type="xs:string" />
         </xs:sequence>
        <xs:attribute name="currency"             type="xs:string" 
use="required"/>
     </xs:complexType>

 </xs:element>

My corresponding JSON message should then be something like:
{ "getPrice" : {"@currency": "USD", "symbol": "IBM" }}
However the parse method in the GetPrice ADBBean keeps complaining "Required 
attribute currency is missing"; specifically this call returns null:
reader.getAttributeValue("http://quickstart.samples/xsd";, "currency");
(However it works when using SOAP).
Do I need to define attributes differently in the JSON message?

Reply via email to