Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts

    problem with nusoap request

    Hi guys,

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

    PHP Code:
    // 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"
    Code:
    <?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.

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    No luck?

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •