You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by lc...@unina.it on 2004/07/29 10:37:39 UTC

PLEASE HELP ME!!! JSR 172 and axis

I have a new problem, I don't know if it is axis dependent but I hope to
found help here.


I'm working with WTK 2.1 and JSR 172. I have published a service (using axis
1.2beta) having the following WSDL
**************************************************
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2beta
Built on Mar 31, 2004 (12:47:03 EST)-->
 <wsdl:types>
  <schema elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace"
xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="sayHello">
    <complexType/>
   </element>
   <element name="sayHelloResponse">
    <complexType>
     <sequence>
      <element name="sayHelloReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
  </schema>
 </wsdl:types>

   <wsdl:message name="sayHelloResponse">

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

   </wsdl:message>

   <wsdl:message name="sayHelloRequest">

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

   </wsdl:message>

   <wsdl:portType name="EducatoInt">

      <wsdl:operation name="sayHello">

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

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

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="educatoSoapBinding" type="impl:EducatoInt">

      <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="sayHello">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="sayHelloRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="sayHelloResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="EducatoIntService">

      <wsdl:port binding="impl:educatoSoapBinding" name="educato">

         <wsdlsoap:address location="http://localhost/axis/services/educato"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

*************************************************************

I'have generated client Stubs by using J2ME Wireless Toolkit. Then I'have
generated a simple client as follow:

*************************************************************
import educato.*;
import javax.xml.rpc.*;
import java.rmi.RemoteException;

public class Client{

final static String serviceURL = "http://127.0.0.1/axis/services/educato";

public static void main(String args[]){
try{
EducatoInt_Stub e = new EducatoInt_Stub();
e._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, serviceURL);
e._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));

String risposta = e.sayHello();
System.out.println("Ha risposto: " + risposta +"!!!");
}catch(Exception e){
e.printStackTrace();
}
}
}
*************************************************
Now the problem: executing the client by

java Client

I obtain the following error message:

