Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » webservice
webservice [message #203143] Fri, 26 October 2007 10:44 Go to next message
Eclipse User
Originally posted by: xdzgor.hotmail.com

Hi - in general is it possible to return a "custom type" from a java
webservice? I mean for example a simple class such as

public class MyClass {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

I have not been able to get this to work using Axis2 - my client which is
a c# application always recieves a MyClass object with a null name. If I
simply return a String from my web-service method then that works fine.

Are there any general pitfalls with writing webservices in java? (I have
written several with Visual Studio c#, and this is easy - you click on the
"make webservice project" button...)

Thanks,
Peter
Re: webservice [message #203304 is a reply to message #203143] Mon, 29 October 2007 12:11 Go to previous message
Lawrence Mandel is currently offline Lawrence Mandel
Messages: 486
Registered: July 2009
Senior Member
Hi Peter,

>Hi - in general is it possible to return a "custom type" from a java
>webservice? I mean for example a simple class such as
>
>public class MyClass {
> private String name;
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
>}

Yes it is.

>I have not been able to get this to work using Axis2 - my client which
is
>a c# application always recieves a MyClass object with a null name. If I
>simply return a String from my web-service method then that works fine.

I'm not sure how Axis2 generates Web services. As an alternative method,
you can develop your service top down, describing your service first by
creating a WSDL document and then generating stub code that you can hook
up to your objects.

>Are there any general pitfalls with writing webservices in java? (I have
>written several with Visual Studio c#, and this is easy - you click on
the
>"make webservice project" button...)

There are definitely places where people go wrong (I see a lot of invalid
XML schemas) because of complexity but no limitations of Java Web
services.

Lawrence
Previous Topic:JSP Web Service Client test facility option missing?
Next Topic:Method DependencyManager.getModStamp missing
Goto Forum:
  


Current Time: Tue Jul 22 19:50:42 EDT 2014

Powered by FUDForum. Page generated in 0.01554 seconds