我用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() ;
    }
    
}

解决方案 »

  1.   

    传参数好像是在第二个参数里面给。
    __construct ( mixed $wsdl [, array $options ] )
    $client = new SoapClient("some.wsdl", array('proxy_host'     => "localhost",
                                                'proxy_port'     => 8080,
                                                'proxy_login'    => "some_name",
                                                'proxy_password' => "some_password"));
      

  2.   

    传参有两种,一种一般是变量或数组传参,数据类型要对,象楼上的yzxlyd兄的有的要求用类,但不知如何传