...

View Full Version : problem with nusoap request



idalatob
11-23-2010, 10:27 AM
Hi guys,

Please can someone help me out with this? Im not used to using SOAP. (haha)



// Pull in the NuSOAP code
require_once('lib/nusoap.php');
// Create the client instance
$client = new soapclient('http://*.*.*.*:8005/Leads.asmx', true);
// Check for an error

$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
// At this point, you know the call that follows will fail
}
$params = array(
"firstName"=>"",
"surname"=>"",
"homeNo"=>"",
"cellNo"=>"",
"workNo"=>"",
"email"=>"",
"idNumber"=>"",
"amount"=>"",
"netSalary"=>"",
"agentID"=>"",
"reference"=>"");
// Call the SOAP method
$result = $client->call('AddLead', $params);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}


Im trying to generate the following wrapper:

POST /Leads.asmx HTTP/1.1
Host: *.*.*.*
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/AddLead"


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddLead xmlns="http://tempuri.org/">
<firstName>string</firstName>
<surname>string</surname>
<homeNo>string</homeNo>
<cellNo>string</cellNo>
<workNo>string</workNo>
<email>string</email>
<idNumber>string</idNumber>
<amount>string</amount>
<netSalary>string</netSalary>
<agentID>int</agentID>
<reference>string</reference>
</AddLead>
</soap:Body>
</soap:Envelope>


What i get is this error:
wsdl error: XML error parsing WSDL from http://*.*.*.*:8005/Leads.asmx on line 65: Mismatched tag

Any help would be greatly appreciated.

idalatob
11-24-2010, 08:59 AM
No luck?

idalatob
11-24-2010, 01:11 PM
ARRGGGRRHHHHH NOOOOOOO!!!

Bugrit!

ok well, if anyone comes up with anything please please let me know! thanks for looking at it guys. dont all reply at once :-P



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum