php soap client for uk mail webservice api?

前端 未结 2 676
粉色の甜心
粉色の甜心 2020-12-01 08:58

I\'m working on a commerce site on which orders are placed. To track that delivery I need to give a link to users with all the parameters from a form filled by user to creat

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 09:21

    Well Mr zafarkhaja helped me a lot but for others like me i will like to explain what worked for me so that might be helpfull to others too in future ..

    For dealing with complex types For Example Like in my Uk Mail Api For login i did this

    $LoginWebRequest = new stdClass();
    $LoginWebRequest->Username = 'username';
    $LoginWebRequest->Password = 'password';
    
    
    
    $Login = new stdClass();
    $Login->loginWebRequest = $LoginWebRequest;
    
    
    
    $soapClient = new SoapClient('somewsdl?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE) );
    
    
    $LoginResponse = $soapClient->Login($Login);
    

    and hurray i could login . it gave me a response which i needed to retreive

     $AuthenticationToken = $LoginResponse->LoginResult->AuthenticationToken; 
    

    and i got the auth token well sure you can change parameters according to your webservice

    Well using a soap Client When You are not dealing with complex type

       $soapClient = new SoapClient('http://somewsdl?wsdl');
    
        //create an array whose valuse will be passed has parameters
              $input_array = array (   
                   UserName => 'username',
                   Password => 'password'
    
         ) ;
    
        // passes our array
        $ConsignmentResponse = $soapClient1->TrackingSearch($input_array);
    
      //retrieve the response like this 
    
        $ResultState =  $ConsignmentResponse->ResultState; // Successful
    

    Well i searched everwhere but no one had posted any working example well all the code works for me in php soap 1.1 with both complex type and without .

提交回复
热议问题