axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Meier (JIRA)" <>
Subject [jira] Created: (AXIS-1781) MarshalException, when calling AXIS webservice function from J2ME
Date Wed, 26 Jan 2005 15:56:21 GMT
MarshalException, when calling AXIS webservice function from J2ME

         Key: AXIS-1781
     Project: Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.1    
 Environment: Windows XP SP1, Tomcat 5, Sun WTK 2.1, Axis 1.1, J2ME, JSR-172
    Reporter: Paul Meier
 Attachments: WSTest WTKProject.rar, hallo.class, hallo.jws, hallo.wsdl


I'm a beginner to webservices with Apache Axis. For a project with J2ME that should use webservice
functions I wanted to test an little webservice with Axis and the Sun WTK 2.1.

The name of the test class is and was renamed to hallo.jws and placed in the webapps\axis
folder of Tomcat.
It contains following code: 

public class hallo {
	public int hallo2(String input, int i) {
	System.out.println("input " + input + " " + i);
 	return (i);

Nothing special as you see. The testing of this service in a java client on pc worked fine,
after creating the needed stubs of course. 

To generate the doc/lit style WSDL file for the Sun WTK 2.1 stub generator I used folowing

java -cp ".\axis.jar;.\commons-logging.jar;.\commons-discovery.jar;.\saaj.jar;.\wsdl4j.jar;.\jaxrpc.jar;."
org.apache.axis.wsdl.Java2WSDL -l "http://localhost:8080/axis/hallo.jws" -y WRAPPED -u LITERAL

That worked fine and the wsdl file with following content was created: 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:impl="http://DefaultNamespace"
xmlns:intf="http://DefaultNamespace" xmlns:apachesoap="" xmlns:wsdlsoap=""
xmlns:soapenc="" xmlns:xsd=""
xmlns:wsdl="" xmlns="">
  <schema xmlns="" targetNamespace="http://DefaultNamespace">
   <element name="hallo2">
      <element name="input" type="xsd:string"/>
      <element name="i" type="xsd:int"/>
   <element name="hallo2Response">
      <element name="hallo2Return" type="xsd:int"/>

   <wsdl:message name="hallo2Request">

      <wsdl:part name="parameters" element="impl:hallo2"/>


   <wsdl:message name="hallo2Response">

      <wsdl:part name="parameters" element="impl:hallo2Response"/>


   <wsdl:portType name="hallo">

      <wsdl:operation name="hallo2" parameterOrder="">

         <wsdl:input name="hallo2Request" message="impl:hallo2Request"/>

         <wsdl:output name="hallo2Response" message="impl:hallo2Response"/>



   <wsdl:binding name="halloSoapBinding" type="impl:hallo">

      <wsdlsoap:binding style="document" transport=""/>

      <wsdl:operation name="hallo2">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="hallo2Request">

            <wsdlsoap:body use="literal" namespace="http://DefaultNamespace"/>


         <wsdl:output name="hallo2Response">

            <wsdlsoap:body use="literal" namespace="http://DefaultNamespace"/>




   <wsdl:service name="halloService">

      <wsdl:port name="hallo" binding="impl:halloSoapBinding">

         <wsdlsoap:address location="http://localhost:8080/axis/hallo.jws"/>




The stub generation generated the needed stubs for the midlet, but 2 errors occured: 

warning: R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for soapbind:body:

warning: R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for soapbind:body:

The deletion of " namespace="http://DefaultNamespace" " in the wsdl file led to stub generation
of "hallostub" in src folder without am error message.

The midlet source is almost the same like the example of AxisUserTest last year.
The only changes are the 
import of the hallostub package, the creation of an object of class Hallo named hallo and
initialized with hallo = new Hallo_Stub(); and the function call 
int result = hallo.hallo2("GoodMorning!", 6);
System.out.println("Ergebnis: " + result);
String text = "Result is " + result + ".";
Alert a = new Alert("Result", text, null, AlertType.CONFIRMATION); .

The compilation and packaging (with j2me-ws.jar in lib) worked fine but in neither the SUN
emulator or other emulators like Siemens CX65 or Nokia S40 or S60, the response to the webservice
could be received.  

For instance the Sun emulator sais after calling the service:

java.rmi.MarshalException: Invalid Element in Response: hallo2Return
	at hallostub.Hallo_Stub.hallo2(+82)

The tomcat output windows shows after calling the service: 
input GoodMorning! 6 

I conclude that the webservice has been called correctly, but the answer can not be understood
by the midlet. 
How can this be solved?

Thank you very much for your help.


This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message