users@jaxb.java.net

Re: Web Services and images from j2me client

From: JULIAN ENRIQUE OSORIO AMAYA <juliane.osorioa_at_unilibrebog.edu.co>
Date: Mon, 30 Aug 2010 15:08:26 -0500

On 29 August 2010 16:27, JULIAN ENRIQUE OSORIO AMAYA <
juliane.osorioa_at_unilibrebog.edu.co> wrote:

>
>
> On 29 August 2010 14:29, Wolfgang Laun <wolfgang.laun_at_gmail.com> wrote:
>
>> Well, go ahead and try it out. Mulling over the source won't get you
>> anwhere. ;-)
>> -W
>>
>>
>>
> Hello Wolfgang
>
>
> http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv/data_types.html
>
> The table 5-1 shows the mapping xml schema built-in data types to java data
> types
>
> the schema generated by the schemagen command has the following
>
> <xs:element name="imagenPaciente" ns1:expectedContentTypes="image/jpeg"
> type="xs:base64Binary" minOccurs="0"
>
> the generated class (PacienteDTO) at client side the imagenPaciente
> attribute is byte[]
>
>
> <http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv/data_types.html>The
> table 5-2 shows the mapping java data types to xml schema data types
> in this case, the generated data types are correct
>
> class PacienteDTO at server side has a javax.activation.DataHandler
> attribute (imagenPaciente)
>
>
>
> --
> Julian Osorio Amaya
> Universidad Libre.
> Ingenierķa de Sistemas.
> Bogota - Colombia
>
>

Greetings.


After transforming the image(jpg file) to byte[] and call the
insertarInfoPaciente service now appears a JAXRPCException
the cause is a java.rmi.MarshalException Invalid Element in Response:
Exception

I don't know why...
I've googled the exception but can't find an answer


Here is the WSDL

<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is
JAX-WS RI 2.1.3.3-hudson-757-SNAPSHOT. --><!-- Generated by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.3.3-hudson-757-SNAPSHOT. --><definitions xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="
http://ws.web.mobile.app.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="
http://ws.web.mobile.app.org/" name="N95WSService">
<types>
<xsd:schema>
<xsd:import namespace="http://ws.web.mobile.app.org/" schemaLocation="
http://localhost:8080/N95WS/N95WSService?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="loginUsuario">
<part name="parameters" element="tns:loginUsuario"></part>
</message>
<message name="loginUsuarioResponse">
<part name="parameters" element="tns:loginUsuarioResponse"></part>
</message>
<message name="Exception">
<part name="fault" element="tns:Exception"></part>
</message>
<message name="insertarInfoPaciente">
<part name="parameters" element="tns:insertarInfoPaciente"></part>
</message>
<message name="insertarInfoPacienteResponse">
<part name="parameters" element="tns:insertarInfoPacienteResponse"></part>
</message>
<message name="obtenerInfoPaciente">
<part name="parameters" element="tns:obtenerInfoPaciente"></part>
</message>
<message name="obtenerInfoPacienteResponse">
<part name="parameters" element="tns:obtenerInfoPacienteResponse"></part>
</message>
<message name="insertarDiagnosticoImagen">
<part name="parameters" element="tns:insertarDiagnosticoImagen"></part>
</message>
<message name="insertarDiagnosticoImagenResponse">
<part name="parameters"
element="tns:insertarDiagnosticoImagenResponse"></part>
</message>
<message name="obtenerDiagnosticos">
<part name="parameters" element="tns:obtenerDiagnosticos"></part>
</message>
<message name="obtenerDiagnosticosResponse">
<part name="parameters" element="tns:obtenerDiagnosticosResponse"></part>
</message>
<portType name="N95WS">
<operation name="loginUsuario">
<input message="tns:loginUsuario"></input>
<output message="tns:loginUsuarioResponse"></output>
<fault message="tns:Exception" name="Exception"></fault>
</operation>
<operation name="insertarInfoPaciente">
<input message="tns:insertarInfoPaciente"></input>
<output message="tns:insertarInfoPacienteResponse"></output>
<fault message="tns:Exception" name="Exception"></fault>
</operation>
<operation name="obtenerInfoPaciente">
<input message="tns:obtenerInfoPaciente"></input>
<output message="tns:obtenerInfoPacienteResponse"></output>
<fault message="tns:Exception" name="Exception"></fault>
</operation>
<operation name="insertarDiagnosticoImagen">
<input message="tns:insertarDiagnosticoImagen"></input>
<output message="tns:insertarDiagnosticoImagenResponse"></output>
<fault message="tns:Exception" name="Exception"></fault>
</operation>
<operation name="obtenerDiagnosticos">
<input message="tns:obtenerDiagnosticos"></input>
<output message="tns:obtenerDiagnosticosResponse"></output>
<fault message="tns:Exception" name="Exception"></fault>
</operation>
</portType>
<binding name="N95WSPortBinding" type="tns:N95WS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"></soap:binding>
<operation name="loginUsuario">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"></soap:fault>
</fault>
</operation>
<operation name="insertarInfoPaciente">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"></soap:fault>
</fault>
</operation>
<operation name="obtenerInfoPaciente">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"></soap:fault>
</fault>
</operation>
<operation name="insertarDiagnosticoImagen">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"></soap:fault>
</fault>
</operation>
<operation name="obtenerDiagnosticos">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"></soap:fault>
</fault>
</operation>
</binding>
<service name="N95WSService">
<port name="N95WSPort" binding="tns:N95WSPortBinding">
<soap:address location="http://localhost:8080/N95WS/N95WSService
"></soap:address>
</port>
</service>
</definitions>


Thanks
-- 
Julian Osorio Amaya
Universidad Libre.
Ingenierķa de Sistemas.
Bogota - Colombia