2013 May 10 4:00 PM
I need to make soap request from PHP application to SAP. Below is my call:
<?php
require_once('sap_server.php');
try{
$client = new SoapClient('ZWS_ZBAPI_CCC_PRICING.wsdl', array(
'trace' => 1,
'exceptions' => true,
'cache_wsdl' => WSDL_CACHE_NONE,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'login' => "username",
'password' => "password",
)
);
$client->ZbapiCccPricing(
new SoapVar(array(
'Checkdata' => 'Y',
'ExCond' => null,
'ExVbap' => null,
'GetParinfo' => 'N',
'Materials' => '78101101273',
'Noofrecords' => null,
'OnlyNzeroCond' => null,
'OrderType' => 'ZOR',
'Parinfo' => null,
'Partners' => null,
'Partnertype' => null,
'Pricingmsgs' => null,
'Sarea' => '12101010',
'SortByCond' => 'Y')
, XSD_ANYTYPE, "ZbapiCccPricing")
);
echo "REQUEST:\n" . htmlentities($client->__getLastRequest()) . "\n";
echo "REQUEST:\n" . htmlentities($client->__getLastRequestHeaders()) . "\n";
echo "RESPONSE:<pre>" . htmlentities($client->__getLastResponse()) . "</pre>";
echo "RESPONSE:<pre>" . htmlentities($client->__getLastResponseHeaders()) . "</pre>";
} catch (Exception $e) {
echo $e->getMessage();
}
?>
I'm stuck with the input parameters. SAP expects to get this request:
<ns2:ZbapiCccPricing xmlns:ns2='urn:sap-com:document:sap:soap:functions:mc-style'>
<Checkdata>Y</Checkdata>
<ExCond></ExCond>
<GetParinfo>N</GetParinfo>
<Materials>
<item><Material>78101101273</Material>
<Orderqty>10</Orderqty></item>
</Materials>
<Noofrecords>0</Noofrecords>
<OnlyNzeroCond>Y</OnlyNzeroCond>
<OrderType>ZOR</OrderType>
<Partners>
<item><Parvw>WE</Parvw><Parnr>0000300046</Parnr></item>
</Partners>
<Pricingmsgs></Pricingmsgs>
<Sarea>
<Vkorg>1210</Vkorg>
<Vtweg>10</Vtweg>
<Spart>10</Spart>
</Sarea>
<SortByCond>Y</SortByCond>
</ns2:ZbapiCccPricing>
But I have no idea how to input these parameters into PHP SoapClient. Can anyone help? I am new to SOAP and SAP.
Thank you.
2013 May 10 5:25 PM
Have you used the Scripting Tool? See the attached link for details on PHP SOAP and a link to the Scripting Tool.
2013 May 10 7:58 PM
I've seen that page before. The problem is I can only download the Scripting Languages Tool Preview 2 which works on the old version of Eclipse (2.1). The Scripting Languages Tool Preview 3 is not downloadable (at least there is no link, as far as I can tell).
How can I download the Scripting Languages Tool Preview 3?
Thanks in advance.
2013 May 10 8:32 PM
I tried to install the Scripting Languages Tool Preview 2 on Eclipse for PHP Developers Version: 3.0.2, but I got this error:
Cannot complete the install because of a conflicting dependency.
Software being installed: Eclipse Modeling Framework (EMF) 2.1.2 (org.eclipse.emf.feature.group 2.1.2)
Software currently installed: Eclipse for PHP Developers 3.0.2.v20120611144 (org.zend.php.product 3.0.2.v20120611144)
Only one of the following can be installed at once:
EMF Edit 2.7.2.v20120130-0943 (org.eclipse.emf.edit 2.7.2.v20120130-0943)
org.eclipse.emf.edit 2.1.1
Cannot satisfy dependency:
From: EMF Edit 2.7.2.v20120130-0943 (org.eclipse.emf.edit.feature.group 2.7.2.v20120130-0943)
To: org.eclipse.emf.edit [2.7.2.v20120130-0943]
Cannot satisfy dependency:
From: Eclipse Modeling Framework (EMF) 2.1.2 (org.eclipse.emf.feature.group 2.1.2)
To: org.eclipse.emf.edit [2.1.1]
Cannot satisfy dependency:
From: Eclipse for PHP Developers Feature 3.0.2.201206111411 (org.zend.php.feature.feature.group 3.0.2.201206111411)
To: org.eclipse.emf.edit.feature.group 0.0.0
Cannot satisfy dependency:
From: Eclipse for PHP Developers 3.0.2.v20120611144 (org.zend.php.product 3.0.2.v20120611144)
To: org.zend.php.feature.feature.group [3.0.2.201206111411]
2013 May 11 3:41 PM
2013 May 12 2:28 AM