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...)
>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.