Quantcast
Channel: SCN : Popular Discussions - SAP Cloud Applications Studio
Viewing all articles
Browse latest Browse all 1333

Using a SOAP Web Service [PHP]

$
0
0

Hello,

 

I created a web service in the Cloud Application Studio for a custom Business Object I made.

I now want to create a new instance of this B.O. by using an HTML Form and PHP.

 

I tested the web service using SOAPUI and successfully created a new instance of the object.

 

However, when trying to do this through a HTML Form using PHP, I get following error message:

 

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://my307371.crm.ondemand.com/sap/bc/srt/scs/sap/yygyhi4a8y_webtoleadservice?sap-vhost=my307371.crm.ondemand.com' : failed to load external entity "https://my307371.crm.ondemand.com/sap/bc/srt/scs/sap/yygyhi4a8y_webtoleadservice?sap-vhost=my307371.crm.ondemand.com" in C:\xampp\htdocs\WebToLead\sendToC4C.php:58 Stack trace: #0 C:\xampp\htdocs\WebToLead\sendToC4C.php(58): SoapClient->SoapClient('https://my30737...', Array) #1 {main} thrown in C:\xampp\htdocs\WebToLead\sendToC4C.php on line 58

 

I'm currently trying to use following PHP-code:

 

//Setup SOAP Client      $url = "https://my307371.crm.ondemand.com/sap/bc/srt/scs/sap/yygyhi4a8y_webtoleadservice?sap-vhost=my307371.crm.ondemand.com";   $client = new SoapClient($url);      //Create Header      $auth = new Authentication($username, $password);   $header = new SoapHeader("http://0003427388-one-off.sap.com/YGYHI4A8Y_", "Authentication", $auth, false);      //Call Funtion   $result = $client->__soapCall("Create", array(         "WebToLead" => array(              "LeadID" => $ID_in,               "ProductName" => $PRODUCTNAME_in,               "ContactName" => $CONTACTNAME_in,               "ContactEmail" => $CONTACTEMAIL_in,               "CreationDate" => $CREATIONDATE_in         )   ), NULL, $header);      //Result   echo "<pre>".print_r($result, TRUE)."</pre>";   if ($result->Create->Status == "Success") {          echo "Lead created.";          }

I think I might be using a wrong URL for the web service.

Does anybody know where u can find the correct URL for your created web service?

 

Thanks!


Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>