Loading ...
Sorry, an error occurred while loading the content.

Returning function giving error in soap

Expand Messages
  • Anish Kumar K.
    Hi I use the perl to do the SOAP services and in the client side I am using javascript...Unfortunately I am getting errors. I tried different combinations and
    Message 1 of 1 , Apr 26 7:47 AM
    • 0 Attachment
      Hi

      I use the perl to do the SOAP services and in the client side I am
      using javascript...Unfortunately I am getting errors. I tried
      different combinations and end result is :(

      the sample perl code...
      #######################
      use SOAP::Transport::HTTP;

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('RegisterUser')
      -> handle;

      package RegisterUser;
      sub createUser
      {
      my ($firstName,$lastName,$clientName,$email)=@_;
      .....
      return $result;
      }
      #############################

      The javascript code I used to invoke is...Only pasting the relevant
      one...
      #########################
      var soapCall = new SOAPCall();
      soapCall.transportURI ="http://aaa.cc.com/cgi-
      bin/user/RegisterUser.pl"
      soapCall.actionURI = "RegisterUser";
      var fname = new SOAPParameter(firstname,"firstname");
      var lname = new SOAPParameter(lastname,"lastname");
      var paramsArray = new Array(fname,lname);

      soapCall.encode
      (0,"createUser","RegisterUser",0,null,paramsArray.length,paramsArray);
      var soapResponse = soapCall.invoke();
      var soapFault = soapResponse.fault;
      alert ("Failed: "+soapFault.faultCode);
      alert ("Reason: "+soapFault.faultString);

      #########################

      For the First alert I am getting as

      Failed: Client

      and for the second one..

      Reason: SoapAction shall match 'uri#method' if present
      (got 'RegisterUser', expected RegisterUser#createUser

      I tried the variuos combination.. Please help to proceed

      Thanks
      Anish
    Your message has been successfully submitted and would be delivered to recipients shortly.