cancel
Showing results for 
Search instead for 
Did you mean: 

Testing Web Service in WS navigator

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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;
	}
}

snehal_kendre
Active Contributor
0 Kudos

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.