You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by bn...@123india.com on 2001/04/26 23:15:49 UTC

Datatype question

Hello,
I guess the xml message below is valid soap message.
But i question regarding data types.

s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<purchaseOrder xmlns="urn:po-processor" orderDate="1999-10-20">
    <shipTo country="US">
        <name>Alice Smith</name>
        <street>123 Maple Street</street>
        <city>Mill Valley</city>
        <state>CA</state>
        <zip>90952</zip>
        <quantatiy>12</quantatiy> 
    </shipTo>
</purchaseOrder>
</s:Body>
</s:Envelope>
   
How will i associate the types with the above elements
for example if i want 
<name> should be string
<street> shoulb be string
<city>   should be string
<state>  should be string
<zip>    shoulb be string
<quantatiy> shoub be interger. Can somebody tell me
how to modify above message so that it has type associated with above elements. I have an idea how to write it , but just wanted confirm it. 



Thanks guys
Basa


______________________________________________________
123India.com - India's Premier Portal 
Get your Free Email Account at http://www.123india.com



Re: Datatype question

Posted by Scott Nichol <sn...@computer.org>.
The xsi:type attribute is used to specify the type of an element.  SOAP
"primitive" types are, e.g., xsd:string, xsd:int.  Of course, xsi and xsd are
namespace aliases which much be defined to refer to the proper URIs elsewhere
within the XML.

Examples:

         <zip xsi:type="xsd:string">90952</zip>
         <quantity xsi:type="xsd:int">12</quantity>

Scott

----- Original Message -----
From: <bn...@123india.com>
To: <so...@xml.apache.org>
Sent: Thursday, April 26, 2001 5:15 PM
Subject: Datatype question


> Hello,
> I guess the xml message below is valid soap message.
> But i question regarding data types.
>
> s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
> <s:Body>
> <purchaseOrder xmlns="urn:po-processor" orderDate="1999-10-20">
>     <shipTo country="US">
>         <name>Alice Smith</name>
>         <street>123 Maple Street</street>
>         <city>Mill Valley</city>
>         <state>CA</state>
>         <zip>90952</zip>
>         <quantatiy>12</quantatiy>
>     </shipTo>
> </purchaseOrder>
> </s:Body>
> </s:Envelope>
>
> How will i associate the types with the above elements
> for example if i want
> <name> should be string
> <street> shoulb be string
> <city>   should be string
> <state>  should be string
> <zip>    shoulb be string
> <quantatiy> shoub be interger. Can somebody tell me
> how to modify above message so that it has type associated with above
elements. I have an idea how to write it , but just wanted confirm it.
>
>
>
> Thanks guys
> Basa
>
>
> ______________________________________________________
> 123India.com - India's Premier Portal
> Get your Free Email Account at http://www.123india.com
>
>
>