Forum Discussion

SmartBear_Suppo's avatar
16 years ago

Rest support, method body is not created from the schema

Hi Doron,

Are you using the latest build? can you attach the WADL file (and xsds..).

regards,

/Ole
eviware.com

2 Replies

  • Hello,

    Looking at your WADL, it seems there are a few errors. For one, the type:


    <xs:simpleType name="status">
        <xs:restriction base="xs:boolean">
            <xs:enumeration value="true"/>
            <xs:enumeration value="false"/>
        </xs:restriction>
    </xs:simpleType>


    is illegal according to the XSD specification, as you cannot use the enumeration facet for a type based on xs:boolean (don't ask me why this is though!). Instead, you could use the following which should be equivalent:


    <xs:simpleType name="status">
        <xs:restriction base="xs:boolean">
            <xs:pattern value="(true)|(false)"/>
        </xs:restriction>
    </xs:simpleType>


    The second problem is that the schema defines types in the empty namespace since there is no targetNamespace attribute for the xs:schema element, but since the parent application-element specifies the default namespace to be "http://research.sun.com/wadl/2006/10" any reference will be to elements in that namespace. So the schema defines a type "lang" in the empty namespace, but tries to reference "{http://research.sun.com/wadl/2006/10}lang", which fails since the type is undefined. You can remedy this by explicitly setting the namespace prefix for the wadl elements insteead of using a default namespace. For example:


    <wadl:application xmlns:wadl="http://research.sun.com/wadl/2006/10" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <wadl:grammars>
            <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified">
                ...


    Fixing these issues with the WADL should remove the errors you are getting with soapUI. I'm attaching a modified hub.xml which uses the fixes I suggested.

    Regards,
    Dain
    eviware.com
  • Hello,

    I noticed that in your WADL where you define your request that you do not specify an element type. This is the reason that soapUI is not able to generate the default XML. Try changing the request representation to the following:

    element="sendSmsResponse" />...

    I noticed however that there is a bug with the XML editor right now. Whenever recreate the response, the actual XML editor does not update correctly, instead displaying whatever was previously the request content. This should be fixed shortly, but for now you can manually update the editor by closing and reopening the Request panel.

    Regards,
    Dain
    eviware.com