Hello People,
I created a WebService in .NET on my machine with following methode: - <WebMethod(Description:="test")> _
-
Public Function sayHello(ByVal myName As String, ByVal myID As Integer) As String
-
Return "Hello " & myName & " (" & myID & ")"
-
End Function
-
Web service works fine, I can access my function in .NET without problem.
I can also access the function using PHP and NuSOAP however I CANNOT pass the parameters, so the result of my php page is only:
"Hello ()"
hereby is some php code I'm using:
What am I doing false: - <?php
-
-
/*NuSOAP*/
-
require_once('NuSOAP/nusoap.php');
-
$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 soapclient('http://localhost/myWS/myWS.asmx?wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
-
$err = $client->getError();
-
if ($err) {
-
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
-
}
-
$params = 'amine';
-
$result = $client->call("sayHello", $params);
-
// 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><pre>';
-
print_r($result);
-
echo '</pre>';
-
}
-
}
-
?>
-
6 21012
amine,
I believe that the problem is in the way you set your parameters, they need to be set as named values and wrapped in an outer "parameters " array for .Net. -
-
$client = new soapclient('http://localhost/myWS/myWS.asmx?wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
-
$err = $client->getError();
-
$params = array('parameters' => array ('name' => 'amine'));
-
$result = $client->call("sayHello", $params);
-
-
the parameter $$params = 'amine'; must be passed as an array not a string.
Hello People,
I created a WebService in .NET on my machine with following methode: - <WebMethod(Description:="test")> _
-
Public Function sayHello(ByVal myName As String, ByVal myID As Integer) As String
-
Return "Hello " & myName & " (" & myID & ")"
-
End Function
-
Web service works fine, I can access my function in .NET without problem.
I can also access the function using PHP and NuSOAP however I CANNOT pass the parameters, so the result of my php page is only:
"Hello ()"
hereby is some php code I'm using:
What am I doing false: - <?php
-
-
/*NuSOAP*/
-
require_once('NuSOAP/nusoap.php');
-
$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 soapclient('http://localhost/myWS/myWS.asmx?wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
-
$err = $client->getError();
-
if ($err) {
-
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
-
}
-
$params = 'amine';
-
$result = $client->call("sayHello", $params);
-
// 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><pre>';
-
print_r($result);
-
echo '</pre>';
-
}
-
}
-
?>
-
use this. it worked for me
$params =array( 'parametername' => 'amine' );
$result = $client->call("sayHello ", array('paramete rs' => $param));
Hello People,
I created a WebService in .NET on my machine with following methode: - <WebMethod(Description:="test")> _
-
Public Function sayHello(ByVal myName As String, ByVal myID As Integer) As String
-
Return "Hello " & myName & " (" & myID & ")"
-
End Function
-
Web service works fine, I can access my function in .NET without problem.
I can also access the function using PHP and NuSOAP however I CANNOT pass the parameters, so the result of my php page is only:
"Hello ()"
hereby is some php code I'm using:
What am I doing false: - <?php
-
-
/*NuSOAP*/
-
require_once('NuSOAP/nusoap.php');
-
$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 soapclient('http://localhost/myWS/myWS.asmx?wsdl', true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
-
$err = $client->getError();
-
if ($err) {
-
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
-
}
-
$params = 'amine';
-
$result = $client->call("sayHello", $params);
-
// 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><pre>';
-
print_r($result);
-
echo '</pre>';
-
}
-
}
-
?>
-
Hello
I did two web services manageSession.a smx and manageStaff.asm x
I consume them with nusoap, first start session, sencond try to get the staff list but it displays The session is not set, .net pages I have solved the problem but in php no.
All your help is wellcome
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Arne Holderbeke |
last post by:
I'm doing my final project in PHP with a Soap webservice
In the client script (PHP) 3 files are read into a string
these strings and the name of the 3 files need to be passed to the
webservice
( python ) where he does some stuff with it and than normally returns "ok"
the code below works , but instead of the contents of the files
$Code_xxx_Contents I putted a fixed string.
if i try to put the name of the varialbe i don't get the wanted...
|
by: olafmol |
last post by:
Hello,
i have a problem using a .NET WSDL Webservice from PHP. Using both the
NuSOAP lib for PHP4, and the build-in SOAP lib for PHP5 it seems that the
SOAP client cannot pass a variable amount of complex datatypes to the WSDL
webservice.
This is the request-structure we've been using:
<EzCreateAuctionArray xmlns=http://www.blabla.com>
|
by: Carlos Lozano |
last post by:
Hi,
as a background I have an Windows application developed with VS 2003 (c#)
that needs to transfer securely data to a MySQL database located on a Linux
server.
I have created a PHP webservice that will receive an xml file with all the
data to update an encrypted database. This way all database logic will remain
on the Linux server. The web service works OK using a testing PHP client.
|
by: Nattydreadlock |
last post by:
Hi,
I've written an ASP.Net webservice which takes somes specific .net
objects.
Now I want to caal this service by PHP, which normally would be
possible, after all that's the main reason of existence for web
services.
I have three function:
|
by: Preben Zacho |
last post by:
Anyone that has a link or description that simply as possible shows how to
add a web reference to a class library in C# and consuming it?
TIA
PZ
| |
by: Boni |
last post by:
I want consuming a webserivce trough a proxy. I use this code.
myService s = new myService ();
System.Net.WebProxy proxyObject = new
System.Net.WebProxy("http://proxyhost:8080");
s.Proxy = proxyObject;
It doesn't works, it returns a error
HTTP 407: Proxy Authentication Required ( Access is denied. ).
But my proxy don't need a user Authentication.
|
by: luftikus143 |
last post by:
Hi there,
we have successfully running a webservice wrapped with the NuSoap.php libs since quite a while. Now, a colleague of mine in another institution would like to use this webservice. But he is using ASP... As I have only experiences with the setup of PHP webservice, I don't know where to start... Is there any ASP lib available? Or how does it work?
Thanks for any hints!
|
by: luftikus143 |
last post by:
Hi there,
we have successfully running a webservice wrapped with the NuSoap.php libs since quite a while. Now, a colleague of mine in another institution would like to use this webservice. But he is using ASP... As I have only experiences with the setup of PHP webservice, I don't know where to start... Is there any ASP lib available? Or how does it work?
Thanks for any hints!
|
by: aswathip |
last post by:
I am doing a Webservice in PHP for the first time. I have a service named as testWebService.php and testclient.php that consumes the service. Below is my testclient.php
<?php
require_once 'includes/nusoap.php';
$params = array('CardId' => 'sm_stu_id_001',
'DeviceIp' => '192.168.60.68'
);
$client = new nusoap_client('testWebService.php',false);
//+++++++++++++++++++++++++++++++++++++
|
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,...
|
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...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
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();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
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...
| |