Remoting Using PERL and Getting junk ' error? What is wrong?

Discussion in 'General' started by bpmee, May 20, 2009.

  1. bpmee

    bpmee Member

    Hi All,

    I'm struggling with a PERL script I wrote that uses remoting to install new resellers, clients, websites etc.

    I can't seem to get past this section when running the script:
    Code:
    ...
    @params = (
    SOAP::Data->name(username=>'bpmee'),
    SOAP::Data->name(password=>'zxcvbn31'),
    );
    
    $obj = $soap->call(login=>@params);
    
    if ( $obj->faultstring ) {
    die "error: ".$obj->faultstring ;
    }
    
    $session_id = $obj->result;
    ...
    
    When my PERL script logins in and gets a session, I immediately get a " junk ' " error... see below, which I copied directly from the shell:

    Code:
    junk '
    soap_server: entering parseRequest() on 16:02 2009-05-20
    soap_server: Accept: text/xml, multipart/*, application/soap
    soap_server: Connection: TE, close
    soap_server: Content-Length: 481
    soap_server: Content-Type: text/xml; charset=utf-8
    soap_server: Host: xx.xx.xx.xx:81
    soap_server: SOAPAction: "#login"
    soap_server: TE: deflate,gzip;q=0.3
    soap_server: User-Agent: SOAP::Lite/Perl/0.710.08
    soap_server: got encoding: UTF-8
    soap_server: method name: login
    soap_server: method 'login' exists
    soap_server: calling parser->get_response()
    soap_server: parser debug:
    soap_parser: Entering soap_parser()
    soap_parser: found root struct login, pos 2
    soap_parser: adding data for scalar value username of value USER
    soap_parser: adding data for scalar value password of value PASS
    soap_parser: inside buildVal() for login(pos 2) of type struct
    soap_parser: parsed successfully, found root struct: 2 of name login
    
    soap_server: params var dump array(2) {
      ["username"]=>
      &string(5) "USER"
      ["password"]=>
      &string(8) "PASS"
    }
    
    soap_server: calling 'login' with params
    soap_server: calling method using call_user_func_array()
    soap_server: response var dumpstring(32) "9e31328ee7bc77527379c13380daecde"
    
    soap_server: done calling method: login, received 9e31328ee7bc77527379c13380daecde of typestring
    soap_server: got a(n) string from method
    soap_server: serializing return value
    soap_server: in serialize_val: 9e31328ee7bc77527379c13380daecde, , , , , , encoded
    soap_server: return val:string(73) "' after XML element
    <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"  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:si="http://soapinterop.org/xsd"><SOAP-ENV:Body><loginResponse><soapVal xsi:type="xsd:string">9e31328ee7bc77527379c13380daecde</soapVal></loginResponse></SOAP-ENV:Body></SOAP-ENV:Envelope><!--
    soap_server: entering parseRequest() on 16:02 2009-05-20
    soap_server: Accept: text/xml, multipart/*, application/soap
    soap_server: Connection: TE, close
    soap_server: Content-Length: 481
    soap_server: Content-Type: text/xml; charset=utf-8
    soap_server: Host: 66.197.160.21:81
    soap_server: SOAPAction: "#login"
    soap_server: TE: deflate,gzip;q=0.3
    soap_server: User-Agent: SOAP::Lite/Perl/0.710.08
    soap_server: got encoding: UTF-8
    soap_server: method name: login
    soap_server: method 'login' exists
    soap_server: calling parser->get_response()
    soap_server: parser debug:
    soap_parser: Entering soap_parser()
    soap_parser: found root struct login, pos 2
    soap_parser: adding data for scalar value username of value USER
    soap_parser: adding data for scalar value password of value PASS
    soap_parser: inside buildVal() for login(pos 2) of type struct
    soap_parser: parsed successfully, found root struct: 2 of name login
    
    soap_server: params var dump array(2) {
      ["username"]=>
      &string(5) "USER"
      ["password"]=>
      &string(8) "PASS"
    }
    
    soap_server: calling 'login' with params
    soap_server: calling method using call_user_func_array()
    soap_server: response var dumpstring(32) "9e31328ee7bc77527379c13380daecde"
    
    soap_server: done calling method: login, received 9e31328ee7bc77527379c13380daecde of typestring
    soap_server: got a(n) string from method
    soap_server: serializing return value
    soap_server: in serialize_val: 9e31328ee7bc77527379c13380daecde, , , , , , encoded
    soap_server: return val:string(73) "<soapVal xsi:type="xsd:string">9e31328ee7bc77527379c13380daecde</soapVal>"
    
    soap_server: serializing response
    soap_server: server sending...
    
    --> at remoteperl-srt10.pl line 23
    
    
    My remote perl script line 23 is:
    Code:
    $obj = $soap->call(login=>@params);
    
    I had a similar problem months ago and a user replied that it has something to do with a string vs xml element being returned by the remote.php script in /home/.../ispconfig/web/remote , but I'm completely baffled...

    Any ideas? Thanks for your help!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I've only used the remoting framework with php, so I dont know if it works with perl. The remoting framework uses a widely used soap library for communication, so I guess the soap calls should be fine in general.
     

Share This Page