Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2638

first timer connecting to sap

$
0
0

hi need help.

 

it is my first time to connect my application from php/perl to sap.

 

the sap developer gave me WSDL but no matter how many try i do i dont get the response or the XML from the system.

 

tried this in PHP

 

[code]

class SapTest {

  const SAP_WSDL_URI  = "203.177.50.135:50000/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_DiamondFleet&receiverParty=&receiverService=&interface=SI_DF_AssetMaster&int";

  const SAP_USER = "user";

  const SAP_PWD  = "pass";

 

 

public function execute() {

 

        $header =new SoapHeader('urn:sap-com:document:sap:soap:functions:mc-style', null);

        $client->__setSoapHeaders($header);

 

 

        $client = new SoapClient('http://'.urlencode(self::SAP_USER).':'.urldecode(self::SAP_PWD).'@'.self::SAP_WSDL_URI,

                array("trace" => 1,

                      "exceptions" => 1,

                      "login" => self::SAP_USER,

                      "password" => self::SAP_PWD,

                      'features' => SOAP_SINGLE_ELEMENT_ARRAYS)

        );

 

 

        $method = '_-bic_-nf2';

 

 

        $parameter = array('ETColumnDescription' => null,

                          'ETGridData' => null,

                          'ETMessageLog' => null,

                          'ETRowDescription' => null,

                          'ISVar_01xwerbet' => array('Sign' => 'I',

                                                      'Option' => 'LE',

                                                      'Low' => '3',

                                                      'High' => null));

 

 

        try

        {

 

 

        $result = $client->$method($parameter);

        print_r($result);

        } catch(SoapFault $e) {

 

 

        echo "REQUEST HEADER:\n" . $client->__getLastRequestHeaders() . "\n";

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

 

 

          echo "RESPONSE HEADER:\n" . $client->__getLastResponseHeaders() . "\n";

 

 

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

        print_r($e);

    }

 

 

}

 

 

}

 

 

$oSap = new SapTest();

$oSap->execute();

[/code]

 

even tried this via soap

 

[code]

$SOAP_AUTH = array( 'username' => 'user',

                        'password' => 'pass');

 

 

 

 

   #Specify WSDL

    $WSDL = "https://203.177.50.135:50000/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_DiamondFleet&receiverParty=&receiverService=&interface=SI_DF_AssetMaster&int";

  

 

 

    try{

        $client = new SoapClient($WSDL, array('username'=>"user",'password'=> "pass"));

    }

    catch(SoapFault $fault) {

        trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);

    }

 

 

    #Create Client Object, download and parse WSDL

    $client = new SoapClient($WSDL,$SOAP_AUTH);

  

    #Setup input parameters (SAP Likes to Capitalise the parameter names)

  

    $params = array(

            'LASTDATEUPDATE_FROM' => "20150101",

            'LASTDATEUPDATE_TP' => "20151101"

    );

 

 

    #Call Operation (Function). Catch and display any errors

    try

    {

       $result = $client->ZSoapDemo1($params);

    }

    catch (SoapFault $exception)

    {

        print "***Caught Exception***\n";

        print_r($exception);

        print "***END Exception***\n";

        die();

    }

  

    #Out the results

    print_r($result);

[/code]

 

hope someone here tried something like this.

 

the purpose is that i have a web application that needs to get details from SAP and at the same time SUBMIT POST data from data entry on the web application i am doing which is using PHP.

 

thanks in advance.


Viewing all articles
Browse latest Browse all 2638

Trending Articles



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