soap request error message in php

Discussion in 'PHP' started by macky_shak, Apr 11, 2012.

  1. #1
    I am writng a program in php which is accessing a web services code is :

    
    error_reporting(0);
    require_once('../lib/nusoap.php');
    
    $client = new nusoap_client("https://abc_ws?wsdl", 'WSDL');
    $error = $client->getError();
    
    if ($error) {       die("client construction error: {$error}\n"); }
    
    $client->setCredentials('login', '123456', 'basic');
    $param = array(param1' => '1234567899');
    
    $result = $client->call('MyGetOperation', $param);
    
    if ($client->fault) {
    
        print_r($result);
        
    }
    
    
    Code (markup):
    and this is my request and response

    Request :
    
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns6153="http://tempuri.org">
    <SOAP-ENV:Body>
    <CDES-GET-Request xmlns="http://url.com/cdes/services"/>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
    Code (markup):
    and i am getting response :

    
    
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body><soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>cvc-complex-type.2.4.b: The content of element 'My-GET-Request' is not complete. One of '{"http://url.com/cdes/services":param1}' is expected.</faultstring>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>
    
    Code (markup):
    I am newbe in web services and php, so suggest me the way of how solve it

    Thanks,
     
    macky_shak, Apr 11, 2012 IP
  2. macky_shak

    macky_shak Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    anybody can suggest me ?
     
    macky_shak, Apr 11, 2012 IP
  3. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #3
    no real experience with soap, but
    $param = array(param1' => '1234567899');
    
    Code (markup):
    there is a single quote missing, properbly the reason why it doesnt recieve the required param element
     
    Basti, Apr 11, 2012 IP
  4. e-abi

    e-abi Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    3
    Trophy Points:
    38
    #4
    That would cause syntax error, so I guess the real code is fine.

    The problem why no-one is answering you could be one of the following reasons:
    1) You did not supply WDSL file with your code. So it is not possible to know what kind of parameters should be supplied
    2) SOAP is quite tough, not everyone understands it.
     
    e-abi, Apr 11, 2012 IP
  5. macky_shak

    macky_shak Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    no by mistake i wrote that Basti, but still i am getting that error message.
     
    macky_shak, Apr 15, 2012 IP