******************************
java.rmi.MarshalException: Invalid Element in Response: sayHelloReturn
at
com.sun.j2mews.xml.rpc.SOAPDecoder.decode(Ljavax/microedition/xml/rpc/Type;Ljava/io/InputStream;Ljava/lang/String;J)Ljava/lang/Object;(Unknown
Source)
at
com.sun.j2mews.xml.rpc.OperationImpl.invoke(Ljava/lang/Object;)Ljava/lang/Object;(Unknown
Source)
at
educato.EducatoInt_Stub.sayHello()Ljava/lang/String;(EducatoInt_Stub.java:77)
at Client.main([Ljava/lang/String;)V(Client.java:15)
*****************************


I need help...
Luigi Coppolino



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Re: PLEASE HELP ME!!! JSR 172 and axis

Posted by lc...@unina.it.
Hi, 
I have used tcpmonitor and have found the following SOAP request and response

***************
REQUEST:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:tns="http://DefaultNamespace">
<soap:Body>
	<tns:Somma>
		<tns:in0>3</tns:in0>
		<tns:in1>7</tns:in1>
	</tns:Somma>
</soap:Body>
</soap:Envelope>

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <SommaResponse xmlns="http://DefaultNamespace">
   <SommaReturn xmlns="">10</SommaReturn>
  </SommaResponse>
 </soapenv:Body>
</soapenv:Envelope>

****************
I'm not very practice with SOAP so I haven't any idea about actual problem
cause.
Any of you has some idea? 
I see in SommaReturn xmlns="" and I'm not so sure that it work...
I read on axis User Guide about the problem of untyped response...in WTK stub
client there isn't a setResponseType method so can be this the problem...

Is it possible that I can't access to a service published with axis by Sun's
Wirless Tool Kit?

thanks for your help...
Luigi Coppolino


Scrive Chandrasegaram Jeyakumaran <jk...@opensource.lk>:

> Hi,
> 
> I couldn't really get your problem. But have you checked the SOAP using
> the tcpmonitor.
> That may give you a clear idea of the problem.
> Because you will clearly know the elements in the response SOAP.
> Try the tcpmonitor and check whether the expected result with the format
> arrives.Then only you can find whether it is a problem with the axis
> webservice deployment or with the stubs.
> 
> regards,
> Jeyakumaran
> 
> > I have a new problem, I don't know if it is axis dependent but I hope to
> > found help here.
> >
> >
> > I'm working with WTK 2.1 and JSR 172. I have published a service (using
> > axis
> > 1.2beta) having the following WSDL
> > **************************************************
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:definitions targetNamespace="http://DefaultNamespace"
> > xmlns:apachesoap="http://xml.apache.org/xml-soap"
> > xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace"
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > <!--WSDL created by Apache Axis version: 1.2beta
> > Built on Mar 31, 2004 (12:47:03 EST)-->
> >  <wsdl:types>
> >   <schema elementFormDefault="qualified"
> > targetNamespace="http://DefaultNamespace"
> > xmlns="http://www.w3.org/2001/XMLSchema">
> >    <element name="sayHello">
> >     <complexType/>
> >    </element>
> >    <element name="sayHelloResponse">
> >     <complexType>
> >      <sequence>
> >       <element name="sayHelloReturn" type="xsd:string"/>
> >      </sequence>
> >     </complexType>
> >    </element>
> >   </schema>
> >  </wsdl:types>
> >
> >    <wsdl:message name="sayHelloResponse">
> >
> >       <wsdl:part element="impl:sayHelloResponse" name="parameters"/>
> >
> >    </wsdl:message>
> >
> >    <wsdl:message name="sayHelloRequest">
> >
> >       <wsdl:part element="impl:sayHello" name="parameters"/>
> >
> >    </wsdl:message>
> >
> >    <wsdl:portType name="EducatoInt">
> >
> >       <wsdl:operation name="sayHello">
> >
> >          <wsdl:input message="impl:sayHelloRequest"
> > name="sayHelloRequest"/>
> >
> >          <wsdl:output message="impl:sayHelloResponse"
> > name="sayHelloResponse"/>
> >
> >       </wsdl:operation>
> >
> >    </wsdl:portType>
> >
> >    <wsdl:binding name="educatoSoapBinding" type="impl:EducatoInt">
> >
> >       <wsdlsoap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> >
> >       <wsdl:operation name="sayHello">
> >
> >          <wsdlsoap:operation soapAction=""/>
> >
> >          <wsdl:input name="sayHelloRequest">
> >
> >             <wsdlsoap:body use="literal"/>
> >
> >          </wsdl:input>
> >
> >          <wsdl:output name="sayHelloResponse">
> >
> >             <wsdlsoap:body use="literal"/>
> >
> >          </wsdl:output>
> >
> >       </wsdl:operation>
> >
> >    </wsdl:binding>
> >
> >    <wsdl:service name="EducatoIntService">
> >
> >       <wsdl:port binding="impl:educatoSoapBinding" name="educato">
> >
> >          <wsdlsoap:address
> > location="http://localhost/axis/services/educato"/>
> >
> >       </wsdl:port>
> >
> >    </wsdl:service>
> >
> > </wsdl:definitions>
> >
> > *************************************************************
> >
> > I'have generated client Stubs by using J2ME Wireless Toolkit. Then I'have
> > generated a simple client as follow:
> >
> > *************************************************************
> > import educato.*;
> > import javax.xml.rpc.*;
> > import java.rmi.RemoteException;
> >
> > public class Client{
> >
> > final static String serviceURL = "http://127.0.0.1/axis/services/educato";
> >
> > public static void main(String args[]){
> > try{
> > EducatoInt_Stub e = new EducatoInt_Stub();
> > e._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, serviceURL);
> > e._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
> >
> > String risposta = e.sayHello();
> > System.out.println("Ha risposto: " + risposta +"!!!");
> > }catch(Exception e){
> > e.printStackTrace();
> > }
> > }
> > }
> > *************************************************
> > Now the problem: executing the client by
> >
> > java Client
> >
> > I obtain the following error message:
> >
> > ******************************
> > java.rmi.MarshalException: Invalid Element in Response: sayHelloReturn
> > at
> >
>
com.sun.j2mews.xml.rpc.SOAPDecoder.decode(Ljavax/microedition/xml/rpc/Type;Ljava/io/InputStream;Ljava/lang/String;J)Ljava/lang/Object;(Unknown
> > Source)
> > at
> >
>
com.sun.j2mews.xml.rpc.OperationImpl.invoke(Ljava/lang/Object;)Ljava/lang/Object;(Unknown
> > Source)
> > at
> >
> educato.EducatoInt_Stub.sayHello()Ljava/lang/String;(EducatoInt_Stub.java:77)
> > at Client.main([Ljava/lang/String;)V(Client.java:15)
> > *****************************
> >
> >
> > I need help...
> > Luigi Coppolino
> >
> >
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >
> 
> 
> Lanka Software Foundation
> Promoting opensource in Srilanka
> 




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Re: PLEASE HELP ME!!! JSR 172 and axis

Posted by Chandrasegaram Jeyakumaran <jk...@opensource.lk>.
Hi,

I couldn't really get your problem. But have you checked the SOAP using
the tcpmonitor.
That may give you a clear idea of the problem.
Because you will clearly know the elements in the response SOAP.
Try the tcpmonitor and check whether the expected result with the format
arrives.Then only you can find whether it is a problem with the axis
webservice deployment or with the stubs.

regards,
Jeyakumaran

> I have a new problem, I don't know if it is axis dependent but I hope to
> found help here.
>
>
> I'm working with WTK 2.1 and JSR 172. I have published a service (using
> axis
> 1.2beta) having the following WSDL
> **************************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://DefaultNamespace"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.2beta
> Built on Mar 31, 2004 (12:47:03 EST)-->
>  <wsdl:types>
>   <schema elementFormDefault="qualified"
> targetNamespace="http://DefaultNamespace"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <element name="sayHello">
>     <complexType/>
>    </element>
>    <element name="sayHelloResponse">
>     <complexType>
>      <sequence>
>       <element name="sayHelloReturn" type="xsd:string"/>
>      </sequence>
>     </complexType>
>    </element>
>   </schema>
>  </wsdl:types>
>
>    <wsdl:message name="sayHelloResponse">
>
>       <wsdl:part element="impl:sayHelloResponse" name="parameters"/>
>
>    </wsdl:message>
>
>    <wsdl:message name="sayHelloRequest">
>
>       <wsdl:part element="impl:sayHello" name="parameters"/>
>
>    </wsdl:message>
>
>    <wsdl:portType name="EducatoInt">
>
>       <wsdl:operation name="sayHello">
>
>          <wsdl:input message="impl:sayHelloRequest"
> name="sayHelloRequest"/>
>
>          <wsdl:output message="impl:sayHelloResponse"
> name="sayHelloResponse"/>
>
>       </wsdl:operation>
>
>    </wsdl:portType>
>
>    <wsdl:binding name="educatoSoapBinding" type="impl:EducatoInt">
>
>       <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
>       <wsdl:operation name="sayHello">
>
>          <wsdlsoap:operation soapAction=""/>
>
>          <wsdl:input name="sayHelloRequest">
>
>             <wsdlsoap:body use="literal"/>
>
>          </wsdl:input>
>
>          <wsdl:output name="sayHelloResponse">
>
>             <wsdlsoap:body use="literal"/>
>
>          </wsdl:output>
>
>       </wsdl:operation>
>
>    </wsdl:binding>
>
>    <wsdl:service name="EducatoIntService">
>
>       <wsdl:port binding="impl:educatoSoapBinding" name="educato">
>
>          <wsdlsoap:address
> location="http://localhost/axis/services/educato"/>
>
>       </wsdl:port>
>
>    </wsdl:service>
>
> </wsdl:definitions>
>
> *************************************************************
>
> I'have generated client Stubs by using J2ME Wireless Toolkit. Then I'have
> generated a simple client as follow:
>
> *************************************************************
> import educato.*;
> import javax.xml.rpc.*;
> import java.rmi.RemoteException;
>
> public class Client{
>
> final static String serviceURL = "http://127.0.0.1/axis/services/educato";
>
> public static void main(String args[]){
> try{
> EducatoInt_Stub e = new EducatoInt_Stub();
> e._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, serviceURL);
> e._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
>
> String risposta = e.sayHello();
> System.out.println("Ha risposto: " + risposta +"!!!");
> }catch(Exception e){
> e.printStackTrace();
> }
> }
> }
> *************************************************
> Now the problem: executing the client by
>
> java Client
>
> I obtain the following error message:
>
> ******************************
> java.rmi.MarshalException: Invalid Element in Response: sayHelloReturn
> at
> com.sun.j2mews.xml.rpc.SOAPDecoder.decode(Ljavax/microedition/xml/rpc/Type;Ljava/io/InputStream;Ljava/lang/String;J)Ljava/lang/Object;(Unknown
> Source)
> at
> com.sun.j2mews.xml.rpc.OperationImpl.invoke(Ljava/lang/Object;)Ljava/lang/Object;(Unknown
> Source)
> at
> educato.EducatoInt_Stub.sayHello()Ljava/lang/String;(EducatoInt_Stub.java:77)
> at Client.main([Ljava/lang/String;)V(Client.java:15)
> *****************************
>
>
> I need help...
> Luigi Coppolino
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>


Lanka Software Foundation
Promoting opensource in Srilanka