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

Getting 500 Internal Server Error - encountered child element which is NOT ....

Expand Messages
  • Rushi
    Error Summary: Getting 500 Internal Server Error - encountered child element which is NOT expected, in something it was trying to deserialize ... Hi All, I am
    Message 1 of 8 , Aug 10 7:53 AM
    • 0 Attachment
      Error Summary:

      Getting 500 Internal Server Error - encountered child element which
      is NOT expected, in something it was trying to deserialize

      Details:
      --------
      Hi All,

      I am using soap::Lite, and I am try to use one of method of
      webservices.
      Below is my passed hash log..............

      I am getting error "500 Internal Server Error"

      And I am receiveing Error from Apache Server that
      is "org.xml.sax.SAXException: SimpleDeserializer encountered a child
      element, which is NOT expected, in something it was trying to
      deserialize"

      Below are the Logs of Passed/Received data in XML

      Any one help me how to resolve it.

      ##################### Passed XML Log ######################
      POST /anacreon/servlet/XMLrpcrouter HTTP/1.1
      TE: deflate,gzip;q=0.3
      Connection: TE, close
      Accept: text/xml
      Accept: multipart/*
      Host: www.foundationapi.com:9090
      User-Agent: SOAP::Lite/Perl/0.55
      Content-Length: 1158
      Content-Type: text/xml; charset=utf-8
      SOAPAction: ""

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body><namesp1:hashtableTest
      xmlns:namesp1="com.logicboxes.foundation.sfnb.user.Test">
      <userName xmlns:ns="http://www.w3.org/2001/XMLSchema"
      xsi:type="ns:string">kalpesh.p@...</userName>
      <password xmlns:ns="http://www.w3.org/2001/XMLSchema"
      xsi:type="ns:string">kkkkkk</password>
      <role xmlns:ns="http://www.w3.org/2001/XMLSchema"
      xsi:type="ns:string">reseller</role>
      <langpref xmlns:ns="http://www.w3.org/2001/XMLSchema"
      xsi:type="ns:string">en</langpref>
      <parentid xmlns:ns="http://www.w3.org/2001/XMLSchema"
      xsi:type="ns:int">1</parentid>
      <hashtableParam xmlns:ns="http://www.w3.org/2001/XMLSchema"
      xsi:type="ns:string">
      <Hashtable xmlns="http://localhost/Schemas/HashtableSchema.xsd">
      <row name="param">112233</row>
      </Hashtable>
      </hashtableParam>
      </namesp1:hashtableTest></SOAP-ENV:Body></SOAP-ENV:Envelope>HTTP/1.1
      500 Internal Server Error
      Server: Resin/2.1.11
      Content-Type: text/xml; charset=utf-8
      Transfer-Encoding: chunked
      Date: Tue, 10 Aug 2004 14:01:46 GMT



      ############################ Server Returened XML Log
      ############################
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: SimpleDeserializer
      encountered a child element, which is NOT expected, in something it
      was trying to deserialize.</faultstring>
      <detail/>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>

      Thanks In Advance
      Rushikesh Joshi
      Sr. Software Developer
      Mega-E-Services
    • Duncan Cameron
      ... This is wrong. The type cannot be a string if the element has child elements Regards Duncan
      Message 2 of 8 , Aug 11 12:31 AM
      • 0 Attachment
        At 2004-08-10, 15:53:19 Rushi <rushi_asi@...> wrote:

        >Error Summary:
        >
        >Getting 500 Internal Server Error - encountered child element which
        >is NOT expected, in something it was trying to deserialize
        >
        >Details:
        >--------
        >Hi All,
        >
        >I am using soap::Lite, and I am try to use one of method of
        >webservices.
        >Below is my passed hash log..............
        >
        >I am getting error "500 Internal Server Error"
        >
        >And I am receiveing Error from Apache Server that
        >is "org.xml.sax.SAXException: SimpleDeserializer encountered a child
        >element, which is NOT expected, in something it was trying to
        >deserialize"
        >
        >Below are the Logs of Passed/Received data in XML
        >
        >Any one help me how to resolve it.

        ... snipped ...

        ><hashtableParam xmlns:ns="http://www.w3.org/2001/XMLSchema"
        >xsi:type="ns:string">
        ---------->^^^^^^^^^
        This is wrong. The type cannot be a string if the element has child elements

        Regards
        Duncan
      • Rushikesh Joshi
        Hi Verry thanks to reply my anser but i have resolved this problem now as im passing a hashtable to my webservices methods. But now I have really no any idea
        Message 3 of 8 , Aug 12 6:00 AM
        • 0 Attachment
           
          Hi Verry thanks to reply my anser but i have resolved this problem now as im passing a hashtable to my webservices methods.
           
          But now I have really no any idea how can i trace the error that are generated at runtime.
          Like invalide arguments, error in type conversion, user already registered, user deactive..
           
          This fault strings are generated by server but i m unable to trake it using SOAP::Lite
           
          I have tried to...
          use SOAP::Lite +trace => 'debug';
          But it is no any help full i required to realtime error traping
           
          So any one have idea how to trace all the error that generated at runtime .......
           
          Your help will be greatly appreciate for me.
           
          Thanks & Regards,
          Rushikesh
          Sr. Software Developer,
          Mega-E-Services

          Duncan Cameron <duncan_cameron2002@...> wrote:
          At 2004-08-10, 15:53:19 Rushi <rushi_asi@...> wrote:

          >Error Summary:
          >
          >Getting 500 Internal Server Error - encountered  child element which
          >is NOT expected, in something it was trying to deserialize
          >
          >Details:
          >--------
          >Hi All,
          >
          >I am using soap::Lite, and I am try to use one of method of
          >webservices.
          >Below is my passed hash log..............
          >
          >I am getting error "500 Internal Server Error"
          >
          >And I am receiveing Error from Apache Server that
          >is "org.xml.sax.SAXException: SimpleDeserializer encountered a child
          >element, which is NOT expected, in something it was trying to
          >deserialize"
          >
          >Below are the Logs of Passed/Received data in XML
          >
          >Any one help me how to resolve it.

          ... snipped ...

          ><hashtableParam xmlns:ns="http://www.w3.org/2001/XMLSchema"
          >xsi:type="ns:string">
          ---------->^^^^^^^^^
          This is wrong. The type cannot be a string if the element has child elements

          Regards
          Duncan




          Do you Yahoo!?
          Yahoo! Mail Address AutoComplete - You start. We finish.

        • Rushikesh Joshi
          I have really no any idea how can i trace the error that are generated at runtime. Like invalide arguments, error in type conversion, user already registered,
          Message 4 of 8 , Aug 19 6:30 AM
          • 0 Attachment

            I have really no any idea how can i trace the error that are generated at runtime.
            Like invalide arguments, error in type conversion, user already registered, user deactive..
             
            This fault strings are generated by server but i m unable to trake it using SOAP::Lite
             
            I have tried to...
            use SOAP::Lite +trace => 'debug';
            But it is no any help full i required to realtime error traping
             
            So any one have idea how to trace all the error that generated at runtime .......

            Is there any methods to retrive last Request & Resoponse & faults ............
             
            Your help will be greatly appreciate for me.
             
            Thanks & Regards,
            Rushikesh
            Sr. Software Developer,
            Mega-E-Services


            Do you Yahoo!?
            New and Improved Yahoo! Mail - 100MB free storage!
          • Duncan Cameron
            ... See the SOAP::SOM section of the documentation. It gives access to the complete SOAP message. Regards Duncan
            Message 5 of 8 , Aug 19 8:12 AM
            • 0 Attachment
              At 2004-08-19, 14:30:24 Rushikesh Joshi <rushi_asi@...> wrote:

              >I have really no any idea how can i trace the error that are generated
              >at runtime.
              >Like invalide arguments, error in type conversion, user already
              >registered, user deactive..
              >
              >This fault strings are generated by server but i m unable to trake it
              >using SOAP::Lite
              >
              >I have tried to...
              >use SOAP::Lite +trace => 'debug';
              >But it is no any help full i required to realtime error traping
              >
              >So any one have idea how to trace all the error that generated at
              >runtime .......
              >
              >Is there any methods to retrive last Request & Resoponse & faults

              See the SOAP::SOM section of the documentation. It gives access to the
              complete SOAP message.

              Regards
              Duncan
            • Mark Fuller
              ... Are you saying trace/trap errors the server has with the client s parms (or other processing using those parms), and trace/trap them on the server? Or,
              Message 6 of 8 , Aug 19 9:58 AM
              • 0 Attachment
                --- Rushikesh Joshi <rushi_asi@...> wrote:
                > I have really no any idea how can i trace the error
                > that are generated at runtime.

                Are you saying trace/trap errors the server has with
                the client's parms (or other processing using those
                parms), and trace/trap them on the server? Or,
                trap/trace errors the server returns to the client,
                and trap/trace them on the client?

                In the first case, everywhere you would generate a
                soapfault message in your server you'd have to write
                custom log messages to a file.

                In the second case, the server would do something like
                this:

                -------
                die SOAP::Fault->faultcode('Server.Custom') # will be
                qualified
                ->faultstring('Died in server method')
                ->faultdetail(bless {code => 1} => 'BadError')
                ->faultactor('http://www.soaplite.com/custom');

                And the client
                if ($result->fault) {
                print 'faultcode: ' . $result->faultcode . "\n";
                print 'faultstring: ' . $result->faultstring . "\n";
                print 'faultdetail: ' . $result->faultdetail . "\n";
                # returns the value of faultdetail'
                #
                element as string or object
                print '... access into nested hash (key \'code\'
                within key \'BadError\'): '
                .
                ${${$result->faultdetail}{BadError}}{code} . "\n";

                print 'faultactor: ' . $result->faultactor . "\n";
                #
                }

                ---------------

                Does that help?




                _______________________________
                Do you Yahoo!?
                Win 1 of 4,000 free domain names from Yahoo! Enter now.
                http://promotions.yahoo.com/goldrush
              • Rushikesh Joshi
                Thanks for your reply........... See below is my code to call my webservices method ######################### Code Starts ##################################
                Message 7 of 8 , Aug 19 11:24 PM
                • 0 Attachment

                  Thanks for your reply...........
                  See below is  my code to call my webservices method

                  ######################### Code Starts ##################################
                  use Data::Dumper;
                  use SOAP::Lite +trace => 'debug';
                  my $_debug_=1; #to check code in debug mode
                  my $service=SOAP::Lite->service("/root/testing/test.WSDL"); #create soap lite object

                  $intTest=intTest(1,2,3); #call intTest method and save return value in some value
                  prinrt $intTest; #print returned value of intTest method

                  sub intTest{
                   my (@param)=@_;
                   if ($_debug_) {
                    print "\n/-------------------- In intTest Method --------------------\\ \n";
                   }
                   #Call intTest method of webservices and stores data in $intTest variable
                   my $intTest = $service->intTest(@param) or die ("Some Error at time of returning value");
                   if ($_debug_) {
                    print "\n Return Value in intTest Method:...............\n";
                    pritn "$intTest","\n";
                    print "\n\\-------------------- In End intTest Method --------------------/ \n";
                   }
                   return $intTest;
                  }
                  ########################### end of code ##################################

                  intTest metod on my webserver is return some of passed parameter.
                  So when I am executing this function I am receiving total (6).

                  But problem is there whenever i am sending (1,"A",3) then the webserver method not executed and I am receiving
                  "Some Error at time of Returing value at line ....".

                  And below is my xml dump.
                  <?xml version="1.0" encoding="UTF-8"?>
                  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmln
                  s:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSc
                  hema-instance">
                   <soapenv:Body>
                    <soapenv:Fault>
                     <faultcode>soapenv:Server.userException</faultcode>
                     <faultstring>org.xml.sax.SAXException: invalid datatype (integer, string, integer)</faultstring>
                     <detail/>
                    </soapenv:Fault>
                   </soapenv:Body>
                  </soapenv:Envelope>

                  But this dump is taken from middle of sockets.
                  And I want real error handling at die statement at time of returning the webmethod.
                  I also tried below code but it hopeless

                  my $intTest = $service->intTest(@param) or die ("Some Error at time of returning value Error:-".$intTest->faultstring);

                  so what to do .........


                  Your help will be greatly appreciate for me.
                   
                  Thanks & Regards,
                  Rushikesh
                  Sr. Software Developer,
                  Mega-E-Services

                  __________________________________________________
                  Do You Yahoo!?
                  Tired of spam? Yahoo! Mail has the best spam protection around
                  http://mail.yahoo.com

                • Duncan Cameron
                  ... When you use WSDL the result of the call is the return value from the service. To access the SOAP message you need to get the som object by using call()
                  Message 8 of 8 , Aug 20 5:54 AM
                  • 0 Attachment
                    At 2004-08-20, 07:24:36 Rushikesh Joshi <rushi_asi@...> wrote:

                    >Thanks for your reply...........
                    >See below is my code to call my webservices method
                    >
                    >######################### Code Starts
                    >##################################
                    >use Data::Dumper;
                    >use SOAP::Lite +trace => 'debug';
                    >my $_debug_=1; #to check code in debug mode
                    >my $service=SOAP::Lite->service("/root/testing/test.WSDL"); #create
                    >soap lite object
                    >
                    >$intTest=intTest(1,2,3); #call intTest method and save return value in
                    >some value
                    >prinrt $intTest; #print returned value of intTest method
                    >
                    >sub intTest{
                    > my (@param)=@_;
                    > if ($_debug_) {
                    > print "\n/-------------------- In intTest Method --------------------
                    >\\ \n";
                    > }
                    > #Call intTest method of webservices and stores data in $intTest
                    >variable
                    > my $intTest = $service->intTest(@param) or die ("Some Error at time
                    >of returning value");
                    > if ($_debug_) {
                    > print "\n Return Value in intTest Method:...............\n";
                    > pritn "$intTest","\n";
                    > print "\n\\-------------------- In End intTest Method ---------------
                    >-----/ \n";
                    > }
                    > return $intTest;
                    >}
                    >########################### end of code
                    >##################################
                    >
                    >intTest metod on my webserver is return some of passed parameter.
                    >So when I am executing this function I am receiving total (6).
                    >
                    >But problem is there whenever i am sending (1,"A",3) then the
                    >webserver method not executed and I am receiving
                    >"Some Error at time of Returing value at line ....".
                    >
                    >And below is my xml dump.
                    ><?xml version="1.0" encoding="UTF-8"?>
                    ><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap
                    >org/soap/envelope/" xmln
                    >s:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3
                    >org/2001/XMLSc
                    >hema-instance">
                    > <soapenv:Body>
                    > <soapenv:Fault>
                    > <faultcode>soapenv:Server.userException</faultcode>
                    > <faultstring>org.xml.sax.SAXException: invalid datatype (integer,
                    >string, integer)</faultstring>
                    > <detail/>
                    > </soapenv:Fault>
                    > </soapenv:Body>
                    ></soapenv:Envelope>
                    >
                    >so what to do .........
                    >
                    When you use WSDL the result of the call is the return value from the
                    service. To access the SOAP message you need to get the som object by
                    using call() with no parameters.

                    Something like this may work in your case. It is not clear whether an
                    exception (die'ing) is occuring. In that case you need to wrap this in
                    an eval{} block.

                    my $result = $service->intTest(1, 'A', 3);
                    my $som = $service->call();
                    if ($som->fault) {
                    # it failed
                    print $som->faultdetail;
                    print $som->faultcode;
                    print $som->faultstring;
                    } else {
                    # it worked
                    print $result;
                    }
                    Regards
                    Duncan
                  Your message has been successfully submitted and would be delivered to recipients shortly.