I'm designing a website for an organization that's a state chapter of a national organization. The national organization has implemented a member login that I need to use for the state website.
My website is in PHP, and it looks like the server for the national organization is using SOAP and ColdFusion. I'm a total newbie to using SOAP, so I'm probably missing a bunch of things.
The national organization sent me this information:
Fields to collect on a form
mausername
mapasswordStatic variables
componenttype Value: Chapter
components Value: NM
authusername Value: NMChap
authpassword Value: USA
authpagealias Value: LoginThe webservice is located here: https://www.apta.org/AM/APTAAPPS/ComponentAuthWebService/aptamemberauthorize.cfc?WSDL
The following fields will be returned: Email, FirstName, LastName, LoggedIn, Phone_Release, UserName
If LoggedIn returns “true,” the member has been authenticated as a member of the component.
This has been implemented and tested here: http://aptadevisg.apta.org/am/aptaapps/test/NM_Chap_test_form.cfm
Based on this information and reading the SOAP documentation, this is what I came up with:
$apta_server = 'https://www.apta.org/AM/APTAAPPS/ComponentAuthWebService/aptamemberauthorize.cfc?WSDL';
$post_data['mausername'] = '107150';
$post_data['mapassword'] = 'barnes';
$post_data['componenttype'] = 'Chapter';
$post_data['components'] = 'NM';
$post_data['authusername'] = 'NMChap';
$post_data['authpassword'] = 'USA';
$post_data['authpagealias'] = 'Login';
$options = array('trace' => 1, 'exceptions' => 0);
$options['location'] = 'https://www.apta.org/AM/APTAAPPS/ComponentAuthWebService/MemberAuth';
try
{
$client = new soapclient($apta_server, $options);
}
catch (Exception $e)
{
}
$client->debug_flag = 1;
try
{
$result = $client->__soapCall('MemberAuth', array($post_data));
echo '<h1>Soap Result</h1><pre>';
print_r($result);
echo '</pre>';
}
catch (SoapFault $fault)
{
echo '<h1>Soap Fault</h1><pre>';
print_r($fault);
echo '</pre>';
}
echo '<pre>getFunctions<br>';
print_r($client->__getFunctions());
echo '</pre>';
echo '<pre>getTypes<br>';
print_r($client->__getTypes());
echo '</pre>';
echo '<pre>getLastResponseHeaders<br>';
print_r($client->__getLastResponseHeaders());
echo '</pre>';
echo '<pre>getLastResponse<br>';
print_r($client->__getLastResponse());
echo '</pre>';
When I print out the result of the __soapCall(), I get a message of: "looks like we got no XML document."
I really don't know what I'm doing regarding SOAP, so any help would be greatly appreciated. You can view the results of the test login attempt at: http://rc19.info/test_login.php