Web Services - WSDL Array: Array Type
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 Tag: web services, wsdl, array, type Category: PHP Application Post : April 14th 2008 Read: 6,306 blog comments powered by Disqus |
