Using X-UP Models in an XPLATFORM Application

This chapter describes how to develop an XPLATFORM application using a model created in the section Model Development Using SAP RFC Invoke. XPLATFORM applications are developed using the UX-Studio tool. Please refer to the section Deploy and Undeploy for model development and deployment methods.

This chapter has been written with the assumption that the user is familiar with XPLATFORM and UX-Studio. Therefore, certain details have been omitted for basic XPLATFORM application development stages.

The application development stages described in this chapter for an X-UP model that uses UX-Studio are as follows:

TypeDefinition - Service Registration

  1. Add a service in TypeDefinition as shown in the image below.

Field Name

Field Value

Prefix

‘XUP_SERVER’

Enter a prefix used in the model call script code.

Type

‘bs’

To call an X-UP model, “bs” must be selected as the type.

URL

‘http://localhost:8080/xup/’

Enter the X-UP Server URL.

ServiceList

‘FrontControllerServlet.do?service=serviceInfo&target=modelList’

Enter the service list call URL.

DatasetLayout

‘FrontControllerServlet.do?service=serviceInfo&target=modelLayout’

Enter the URL for I/O information acquisition.

Model List and Interface Import

  1. [Refresh] the service in Project Explorer, and retrieve the X-UP Server's model list.

The imported model list displays models according to domains.

A domain is a namespace to distinguish between models and is set with the X-UP Builder project name. In other words, a single X-UP project corresponds to a single model domain.

  1. Refresh the INVOKE_SAP_RFC model in the model list and retrieve the interface information (I/O).

Model Call Script Creation

  1. Drag the output dataset from the model's interface information in Project Explorer, and drop it into the Invisible Objects Editor.

  1. Create a model call code in the Script Editor as shown below.

function btnSearch_onclick(obj:Button,  e:ClickEventInfo)
{
	var svcparam 	= "domain=" 	+ "NexawebInc"   		// Domain name
					+ "&model=" 	+ "INVOKE_SAP_RFC"  	// Model name
					+ "&format=" 	+ "xml"
					+ "&version=" 	+ "xplatform";

	var svcUrl = "XUP_SERVER::FrontControllerServlet.do"+
								"?service=xupservice&" + svcparam;
    
    // Model Input parameters
    var strInDatasets = "";
    var strOutDatasets = "FLIGHT_LIST1=FLIGHT_LIST1";
    var strArgument = "";
    
	transaction("searchFlightList", svcUrl, strInDatasets, strOutDatasets
										, strArgument, "fn_Transaction_Callback");
}

function fn_Transaction_Callback(strSvcID, nErrorCode, strErrorMag)
{
	if(nErrorCode < 0) {
		alert(strErrorMag);
		return
	}
	
	if(strSvcID == "searchFlightList") {
		trace(FLIGHT_LIST1.saveXML());
	} 

}

The information for calling an X-UP model in XPLATFORM is as follows:


Service URL:

http://[host]:[port]/xup/FrontControllerServlet.do?service=xupservice&domain=[domain name]

&model=[model name]&format=xml&version=xplatform


Input parameter: Transmit input parameters required by each model with GET or POST.

  1. Run Quick View and verify the results.