我通过我的PHP代码调用.net编写的web服务。 .net webservice中的函数有一个return语句和一个out参数。我能够获得返回变量的值,但不能获得out参数。有没有什么方法可以让我在webservice中获得函数的返回值和out参数?
如何通过PHP中的soapCall从以下Web服务获取vFileID
?
PHP代码
$client = new SoapClient("abc.wsdl");
$result = $client->__soapCall("SendFile", $params);
输出:
object(OIntegrate_Response)[301]
public 'version' => null
public 'schemaVersion' => null
public 'schemaDocumentation' => null
public 'contentType' => null
public 'cacheControl' => null
public 'data' => string '8129ac11-ab01-4abd-bbd8-1af79dbe1019' (length=36)
private 'errors' =>
array (size=0)
empty
这是.net代码:
[WebMethod(EnableSession = true)]
public string SendFile(string vFileName, string vDescription, bool vLastChunk, bool vFirstChunk, Int32 vStartByte, byte[] vBytes, string vFileID, string vFile, out Int32 vID)
{
avFileTransferManager tmpFileManager;
avFileManager tmpManager = new avFileManager();
vID = 0;
if (vFirstChunk)
{
vFileID = System.Guid.NewGuid().ToString();
tmpFileManager = new avFileTransferManager();
}
else
{
tmpFileManager = GetFileManager(vFileID);
}
tmpFileManager.AddChunk(vStartByte, vBytes);
if (vLastChunk)
{
//Store file in database.
avFile tmpFile = tmpManager.DeserializeFile(vFile);
tmpFile.LockSize = false;
tmpFile.FileStream = tmpFileManager.FileStream;
//tmpFile.Name = vFileName;
//tmpFile.Description = vDescription;
tmpFile = tmpManager.SaveFile(tmpFile);
vID = tmpFile.ID;
//Remove tmp-file from memory.
Session.Remove(vFileID);
}
else
Session[vFileID] = tmpFileManager; //Store tmp-file in session object.
return vFileID;
}