| Welcome to WebmasterWorld Guest from 22.214.171.124 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
| 6:43 pm on Oct 17, 2010 (gmt 0)|
I'm trying to do something that shouldn't be too hard but I'm struggling with it.
I need to send a request to an API and get the response. I've been on with this all weekend so any help is greatly appreciated.
This is the code I'm trying.
$password = 'passwordhere';
$productCode = 'ITEMCODEHERE';
$userName = 'USERNAMEHERE';
$xmlParameters = "password=$password&productCode=productCode";
$client = new SoapClient('https://api.domain.com/');
$res = $client->GetImagesforProduct($userName,$xmlParameters);
$contentString = $res->contentString;
| 7:34 pm on Oct 19, 2010 (gmt 0)|
U forgot the "$" in front of "productCode"
|$xmlParameters = "password=" . $password . "&productCode=" . $productCode; |
I'll assume that $client is defined, has a method named "GetImagesforProduct", and returns an object with a child named "contentString". Otherwise there's not much to debug.
do you have error reporting turned on?
| 7:35 pm on Oct 19, 2010 (gmt 0)|
you may also enjoy using this nifty built-in PHP function:
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved