Welcome, guest! Login
Close

Login to Your Account


  |  » Forgot your password?
Join

Web Services Beginner Desperation

 
Tools Search
  #1  
Old
Full Member
Join Date: January 17th, 2005
Posts: 222
Web Services Beginner Desperation

I just spent hours searching for an elementary tutorial on how to get products from CJ merchants via Web services. I have a developer key, and my web server is using PHP 5.2.

It seems the most basic point is ignored in all of them. And that is:

What files do I need to create and where do I need to put them?

I am new to these kind of applications, and need the ABC's. I've seen the tutorials explaining how to shape the soap API query and all that. That doesn't scare me. But how do you make it happen?

1. What files send the query
2. Receive the response
3. Format it so I can do something with it.

Thanks!
  #2  
Old
Grandma broke her coccyx!
Join Date: May 8th, 2007
Location: North Carolina
Posts: 2,238
I don't use the CJ web services, but I found this from a while ago when I was playing with it a little. You may find it helpful as a example, but keep in mind I worked on this in 11/2006. If you need something explained in this code, I will do my best to answer.

style="margin:20px; margin-top:5px">
Code:
// parameters defined
$developerkey = "";
$websiteIdx = "";
$advertiserIds = "joined";
$keywords  = "''";
$serviceableArea = "''";
$upcOrIsbnOrEan = "''";
$manufacturerName = "''";
$advertiserSku = "''";
$lowPrice = "''";
$highPrice = "''";
$currency = "''";
$sortBy = "''";
$orderIn = "''";
$startAt = 0;
$maxResultsx = 100;


// create a instance of the SOAP client object
$soapclient = new soapclient("http://api.cj.com/wsdl/productSearchService.wsdl", 'wsdl');


// set up an array containing input parameters to be passed to the remote procedure
$params = array(
                        "developerKey" => $developerkey,
                        "websiteId" => $websiteIdx,
                        "advertiserIds" => $advertiserIds,
                        "keywords" => $query,
                        "serviceableArea" => "",
                        "upcOrIsbnOrEan" => "",
                        "manufacturerName" => "",
                        "advertiserSku" => "",
                        "lowPrice" => "",
                        "highPrice" => "",
                        "currency" => "",
                        "sortBy" => "",
                        "orderIn" => "",
                        "startAt" => $startAt,
                        "maxResults" => $maxResultsx
);

// create a proxy so that WSDL methods can be accessed directly
$proxy = $soapclient->getProxy();

// invoke the method
$result = $proxy->search($params);

// Count how many arrays returned when searching product
$a = $result['searchReturn']['products']['products'];
$count = count($a);

echo "Results: " . $count . "
";; // Get the total number of search results for the query $total_itemsx = $result['searchReturn']['totalPossible']; //Loop through the array or returned products for($i = 0;$i < $count; $i++) { $advertiser_id = $result['searchReturn']['products']['products'][$i]['advertiserId']; $advertiser_name = $result['searchReturn']['products']['products'][$i]['advertiserName']; $click_url = $result['searchReturn']['products']['products'][$i]['clickUrl']; $currency = $result['searchReturn']['products']['products'][$i]['currency']; $description = $result['searchReturn']['products']['products'][$i]['description']; $image_url = $result['searchReturn']['products']['products'][$i]['imageUrl']; $name = $result['searchReturn']['products']['products'][$i]['name']; $price = $result['searchReturn']['products']['products'][$i]['price']; $sku = $result['searchReturn']['products']['products'][$i]['sku']; $upc = $result['searchReturn']['products']['products'][$i]['upc']; } // close the loop
  #3  
Old
Full Member
Join Date: January 17th, 2005
Posts: 222
Thanks a lot, I'll look into this, as it makes sense.

But my question is even more basic - where does this go?

Is it on the web page? Is this a separate php? Do you see what I'm asking here?
Join ABW to remove this sponsored message.
  #4  
Old
Member
Join Date: July 18th, 2006
Posts: 92
style="margin:20px; margin-top:5px; ">
Quote:
Originally Posted by hazlcha
Is it on the web page? Is this a separate php? Do you see what I'm asking here?
It goes where ever you want to use it and that is up to you.

How do you expect to use it?
  #5  
Old
Grandma broke her coccyx!
Join Date: May 8th, 2007
Location: North Carolina
Posts: 2,238
style="margin:20px; margin-top:5px; ">
Quote:
Originally Posted by hazlcha
Thanks a lot, I'll look into this, as it makes sense.

But my question is even more basic - where does this go?

Is it on the web page? Is this a separate php? Do you see what I'm asking here?
Many choices on that, but I just slapped this within a webpage and loaded the page. I was just sending the ourput of the call to the page so I could see if it was working.
  #6  
Old
Full Member
Join Date: January 17th, 2005
Posts: 222
OK, so it should work from anywhere. I will go try that, and report back tomorrow.

Thank you kind sirs!

:-)
Join ABW to remove this sponsored message.
Reply
 

Tools Search
Search:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CJ Web Services Core Programming / Datafeeds / Tools 2 March 2nd, 2007 02:34 PM
My Keyword Research - Care to contribute to the research? webdesignhq Search Engine Optimization 3 December 7th, 2004 09:16 PM
Amazon web services script hudson Amazon 2 September 6th, 2004 06:04 AM
Medical Web Services Open House syasher Other Affiliate Networks 0 July 25th, 2003 03:02 PM

X

Welcome to ABestWeb.com

Create your username to jump into the discussion!

ABestWeb.com is the largest affiliate marketing community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?



Content Relevant URLs by vBSEO ©2011, Crawlability, Inc.