logo       

Re: NuSOAP Client help: msg#00082

php.nusoap.general

Subject: Re: NuSOAP Client help

NuSOAP does not currently support the construct

<complexType name="ProductIdType">
<simpleContent>
<extension base="xsd:int" />
</simpleContent>
</complexType>

mainly because extension is a complex process. However, for this particular
scenario, it may not be so difficult, since it seems to me to be similar to a
restriction of a simple type. Unfortunately, I am very busy with work for the
next few days and will not be able to do any NuSOAP coding.

If you are adventurous, the changes to NuSOAP would be in the vicinity of the
following code

case 'restriction':
//$this->xdebug("in restriction for currentComplexType:
$this->currentComplexType and currentElement: $this->currentElement");
if($this->currentElement){
$this->elements[$this->currentElement]['type'] = $attrs['base'];
} elseif($this->currentSimpleType){
$this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base'];
} elseif($this->currentComplexType){
$this->complexTypes[$this->currentComplexType]['restrictionBase'] =
$attrs['base'];
if(strstr($attrs['base'],':') == ':Array'){
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
}
}
break;

As I said, however, I don't have time right away to write decent code for the
case 'extension'.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Tan Hong Tat" <hongtat79@xxxxxxxxxxx>
To: <nusoap-general@xxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, April 26, 2004 3:22 AM
Subject: [Nusoap-general] NuSOAP Client help


Hi,

I've created a client calling the function (checkOrder) connecting to the
server using the NuSOAP Toolkit (v1.73).

I wrote the following PHP code, but the productID is missing in the request.
Could someone help me with this? Thank you..


--------------------------- Request ---------------------------
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:si="http://soapinterop.org/xsd";
xmlns:impl="http://elgr.com/scm/warehouse";
xmlns:tns3="http://elgr.com/scm/warehouse/processing";><SOAP-ENV:Body>
<impl:checkOrder>
<checkOrderReq xsi:type="tns3:CheckOrderReqType">
<orderDetailReq xsi:type="tns3:OrderDetailReqType">
<productId xsi:type="tns3:ProductIdType"></productId>
<quantity xsi:type="xsd:int">125</quantity>
</orderDetailReq>
<orderDetailReq xsi:type="tns3:OrderDetailReqType">
<productId xsi:type="tns3:ProductIdType"></productId>
<quantity xsi:type="xsd:int">5</quantity>
</orderDetailReq>
</checkOrderReq>
</impl:checkOrder></SOAP-ENV:Body></SOAP-ENV:Envelope>


--------------------------- PHP Code ---------------------------
require_once('nusoap.php');
$client =new soapclient('http://localhost:8080/axis/services/Warehouse?wsdl',
true);
// Check for an error
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
// Create the proxy
$proxy = $client->getProxy();

$orderDetailReq = array();
$orderDetailReq[] = array(
'productId' => 10001,
'quantity' => 125,
);
$orderDetailReq[] = array(
'productId' => 10002,
'quantity' => 5,
);
$param = array(
'orderDetailReq' => $orderDetailReq,
);

$result = $proxy->checkOrder($param);



------------------------------------ Part of WSDL file
------------------------------------
<schema targetNamespace="http://elgr.com/scm/warehouse/processing";
xmlns="http://www.w3.org/2001/XMLSchema";>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"; />
- <simpleType name="OrStatusType">
- <restriction base="xsd:string">
<enumeration value="Sufficient" />
<enumeration value="Insufficient" />
</restriction>
</simpleType>
- <complexType name="ProductIdType">
- <simpleContent>
<extension base="xsd:int" />
</simpleContent>
</complexType>
- <complexType name="OrderDetailReqType">
- <sequence>
<element name="productId" nillable="true" type="tns3:ProductIdType" />
<element name="quantity" type="xsd:int" />
</sequence>
</complexType>
- <complexType name="CheckOrderReqType">
- <sequence>
<element maxOccurs="unbounded" name="orderDetailReq" nillable="true"
type="tns3:OrderDetailReqType" />
</sequence>
</complexType>
- <complexType name="OrderDetailRespType">
- <sequence>
<element name="productId" nillable="true" type="tns3:ProductIdType" />
<element name="quantity" type="xsd:int" />
<element name="status" nillable="true" type="tns3:OrStatusType" />
</sequence>
</complexType>
- <complexType name="CheckOrderRespType">
- <sequence>
<element maxOccurs="unbounded" name="orderDetailResp" nillable="true"
type="tns3:OrderDetailRespType" />
</sequence>
</complexType>
</schema>

- <wsdl:message name="checkOrderRequest">
<wsdl:part name="checkOrderReq" type="tns3:CheckOrderReqType" />
</wsdl:message>

- <wsdl:portType name="Warehouse">
- <wsdl:operation name="checkOrder" parameterOrder="checkOrderReq">
<wsdl:input message="impl:checkOrderRequest" name="checkOrderRequest" />
<wsdl:output message="impl:checkOrderResponse" name="checkOrderResponse" />
</wsdl:operation>

- <wsdl:binding name="WarehouseSoapBinding" type="impl:Warehouse">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"; />
- <wsdl:operation name="checkOrder">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="checkOrderRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
namespace="http://elgr.com/scm/warehouse"; use="encoded" />
</wsdl:input>
- <wsdl:output name="checkOrderResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
namespace="http://elgr.com/scm/warehouse"; use="encoded" />
</wsdl:output>
</wsdl:operation>



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg297


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise