Using the Gateway Proxy

Use

To interface with the selected SAP service through an HTTP Destination that points to an SAP Gateway server, you can call the generated proxy classes from your application.

The following are examples of a portal component that calls the generated classes and methods of an SAP service that handles flights, named RMTSAMPLEFLIGHTService :

  • Create an instance of the SAP service using the pre-configured destination name:

  • Filter the flight collection according to airline:

  • Create a booking object and provide the booking information for a specific flight of the carrier:

  • Create a new booking in the booking collection for a specific flight. It returns the newly created booking entry with additional information, for example, the booking ID, and prints the booking ID of the newly created booking entry:

  • Update a booking entry by providing a new passenger name. If successful, it gets the booking entry and prints the updated passenger name:

  • Delete a booking entry and print the status:

  • Get the booking collection of a specific flight (navigation property) and print all the passenger names:

  • Get the flights between specific dates for a specific destination:

The following are examples of a portal component that calls the generated classes and methods of an SAP service named Workflow , which obtains a list of workflow tasks from the SAP Gateway server:

  • Get a list of workflow tasks from the SAP Gateway server:

  • Get the attachment of the first task in the task list:

  • Get the byte buffer of a media resource:

Handling Errors and Exceptions

In your application, you need to handle errors and exceptions thrown by the proxy, using ProxyException .