RE: [PHP] PHP and SAP Business One DI Server

2007-11-20 Thread Robert Cummings
On Tue, 2007-11-20 at 04:55 -0300, Andrés Robinet wrote:
 I can only speak for my experience in PHP+SOAP in a recent project, but not
 on SAP. You'll surely get more information here as the experts will start
 speaking... If this is of any help to you, then PERFECT! If not, well, hope
 not to bother you with well-known stuff at least.
 
 The project I'm involved with uses web services to fetch vehicle data from
 Chrome (http://www.chrome.com). We are using NuSoap, because we found no
 other options for PHP 4 (PHP 5 has a native Soap Extension, but I can only
 tell you that I've READ NuSoap has more features, I didn't even test it).
 
 You can download NuSoap here (pick the last version, the previous ones had a
 name clash problem with PHP 5).
 http://sourceforge.net/project/showfiles.php?group_id=57663
 
 As for how to use it... well... RTFM. I don't have a clue of how the SAP
 part works (I know very generally what SAP is... I never faced a PHP
 integration with it). But I can give you some sample code for the PHP part,
 obviously, the last word is that of SAP's technical specifications.
 
 /* First Create a WSDL Object and save it in the cache */
 $wsdlURL = https://where/is/my/service?WSDL;;
 $cacheDir = /path/to/writable/dir;
 $timeToLive = 86400; // Only one day, but wsdl's don't change that often,
 you can increase it much more
 $wsdlCache = new wsdlcache($cacheDir, $timeToLive);
 $wsdl = $wsdlCache-get($wsdlURL);
 if ($wsdl == null):
   $wsdl = new wsdl($wsdlURL);
   $wsdlCache-put($this-wsdl);
 endif;
 // After this line you have a wsdl object that was either created or
 retrieved from the cache
 
 /* Get the client and the proxy */
 $client = new nusoap_client($wsdl, true);
 $proxy = $client-getProxy();
 
 /* Now call SAP web service functions as documented in the tech spec */
 $param1 = 'my param 1';
 $param2 = array('whatever', 'is', 2, 'be');
 // Call one of SAP functions
 $result = $proxy-myFunctionAsReadFromSAPTechSpec($param1, $param2);
 
 /* Now check for error codes in the result, store them in a db, whatever you
 need */
 If ($result['WhoKnows'] == 'Checking is your job'):
   echo Good Job!;
 else:
   echo RTFM AGAIN!!!;
 endif;

Thanks for the information Andrés though to be honest I'm looking more
for information about the actual SAP Business One integration since I
have done SOAP in the past without problem. Specifically I guess I'm
looking for the following from the group:

- have you integrated SAP BO with PHP via DI server

- any gotchas with respect to configuration and connecting
  to DI server?

There are a few tidbits on the net, some dating to early 2005. But none
that I read had very definitive information about PHP.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP and SAP Business One DI Server

2007-11-19 Thread Andrés Robinet
I can only speak for my experience in PHP+SOAP in a recent project, but not
on SAP. You'll surely get more information here as the experts will start
speaking... If this is of any help to you, then PERFECT! If not, well, hope
not to bother you with well-known stuff at least.

The project I'm involved with uses web services to fetch vehicle data from
Chrome (http://www.chrome.com). We are using NuSoap, because we found no
other options for PHP 4 (PHP 5 has a native Soap Extension, but I can only
tell you that I've READ NuSoap has more features, I didn't even test it).

You can download NuSoap here (pick the last version, the previous ones had a
name clash problem with PHP 5).
http://sourceforge.net/project/showfiles.php?group_id=57663

As for how to use it... well... RTFM. I don't have a clue of how the SAP
part works (I know very generally what SAP is... I never faced a PHP
integration with it). But I can give you some sample code for the PHP part,
obviously, the last word is that of SAP's technical specifications.

/* First Create a WSDL Object and save it in the cache */
$wsdlURL = https://where/is/my/service?WSDL;;
$cacheDir = /path/to/writable/dir;
$timeToLive = 86400; // Only one day, but wsdl's don't change that often,
you can increase it much more
$wsdlCache = new wsdlcache($cacheDir, $timeToLive);
$wsdl = $wsdlCache-get($wsdlURL);
if ($wsdl == null):
$wsdl = new wsdl($wsdlURL);
$wsdlCache-put($this-wsdl);
endif;
// After this line you have a wsdl object that was either created or
retrieved from the cache

/* Get the client and the proxy */
$client = new nusoap_client($wsdl, true);
$proxy = $client-getProxy();

/* Now call SAP web service functions as documented in the tech spec */
$param1 = 'my param 1';
$param2 = array('whatever', 'is', 2, 'be');
// Call one of SAP functions
$result = $proxy-myFunctionAsReadFromSAPTechSpec($param1, $param2);

/* Now check for error codes in the result, store them in a db, whatever you
need */
If ($result['WhoKnows'] == 'Checking is your job'):
echo Good Job!;
else:
echo RTFM AGAIN!!!;
endif;

 -Original Message-
 From: Robert Cummings [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, November 20, 2007 4:11 AM
 To: php-general@lists.php.net
 Subject: [PHP] PHP and SAP Business One DI Server
 
 Anyone have any experience with this? Searching the web doesn't popup
 much useful information with respect to using PHP. It seems that it
 should be simple enough using PHP and SOAP, but the lack of information
 on the web is unsettling :) So on that note, any information will be
 appreciated.
 
 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com
 
 Leveraging the buying power of the masses!
 ...
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php