views:

844

answers:

6

Is anyone successfully using the CJ web services? I just keep getting java.lang.NullPointerExceptions even though my app is .net (clearly their errors). CJ support doesn't even know what a web service is. I googled and found many people getting this or other errors. Question is: is it a temporary problem or am I doomed to parse manually downloaded reports for eternity?

The specific API I'm trying to use is the daily publisher commission service. Here is the WSDL.

Links:

+1  A: 

Hi Mausch,

I can make a user interface for you to lift your curse !!!

To use Daily Publisher Commission Report Service !!

Let me know here if you still need help.

chinmay
Thanks, but I need programmatic access to their API, not a user interface... anyway I'm currently working around this by manually exporting their report as xml, then importing it in my app. It's not a vital feature so I just have to do this once or twice a month.
Mauricio Scheffer
A: 

I have successfully used CJ's API with PHP, though not this particular WSDL. I am seriously troubled by the lack of documentation and even cannot find any serious programmer using it (all amateurs basically trying to copy-paste). If you have some more experience we may be able to help each other out.

Michiel van der Blonk
Hi Michiel, I finally gave up on that one and resorted to manually exporting/importing the data. I recently used another API, product search via REST (http://help.cj.com/en/web_services/product_catalog_search_service_rest.htm) which works ok (when the service isn't down, which happens frequently). Maybe I should try the publisher commission API again, via REST.
Mauricio Scheffer
A: 

Good question guys. Do anyone get good reposts? does the CJ report service down frequently?

Dima
A: 

I have articles written on the CJ API code. I have used trial and error to make them work on both the SOAP and REST calls. You are free to read and use the code. http://phpPig.org

All of the code that I have written is basically for WordPress though, the php code will work with any php script. It works well and I get about 4000 clicks per month on a handful of sites using the code.

Scott Daugherty
A: 

EDIT: First and foremost, you will not get any results back if there are no commissions to report.

I am working with these API's, I have no problem with any of the REST API's, the SOAP API for the daily publisher commission service does not appear to be working. The results from:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="https://pubcommission.api.cj.com"&gt;
       <soapenv:Header/>
       <soapenv:Body>
          <api:findPublisherCommissions>
             <api:developerKey>*DEVKEY*</api:developerKey>
             <api:date>01/19/2007</api:date>
             <api:dateType>event</api:dateType>
             <api:advertiserIds></api:advertiserIds>
             <api:websiteIds>123456</api:websiteIds>
             <api:actionStatus>all</api:actionStatus>
             <api:actionTypes></api:actionTypes>
             <api:adIds></api:adIds>
             <api:countries></api:countries>
             <api:correctionStatus></api:correctionStatus>
             <api:sortBy>commissionAmount</api:sortBy>
             <api:sortOrder>desc</api:sortOrder>
          </api:findPublisherCommissions>
       </soapenv:Body>
    </soapenv:Envelope>

Which is completely valid and correct, gives me an HTML page back. Your error is probably related to parsing the page as XML.

The results are:

<html>
<head>
<title>Web Services</title>
</head>

<body vlink="#333333" alink="#FFCC33" bgcolor="#FFFFFF" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td background="images/header_bg.gif">
                <a href="http://webservices.cj.com"&gt;&lt;img src="images/header.gif" width="600" height="63" border="0" alt="webservices.cj.com" /></a>
            </td>
        </tr>
    </table>



<h3>Latest WSDLs</h3>
<table width=70%><tr><td>
<ul>
  <li>ProductSearchServiceV2.0<a href="wsdl/version2/productSearchServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></li>
  <li>LinkSearchServiceV2.0<a href="wsdl/version2/linkSearchServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></</li>  
  <li>PublisherCommissionService and ItemDetails V2.0<a href="wsdl/version2/publisherCommissionServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></</li>
  <li>RealTimeCommissionServiceV2.0<a href="wsdl/version2/realtimeCommissionServiceV2.wsdl">[wsdl]</a><img src="images/new11.gif"  width="40" height="15"/></</li>
  <li>AdvertiserSearchService<a href="wsdl/version2/advertiserSearchServiceV2.wsdl">[wsdl]</a></li>
  <li>FieldTypesSupportService<a href="wsdl/version2/supportServiceV2.wsdl">[wsdl]</a></li>
</ul>
</td></tr></table>

<h3>Previously Released WSDLs</h3>
For previous versions of the wsdls <a href="old_versions.jsp">click here.</a><p>

<h3>Sign Up</h3>
<ul>
  <li><a href="sign_up.cj">Sign Up</a></li>
</ul>

</body>
</html>

I have sent them an email, and expect a response today. I will confirm with you that this API is still available, it may have been completely replaced by the Real Time publisher commission API.

explodes
A: 

Hello all,

After a spending many days, this code is working for me.

$client = new SoapClient($cjCommissionUrl,

    array('trace' => 1,

    'soap_version' => SOAP_1_1,

            'style' => SOAP_DOCUMENT,

    'encoding' => SOAP_LITERAL

    ));




$date = '06/23/2010';

    $results = $client->findPublisherCommissions(array(

    "developerKey" => $cjDeveloperKey,

    "date" => $date,

    "dateType" => 'posting',

    "countries" => 'all',

));
Surjit