<xsd:schema elementFormDefault="qualified" targetNamespace="http://www.wso2.org/php">
<xsd:element name="echoString">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="inMessage" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="echoStringResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="returnVal" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
This type of schemas allow users to set any types at run-time. Now WSF/PHP allows users to use this facility in PHP. For an example,
So if any one want to build the following payload,
<echostring xmlns="http://www.wso2.org/php">You can just use following array to generate this,
<inmessage>
code and string
</inmessage>
</echostring>
$res = $proxy->echoString(array("inMessage" => "code and string"));
or using the classmap,
class echoStringSimilarly you will be able handle the response..
{
public $inMessage;
}
$echostr = new echoString();
$echostr->inMessage = "test1";
$proxy->echoString($echostr);
1 comment:
Thanks for example. My question is can the value of an element of type "anyType" be a complexType? Your example shows jsut setting it to a string, which works in my testing. In my case the element that is anyType may be any number of complex types and I am wondering how to do this, especially in wsdl mode.
Post a Comment