Results 1 to 4 of 4
  1. #1
    ABW Ambassador
    Join Date
    October 22nd, 2006
    Posts
    1,011
    CJ WebServices Errors PHP5
    I am trying to write a simple php5 script to access to access the product search API, but I am getting the following error.

    Warning: SoapClient::SoapClient(https://api.cj.com/wsdl/version2/pro...ServiceV2.wsdl) [function.SoapClient-SoapClient]: failed to open stream: Connection timed out

    I have PHP5 and SOAP is enabled on my server. Anybody has worked with the API. Any help will be appreciated.

    The following is my code.


    $key = "My Dev Key";
    $siteId = "My PID";
    $wdslurl = 'https://api.cj.com/wsdl/version2/productSearchServiceV2.wsdl';
    $keywords = 'NBA Playoff tickets'; // What you want to search for.

    try {

    $productClient = new SoapClient($wdslurl,array('trace' => 1));

    $results = $productClient->search(array(
    "developerKey" => $key,
    "websiteId" => $siteId,
    "advertiserIds" => '',
    "keywords" => "$keywords",
    "serviceableArea" => '',
    "upc" => '',
    "manufacturerName" => '',
    "manufacturerSku" => '',
    "advertiserSku" => '',
    "lowPrice" => '',
    "highPrice" => '',
    "lowSalePrice" => '',
    "highSalePrice" => '',
    "currency" => '',
    "isbn" => '',
    "sortBy" => '',
    "sortOrder" => '',
    "startAt" => 0,
    "maxResults" => 10
    )
    );


    print_r($results->out->totalResults);

    // if something goes wrong show the user a nice message
    } catch (Exception $e){

    echo "

    There was an error with your request or the service is unavailable.

    ";
    print_r ($e);

    }

    ?>

  2. #2
    ABW Ambassador
    Join Date
    October 22nd, 2006
    Posts
    1,011
    After spending hours on it, I finally got it to work. I wish CJ had some good documentation. But anyway it now works and I can enjoy the rest of the weekend.

  3. #3
    Member Teesed's Avatar
    Join Date
    June 28th, 2006
    Posts
    96
    Just coming to see if I could help out. I spent months of time and lots of tweaking to get their stuff working for my sales notifier. I ended up having to do my own php install at dreamhost to get all of the settings the way they needed to be plus lots of help from others. So, let me know if you need any more help and I'll be glad to do what I can!

  4. #4
    ABW Ambassador
    Join Date
    October 22nd, 2006
    Posts
    1,011
    Thanks for the response. I finally got it to work. I was trying get the product search module to work. And finally it did work. Not all php web hosts are set up the same. I had to do some tweaking to get it to work on one of my webhosts.

+ Reply to Thread

Similar Threads

  1. php5
    By knight01 in forum Programming / Datafeeds / Tools
    Replies: 12
    Last Post: January 28th, 2008, 03:21 PM
  2. CJ webservices
    By Affnice in forum Commission Junction - CJ
    Replies: 15
    Last Post: September 19th, 2006, 09:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •