Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Axis Client FROM nusoap php server

Thread view: 
mccalv - 16 Jun 2005 13:47 GMT
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
iksrazal@terra.com.br - 16 Jun 2005 15:17 GMT
<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/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.