【发布时间】:2016-07-13 18:13:53
【问题描述】:
我正在通过 SoapUI 等工具成功响应 SOAP API。 我正在开发 deltek API。
以下是我在 SoapUI 中使用的代码格式
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:del="http://tempuri.org/Deltek.Vision.WebServiceAPI.Server/DeltekVisionOpenAPIWebService">
<soap:Header/>
<soap:Body>
<del:GetSchema>
<!--Optional:-->
<del:ConnInfoXML><![CDATA[<VisionConnInfo>
<databaseDescription>Example_Test (TEST_001)</databaseDescription>
<userName>test</userName>
<userPassword>test123</userPassword>
<integratedSecurity>Y</integratedSecurity>
</VisionConnInfo>]]> </del:ConnInfoXML>
<!--Optional:-->
<del:InfoCenter><![CDATA[User]]></del:InfoCenter>
</del:GetSchema>
</soap:Body>
</soap:Envelope>
但是当我通过 php 中的 SOAP 客户端调用 API 时。我收到此错误:
stdClass Object
(
[GetSchemaResult] => ErrLoginValInvalid login. Please change the username or password and try again.Value cannot be null.
Parameter name: sGetSchema.validateVisionLogin.VisionWSUtil.ValidateVisionLogin
)
以下是我的 PHP 代码:
$apiURL = 'http://example.com/Vision/VisionWS.asmx?wsdl';
$client = new SoapClient($apiURL, array('trace' => 1, 'exceptions' => 1));
$conninfo = array(
'ConnInfoXML' => array(
'VisionConnInfo' => array(
"databaseDescription" => 'Example_Test (TEST_001)',
"userName" => "test",
"userPassword" => 'test123',
"integratedSecurity" => "Y"
)
)
);
$userinfo = array('InfoCenter' => 'User');
try {
$result = $client->GetSchema($conninfo, $userinfo);
} catch (SoapFault $fault) {
print_r($fault);
}
echo '<pre>';
print_r($result);
请建议?我在哪里犯错了?
【问题讨论】:
标签: php web-services soap soapui soap-client