473,789 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access Web API PHP and NuSOAP

1 New Member
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.co m/payloadzws.asmx ?WSDL', 'wsdl',
$proxyhost, $proxyport, $proxyusername, $proxypassword) ;
echo "vinay56";
$err = $client->getError();
echo "vinay57";
if ($err) {
echo '<h2>Constructo r error</h2><pre>' . $err . '</pre>';
}

/* REQUIRED PARAMETER */
echo "vinay58";
$username ="PL_API_FAD309 46AC021BBD374DB 4CF0F27AB21";
$password = "shyam";
$signature = "1AE78E32391B4A C70F0F492717D88 F48FAD30946AC02 1BBD374DB4CF0F2 7AB21";
echo "vinay59";
//$item_number[] =array('item_nu mber1'=>'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','n v1');
$item_name = array('nov2','n ov1');
$item_price =array(10.00,10 .00);
$quantity = array(2,2);
//$item_number1 =array('i_numbe r' => $item_number);
//$item_name1 = array('i_name' => $item_name);
//$item_price1 =array('i_price ' => $item_price);
//$quantity1 = array('i_quanti ty' => $quantity);
echo "vinay66";
$mc_gross = "20.00";
$mc_currency = "USD";
$payer_email = "shyam@econnois seur.com";
$flag_txn_id = "false"; /*/////// NOT GENERATE NEW TXT_ID, */
$txn_id="NDUBXI KNGRIGGKZKTQLF" ;
/* OPTIONAL PARAMETERS */
$business="";
$mc_fee="0.00";
$invoice="";
$receipt_id="";
$custom="";
$settle_amount= "0";
$settle_currenc y="";
$exchange_rate= "0";
$first_name="";
$last_name="";
$address_street ="";
$address_status ="";
$address_city=" ";
$address_state= "";
$address_zip="" ;
$address_countr y="";
$address_countr y_code="";
$param = array('APIusern ame' => $username, 'APIpassword' => $password, 'APIsignature' => $signature,'ite m_number' =>$item_number, 'item_name' =>$item_name,
'item_price'=>$ item_price, 'quantity'=>$qu antity, 'mc_gross'=>$mc _gross, 'mc_currency'=> $mc_currency, 'payer_email'=> $payer_email, 'flag_txn_id'=> $flag_txn_id,
'txn_id'=>$txn_ id, 'business'=>$bu siness,'mc_fee' =>$mc_fee,'invo ice'=>$invoice, 'receipt_id'=>$ receipt_id, 'custom'=>$cust om, 'settle_amount' =>$settle_amoun t, 'settle_currenc y'=>$settle_cur rency, 'exchange_rate' =>$exchange_rat e, 'first_name'=>$ first_name, 'last_name'=>$l ast_name, 'address_street '=>$address_str eet,
'address_status '=>$address_sta tus, 'address_city'= >$address_cit y, 'address_state' =>$address_stat e, 'address_zip'=> $address_zip, 'address_countr y'=>$address_co untry, 'address_countr y_code'=>$addre ss_country_code );
echo "vinay61";
// print_r ($param);
$vinayres=$clie nt->getHTTPBody( );
echo $vinayres;
//calling web sevices
$result = $client->call('Transact ionCreation', array('paramete rs' => $param), '', '', false, true);
echo "vinay62";
echo '<h2>Request</h2><pre>' . htmlspecialchar s($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchar s($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['TransactionCre ationResult']);
}
echo '<h2>Request</h2><pre>' . htmlspecialchar s($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchar s($client->response, ENT_QUOTES) . '</pre>';
}
//echo '<h2>Debug</h2><pre>' . htmlspecialchar s($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 4147
ronverdonk
4,258 Recognized Expert Specialist
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
2391
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. Not so easy. My client forms the request nicely, and I see with my packet sniffer that the SOAP server is producing the expected response message, but all I can get my client to do is return a NULL pointer (at least I don't have any errors!).
2
5296
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. First thing I tested the Hello (sample server and client) that are in the Readme file. No problem. Then I tried to accepting the data from the URL string (GET). That worked. Then I tried two parameters and the only output I get is the word...
0
2381
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 generate the a SOAP message as follow instead of a WSDL file. So, my question is 1.) Can I use excel or .Net as a client to call the nusoap server?
0
2969
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 service. When I click it, php barfs this : Cannot modify header information - headers already sent by \nusoap.php on line 2421.
5
5389
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 2004/06/25 13:17:56 snichol Exp $. I am running PHP version 4.2.2 on RedHat 9.0 I presume I need to unallocated something other than the soapclient, but I'm nor sure what. This is the code that is called in the loop and the error message...
0
1561
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 with array of complex types, so when i call it from any client (pear/G) it passes last argument as [\[\[\[ ...
3
6361
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 (including the ones that come with soap) and I'm getting the same error for each of them: Fatal error: Cannot redeclare class soapclient in /opt/lampp/htdocs/Jims/Database/nusoap.php on line 6500
2
4721
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 service set a cookie in the client browser as the first output. Works fine in IE6 and the service returns the state of the cookie in the client browser but in firefox 1.0 the exact same service gives a notice error about an undefined variable...
2
5566
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 of anyone pullling data from a database in PHP then using NuSoap to send it to a .NET application and have the .NET proxy class recognize the return datatype as a dataset so that i can cache the dataset on the desktop application. Gary...
1
3967
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 create NuSOAP call like this. $arguments = array("aNumber" => 10,"testObjects" => $testObjects);
0
9506
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.