There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot computer connection crash css dell drive driver drivers email error ethernet excel explorer firefox firefox 3 freeze hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook express password printer problem problems ram router security slow software sound trojan usb virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
PHP with nusoap accessing a .net web service!


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
simonshort's Avatar
Member with 34 posts.
 
Join Date: Aug 2004
Experience: Crap at networking!!!
21-Jun-2006, 02:46 PM #1
PHP with nusoap accessing a .net web service!
I am a total noob when it comes to this. I have tried simply getting a string to be displayed bt cannot get it to work. i have included the code below. I simply want the page to print out "Hello" as stored in the web service

<PHP>
<?php

require_once('nusoap/nusoap.php');
$soapClient = new soapclient("http://localhost/ensembleservice1/Service1.asmx?wsdl", true);
$result = ($soapClient->call("Greeting"));
print_r($result);

?>

<ASMX>
.
.
.
<WebMethod()> _
Public Function Greeting() As String
Return "hello"
End Function
.
.

The output to the web browser is:

Array ( [GreetingResult] => Hello )
simonshort's Avatar
Member with 34 posts.
 
Join Date: Aug 2004
Experience: Crap at networking!!!
21-Jun-2006, 04:43 PM #2
Ok ive done it...

<html>
<head>
<?php
require_once('nusoap/nusoap.php');
/* New instance of soapClient */

$soapClient = new soapclient('http://localhost/ensembleservice1/Service1.asmx?WSDL', 'wsdl');
$soapClient->setDefaultRpcParams(true);
/* Set parameters to pass to client */
$param = array (
'myname' =>"Simon" //uses myname from the web service
);
$soapproxy = $soapClient->getProxy();
$result = $soapproxy->Greeting($param);

if (!$err = $soapproxy->getError()){
echo (implode($result)) . "\n";
}
else{
echo 'Error: ' . $err . "\n";
}



?>

</head>
<body>
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
21-Jun-2006, 05:30 PM #3
mark the thread SOLVED by editing its title
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:56 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.