You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rodrigo Asensio <ra...@gmail.com> on 2008/12/11 18:35:20 UTC

Response a Custom XSD

Axis2 141
we are developing a ws based on our customer spec. He gave me a XSD
and the response XML (inner the soap msg) should be in a specific way.
I made it 100% using AXIOM OMElements because I didnt found a way to
do the XS:ATTRIBUTES as is shown below.


	<xs:element name="BigObject">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="SmallObject1"/>
				<xs:element ref="SmallObject2" minOccurs="0"/>
				<xs:element ref="SmallObject3" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="SmallObject4" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="Version" type="xs:string" use="optional" default="3.3"/>
			<xs:attribute name="UnitsOfMeasure" type="UnitsOfMeasure"
use="optional" default="metric"/>
			<xs:attribute name="TrainingModeFlag" type="xs:boolean"
use="optional" default="false"/>
		</xs:complexType>
	</xs:element>


If I deploy a WS returning objects, how can I do that some attributes
of the BigObject are shown like xs:attribute and not in the
xs:sequence, is this possible or they are crazy asking me this ? is
this standard ???


Rodrigo Asensio
rasensio@gmail.com
http://www.rodrigoasensio.com
"To err is human, but to really screw up requires the root password."

Re: Response a Custom XSD

Posted by Rodrigo Asensio <ra...@gmail.com>.
I'm seeing the wikipedia article (
http://en.wikipedia.org/wiki/Web_Services_Description_Language#Example_WSDL_file
) and I saw something like I want, that means is not that crazy, now
my question is , how can I represent in the XML the attributes of an
object
having this obj for example

class Request {
  private Header header;  >>> would be the complex type
  private String method; >>> is represented as an xs:attribute.. HOW
can I make this ????
}


         <xs:element name="request">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="header" maxOccurs="unbounded">
                     <xs:complexType>
                        <xs:simpleContent>
                           <xs:extension base="xs:string">
                              <xs:attribute name="name"
type="xs:string" use="required"/>
                           </xs:extension>
                        </xs:simpleContent>
                     </xs:complexType>
                  </xs:element>
                  <xs:element name="body" type="xs:anyType" minOccurs="0"/>
               </xs:sequence>
               <xs:attribute name="method" type="xs:string" use="required"/>
               <xs:attribute name="uri" type="xs:anyURI" use="required"/>
            </xs:complexType>
         </xs:element>





Rodrigo Asensio
rasensio@gmail.com
http://www.rodrigoasensio.com
"To err is human, but to really screw up requires the root password."



On Thu, Dec 11, 2008 at 3:35 PM, Rodrigo Asensio <ra...@gmail.com> wrote:
> Axis2 141
> we are developing a ws based on our customer spec. He gave me a XSD
> and the response XML (inner the soap msg) should be in a specific way.
> I made it 100% using AXIOM OMElements because I didnt found a way to
> do the XS:ATTRIBUTES as is shown below.
>
>
>        <xs:element name="BigObject">
>                <xs:complexType>
>                        <xs:sequence>
>                                <xs:element ref="SmallObject1"/>
>                                <xs:element ref="SmallObject2" minOccurs="0"/>
>                                <xs:element ref="SmallObject3" minOccurs="0" maxOccurs="unbounded"/>
>                                <xs:element ref="SmallObject4" minOccurs="0" maxOccurs="unbounded"/>
>                        </xs:sequence>
>                        <xs:attribute name="Version" type="xs:string" use="optional" default="3.3"/>
>                        <xs:attribute name="UnitsOfMeasure" type="UnitsOfMeasure"
> use="optional" default="metric"/>
>                        <xs:attribute name="TrainingModeFlag" type="xs:boolean"
> use="optional" default="false"/>
>                </xs:complexType>
>        </xs:element>
>
>
> If I deploy a WS returning objects, how can I do that some attributes
> of the BigObject are shown like xs:attribute and not in the
> xs:sequence, is this possible or they are crazy asking me this ? is
> this standard ???
>
>
> Rodrigo Asensio
> rasensio@gmail.com
> http://www.rodrigoasensio.com
> "To err is human, but to really screw up requires the root password."
>