Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3660560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:13:08+00:00 2026-05-19T01:13:08+00:00

I am creating a website with the Commission Junction links,. Now I need to

  • 0

I am creating a website with the Commission Junction links,. Now I need to process the commission reports for dividing the commissions. I am planning to use Daily Publisher Commission Service as it provides a provision for including the date in the request. Now I am not able to do a purchase through the CJ link and so I am using a sample query that has given in CJ site itself. I am new to these wbservices and so have some doubts here.

  1. The actual respone will be exactly same as the one given. I mean will it includes the <soapenv:Envelope
    things or it is begin with just the ns1.???

  2. I have assigned the response to a variable $result and give

    $result_xml=simplexml_load_string($result);

but it is showing the error that ns1 is not defined in namespace. Then I have given the <soapenv:Envelope things to the top. Now the error has gone. But the result_xml variable is blank .

Please help me if someone has done it before. or please suggest me some good tutorials so that I can learn and do it. It will be much helpful if someone can give the complete sample response and so I can check the code with it.

Thanks in Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:13:09+00:00Added an answer on May 19, 2026 at 1:13 am

    An XML response to a SOAP request will be something like:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soap:Body>
            <findPublisherCommissionsResponse xmlns="http://api.cj.com">
                <out xmlns="http://api.cj.com">
                    <publisherCommissions xmlns="http://transaction.service.cj.com">
                        <ns1:PublisherCommissionV2 xmlns:ns1="http://transaction.domain.cj.com">
                            <actionStatus xmlns="http://transaction.domain.cj.com">
                                closed
                            </actionStatus>
                            <actionType xmlns="http://transaction.domain.cj.com">
                                sale
                            </actionType>
                            <adId xmlns="http://transaction.domain.cj.com">
                                13123123
                            </adId>
                            <advertiserId xmlns="http://transaction.domain.cj.com">
                                12312312
                            </advertiserId>
                            <advertiserName xmlns="http://transaction.domain.cj.com">
                                Merchant UK ltd
                            </advertiserName>
                            <commissionAmount xmlns="http://transaction.domain.cj.com">
                                25
                            </commissionAmount>
                            <country xmlns="http://transaction.domain.cj.com">
                            </country>
                            <eventDate xmlns="http://transaction.domain.cj.com">
                                2009-08-28T20:30:44-07:00
                            </eventDate>
                            <lockingDate xmlns="http://transaction.domain.cj.com">
                                2009-09-10T00:00:00-07:00
                            </lockingDate>
                            <orderId xmlns="http://transaction.domain.cj.com">
                                1231232
                            </orderId>
                            <original xmlns="http://transaction.domain.cj.com">
                                true
                            </original>
                            <originalActionId xmlns="http://transaction.domain.cj.com">
                                12312321312
                            </originalActionId>
                            <postingDate xmlns="http://transaction.domain.cj.com">
                                2009-08-28T23:30:03-07:00
                            </postingDate>
                            <sId xmlns="http://transaction.domain.cj.com">
                                googlelink
                            </sId>
                            <saleAmount xmlns="http://transaction.domain.cj.com">
                                25
                            </saleAmount>
                            <transactionId xmlns="http://transaction.domain.cj.com">
                                123123123
                            </transactionId>
                            <websiteId xmlns="http://transaction.domain.cj.com">
                                1231231
                            </websiteId>
                        </ns1:PublisherCommissionV2>
                    </publisherCommissions>
                    <sortBy xmlns="http://transaction.service.cj.com">
                    </sortBy>
                    <totalResults xmlns="http://transaction.service.cj.com">
                        1
                    </totalResults>
                </out>
            </findPublisherCommissionsResponse>
        </soap:Body>
    </soap:Envelope>
    

    You maybe having issues parse the xml response into a SimpleXml Object because SimpleXML doesn’t like colons (:) in the tag and attribute names SOAP & SimpleXML. Also check here SimpleXML & Namespaces

    Your SOAP request should already be an object so I am uncertain as to why you are trying to parse it using SimpleXML. If you need the response as XML then you could always use a serializer.

    In my own script as an example I use something like this:

    //code here
    $cj_devkey = “CJ KEY HERE”;

            $ini    = ini_set( "soap.wsdl_cache_enabled", "0" );
            $client = new SoapClient( "https://pubcommission.api.cj.com/wsdl/version2/publisherCommissionServiceV2.wsdl", array(
                 'trace' => true,
                'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
                'proxy_host' => "proxy" 
            ) );
    
            $object = $client->findPublisherCommissions( array(
                 "developerKey" => $cj_devkey,
                "date" => '08/28/2009',
                "dateType" => 'event',
                "advertiserIds" => '',
                "websiteIds" => '123456',
                "actionStatus" => '',
                "actionTypes" => 'sale',
                "adIds" => '',
                "countries" => 'all',
                "correctionStatus" => 'all',
                "sortBy" => '',
                "sortOrder" => '' 
            ) );
    

    A sample response using print_r($object) will return :

    stdClass Object
    (
        [out] => stdClass Object
            (
                [publisherCommissions] => stdClass Object
                    (
                        [PublisherCommissionV2] => stdClass Object
                            (
                                [actionStatus] => closed
                                [actionType] => sale
                                [adId] => 123123213
                                [advertiserId] => 2313531
                                [advertiserName] => MERCHANT HERE
                                [commissionAmount] => 25
                                [country] => 
                                [eventDate] => 2009-08-28T20:30:44-07:00
                                [lockingDate] => 2009-09-10T00:00:00-07:00
                                [orderId] => 123123
                                [original] => 1
                                [originalActionId] => 123123
                                [postingDate] => 2009-08-28T23:30:03-07:00
                                [sId] => sports
                                [saleAmount] => 25
                                [transactionId] => 12312312
                                [websiteId] => 123123
                            )
    
                    )
    
                [sortBy] => 
                [totalResults] => 1
            )
    
    )
    

    If you want to traverse the object elements you can use stuff like:

    $num_results = $object->out->totalResults;
    

    or loop through each commission payment with stuff like:

    foreach ( $object->out->publisherCommissions as $commission ) {
                    $user_id        = $commission->{'sId'};
                    $transaction_id = $commission->{'transactionId'};
                    $program_id     = $commission->{'advertiserId'};
                    $post_date      = $commission->{'postingDate'};
                    $action_status  = $commission->{'actionStatus'};
                    $amount         = $commission->{'commissionAmount'};
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am planning on creating a small website for my personal book collection. To
I'm creating a user-based website. For each user, I'll need a few MySQL tables
I'm creating website that handles great amount of images. I have decided to use
I'm creating a website in Visual Studio 2010. I would like to use Visual
I am creating a website in CakePHP and I am kind of new on
I am creating a website that has 5 different sub-sites each with the same
I'm creating a website for my church and I'm having problems making it display
I have been creating a website with Ruby on Rails, and will be hosting
I am considering creating my own website using Java and am trying to decide
I'm creating an installer for a website that uses a custom event log source.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.