phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Web Services - WSDL Array: Array Type

Tag: web services, wsdl, array, type   Category: PHP Application
post: 14 Apr 2008 read: 2,223


Web Services WSDL Array Type Step By Step Tutorial - Part 1: We ever talk anatomy of wsdl document at here. At the post, we have simple practice use string type. Now, we will talk how about transmit array type.

Actually, arrays have no native built-in type under XML Schemas. At WSDL, when you work with array, you can use the soapenc:Array type. But not directly. First, you create a custom complex type by extending the soapenc:Array type. Example, you want to say:
array("Ali", "Baba");

You can use such as:


<xsd:complexType name="ArrayOfstring">
  <xsd:complexContent>
    <xsd:restriction base="soapenc:Array">
      <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]">
    </xsd:restriction>
  </xsd:complexContent>
</xsd:complexType>

We should follow rule in WSDL 1.1:

  • The name should be ArrayOfXXXX, where XXXX is the type of items contained in the array.
  • Specify the type of items contained and its dimensions using a default value for the soapenc:arrayType attribut.
  • Name space associated with the wsdl prefix in table below:
Prefix Namespace URI Description
wsdl http://schemas.xmlsoap.org/wsdl/ WSDL namespace for the WSDL framework
soap http://schemas.xmlsoap.org/wsdl/soap/ WSDL namespace for the WSDL SOAP Binding
http http://schemas.xmlsoap.org/http/ WSDL namespace for the WSDL HTTP GET and POST Binding
mime http://schemas.xmlsoap.org/wsdl/mime/ WSDL namespace for the WSDL MIME Binding
soapenc http://schemas.xmlsoap.org/wsdl/encoding/ Encoding namespace as defined by SOAP 1.1
soapenv http://schemas.xmlsoap.org/wsdl/envelope/ Enveloping namespace as defined by SOAP 1.1
xsd http://www.w3.org/2001/XMLSchema Schema namespace as defined by XSD
tnsc various The "this namespace" (tns) prefix is used as a convention to refer to the current document


Series this article:
Web Services - WSDL Array: Array Type
Web Services - WSDL Array: Object Type
Web Services - WSDL Array: Sample WSDL Document
Web Services - WSDL Array: Sample Soap Server
Web Services - WSDL Array: Testing with SOAP Client

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Joomla: Fast Road to Understand Component Programming
Chart: How to Build Cool Animation Real Time Chart
Email: Send Attachement Mail
SMS : Sending SMS with PHP and ActiveXperts (Part 1)

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


624
posting