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
Solved

Web Service Client

Posted on 2008-10-30
3
267 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
writing a post to a file that is on same folder and same webserver 5 45
Logic behind "best rated" calculation 11 31
Dynamic Dropdowns 15 32
jQuery force form POST 7 45
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to count occurrences of each item in an array.

856 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