At first, Please go through my scenario, WSDL file is: https://203.196.200.42/cmspi/UCMSPAY/BusinessServices/StarterProcesses/CMS_Service.serviceagent?wsdl
Sample Request XML is:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:rev="http://www.tibco.com/schemas/CMS_Service/BusinessServices/Schemas/Rev_Input_Schema.xsd">
<soap:Header/>
<soap:Body>
<rev:reversal>
<rev:header>
<rev:req_id>01404099</rev:req_id>
<rev:msg_src>BTS</rev:msg_src>
<rev:client_code>KOSECNSE</rev:client_code>
<rev:date_post>2014-09-10T00:00:00+01:00</rev:date_post>
</rev:header>
<rev:details>
<!--Zero or more repetitions:-->
<rev:msg_id>CMS-2014062300007</rev:msg_id>
<rev:msg_id>CMS-2014062300013</rev:msg_id>
<rev:msg_id>CMS-2014062300010</rev:msg_id>
<rev:msg_id>CMS-2014062300016</rev:msg_id>
<rev:msg_id>CMS-2014042300008</rev:msg_id>
</rev:details>
</rev:reversal>
</soap:Body>
</soap:Envelope>
Now, i tried to construct the same above sample request using the PHP soapVar as follows:
$soapClient = new SoapClient('https://203.196.200.42/cmspi/UCMSPAY/BusinessServices/StarterProcesses/CMS_Service.serviceagent?wsdl',
array('trace' => 1, "exceptions"=>0, 'soap_version' => SOAP_1_1) );
$soapClient->__setLocation('https://203.196.200.42/cmspi/UCMSPAY/BusinessServices/StarterProcesses/CMS_Service.serviceagent?wsdl');
$headerRequestVar = new SoapVar(array(
'rev:req_id' => '01404099',
'rev:msg_src' => 'BTS',
'rev:client_code' => 'KOSECNSE',
'rev:date_post' => '2014-09-10T00:00:00+01:00',
), SOAP_ENC_OBJECT);
$headerRequest = new SoapVar(array('rev:header' => $headerRequestVar), SOAP_ENC_OBJECT);
$detailsRequestVar = new SoapVar(array(
'rev:msg_id' => 'CMS-2014062300007',
), SOAP_ENC_OBJECT);
$detailsRequest = new SoapVar(array('rev:details' => $detailsRequestVar), SOAP_ENC_OBJECT);
$request = new SoapVar(array('rev:reversal' => $detailsRequest, $headerRequest), SOAP_ENC_OBJECT);
$result = $soapClient->WebAPI_rev($request);
var_dump($result);
When i run the above program i am getting the following error (Var_dump response) :
object(SoapFault)#7 (10) {
["message":protected]=>
string(13) "Wrong Version"
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(41) "/home/skumar/testme/kotak/soapClient3.php"
["line":protected]=>
int(37)
["trace":"Exception":private]=>
array(2) {
[0]=>
array(6) {
["file"]=>
string(41) "/home/skumar/testme/kotak/soapClient3.php"
["line"]=>
int(37)
["function"]=>
string(6) "__call"
["class"]=>
string(10) "SoapClient"
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(10) "WebAPI_rev"
[1]=>
array(1) {
[0]=>
object(SoapVar)#6 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(2) {
["rev:reversal"]=>
object(SoapVar)#5 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(1) {
["rev:details"]=>
object(SoapVar)#4 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(1) {
["rev:msg_id"]=>
string(17) "CMS-2014062300007"
}
}
}
}
[0]=>
object(SoapVar)#3 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(1) {
["rev:header"]=>
object(SoapVar)#2 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(4) {
["rev:req_id"]=>
string(8) "01404099"
["rev:msg_src"]=>
string(3) "BTS"
["rev:client_code"]=>
string(8) "KOSECNSE"
["rev:date_post"]=>
string(25) "2014-09-10T00:00:00+01:00"
}
}
}
}
}
}
}
}
}
[1]=>
array(6) {
["file"]=>
string(41) "/home/skumar/testme/kotak/soapClient3.php"
["line"]=>
int(37)
["function"]=>
string(10) "WebAPI_rev"
["class"]=>
string(10) "SoapClient"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
object(SoapVar)#6 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(2) {
["rev:reversal"]=>
object(SoapVar)#5 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(1) {
["rev:details"]=>
object(SoapVar)#4 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(1) {
["rev:msg_id"]=>
string(17) "CMS-2014062300007"
}
}
}
}
[0]=>
object(SoapVar)#3 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(1) {
["rev:header"]=>
object(SoapVar)#2 (2) {
["enc_type"]=>
int(301)
["enc_value"]=>
array(4) {
["rev:req_id"]=>
string(8) "01404099"
["rev:msg_src"]=>
string(3) "BTS"
["rev:client_code"]=>
string(8) "KOSECNSE"
["rev:date_post"]=>
string(25) "2014-09-10T00:00:00+01:00"
}
}
}
}
}
}
}
}
}
["previous":"Exception":private]=>
NULL
["faultstring"]=>
string(13) "Wrong Version"
["faultcode"]=>
string(15) "VersionMismatch"
["faultcodens"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
}
When i checked in Firebug, it is showing, status is "200 OK" , did any one know, what is happening here please. I think, if you look at the sample xml, it " < reversal > " parent has two children "< header > < details >", i passed the same in my code as shown above :
$request = new SoapVar(array('rev:reversal' => $detailsRequest, $headerRequest), SOAP_ENC_OBJECT);
Do you think this is the problem?