Skip to Content
0
Former Member
Dec 20, 2006 at 03:19 PM

SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:

2425 Views

I tried to call a ABAP webservice from PHP (/people/anton.wenzelhuemer/blog/2006/03/05/integrating-php-and-abap-using-webservices). I getting the following error,

<i>Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://<servername>:<port>/sap/bc/srt/rfc/sap/zkb_test_rfc?sap-client=100&wsdl=1.1' in C:\php-5\webapps\webservices\CallSAP.php:15 Stack trace: #0 C:\php-5\webapps\webservices\CallSAP.php(15): SoapClient->__construct('http://<servername>...', Array) #1 thrown in C:\php-5\webapps\webservices\CallSAP.php on line 15</i>

This is my PHP code,

[code]

<?php

$wsdlurl ="http://<servername>:<port>/sap/bc/srt/rfc/sap/ZKB_TEST_RFC?sap-client=100&wsdl=1.1";

$login = "<UserName>";

$password = "<Password>";

$name = "Kathirvel";

?>

<HTML><HEAD><TITLE>Call SAP WebService</TITLE></HEAD>

<BODY>

<?php

$client = new SoapClient($wsdlurl,

array('login' => $login,

'password' => $password,

'trace' => true,

'exceptions' => true));

try {

echo $client->ZKB_TEST_RFC(array('INPUT_TEXT' => $name))->OUTPUT_TEXT;

}

catch (SoapFault $e) {

echo 'Caught an Error: [' . $e->faultcode . '] - ' . $e->faultstring;

}

echo "<hr><pre>\n";

echo "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n";

echo "Response:\n".htmlspecialchars($client->__getLastResponse())."\n";

echo "</pre>";

?>

</BODY></HTML>

[/code]

The ABAP code is a simple one, a RFC enabled FM that was converted into webservice,

[code]

*"----


""Local Interface:

*" IMPORTING

*" VALUE(INPUT_TEXT) TYPE STRING OPTIONAL

*" EXPORTING

*" VALUE(OUTPUT_TEXT) TYPE STRING

*"----


CONCATENATE 'Welcome' input_text INTO output_text SEPARATED BY space.

[/code]

Any help would be appreciated.

Regards

Kathirvel