I am trying to create a web service using wdsl and soap. The server must be written in php.
At the moment, I'm trying to use things by adding only one function to the soap server object. My requirement is that this function must take an associative array. Now it returns a string, but its just a trial version, and will also return an array on demand.
To accept a member array as input, I defined complexType in wsdl. Below is the code
<types> <xsd:schema targetNamespace="http://projects.kp/test/webservice/StoreService.wsdl" xmlns="http://www.w3.org/1999/XMLSchema/"> <xsd:complexType name="store"> <xsd:element name="name" type="xsd:string" /> <xsd:element name="subdomain" type="xsd:string" /> </xsd:complexType> </xsd:schema> </types> <message name="StoreRequest"> <part name="store" type="tns:store"/> </message> <message name="StoreResponse"> <part name="url" type="xsd:string"/> </message>
When I run the soap client file in the browser, it gives the following error.
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unexpected in complexType
If I use a string data type instead of complexType, it works correctly. I think I have not figured out how complex types work yet, so I cannot debug this.
Also, I would like to know if the array will be the type of request and response if the client is encoded in another language, such as .NET.
(Now I am testing this on a virtual host on the ubuntu desktop, and the server and client are on the same vhost and both are written in php)
thanks
source share