One of my company's software vendors convinced me to let them develop a web service that would allow me to create records in our financial database. Their web service/commercial software is running on Server 2008. My web service client is running on Server 2008/XAMPP. At first their function worked fine, but now it always gives me fatal errors.

Here's my code:

$ws = new SoapClient("http://local_server:8082/ws/Spectrum%20Web%20Service?wsdl");

// Display available XML elements...
var_dump($ws->__getTypes());
echo "<hr />\n";

// Display available XML functions...
var_dump($ws->__getFunctions());
echo "<hr />\n";

// Build argument list (array)...
$args['COMPANY'] = "TC1";
$args['WONUM'] = "iABC123b";
$args['SITE'] = "ELMHURSLIB";
$args['WODIV'] = "0101G";
$args['WOSTATUS'] = "";
$args['WOCONTRACT'] = "";
$args['WOCMPO'] = "";
$args['WOPRIORITY'] = "";
$args['WOQUOTE'] = "";
$args['WOSUMMARY'] = "Second test.";

// Run function...
$result = $ws->TK_CONTEC_479941_WOWSCALL($args);

This gives me the following output (Note the "Connection refused" part):

[FONT="Courier New"][INDENT]array(4) { [0]=> string(207) "struct TK_CONTEC_479941_WOWSCALL { string COMPANY; string WONUM;
string SITE; string WODIV; string WOSTATUS; string WOCONTRACT; string WOCMPO; string WOPRIORITY;
string WOQUOTE; string WOSUMMARY; }" [1]=> string(62) "struct TK_CONTEC_479941_WOWSCALLResponse
{ reports reports; }" [2]=> string(34) "struct reports { report report; }" [3]=>

string(36) "struct report { string report_el; }" }


array(1) { [0]=> string(98) "TK_CONTEC_479941_WOWSCALLResponse

TK_CONTEC_479941_WOWSCALL(TK_CONTEC_479941_WOWSCALL $parameters)" }


Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Error executing Web Service:
class com.northgateis.proiv.api.ProivException:Exception running Task: Task execute failed:
Connection refused: connect in C:\xampp\htdocs\ws_test.php:41 Stack trace: #0 [internal function]:
SoapClient->__call('TK_CONTEC_47994...', Array) #1 C:\xampp\htdocs\ws_test.php(41):
SoapClient->TK_CONTEC_479941_WOWSCALL(Array) #2 {main} thrown in C:\xampp\htdocs\ws_test.php on
line 41[/INDENT]
[/FONT]

Interestingly, if I run the function with no parameters, I get a different (but still fatal) error:

[FONT="Courier New"][INDENT]Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Error identifying Web Service: class
com.northgateis.proiv.ws.servlet.WebServiceIdentificationException: Parameter COMPANY
had 0 entry in the message part
. Expecting 1. in C:\xampp\htdocs\ws_test.php:41
Stack trace: #0 [internal function]: SoapClient->__call('TK_CONTEC_47994...', Array) #1
C:\xampp\htdocs\ws_test.php(41): SoapClient->TK_CONTEC_479941_WOWSCALL(NULL) #2 {main} thrown in
C:\xampp\htdocs\ws_test.php on line 41[/INDENT]
[/FONT]

Am I doing something wrong on my end (missing connection parameters...?), or is this a problem in the vendor's WSDL function (or anywhere on their server)?

    The first error sounds like you were unable to connect, "connection refused". I'd ask them about that. If it was working before, they must have changed something. Another possibility is that your server couldn't connect due to a network outage or changed system param or something. In that case, they would be able to tell you that they never received a request.

    Trying to call a WSDL request with no parameters is very likely to end with an error. Don't sweat that one.

      11 days later

      Closing this issue...

      It turned out to be an odd service issue within the PROIV software (on the server), which provides the web service. All SQL and PROIV services restart nightly (per vendor's recommendation), but while the PROIV "Gateway" service started in Windows, PROIV didn't think it was. I "started" the Gateway service in PROIV and web services worked.

      This may happen again, but so far it hasn't. Anyway, there's not much I can do about it.

      Since Dexter & Chaney (who publish Spectrum software) are pushing the web services solution and we seem to be the guinea pigs, I'm hoping I've prevented some of the pain that will surely come to others.

        Write a Reply...