Axis Client FROM nusoap php server

Discussion in 'Java' started by mccalv, Jun 16, 2005.

  1. mccalv

    mccalv Guest

    I'm having some with this response from a php-nusoap server.

    <?xml version="1.0"?>
    <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>
    <getResource_byIDResponse>
    <noname>
    <risorsa>
    <id_risorsa xsi:type="xsd:string">19</id_risorsa>
    <id_utente xsi:type="xsd:string">19</id_utente>
    <titolo xsi:type="xsd:string">John Wayne e John Ford al Marco
    Aurelio</titolo>
    <descrizione xsi:type="xsd:string"> Ill regista John Ford e l'attore
    John Wayne sotto la statua del Marco Aurelio</descrizione>
    <data_immissione xsi:type="xsd:string">1115642468</data_immissione>
    <path
    xsi:type="xsd:string">1978216151422dd1a5b35374.17632548.jpg</path>
    <visibile xsi:type="xsd:string">si</visibile>
    </risorsa>
    <metadata xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:array[7]">
    <item>
    <id_metadata xsi:type="xsd:string">65</id_metadata>
    <metadata xsi:type="xsd:string">Rion_trevi</metadata>
    </item>
    <item>
    <id_metadata xsi:type="xsd:string">105</id_metadata>
    <metadata xsi:type="xsd:string">Palazzi storici</metadata>
    </item>
    <item>
    <id_metadata xsi:type="xsd:string">108</id_metadata>
    <metadata xsi:type="xsd:string">Piazze</metadata>
    </item>
    <item>
    <id_metadata xsi:type="xsd:string">132</id_metadata>
    <metadata xsi:type="xsd:string">Fotografia</metadata>
    </item>
    <item>
    <id_metadata xsi:type="xsd:string">149</id_metadata>
    <metadata xsi:type="xsd:string">Bianco/nero</metadata>
    </item>
    <item>
    <id_metadata xsi:type="xsd:string">158</id_metadata>
    <metadata xsi:type="xsd:string">1950-1960</metadata>
    </item>
    <item>
    <id_metadata xsi:type="xsd:string">219</id_metadata>
    <metadata xsi:type="xsd:string">Foto Album</metadata>
    </item>
    </metadata>
    </noname>
    </getResource_byIDResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    {ARRAY OF string}

    my code is:
    <%@ page import="org.apache.axis.client.Call"%>
    <%@ page import="org.apache.axis.*"%>
    <%@ page import="org.apache.axis.client.Service" %>
    <%@ page import=" org.apache.axis.encoding.XMLType"%>
    <%@ page import=" org.apache.axis.utils.Options" %>
    <%@ page import=" java.net.URL" %>
    <%@ page import=" java.util.*" %>
    <%@ page import=" javax.xml.rpc.ParameterMode" %>
    <%@ page import=" javax.xml.namespace.*" %>


    <%
    //
    Integer numero = new Integer(20);
    String nameWS = "http://www.opent.it/romacinema/service/";
    URL endPointWS = new URL(nameWS);

    //inizializzazione WS
    Service service = new Service();
    Call call = (Call)service.createCall();
    call.removeAllParameters();

    //configurazione parametri WS
    call.setTargetEndpointAddress(endPointWS);
    call.addParameter("numero", XMLType.XSD_INT, ParameterMode.IN);
    call.setOperationName("getResource_byID");






    String[] ret = (String[]) call.invoke(new Object[] {numero});
    out.print(ret);

    %>
    The error i get is ....SimpleDeserializer encountered a child element,
    which is NOT expected, in something it was trying .
    Did anyone experienced the same problem?
    Thank u
    Mirko
     
    mccalv, Jun 16, 2005
    #1
    1. Advertising

  2. mccalv

    Guest

    <snip>
    > The error i get is ....SimpleDeserializer encountered a child element,
    > which is NOT expected, in something it was trying .
    > Did anyone experienced the same problem?
    > Thank u
    > Mirko


    Classic error. Lots of things cause it, but usually its either you are
    using WSDL and you need to supply a mapping document for custom
    objects/arrays, or you using doc/literal instead of rpc somewhere and
    arrays/multiple objects aren't in the right order somehow. Note these
    may or not be the problem because I've seen other things cause it
    during stress testing - its only general advice. Creating your own
    deserializer for a php server ... no idea how to do that - ie get your
    mapping doc for the objects - and you may not have to just for Integer,
    but the general form with Axis is:

    javax.xml.rpc.Service service = factory.createService(url,
    mappinglocation, ws4eeMetaData, qname, null);

    For doc/literal you'll need to google on that one.

    HTH,
    iksrazal
    http://www.braziloutsource.com/
     
    , Jun 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    987
  2. Replies:
    2
    Views:
    17,476
    IchBin
    Aug 15, 2006
  3. Rajive Narain
    Replies:
    0
    Views:
    2,077
    Rajive Narain
    Sep 18, 2009
  4. Ahto Jaago

    php NuSOAP and .net SOAP interfacing

    Ahto Jaago, Aug 5, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    160
    Ahto Jaago
    Aug 5, 2004
  5. winson
    Replies:
    0
    Views:
    152
    winson
    Feb 15, 2007
Loading...

Share This Page