problem with php nusoap connecting .net web service

Discussion in 'PHP' started by guga121, Dec 14, 2009.

  1. #1
    hi, i got a problem when i'm trying to connect to a .net web service through php.

    actually the problem is:
    Server did not recognize the value of HTTP Header SOAPAction:

    first i didnt define any value for soapaction, after i found i must do, i pass the variable, it take it ok, but it still the same problem. i dont know which value i must pass throgh this variable, if someon can help me. i leave you here the code i use:

    <?
    require_once('soap/lib/nusoap.php');

    $example = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
    <datarefresh source=\"city\" clientid=\"CLIENTID\" user=\"USERNAME\" pass=\"PASSWORD\">
    <clientid>227867</clientid>
    <select name=\"Buenos Aires\" country=\"AR\"></select>
    </datarefresh>";

    //$soapaction = "http://xml.dev.hoteldo.com/Datarefresh";
    $soapaction = "http://xml.dev.hoteldo.com/send";

    $wsdl = "http://xml.dev.hoteldo.com/HoteldoInterface.asmx?WSDL";
    $client = new nusoap_client($wsdl, true);

    $result = $client->send($example, $soapaction);

    if ($client->fault) {
    echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';
    } else {
    $err = $client->getError();
    if ($err) {
    echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
    echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
    }
    }

    echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
    echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
    ?>
     
    guga121, Dec 14, 2009 IP
  2. yoes_san

    yoes_san Peon

    Messages:
    443
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you read WSDL file for the service? That way you'll know what arguments the service needs/what it'll returns.

    I remember you can let nusoap read the WSDL and then you can pass the required arguments into send() function as array, not 100% sure about this though it's been a long time.
     
    yoes_san, Dec 14, 2009 IP