fujiman has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I have been troubled by this problem for the past few days and wondering if there are any PERL gurus that can help.

I get the following fault error message when I'm make a Web Service call using SOAP::Lite. Can some one tell me what this error means and how I can resolve this.

Error Code: soapenv:Server.userException org.xml.sax.SAXException: Bad types (class java.lang.String -> class usdjws65.ArrayOfString) []

Following the samples and documentations of SOAP::Lite, here is a partial to my code:
use SOAP::Lite trace=>'debug'; use Data::Dumper; use strict; my $wsdl = #wsdl address my $user, $pwd #variable definition my $service = SOAP::Lite->service($wsdl); my $sid = $service->login($user, $pw); my $method = SOAP::Data->name('doSelect'); my @params = ( SOAP::Data->name("sid" => $sid), SOAP::Data->name("objectType" => 'pcat'), SOAP::Data->name("whereClause" => "sym like 'Hoste +d%'"), SOAP::Data->name("maxRows" => "1"), # what values to get back, more could be added. SOAP::Data->name("attributes" =>SOAP::Data->value( SOAP::Data->name("string" => "sym" +), SOAP::Data->name("string" +=> 'description') ) ) ); #print "dumper: ".Dumper(@params)."\n"; my $result = $service->call($method => @params); if ($result->fault){ print "[".$result->faultcode."] [".$result->faultstring."] [". +$result->faultdetail."]"; } else { print $result->result; }
Thanks so much! fujiman
  • Comment on SOAP::Lite org.xml.sax.SAXException: Bad types (class java.lang.String -> class usdjws65.ArrayOfString)
  • Download Code

Replies are listed 'Best First'.
Re: SOAP::Lite org.xml.sax.SAXException: Bad types (class java.lang.String -> class usdjws65.ArrayOfString)
by fujiman (Novice) on Sep 13, 2008 at 12:52 UTC
    Hi All,

    I was able to resolve this issue by rewritting my array definition. For those interested below is the redefined code.

    my @params = ( SOAP::Data->name("sid" => $sid), SOAP::Data->name("objectType" => 'pcat'), SOAP::Data->name("whereClause" => "sym like 'Hoste +d%'"), SOAP::Data->name("maxRows" => "1"), # what values to get back, more could be added. SOAP::Data->name("attributes" => \SOAP::Data->value( SOAP::Data->name("string" => "sym" +), SOAP::Data->name("string" => 'desc +ription') ) ) );

    Although I have this resolved but I do not understand why the "/" prior to SOAP::Data within SOAP::Data structure make the difference?

    Thanks all,

    fujiman
        Thanks for your help!
Re: SOAP::Lite org.xml.sax.SAXException: Bad types (class java.lang.String -> class usdjws65.ArrayOfString)
by psini (Deacon) on Sep 13, 2008 at 10:47 UTC

    I'm not sure if the error is fully reported in your post, for you used brackets in a <p></p> paragraph and PerlMonks translate it into a link.

    AFAICS your problem is not a Perl one, it seems the SOAP server is complaining for your data. You'd better reformat your post putting the result into <code...</code> tags and, if possible, add the relevant part of the WSDL for the service you are connecting to.

    Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

Re: SOAP::Lite org.xml.sax.SAXException: Bad types (class java.lang.String -> class usdjws65.ArrayOfString)
by Anonymous Monk on Sep 13, 2008 at 10:20 UTC
    You need a SOAP guru, one that can magically read your mind and determine what the server is expecting