Solved

Web Service Client

Posted on 2008-10-30
3
277 Views
Last Modified: 2013-11-18
Hi,

I'm trying to consume a web servie to make onlyne payments with Authorize.Net, the thing is that the server is giving me this error: soap:Client: Server was unable to read request. ---> There is an error in XML document (1, 1132). ---> Input string was not in a correct format.

but i think that i have the correct xml, also i put it into a XML document: http://spirittechnologies.net/carlos/web_service/CBF%20authorize/SOAP/Transaction%20sample%20xml2.xml

Someone now what can be the problem?, I have also attach their api guide.
CIM-SOAP-guide.pdf
0
Comment
Question by:Spirit_US
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Expert Comment

by:alain34
ID: 22848503
Hello Spirit_US,

Could you post the code that you are using to send the data to the service, and experts will be able to se if there is aproblem with it.

Regards,

alain34
0
 

Author Comment

by:Spirit_US
ID: 22850060
I'm using a framework called NuSOAP.

This is my code:

<?
      /
   
      require_once('lib/nusoap.php');
   
   
      $url = 'https://apitest.authorize.net/soap/v1/Service.asmx?wsdl';
      $loginId =  '7q6Lu8X7';
      $transactionKey = '9YM4aUP5Ej77a854';
 
     
      $soapclient = new soapclient($url, true);


      $function = 'CreateCustomerProfileTransaction';
 

       
     
       
      $params = array('merchantAuthentication' => array('name' => $loginId, 'transactionKey' => $transactionKey),
                        'transaction' => array('profileTransAuthCapture' => array('amount' => '61.00',
                                                                               'customerProfileId' => '181463',
                                                                             'customerPaymentProfileId' => '175606',
                                                                             'tax' => array('amount' => '20',
                                                                                            'name' => 'TJ',
                                                                                            'description' => 'N/A',    
                                                                                    ),
                                                                             'shipping' => array('amount' => '20',
                                                                                            'name' => 'TJ',
                                                                                            'description' => 'N/A'
                                                                                            ),
                                                                             'duty' => array('amount' => '20',
                                                                                            'name' => 'TJ',
                                                                                            'description' => 'N/A'
                                                                                            ),
                                                                             'lineItems' => array('itemId' => '',
                                                                                                  'name' => '',
                                                                                                  'description' => '',
                                                                                                  'quantity' => '',
                                                                                                  'unitPrice' => '',
                                                                                                  'taxable' => 'FALSE'
                                                                                            ),
                                                                             'order' => array('invoiceNumber' => '',
                                                                                              'description' => '',
                                                                                              'purchaseOrderNumber' => ''
                                                                                        )
               
           
                                                                   )
                                          )
                                                             
                        );
 
      /
 
      $resultado = $soapclient->call( $function , $params );
 
       
 $err = $soapclient->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}

     
      print_r($resultado['customerProfileId']);
       print_r($resultado);

     
      echo "<br>";
      //echo $soapclient->response;
        // Check for a fault
        if ($soapclient->fault) {
            echo '<h2>Fault</h2>';
           
        } else {
            // Check for errors
            $err = $soapclient->getError();
            if ($err) {
                // Display the error
                echo '<h2>Error:</h2>'.$err ;
            }
        }
       
// Display the request and response
echo '<br>';
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($soapclient->debug_str, ENT_QUOTES) . '</pre>';

?>
0
 
LVL 16

Accepted Solution

by:
alain34 earned 500 total points
ID: 22850129
Spirit,

Thank you for the code.
I'm concerned that you haven't hidden the loginId and transactionId
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question