Scalar Types
For scalar types, SOAP adopts all the built-in simple types specified by the XML Schema specification. This includes strings, floats, doubles, and integers. Table 3-3 lists the main simple types, excerpted from the XML Schema Part 0: Primer (http://www.w3.org/TR/2000/WD-xmlschema-0-20000407/ ).
Simple type |
Example(s) |
string |
Web services |
Boolean |
true, false, 1, 0 |
float |
-INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaN |
double |
-INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaN |
decimal |
-1.23, 0, 123.4, 1000.00 |
binary |
100010 |
integer |
-126789, -1, 0, 1, 126789 |
nonPositiveInteger |
-126789, -1, 0 |
negativeInteger |
-126789, -1 |
long |
-1, 12678967543233 |
int |
-1, 126789675 |
short |
-1, 12678 |
byte |
-1, 126 |
nonNegativeInteger |
0, 1, 126789 |
unsignedLong |
0, 12678967543233 |
unsignedInt |
0, 1267896754 |
unsignedShort |
0, 12678 |
unsignedByte |
0, 126 |
positiveInteger |
1, 126789 |
date |
1999-05-31 |
time |
13:20:00.000, 13:20:00.000-05:00 |
For example, here is a SOAP response with a double data type:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getPriceResponse
xmlns:ns1="urn:examples:priceservice"
SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-encoding">
<return xsi:type="xsd:double">54.99</return>
</ns1:getPriceResponse> ...
Get Web Services Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.