M and MSM Series
1751707 Members
5352 Online
108781 Solutions
New Discussion

MSM760 Soap Call returning an unexpected response

 
Master_lain
Occasional Advisor

MSM760 Soap Call returning an unexpected response

Good evening,

      I'm trying to work out a simple proof of concept monitoring/data collection system using soap. I'm starting off with some basic HP provided PHP samples.  

I'm trying to poll an MSM760 to report the status of its controlled APs, everytime I call ControlledNetworkGetDiscoveredAPStatus it returns a bad response and fails

$rc = $c->ControlledNetworkGetDiscoveredAPStatus("Group", "Default Group", "All_States");


Results in

string: <Validation constraint violation: tag name or namespace mismatch in element <param1>>
code:   <SOAP-ENV:Client> 


I'm using the HP supplied WDSL and soapapi-inc.php of like versions

Attached is my code,
Thanks for any insight into this, I've called everything according to examples and its getting frustrating :O

As a side note... I can call other controlled mode related items just fine eg.

$rc = $c->ControlledNetworkGetGroupList();

 results in the list of groups on the controller.

Thanks,

Ryan


EDIT: Wouldn't attach my file so I've embeded it...

<?php
	// Copyright Colubris Network Inc. 2008 */

	// This code is provided "as is", without any warranty of any kind, either
	// expressed or implied, including but not limited to, any implied warranty
	// of merchantibility or fitness for any purpose.
	// In no event will Colubris Networks Inc. or any party who distributed
	// the code be liable for damages or for any claim(s) by any other party,
	// including but not limited to, any lost profits, lost data or data rendered
	// inaccurate, losses sustained by third parties, or any other special,
	// incidental or consequential damages arising out of the use or inability to
	// use the program, even if the possibility of such damages has been advised
	// against.
	// The entire risk as to the quality, the performance, and the fitness of the
	// program for any particular purpose lies with the party using the code.
	//
	// It is possible that the provided example script may not work with your
	// specific combination of Colubris software and the SOAP client toolkit.
	// The example script is known to work with  certain versions of the software
	// and SOAP.
	// When possible, we will specify which versions of software and SOAP are known
	// to work with the example.
	// The main purpose of the example is to give you a general idea of how to
	// write a SOAP client application and, therefore, even if the example does
	// not work with your software, the example script still provides many valuable
	// clues as to how such scripts should be written.

	require_once("soapapi-inc.php");

	// connection settings
	define("SOAPAPI_PROTO", "https");
	define("SOAPAPI_HOST", "192.168.1.1");
	define("SOAPAPI_PORT", "448");
	define("SOAPAPI_FORMAT", "%s://%s:%d/SOAP");
	define("SOAPAPI_WSDL_FILE", "soapapi.wsdl");

	// SSL settings
	define("SOAPAPI_CLIENT_CERT", "x509/soap-api-client.crt");
	define("SOAPAPI_CLIENT_CERT_PASSPHRASE", "soap-api-client");

	// defining some useful constants.
	define("REQUIRED_API_VERSION", "2.6.0");
	define("VAP_GLOBAL", "Global");
	define("EQUIPMENT_ID", "EQPT_1");
	define("COUNTRY_CODE", "CANADA");

	// clearing WSDL cache in the case the WSDL
	// file would have changed.
	SoapApi::ClearWSDLCache();

	try {
		// creating target URL
		$url = sprintf(SOAPAPI_FORMAT, SOAPAPI_PROTO, SOAPAPI_HOST, SOAPAPI_PORT);
		echo "connecting to " . SOAPAPI_HOST . " using " . SOAPAPI_PROTO . "\n";

		if (strcmp("http", SOAPAPI_PROTO) == 0) {
			$c = new SoapApi(SOAPAPI_WSDL_FILE, array(	'location' => $url ,
														'proxy_host' => SOAPAPI_HOST,
														'proxy_port' => SOAPAPI_PORT 
													 )
							);
							
		} else if (strcmp("https", SOAPAPI_PROTO) == 0) {
			// creating a new SoapApi object. A fault will be raised if unsucessul.
			$c = new SoapApi(SOAPAPI_WSDL_FILE, array( 'location' => $url,
													   'local_cert' => SOAPAPI_CLIENT_CERT,
													   'passphrase' => SOAPAPI_CLIENT_CERT_PASSPHRASE
													 )
							) or die("Failed casting");	
		} else {
			echo "unknown protocol <" . SOAPAPI_PROTO . ">\n";
			exit(1);
		}

		echo "Retrieving SOAP API version...\n";
		$rc = $c->soapGetSOAPVersion();
		if (strcmp($rc->version, REQUIRED_API_VERSION) != 0) {
			printf("Incorrect SOAP API version found: <%s> - expecting <%s>\n",
				   $rc->version,
				   REQUIRED_API_VERSION
				  );
			exit(1);
		}

		//Print system name/ip
		$rc = $c->GetSNMPInterface();
			echo "<b>".$rc->systemName."</b>\n<br>".$SOAPAPI_HOST."\n<br>";
		
		//Print basic system info
		$rc = $c->GetSystemInfo();
			echo $rc->productName . " : " . $rc->firmwareRevision . " : " . $rc->serialNumber."\n<br>";
		
		$rc = $c->ControlledNetworkGetGroupList();
		if(count($rc->result->item)>0){
		echo "<ul>\n";
			foreach($rc->result->item as $groupname){
				echo "<li>".$groupname->grpName."</li>\n";
			}
		echo "</ul>\n";
		}
		
		$rc = $c->ControlledNetworkGetDiscoveredAPStatus("Group", "Default Group", "All_States");
		print_r($rc);

		
		
	} catch (SoapFault $fault) {
		// displaying fault.
		printf("string: <%s>\n",  $fault->faultstring);
		printf("code:   <%s>\n",  $fault->faultcode);
		printf("actor:  <%s>\n",  $fault->error_message_prefix);
		printf("detail: <%s>\n",  $fault->userinfo);

		// terminating and returning an error.
		exit(1);
	}

?>