我有一个在asp.net中创建并在iis 5.1中发布的web服务。现在我想从php环境中调用这个web服务。其实我的Web服务获取一个字符串作为参数,并返回相同的字符串。但始终,返回的字符串是空的或null.I无法发送字符串值从PHP到asp.net的Web服务...如何从PHP调用我的asp.net web服务?
这在asp.net
namespace PRS_WS
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class prs_point : System.Web.Services.WebService
{
[WebMethod]
public string testAssignment(string inputData)
{
return inputData;
}
}
}
而创建我的web服务,这是我调用上述asp.net web服务的PHP代码...
<?php
require_once('nusoap/lib/nusoap.php');
$wsdl="http://localhost/prs_point/prs_point.asmx?WSDL";
$str1="";
$str1="Hello from php";
$client = new soapclient($wsdl,'wsdl');
$result=$client->call('testAssignment',$str1);
foreach($result as $key => $value)
{
echo "<br/>Response ::::: $value";
}
?>
我不知道是否需要在PHP端或asp.net端进行更改?...请指导我解决这个问题...
谢谢你,Saravanan。 – PhatHV 2014-06-23 07:44:18