php 调用.net 写的webservice,无法传参数
我用php的soap扩展调用.net的webservice,淡始终穿不了参数,不知是怎麽会事,请大家指点,代码如下:
PHP:
$bugclient=new SoapClient("http://localhost:1944/WebSite2/Service.asmx?WSDL");
return $bugclient->HelloWorld(2121) ;
.net:(就一个简单示例)
using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
[WebService(Namespace = "http://haha.com")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// 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 Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld(int bugid) {
return bugid.ToString() ;
}
}