我有一个WCF服务,当连接一个c#应用程序时,接口工作得很好,但是当我使用一个PHP应用程序连接时,传递给服务的所有变量都是空的。
这是用于连接到服务并发送数据的PHP代码。
$SelectedFolder = $_REQUEST['folder'];
var_dump($SelectedFolder);
try
{
$client = new SoapClient('http://localhost:8663/Service.svc?wsdl');
$Files = $client->GetAllLatestVersionsString($SelectedFolder);
}var转储显示以下内容
string 'Pictures/Sample/' (length=16)这是服务代码
[OperationContract]
List<VersionedFileDataModel> GetAllLatestVersionsString(string partUri);我试着传递一个静态值,而不是一个变量,两次服务收到的值都是空的。
提前感谢你的帮助,
哑光
发布于 2011-05-02 03:54:01
修复了它,我被要求使用参数数组来传递变量,对于我发布的示例,我必须将代码更改为以下代码。
try
{
$client = new SoapClient('http://localhost:8663/Service.svc?wsdl');
$params->partUri = $SelectedFolder;
$Files = $client->GetAllLatestVersionsString($params);
}https://stackoverflow.com/questions/5755463
复制相似问题