on 10-10-2008 1:47 PM
Hello, guys.
I have an EJB with @WebService annotation with a method that returns me a List of an entities (List<MyEntity>). When I test it using WS navigator, I always get an exception - navigator knows nothing about MyEntity. Methods with primitive return types work fine. How can I solve that problem?
Thanks in advance.
Hi Borodin,
Try creating a complex type and put your list into that complex type. Then return the complex type instead of the list. In webservices you will not be able to return a list. We also had similar problem with composite applications.
Hope it helps.
Thanks and Regards,
Srinivasan Subbiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check data types of all feils in MyEntity class. Web service will fail if u r hvng Sql or Timestamp date , also raw collection won't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Borodin,
Did you check [this|http://help.sap.com/saphelp_nwce10/helpdata/en/94/91d32be5b8f945a4122ac6119316df/content.htm]?. If the Entity contains supported data types, then try with a wrapper POJO - that is serializable and containing MyEntity with proper getters and setters.
Inshort, replace (List<MyEntity>) with (List<MyEntityPOJO>) as the WebParam where MyEntityPOJO is as shown below.
public class MyEntityPOJO {
MyEntity myEntity;
public MyEntity getMyEntity() {
return myEntity;
}
public void setMyEntity(MyEntity myEntity) {
this.myEntity = myEntity;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
is there any variable of type sql.* like sql.date or etc.....in MyEntity
then you wont be able to use it as return type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.