Click here to Skip to main content
15,885,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
0 down vote favorite


I need some assistance please. I am not a PHP expert but I know my way around, but for the life of me I cannot find the problem for this.

We have an external database (MSSQL Database to which we do not have access to) residing at our client. We use a CRM solution which generates a licence key for their products using a string. We access the stored procedures via a web service written in C#. On our side we have a PHP site that accesses the web service to write to the database.

My Code in PHP looks like this :
PHP
$skey = "FDGK:LKss#()#84$$$";
        $productID = 5;
        $data = "D359;00011,P,D359ZZ,SQKGLTKQKQYZHRA,ALNR,009350,20140228,005392;DEWALDH;D359;0";

        try
        {
            $wsdl = "http://connectedservices.sagesouthafrica.co.za/serv/communicate.asmx?wsdl";
            $client = new SoapClient($wsdl);
            $result = $client->__soapCall("InsertSerialAuthProduct", array("InsertSerialAuthProduct" => array("skey"=>$skey,"ProductID" => $productID ,"Data"=>$data)));
        } catch (SoapFault $E)
        {
            echo $E->faultstring;
        }


For some reason, every time I try to generate the product code, it show only a grey page, no error message to test it, I made code errors, changed the parameters and every time it gave me an error, but now nothing.

Any help would be greatly appreciated.
Thank you
Posted
Comments
Morgan Estes 20-Aug-13 22:12pm    
What is the result of `var_dump($result);` at the very end of your `try` block? That will give you some insight to what's happening with `__soapCall`.

You need to add an options array to the SoapClient call to use the SoapFault exception handler. This won't fix your problem, but it should at least trigger the exception message so you can get better info.

PHP
<?php
$skey = "FDGK:LKss#()#84$$$";
$productID = 5;
$data = "D359;00011,P,D359ZZ,SQKGLTKQKQYZHRA,ALNR,009350,20140228,005392;DEWALDH;D359;0";

try {
  $wsdl = "http://connectedservices.sagesouthafrica.co.za/serv/communicate.asmx?wsdl";
  $client = new SoapClient($wsdl, array(
    'exceptions' => true,
    'trace' => true,
    )
  );

  $result = $client->__soapCall("InsertSerialAuthProduct", array(
      "InsertSerialAuthProduct" => array(
        "skey" => $skey,
        "ProductID" => $productID,
        "Data" => $data,
        )
      )
    );
} catch (SoapFault $E) {
  echo $E->faultstring;
}
 
Share this answer
 
You can use php nusoap lib
see this link:

http://www.scottnichol.com/nusoapprogwsdl.htm[^]
 
Share this answer
 
you need call getError function befor __soapcall

PHP
$err<pre lang="xml">= $client->getError();

if ($err) {
    echo '<p><b>Error: ' . $err . '</b></p>';
}



and in try block insert any code that show the result in page
for example

PHP
echo $result
or
PHP
print_r($result)


or pars result and get result values for show in html or php controls .
for example gridview or lable or any controls
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900