Simply working with SAP ODATA and Apple

Constantin Frhr. Teuffel von Birkensee, itelligence Bielefeld

What can I learn from this article?
This post informs you about the SAP Netweaver Gateway developer tool for Xcode. From my point of view this tool is really useful for iOS-Developers. As an Expert I ask myself how SAP can be integrated in my apps. It’s actually not difficult at all: at the end of last year, SAP announced its plan to implement communication of mobile devices and its systems. You can find more precise information here. In general, SAP pursues two approaches: use of open data protocol (OData) and mobile business objects (MBO). The following article describes the OData approach.

Where can I find information on ODATA and Sybase API?
Sybase has a large collection of documentation. This has been expanded for development in Objective C and OData. The Sybase documentation provides a starting point for an initial insight, and further information on OData can be found here. It is also very useful to incorporate the SDK into a project and have source-code documentation prepared with the Doxygen tool. Sybase itself uses syntax commands of this tool in its source code, thus obtaining a good API description.

Can the whole process be made easier at all?
SAP has provided developers with a tool for its OS X and Xcode 4.x. The “SAP Netweaver Gateway developer tool for Xcode” tool can be used to create a small app from existing services or generate proxy classes. Accordingly, the proxy classes are suitable for individual projects.

How do I use the proxy classes?
The proxy classes and the associated “.a files” (archive) and “.h files” (header) must be incorporated in the Xcode project. A connection to the gateway can be established easily by importing the proxy classes in the source code.

[sourcecode language=”objc”]
/* Connection */
SDMConnectivityHelper *supConn = [[SDMConnectivityHelper alloc] initWithUsername:@"GatewayUserName" andPassword:@"PassWord"];</code>

LiteSUPUserManager *supUserManager = [supConn
activateSUPModeWithHost:@"SUP-Adress"
andSUPPort:80
andSUPFarmId:@"0"
andAppId:@"AppID"];

if ([supUserManager isUserRegistered]) {
NSLog(@"SUP user registered");
}
else {
[supUserManager registerUser:@"SUPUserName" withActivationCode:@"SUP Activation Code"];
NSLog(@"SUP User is registered“);
}

/* OData Service Query */
ZIS_SFLIGHTService *service = [[ZIS_SFLIGHTService alloc] init];
[service setServiceDocumentUrl:[LiteSUPAppSettings getApplicationEndPoint]];

ODataQuery *dataQuery = service.BookingCollection;
[paramQuery filter:(@"ID eq ‘0300000000000034’ or ID eq ‘0300000000000027’")];

NSError* error = nil;

NSMutableArray *serviceBookingCollection = [service getBookingCollectionWithData:[[supConn executeBasicSyncRequestWithQuery: dataQuery] responseData] error:nil];

if (!error) {
for (BookingCollection *c in serviceBookingCollection) {

}
}

[/sourcecode]

In general, the proxy classes not only provide direct access to the gateway, but also tunneling through the SUP to the gateway. However, this part is commented out in the source code. Even so, it can be accessed very easily by removing the comment signs (see example).

Summary:
The tool does exactly what its name suggests: it provides the basic structure for back-end programming of an app. Nevertheless, to understand what the proxy classes actually do and how it works, it is necessary to refer to the documentation. The proxy classes are easy to expand and can therefore be adapted to any additional requirements. My recommendation: The gateway service can be tested very quickly and effectively with the tool. It is clearly a project accelerator and makes connection to the back-end easier. I would recommend it to anyone working in this area.

And now it´s on you!
Combining ODATA and the SAP architecture is an entirely online-based process. Use of MBOs is recommended for offline apps.

What do you say? Is it possible to work offline with the ODATA approach?

Hasonló hozzászólás

További információ
SAP HANA Enterprise Cloud
További információ
SAP S4HANA 4
További információ
Digital Transformation
További információ
hybris Partner Summit 2015
További információ
man-writing-on-desk
További információ
Kövessen bennünket: