473,385 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

access Web API PHP and NuSOAP

hi i also have some problem to access web api
my api taking arguments as an array but the correct request is not generated my code is like this[php]<?php
set_time_limit(3*60);
/*
* $Id: wsdlclient1.php,v 1.3 2007/11/06 14:48:48 snichol Exp $
*
* WSDL client sample.
*
* Service: WSDL
* Payload: document/literal
* Transport: http
* Authentication: none
*/
require_once('../lib/nusoap.php');
echo "vinay55";
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$client = new nusoap_client('http://api.payloadz.com/payloadzws.asmx?WSDL', 'wsdl',
$proxyhost, $proxyport, $proxyusername, $proxypassword);
echo "vinay56";
$err = $client->getError();
echo "vinay57";
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}

/* REQUIRED PARAMETER */
echo "vinay58";
$username ="PL_API_FAD30946AC021BBD374DB4CF0F27AB21";
$password = "shyam";
$signature = "1AE78E32391B4AC70F0F492717D88F48FAD30946AC021BBD3 74DB4CF0F27AB21";
echo "vinay59";
//$item_number[] =array('item_number1'=>'nv2','item_number2'=>'nv1' );
//$item_name[] = array('string'=>'nov2','string'=>'nov1');
//$item_price[] =array('double'=> 10.00,'double'=> 10.00);
//$quantity[] = array('int'=>2,'int'=>2);
$item_number =array('nv2','nv1');
$item_name = array('nov2','nov1');
$item_price =array(10.00,10.00);
$quantity = array(2,2);
//$item_number1 =array('i_number' => $item_number);
//$item_name1 = array('i_name' => $item_name);
//$item_price1 =array('i_price' => $item_price);
//$quantity1 = array('i_quantity' => $quantity);
echo "vinay66";
$mc_gross = "20.00";
$mc_currency = "USD";
$payer_email = "shyam@econnoisseur.com";
$flag_txn_id = "false"; /*/////// NOT GENERATE NEW TXT_ID, */
$txn_id="NDUBXIKNGRIGGKZKTQLF";
/* OPTIONAL PARAMETERS */
$business="";
$mc_fee="0.00";
$invoice="";
$receipt_id="";
$custom="";
$settle_amount="0";
$settle_currency="";
$exchange_rate="0";
$first_name="";
$last_name="";
$address_street="";
$address_status="";
$address_city="";
$address_state="";
$address_zip="";
$address_country="";
$address_country_code="";
$param = array('APIusername' => $username, 'APIpassword' => $password, 'APIsignature' => $signature,'item_number' =>$item_number,'item_name' =>$item_name,
'item_price'=>$item_price, 'quantity'=>$quantity, 'mc_gross'=>$mc_gross, 'mc_currency'=>$mc_currency, 'payer_email'=>$payer_email, 'flag_txn_id'=>$flag_txn_id,
'txn_id'=>$txn_id, 'business'=>$business,'mc_fee'=>$mc_fee,'invoice'= >$invoice, 'receipt_id'=>$receipt_id, 'custom'=>$custom, 'settle_amount'=>$settle_amount, 'settle_currency'=>$settle_currency, 'exchange_rate'=>$exchange_rate, 'first_name'=>$first_name, 'last_name'=>$last_name, 'address_street'=>$address_street,
'address_status'=>$address_status, 'address_city'=>$address_city, 'address_state'=>$address_state, 'address_zip'=>$address_zip, 'address_country'=>$address_country, 'address_country_code'=>$address_country_code);
echo "vinay61";
// print_r ($param);
$vinayres=$client->getHTTPBody();
echo $vinayres;
//calling web sevices
$result = $client->call('TransactionCreation', array('parameters' => $param), '', '', false, true);
echo "vinay62";
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result

echo '<h2>Result</h2>';
print_r($result['TransactionCreationResult']);
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
}
//echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>[/php]

Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that.

MODERATOR
Mar 11 '08 #1
1 4130
ronverdonk
4,258 Expert 4TB
You are not allowed to 'break in' into a thread with your own new problem. Therefore that post has been split off and continues in this thread.

Read the Posting Guidelines before you continue in this forum, also regarding the use of code tags around shown code and samples.

moderator
Mar 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Eric Dennison | last post by:
I've been playing around with NuSOAP as a PHP based SOAP server and client. Works great! Now I'm trying to write (using gSOAP) a simple C/C++ based client to test against my simple SOAP server....
2
by: Larry Sankey | last post by:
Hello. I am having what is probably the simplest problem there is with Nusoap. I have to admit I'm new to this stuff, but I have some programming experience and what I'm doing *shouldn't* be hard....
0
by: Unbreakable | last post by:
I am using the nusoap client and nusoap server without any problem. However, once I change the client to the excel, I am not sure how to call the nusoap server. Especially the nusoap server only...
0
by: Ward G | last post by:
Hi, Below is a basic webservice using the NuSOAP class. When I run the code to register the service, I get the nice html page generated by nusoap, offering a link to view the WSDL for my...
5
by: Mark C | last post by:
I have a memory allocation problem in PHP using NuSOAP and the built in XML parser. The code below is called in a loop and executed about 1900 times before it failed. I am using nusoap.php,v 1.76...
0
by: Afnan Zari | last post by:
Hi, i've facing a problem in nusoap server ... scenario is my server is in NUSoap ... and have used complex types in my WS. My client is Pear Soap and GSoap. NuSoap ws accepts an argument...
3
by: James Kennedy | last post by:
Hi, I've downloaded the NuSoap class files. I've put them onto my localhost/ where I run my php scripts, just put the nusoap.php file in there. I've got loads of different scripts to try out...
2
by: Johnny | last post by:
Searched on google for any info relating to this before posting here but found none. I set up a web service using nusoap on apache php 4.3.8 on windows with error_reporting = E_ALL and had that...
2
by: Gary Townsend | last post by:
I am writing an app in vb .net that will use an XML webservice written in PHP NuSoap. I want to have the NuSoap server send a dataset to my VB .NET application i am trying to find any documentation...
1
by: Treefrog | last post by:
Hi, I'm having a bit of trouble with NuSOAP. I'm calling a web method that looks like this (excuse the strange sytax) public testItem GetTestItem (int aNumber, testObjects) So, I need to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.