Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Sending Complex Objects Using SOAP
Sending Complex Objects Using SOAP [message #170633] Mon, 05 June 2006 20:18 Go to next message
Eclipse UserFriend
Originally posted by: yitzchok.rentmagic.ca

Hi.
I want to use Axis to return a simple class. When i try to generate the
Web Services I get 3 error messages. (Plus the error messege that TomCat 5
does not support Port Listening which is not true and I think I filed a
bug report on it - "IWAB0002I Apache Tomcat v5.5 does not support port
monitoring.")
First I get twice "Error in generating sample JSP" then an error message
window with no text message ("") with [OK/Details] and a lot of details.
Can someone just post code for me that will let me get a Complex Object
back from an Axis server using SOAP?

Using wtp-all-in-one-sdk-R-1.0.2-200604200208-win32.zip
-------------------------------------------------
Class code
-------------------------------------------------
public class MyClass
{
public MyClass() {};
protected int integer;
protected String str;
public String getStr() { return str;}
public int getInteger() { return integer;}
public void setStr(String str1) { str =str1;}
public void setInteger(int i) { integer = i;}

}
-------------------------------------------------
The servlet code (Dynamic Web Project)
-------------------------------------------------
public class serv {
public MyClass echo (int celsius)
{
MyClass t = new MyClass();
t.setInteger(celsius);
return t;
}
}
-------------------------------------------------
The client code:
-------------------------------------------------
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.ksoap2.*;
import org.ksoap2.serialization.*;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

public class test {
public static void main(String[] args) throws IOException,
XmlPullParserException {
SoapObject soap = new SoapObject("http://wtp", "echo");
soap.addProperty("celsius", 64);
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = soap;
HttpTransportSE ht = new
HttpTransportSE("http://localhost:10477/serve/services/serv");
ht.call("http://schemas.xmlsoap.org/soap/envelope/", envelope);
SoapObject soapIn = (SoapObject)envelope.bodyIn;
System.out.print(soapIn.toString());
}
}
-------------------------------------------------
Re: Sending Complex Objects Using SOAP [message #170880 is a reply to message #170633] Thu, 08 June 2006 17:36 Go to previous message
Kathy Chan is currently offline Kathy ChanFriend
Messages: 93
Registered: July 2009
Member
Hi Isaac,

It looks like you've found a bug in the sample JSP generation. Could you
please open a bugzilla with the classes you used and the steps to reproduce
the problem? Thanks!

Regards,

Kathy Chan

"Isaac Good" <yitzchok@rentmagic.ca> wrote in message
news:c258f5ca1b6a42e63dd83812496407fe$1@www.eclipse.org...
> Hi.
> I want to use Axis to return a simple class. When i try to generate the
> Web Services I get 3 error messages. (Plus the error messege that TomCat 5
> does not support Port Listening which is not true and I think I filed a
> bug report on it - "IWAB0002I Apache Tomcat v5.5 does not support port
> monitoring.")
> First I get twice "Error in generating sample JSP" then an error message
> window with no text message ("") with [OK/Details] and a lot of details.
> Can someone just post code for me that will let me get a Complex Object
> back from an Axis server using SOAP?
>
> Using wtp-all-in-one-sdk-R-1.0.2-200604200208-win32.zip
> -------------------------------------------------
> Class code
> -------------------------------------------------
> public class MyClass
> {
> public MyClass() {};
> protected int integer;
> protected String str;
> public String getStr() { return str;}
> public int getInteger() { return integer;}
> public void setStr(String str1) { str =str1;}
> public void setInteger(int i) { integer = i;}
>
> }
> -------------------------------------------------
> The servlet code (Dynamic Web Project)
> -------------------------------------------------
> public class serv {
> public MyClass echo (int celsius)
> {
> MyClass t = new MyClass();
> t.setInteger(celsius);
> return t;
> }
> }
> -------------------------------------------------
> The client code:
> -------------------------------------------------
> import java.io.BufferedReader;
> import java.io.IOException;
> import java.io.InputStreamReader;
> import org.ksoap2.*;
> import org.ksoap2.serialization.*;
> import org.ksoap2.transport.HttpTransportSE;
> import org.xmlpull.v1.XmlPullParserException;
>
> public class test {
> public static void main(String[] args) throws IOException,
> XmlPullParserException {
> SoapObject soap = new SoapObject("http://wtp", "echo");
> soap.addProperty("celsius", 64);
> SoapSerializationEnvelope envelope =
> new SoapSerializationEnvelope(SoapEnvelope.VER11);
> envelope.bodyOut = soap;
> HttpTransportSE ht = new
> HttpTransportSE("http://localhost:10477/serve/services/serv");
> ht.call("http://schemas.xmlsoap.org/soap/envelope/", envelope);
> SoapObject soapIn = (SoapObject)envelope.bodyIn;
> System.out.print(soapIn.toString());
> }
> }
> -------------------------------------------------
>
Previous Topic:Abnormal exit
Next Topic:WebServices using WTP
Goto Forum:
  


Current Time: Thu Apr 25 12:04:18 GMT 2024

Powered by FUDForum. Page generated in 0.02964 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top