New to soap, I ve used soapUI ( http://www.soapui.org) to test the service I need to access anddetermination that I need the soap request to look as this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_5=mynamespace>
<soapenv:Header/>
<soapenv:Body>
<_5:GetStaff>
<_5:Request>
<_5:SourceCredentials>
<_5:SourceName>name</_5:SourceName>
<_5:Password>pword</_5:Password>
<_5:SiteIDs>
<_5:int>num</_5:int>
</_5:SiteIDs>
</_5:SourceCredentials>
</_5:Request>
</_5:GetStaff>
</soapenv:Body>
</soapenv:Envelope>
我的名词、名称、密码和南都属于谁。 我只是需要用购买力平价来提出这一要求。 这是我最新的尝试:
<html>
<body>
<?php
require_once( nusoap.php );
$wsdl = ...;
$client = new SoapClient($wsdl);
/*
echo("
Dumping client object:
");
var_dump($client);
echo("
Dumping client object functions:
");
var_dump($client->__getFunctions());
*/
try {
$credentials = new SoapVar(array(
SourceName =>name,
Password =>pword,
SiteIDs =>num
),
SOAP_ENC_OBJECT,
type1,
mynamespace
);
$request = new SoapVar(array( SourceCredentials =>$credentials),
SOAP_ENC_OBJECT,
type2,
mynamespace
);
$result = $client->GetStaff(new SoapParam($request, "Request"));
echo $result;
}
catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
print "<pre>
";
print "Request :
".htmlspecialchars($client->__getLastRequest()) ."
";
print "Response:
".htmlspecialchars($client->__getLastResponse())."
";
print "</pre>";
?>
</body>
</html>
用我的话来说,1类是源码标签的适当类型,2类是请求标的适当的类型。
当我在浏览器上打开这一档案时,绝对没有任何迹象显示。 当评论的界线未形成时,我可以看到物体的倾销(尽管我不知道如何解释倾销),但物体功能是显示的NOT。
是否如<代码>。 SoapClient 本身是适当设置的吨数,还是用于 so的参数建筑中的错误?
* 扩大: I ve name this file “index.php
,” and in a browser I m navigating to the summary in which this file is found (it is a sub-directory of my public_html
.
缩略语