cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service input parms

former_member540174
Participant
0 Kudos

I have an XI web service I am utilizing via the Adaptive Web Service Model. This service requires that I send some input parms. I'm not quite sure how to get the parms into the request object. I reviewed the tutorial and the bugger doesn't do that via code but instead does it via mapping context to view context.

Here is my Context node in the component controller


Context
   Request_SelectEmployeeTime
       EmployeeTime_Select
           SELECT
               EMPLID
                   $0023SimpleContent
       Response
           EmployeeTime_Data
               Statement_Response
                   Row
                      ATTIO_FLG
                      ATTNC_TS
                      DEVICE
                      EMPLID
                      POST_LOC
                      REVD_BY
                      REVD_TS

Code I have so far is


Request_EmployeeTime_Select_Sync_OB requestMO = wdContext.currentRequest_SelectEmployeeTimeElement().modelObject();
requestMO.wdSetInvocationLogEnabled(logger.beDebug() ? true : false);
	
try
{
  wdContext.nodeRequest_SelectEmployeeTime().bind(requestMO);
  wdContext.currentRequest_SelectEmployeeTimeElement().modelObject().execute();
  wdContext.nodeResponse().invalidate();
  wdComponentAPI.getMessageManager().reportSuccess("Executed and invalidated " + String.valueOf(wdContext.nodeRow().size()));
}
.....

Any guidance is appreaciated!

Diane

Edited by: Diane Fuller on Aug 19, 2008 10:38 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member540174
Participant
0 Kudos

Ok Here is what I had to do. I had to create objects for each level. Then each object had to be set into the next higher up object in my chain. Several of the objects were lists (allowing me to create several keys to make complex where clauses see http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm


	Request_EmployeeTime_Select_Sync_OB requestMO = 
        wdContext.currentRequest_SelectEmployeeTimeElement().modelObject();
	EmployeeTime_Select EmployeeTime_SelectMO = new EmployeeTime_Select(model);
	SELECT selectMO = new SELECT(model);
	EMPLID emplIdMO = new EMPLID(model);
	
//	TODO hardcoded person 60617
	emplIdMO.set$0023SimpleContent("60617");
	wdComponentAPI.getMessageManager().reportSuccess("About to get do WS for " 
        + emplIdMO.get$0023SimpleContent());

	listEmpl.add(emplIdMO);
	selectMO.setEMPLID(listEmpl);
	
	listSelect.add(selectMO);
	EmployeeTime_SelectMO.setSELECT(listSelect);

	requestMO.setEmployeeTime_Select(EmployeeTime_SelectMO);
		
	requestMO.wdSetInvocationLogEnabled(logger.beDebug() ? true : false);
	
	try
	{
		wdContext.nodeRequest_SelectEmployeeTime().bind(requestMO);
		wdContext.currentRequest_SelectEmployeeTimeElement().modelObject().execute();
		wdContext.nodeResponse().invalidate();
	}
	catch(Exception ex)
	{
		wdComponentAPI.getMessageManager().reportException(ex.getLocalizedMessage(), true);
		this.traceWSInvocation(requestMO, ex);
	}

Former Member
0 Kudos

Hi,

If i understand you want to fill the params without user input, right?

If yes, you can set the parameter requestMO object. Probaly exist a set<YourParameter> method.

Best regards

former_member540174
Participant
0 Kudos

requestMO only has a setter for setEmployeeTime_Select() of type EmployeeTime_Select

So do I have to create the objects all the way down the chain to EMPLID?

Diane

Former Member
0 Kudos

Hi,

In this case yes, you will create a EmployeeTime_Select, fullfill parameters and use setEmployeeTime_Select() before call execute.

Best regards