代码是:
PHP:
$client = new SoapClient('http://webservice.jxdcw.com/Service.asmx?wsdl',true);
$client->soap_defencoding = 'UTF-8';
$aryPara = array('UserName'=>'sdfsdfsdfsd');
$res= $client->call('Set_Cookie',$aryPara);
.net
[WebMethod(EnableSession = true)]
public string Set_Cookie(string UserName)
{
if (UserName == "" || UserName == null)
{
return "132132132";
}
else
{
if (System.Web.HttpContext.Current.Request.Cookies["PhP_User"] == null)
{
HttpCookie Co = new HttpCookie("PhP_User", UserName);
Co.Expires = DateTime.Now.AddDays(3);
System.Web.HttpContext.Current.Response.Cookies.Add(Co);
return Co.Value; }
else
{
return "已经创建";
}
}
}
高手帮下忙。我就差这一步了
PHP:
$client = new SoapClient('http://webservice.jxdcw.com/Service.asmx?wsdl',true);
$client->soap_defencoding = 'UTF-8';
$aryPara = array('UserName'=>'sdfsdfsdfsd');
$res= $client->call('Set_Cookie',$aryPara);
.net
[WebMethod(EnableSession = true)]
public string Set_Cookie(string UserName)
{
if (UserName == "" || UserName == null)
{
return "132132132";
}
else
{
if (System.Web.HttpContext.Current.Request.Cookies["PhP_User"] == null)
{
HttpCookie Co = new HttpCookie("PhP_User", UserName);
Co.Expires = DateTime.Now.AddDays(3);
System.Web.HttpContext.Current.Response.Cookies.Add(Co);
return Co.Value; }
else
{
return "已经创建";
}
}
}
高手帮下忙。我就差这一步了
$aryPara = array('UserName'=>'sdfsdfsdfsd');
$res= $client->call('Set_Cookie',$aryPara); 改为$res=$client->call ('Set_Cookies',array('parameters'==>array('UserName'=>'sdfsdfsdfsd');
服务器端和客户端直接用php更方便http://framework.zend.com/manual/zh/zend.xmlrpc.html