spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / curlbible / chap30 To page 1To page 2current pageTo page 4To page 5To page 6To page 7To page 8
[previous] [next]

Curl Programming Bible, chapter 30

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

XML Types and Curl Types

Curl supplies a number of mappings (Table 30-1) that convert between Curl types and XML types. The entries in the first column in the table below are Curl supplied. In the second column are the corresponding XML Schema built-in types. For each mapping, Curl supplies a marshaler and unmarshaler to convert between the XML type and Curl type. If you need a mapping that is not in Table 30-1, you must supply one. See "Creating Custom Mappings," in this chapter, on how to do it.

Table 30-1: Supplied Mappings
Curl TypeXML Type
floatfloat
doubledouble
intint
unt8unsignedByte
uint16unsignedShort
int8byte
int64long
int16short
boolboolean
Stringstring
ByteVecbase64Binary

Arrays as Arguments

SOAP defines an encoding for arrays. Curl supports passing array arguments with the Soap-1-1-ArrayArgumentDescriptor. The constructor for Soap-1-1ArrayArgumentDescriptor takes three arguments: the name of the argument, the XML type of the array elements, and the Curl type. The Curl type must be an array type.

Consider a SOAP operation that returns synonyms for a given word. It takes a string containing the word as its input argument and returns the synonyms as an array of strings. The Soap-1-1-ArrayArgumentDescriptor constructor for the output argument is

{new Soap-1-1-ArrayArgumentDescriptor,
  	  {new XMLName, "", "Array"},
    {new XMLName, xsd", "string"},
    {Array-of String}
   }

The name of the argument is Array. The XML type of the array elements is string. And the Curl type is {Array-of String}.

NOTE: In the Soap-1-1-ArrayArgument class, the XML type is the array element type and the Curl type is the array type. So the Curl type must be an {Array-of ...} type.

The complete Curl applet (synonyms.curl) containing the Soap-1-1-ArrayArgumentDescriptor is on the accompanying Web site.


home / programming / curlbible / chap30 To page 1To page 2current pageTo page 4To page 5To page 6To page 7To page 8
[previous] [next]

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

Created: August 14, 2002
Revised: August 14, 2002

URL: http://webreference.com/programming/curlbible/chap30/3.html