Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all articles
Browse latest Browse all 8768

PHP API for ABAP Web Service

$
0
0

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.


Viewing all articles
Browse latest Browse all 8768

Trending Articles



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