Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th May 2009, 22:12
bpmee bpmee is offline
Member
 
Join Date: Aug 2006
Posts: 86
Thanks: 3
Thanked 7 Times in 6 Posts
Unhappy Remoting Using PERL and Getting junk ' error? What is wrong?

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!
Reply With Quote
Sponsored Links
  #2  
Old 21st May 2009, 09:46
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,778
Thanks: 821
Thanked 5,334 Times in 4,184 Posts
 
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:02.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.