cancel
Showing results for 
Search instead for 
Did you mean: 

EJB as Web Service doesnot Return value

Former Member
0 Kudos

Hi All,

I have cerated an EJB Wihich fetches the vendor data from MDM database,this EJB I have exposed as a web service.

This Ejb returns an array of object of java class which contains 7 attributes,

Like Vendor number,

City,

country,

Name,

company code,

purchase organization.

Now when i debug the EJB it is returning proper values with all attribute.

But in the web services response am able to get same number of records but attribute list is less...like I am getting the value of only City ,country and Vendor Number although EJB is returning all the values.

If any one can help me with the problem.

Thanks in advance.

Shruti

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hai,

Is that returning java class is having setters and getters, and implementing serializable.

look like

public class beanToTest implements Serializable{

private String vendornumber=null;

private String city=null;

private String country=null;

private String name=null;

private String companyCode=null;

private String purchaseOrganization=null;

/**

  • @return

*/

public String getCity() {

return city;

}

/**

  • @return

*/

public String getCompanyCode() {

return companyCode;

}

/**

  • @return

*/

public String getCountry() {

return country;

}

/**

  • @return

*/

public String getName() {

return name;

}

/**

  • @return

*/

public String getPurchaseOrganization() {

return purchaseOrganization;

}

/**

  • @return

*/

public String getVendornumber() {

return vendornumber;

}

/**

  • @param string

*/

public void setCity(String string) {

city = string;

}

/**

  • @param string

*/

public void setCompanyCode(String string) {

companyCode = string;

}

/**

  • @param string

*/

public void setCountry(String string) {

country = string;

}

/**

  • @param string

*/

public void setName(String string) {

name = string;

}

/**

  • @param string

*/

public void setPurchaseOrganization(String string) {

purchaseOrganization = string;

}

/**

  • @param string

*/

public void setVendornumber(String string) {

vendornumber = string;

}

}

Regards,

naga

Former Member
0 Kudos

Hi Raju,

ya the java class is serializable only...

The code of my java file is exactly same as what you have written.

And I am able to get some values in Web services but not all,

So i am not able to figure out the problem.

Former Member
0 Kudos

Hi Sruthi,

Have you checked that on navigator.

Se whether not visible values are having getter methods.

Regards,

Naga

Former Member
0 Kudos

Hi Raju,

Thanks for quick reply.

I Checked that also, All my getter methods can be seen in navigator also.

But still I am not able to figure out the problem....if u can suggest or help me with this..

Thanks and regards.

Shruti.

Former Member
0 Kudos

Hai Sruthi,

In your Session bean Business Method. have you doing like this.

collection coll=getDatafromBackend();
Iterator itr=coll.iterator();
ReturnClass array[]=new ReturnClass[coll.size()];
int i=0;
while(itr.hasNext()){
ReturnClass  cls=new ReturnClass ();
cls.setData(itr.next());
array<i>=cls;

}

Regards,

Naga

Former Member
0 Kudos

Hi Raju,

I am doing the same thing....

I am getting the value from MDM data base and setting it in the java class object..

And i am using array list only.

Values are coming in EJB...

When i am returning the class......in return value....it shows all data...

Former Member
0 Kudos

Hi,

company code,

purchase organization. these are also type of strings or any.

can you post your wsdl file once

Regards,

Naga

abhijeet_mukkawar
Active Contributor
0 Kudos

Shruti,

have you changed the dictionary structure ?

If yes then I think you need to create web service again , since the definition of Virtual Interface must of older project. The problem you are facing is almost because of improper virtual interface definition.

hope it helps

regards