FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem with web service
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
problem with web service [message #172715] Sun, 27 February 2011 10:43 Go to next message
parviz a is currently offline  parviz a
Messages: 1
Registered: February 2011
Karma: 0
Junior Member
Dear All,
I have a little experience in PHP and so I need to use "Web Service"
because of the using processmaker (BPMS tools) and the Process maker
is based on PHP code. I have programmed following code but
unfortunately the result value is empty. Would you please to lead me

######## PHP code:
<?php
echo '1,';
$client = new SoapClient( 'http://192.168.0.94:8080/DecisionService/ws/
test111ruleapp/4.0/test111/1.0?WSDL');

echo '3,';
$card= array('creditCeilings'=>'45');

$params=array('DecisionID'=>"1",'Card'=>$card);

$result=(array)$client->__SoapCall('executeDecisionService', $params);

echo '<br>=============$result=======================<br>';
var_dump($result);
echo '<br>=============DecisionID====================<br>';
var_dump($result["DecisionID"]);
echo '<br>=============Card==========================<br>';
var_dump((array)$result["Card"]);
echo '<br>========countCard==========================<br>';
var_dump(count((array)$result["Card"]));
echo '<br>=============SoapCall======================<br>';
var_dump((array)$client->__SoapCall('executeDecisionService',
$params));
echo '<br>=============$params=======================<br>';
var_dump($params);
?>

########## result:
1,3,
=============$result=======================
array(4) { ["ilog.rules.outputString"]=> string(0)
"" ["ilog.rules.firedRulesCount"]=> int(0) ["DecisionID"]=> string(36)
"cb37cc0d-6de8-4046-88b1-32c2da1a6874" ["Card"]=> object(stdClass)#111
(0) { } }
=============DecisionID====================
string(36) "cb37cc0d-6de8-4046-88b1-32c2da1a6874"
=============Card==========================
array(0) { }
========countCard==========================
int(0)
=============SoapCall======================
array(4) { ["ilog.rules.outputString"]=> string(0)
"" ["ilog.rules.firedRulesCount"]=> int(0) ["DecisionID"]=> string(36)
"d74a9368-68f9-4f61-b96d-3a38ad66b9dc" ["Card"]=> object(stdClass)#109
(0) { } }
=============$params=======================
array(2) { ["DecisionID"]=> string(1) "1" ["Card"]=> array(1)
{ ["creditCeilings"]=> string(2) "45" } }


########### WSDL:
<definitions targetNamespace="http://www.ilog.com/rules/
DecisionService">
-
<types>
-
<xsd:schema
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://www.ilog.com/rules/DecisionService">
<xsd:import namespace="http://
www.ilog.com/rules/param"/>
-
<xsd:element
name="DecisionServiceRequest">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element
maxOccurs="1" minOccurs="0" name="DecisionID" type="xsd:string"/>
<xsd:element
ref="param:Card"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
-
<xsd:element
name="DecisionServiceResponse">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element
name="ilog.rules.outputString" type="xsd:string"/>
<xsd:element
name="ilog.rules.firedRulesCount" type="xsd:int"/>
<xsd:element
name="DecisionID" type="xsd:string"/>
<xsd:element
ref="param:Card"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
-
<xsd:element
name="DecisionServiceException">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element maxOccurs="1"
minOccurs="1" name="exception" nillable="false" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
-
<xsd:schema
attributeFormDefault="unqualified" elementFormDefault="unqualified"
targetNamespace="http://www.ilog.com/rules/card">
<xsd:element name="Card"
nillable="true" type="Card"/>
-
<xsd:complexType name="Card">
-
<xsd:sequence>
<xsd:element maxOccurs="1"
minOccurs="1" name="creditCeilings" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
-
<xsd:schema targetNamespace="http://
www.ilog.com/rules/param">
<xsd:import namespace="http://
www.ilog.com/rules/card"/>
-
<xsd:element name="Card">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element ref="ns1:Card"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
-
<message name="DecisionServiceSoapResponse">
<part name="parameters"
element="tns:DecisionServiceResponse">
</part>
</message>
-
<message name="DecisionServiceSoapRequest">
<part name="parameters"
element="tns:DecisionServiceRequest">
</part>
</message>
-
<message name="DecisionServiceSoapFault">
<part name="fault"
element="tns:DecisionServiceException">
</part>
</message>
-
<portType name="DecisionServiceTest111">
-
<operation name="executeDecisionService">
<input message="tns:DecisionServiceSoapRequest">
</input>
<output message="tns:DecisionServiceSoapResponse">
</output>
<fault name="DecisionServiceSoapFault"
message="tns:DecisionServiceSoapFault">
</fault>
</operation>
</portType>
-
<binding name="DecisionServiceSOAP"
type="tns:DecisionServiceTest111">
<soap:binding style="document" transport="http://
schemas.xmlsoap.org/soap/http"/>
-
<operation name="executeDecisionService">
<soap:operation soapAction="executeDecisionService"
style="document"/>
-
<input>
<soap:body use="literal"/>
</input>
-
<output>
<soap:body use="literal"/>
</output>
-
<fault name="DecisionServiceSoapFault">
<soap:fault name="DecisionServiceSoapFault"
use="literal"/>
</fault>
</operation>
</binding>
-
<service name="DecisionServiceTest111">
-
<port name="DecisionServiceSOAP192.168.0.94"
binding="tns:DecisionServiceSOAP">
<soap:address location="http://192.168.0.94:8080/
DecisionService/ws/test111ruleapp/4.0/test111/1.0"/>
</port>
</service>
</definitions>
Re: problem with web service [message #172716 is a reply to message #172715] Sun, 27 February 2011 11:21 Go to previous message
Jonathan Stein is currently offline  Jonathan Stein
Messages: 43
Registered: September 2010
Karma: 0
Member
Den 27-02-2011 11:43, parviz a skrev:

> $client = new SoapClient( 'http://192.168.0.94:8080/DecisionService/ws/
> test111ruleapp/4.0/test111/1.0?WSDL');

When debugging SOAP, you can set 'trace' to 1:
$client = new SoapClient(
' http://192.168.0.94:8080/DecisionService/ws/test111ruleapp/4.0/test111/1.0? WSDL',
array('trace' => 1));

Then you can echo the result of these functions after the method call:
SoapClient->__getLastRequest(), SoapClient->__getLastRequestHeaders(),
SoapClient->__getLastResponse() and SoapClient->__getLastResponseHeaders()

This will probably reveal a more or less usable error message from the
server.

> $result=(array)$client->__SoapCall('executeDecisionService', $params);

I think you should be able to call the method as:
$client->executeDecisionService(1, $card);

Maybe $card should be stdObject instead of array:
$card = new stdClass;
$card->creditCeilings = 45;

Regards

Jonathan
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: require/include a file inside a function
Next Topic: PHP and DB2 on an IIS Server
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 23:30:46 GMT 2024

Total time taken to generate the page: 0.02281 seconds