cancel
Showing results for 
Search instead for 
Did you mean: 

Importing Model: Response.setResult?

Former Member
0 Kudos

Hello,

i created a web service including an ejb bean which provides the method getAllData() with return type String[][].

After this i created a web service model for accessing the web dynpro. I am importing a web service model via url. The NWDS automatically creates the java code including the following lines:

Response = new Response_TelBuchWebServiceDisplayViDocument_getAllData();

Response.setResult(logicalPort.getAllData());

The problem is, that the Method setResult is not known:

The method setResult(String[][]) is undefined for the type Response_TelBuchWebServiceDisplayViDocument_getAllData.

I do not know where to start with this problem,

any hints?

Thanks,

André

Accepted Solutions (0)

Answers (3)

Answers (3)

raghuvirab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Andre,

Currently the webservice model supports only one dimensional arrays. Since you are using the 2 dimensional arrays as the return type, the problem is being caused.

Regards,

Raghuvira

Former Member
0 Kudos

Hi,

i installed SP10 an tried to import the model again - i get the same error.

All i want is to display data from a table in database in a WebDynpro table (UI Element).

What would be a good return type of the EJB method i want to use?

Maybe the problem is caused by me.

Regards,

André

Former Member
0 Kudos

I am having similar problems.

I created a Java bean to hold some employee data:


package areva.eeds.emp.bo;

import java.io.Serializable;

public class EmployeeData implements Serializable {
	String _employeeID;
	String _firstName;
	String _middleName;
	String _lastName;
	
	public EmployeeData(String employeeID, String firstName, String middleName, String lastName) {
		_employeeID = employeeID;
		_firstName = firstName;
		_middleName = middleName;
		_lastName = lastName;
	}
	
	/**
	 * @return
	 */
	public String get_employeeID() {
		return _employeeID;
	}

	/**
	 * @return
	 */
	public String get_firstName() {
		return _firstName;
	}

	/**
	 * @return
	 */
	public String get_lastName() {
		return _lastName;
	}

	/**
	 * @return
	 */
	public String get_middleName() {
		return _middleName;
	}

	/**
	 * @param string
	 */
	public void set_employeeID(String string) {
		_employeeID = string;
	}

	/**
	 * @param string
	 */
	public void set_firstName(String string) {
		_firstName = string;
	}

	/**
	 * @param string
	 */
	public void set_lastName(String string) {
		_lastName = string;
	}

	/**
	 * @param string
	 */
	public void set_middleName(String string) {
		_middleName = string;
	}
}

I created a stateless session bean with a method to return an array of EmployeeData beans:


/**
 * Business Method.
 */
public EmployeeData[] getEmployeeListByCostCenter(String costCenter) {
	ArrayList list = new ArrayList();
	Statement stmt = null;
	ResultSet rst = null;

	try {
		if (ds != null) {
			conn = ds.getConnection();
			if (conn != null) {
				stmt = conn.createStatement();
				rst =
					stmt.executeQuery(
						"SELECT eeds_emp_id, "
							+ "eeds_fname, "
							+ "eeds_mname, "
							+ "eeds_lname "
							+ "FROM eeds_emp "
							+ "where eeds_costcenter = '"
							+ costCenter
							+ "'");
				while (rst.next()) {
					EmployeeData ed = new EmployeeData(rst.getString(1),
													   rst.getString(2),
													   rst.getString(3),
													   rst.getString(4));
					list.add(ed);
				}
				return (EmployeeData[]) list.toArray(new EmployeeData[] {});
			} else {
				return null;
			}
		} else {
			return null;
		}
	} catch (Exception ex) {
		ex.printStackTrace();
		return null;
	} finally {
		try {
			stmt.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}

I created a web service from the EJB, tested, and the WS return the correct number of EMployeeData beans. However, when I try to create a WDP model from the WS and then apply a table template, I again get the correct number of rows in the table, but the columns are comming back empty.

HELLLPPPP!!!!

Former Member
0 Kudos

>After this i created a web service model for accessing >the web dynpro. I am importing a web service model via >url. The NWDS automatically creates the java code >including the following lines:

>Response = new

Response_TelBuchWebServiceDisplayViDocument_getAllData();

> Response.setResult(logicalPort.getAllData());

Do you mean the code generated in getResult method?

What version of NDS are you using? I have WAS 6.40 SP9 and the code I thing you are talking about is commented there.

Hope it helps.

Victor.

Former Member
0 Kudos

Hi Victor,

i am using sp09.

The gnerated Code is from the method public void execute() in the public class Request_TelBuchWebServiceDisplayViDocument_getAllData

Any ideas?

Thx,

André

Former Member
0 Kudos

Hi,

I checked execute method, your code is ok. getAllData() shoudl return the original bean method not String[][] but anyway the code is ok.

Adittional point is that it wouldn't help you to find problem in the generated class, it has no sense to change them since WD runtime will regenerate them again and your changes whould be lost. Try to reimport the model, may be it will change somthing.

In general, I made a number of pilot project using different Web Service and I have a lot of problem with this model, A lot of things are not working, in some cases the model is generated wrong. May be some gurus from SAP will see this message and clarify things for us. I know that some of them read this forum.

Best Regards,

Victor.

Former Member
0 Kudos

Better than waiting, please open OSS messages for those problems.

Armin

Former Member
0 Kudos

Hi Armin,

I have an open oss message regarding my problem for a 3 weeks. It is still in process.

Befor opening OSS I tried to solve the problem on SDN, here the link:

In addition I had another problem a couple of month ago, see this thread:

so, I opend oss message and was told that this would be fixed on SP9. However, on SP9 it somtimes works and sometimes not and I acctualy didn't understand yet when and why (I can keep you updated if you want).

If you can please provide me with additional info about this model, may be I did and do wrong things, so any additional info would be gratly appritiated.

Best Regards.

Victor.

Message was edited by: Victor Shafran

Former Member
0 Kudos

Hello Victor,

I'm sorry, but I am not involved in the development of the Web service model so I cannot investigate this problem in detail.

Generally, the best way to get problems solved in the next(?) service pack is to open OSS messages with suited priority. Especially, if there is no workaround possible like with bugs in code generation etc.

Armin