Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
140.10. Example 3: Handling Requests from SAP
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
This example demonstrates a route which handles a request from SAP to the
BOOK_FLIGHT
RFC, which is implemented by the route. In addition, it demonstrates the component's XML serialization support, using JAXB to unmarshal and marshal SAP request objects and response objects to custom beans.
This route creates a
FlightTrip
business object on behalf of a travel agent, FlightCustomer
. The route first unmarshals the SAP request object received by the SAP server endpoint into a custom JAXB bean. This custom bean is then multicasted in the exchange to three sub-routes, which gather the travel agent, flight connection and passenger information required to create the flight trip. The final sub-route creates the flight trip object in SAP as demonstrated in the previous example. The final sub-route also creates and returns a custom JAXB bean which is marshaled into an SAP response object and returned by the server endpoint.
Java DSL for route 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The Java DSL for the example route is as follows:
XML DSL for route 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
And the XML DSL for the same route is as follows:
BookFlightRequest bean 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following listing illustrates a JAXB bean which unmarshals from the serialized form of an SAP
BOOK_FLIGHT
request object:
BookFlightResponse bean 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following listing illustrates a JAXB bean which marshals to the serialized form of an SAP
BOOK_FLIGHT
response object:
Note
The complex parameter fields of the response object are serialized as child elements of the response.
FlightInfo bean 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following listing illustrates a JAXB bean which marshals to the serialized form of the complex structure parameter
FLTINFO
:
ConnectionInfoTable bean 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following listing illustrates a JAXB bean which marshals to the serialized form of the complex table parameter,
CONNINFO
. Note that the name of the root element type of the JAXB bean corresponds to the name of the row structure type suffixed with _TABLE
and the bean contains a list of row elements.
ConnectionInfo bean 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The following listing illustrates a JAXB bean, which marshals to the serialized form of the above tables row elements: