Does anyone successfully use the Junction API?

Does anyone use CJ web services successfully? I just keep getting java.lang.NullPointerExceptionalthough my application is.net (obviously their errors). CJ support doesn't even know what a web service is. I googled and found a lot of people getting these or those errors. Question: is this a temporary problem, or am I doomed to analyze manually downloaded reports for eternity?

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

References:

+3
source share
6 answers

After several days of work, this code works 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',
));
+3
source

CJ API PHP, WSDL. , ( -). , .

+2

cjcall.php forexample

. i.e , dev id,

include('../../../../wp-load.php');

$stringkeyw=urlencode(get_option('cj_keyword'));
if(get_option('rm_num_products')==''){
$pperkeyword=50;
}else{
$pperkeyword= get_option('rm_num_products');
}//number of products against keyword

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://product-search.api.cj.com/v2/product-search?website-id=".get_option('cj_siteid')."&keywords=".$stringkeyw."&records-per-page=".$pperkeyword."&serviceable-area=US");

curl_setopt($ch, CURLOPT_HEADER,false); 

curl_setopt($ch, CURLOPT_HTTPGET, true); 

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml",  "Authorization:".get_option('cj_devid').""));

$result = curl_exec($ch);

, xml :

$hurl= home_url();
$homepage = file_get_contents(''.$hurl.'/wp-content/plugins/rapid_monetizer/cronjob/cjcall.php');
$object = simplexml_load_string($homepage);

    foreach($object->products->product as $cjres)
    {
       //do your code with products coming in $cjres
         }
+1

, !!!

!

, .

0

EDIT: First of all, you will not get any results if there are no reports for the report.

I work with these APIs, I have no problems with any of the REST APIs, the SOAP API for daily commissions for publishers does not work. Results:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="https://pubcommission.api.cj.com">
       <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 correct and correct, returns me an HTML page. Your error is probably related to parsing the page as XML.

Results:

<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"><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 sent them an email and am waiting for a response today. I will confirm that this API is still available, it may have been completely replaced by the publisher API in real time.

0
source

Source: https://habr.com/ru/post/1697637/


All Articles