1 Reply Latest reply on Dec 19, 2011 8:23 AM by sadascq

    webservice:how to set "login" & "password" like this... in flex


      Hello, I'm Thai guy ,if any sentence or some grammar  is not correct or mistake ,I'm sorry for that.


      In php, I test my webservice like this:



      $client = new SoapClient("plus.wsdl",array(

          "trace" => 1,

          "exceptions" => 0,





      $ar= $client->plus(5, 2);



      function plus($num1,$num2) {








      $h[0]=$user;                  // check sever-side can get user from client

      $h[1]=$pwd;                    // check sever-side can get password from client



      return $h;




      $server = new SoapServer("plus.wsdl");




      This is basic test for next step of my authentication so It's work.

      but now I wanna use in Flex but I don't know how to set 





      in the other way I know I should soapheader for authen but I don't know how to use it because

      it's error #1009 and I don't know how to get value(user,pwd) in server-side if use soapheader.



      Thank you very much.







        • 1. Re: webservice:how to set "login" & "password" like this... in flex
          sadascq Level 1

          no one help me- -'


          but now I can figure it out.



          private function authAndSend():void
          var encoder:Base64Encoder = new Base64Encoder();

          .httpheaders = {Authorization:"Basic " + encoder.toString()};                                               


          adove code(flex) is equivalent to php code (below)


          $client = new SoapClient("plus.wsdl",array(

              "trace" => 1,

              "exceptions" => 0,

              "login"=>"51011111",  //someusername

               "password"=>"1234" //somepassword