I am getting successfully response of the SOAP API by the some tools like SoapUI. I am working on the deltek API.
Following is the code format which i am using in 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>
But when i am calling the API through the SOAP client in php. I am getting this error :
stdClass Object
(
[GetSchemaResult] => ErrLoginValInvalid login. Please change the username or password and try again.Value cannot be null.
Parameter name: sGetSchema.validateVisionLogin.VisionWSUtil.ValidateVisionLogin
)
Following is my PHPcode :
$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);
Please suggest? where am I in making mistake?
If you look carefully on the request, you can see that the element del:ConnInfoXML
contains a string.
To make it work, you have to set the ConnInfoXML
as string too:
'ConnInfoXML' => '<VisionConnInfo>...</VisionConnInfo>';
When creating the string programmatically, be sure to escape the values, so the resulting XML is valid.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.