Axis Client FROM nusoap php server

M

mccalv

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
 
I

iksrazal

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/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top