What's with Microsoft .NET and PHP5's SOAP?

liunx

Guest
First Disclaimer -- I know very little about how MS .NET works or what it requires to work. Thus this question.

Second Disclaimer -- I'm new to SOAP, so it's just a "blackbox" to me so far.

I have the task of creating a data collection link between a client's web site (Apache / PHP 5.1) and a vendor's Web-based application. The interface to the vendor's application database is a Microsoft .NET WebServices module written in VB by someone who also doesn't understand SOAP or the nitty gritty of how / what Microsoft does to make this all work.


I am able to build the SoapClient object using a link to the Microsoft .NET generated WSDL.
Using this client object, I can make a successful call to the Access Verification routine, and obtain "credentials".
This Access Verification process also returns a couple of key cookies.
The cookies can be seen in the client object (using var_dump).
Subsequent calls to the functions which do work all fail.
Error shown on the WebServices server side all indicate that the key authentication cookie wasn't received.
The client code fails because the return object doesn't match the WSDL structure.


Note that the SoapClient does not provide a method to retrieve the cookies, while it does provide something to set cookies. The manual states that cookies are sent with each transaction to the server.

Is there something magic which needs to be provided with dealing with .NET services?

Here is a code fragment showing the connection, validation, and work calls.:
<?php


$loginName = 'xxxxxxxxxxxxxx'; //Webservices login name
$database = 'xxxxxxxxxxxxxxx; //Webservices database
$password = 'xxxxxxxx'; //Webservices password
$credentials = '';
$status = 'success';

$WSDLurl = "https://someplace.org/webservices/registrationservices.asmx?WSDL";

$client = new SoapClient($WSDLurl);

$parms = new stdClass();
$parms->LoginDatabase = $database;
$parms->LoginName = $loginName;
$parms->Password = $password;
$parms->loginCredentialsRecid = '';
$parms->status = $status;

$reply = $client->ValidateWebServicesLogin($parms);

print "Status: '{$reply->status}'\n";
print "Recid : '{$reply->loginCredentialsRecid}'\n";

print "\n";

$parms = new stdClass();
$parms->LoginName = <!-- e --><a href="mailto:'[email protected]">'[email protected]</a><!-- e -->';
$parms->Password = ''; // No password Assigned
$parms->IsEncrypted = false;
$parms->CookieValue = <!-- e --><a href="mailto:'[email protected]">'[email protected]</a><!-- e -->';
$parms->CookieLifetime = 3600;
$parms->Locale = 'C';
$parms->lastLeadId = '';
$parms->status = '';

$rsp = new stdClass();
$rsp->Status = 'Failure';

try {
$rsp = $client->CreateLogin($parms);
} catch (Exception $e) {
print "Caught exception: " . $e->getMessage() . "\n";
}

print "Create Login: ";
if ( $rsp->status == 'Success' ) {
print "Successful!\n";
print "LeadID = " . $rsp->lastLeadId . "\n";
} else {
print "FAILED!\n";
}

echo "\nDone\n";

?>

This code always catches an exception...

Any ideas?

Thanks,
JT McDuffie
 
Back
Top