Invoking a JSON service over HTTP from OSB is quite straightforward. Using the Java code that we built in the previous recipe will make working with the JSON messages much simpler.
We'll assume that you have an OSB configuration project in OEPE, and that you have the Jackson and XmlBeans JAR files referred to in the previous recipe, as well as the JAR files produced by that recipe.
We will first create an Oracle Service Bus project. Select the Oracle Service Bus perspective in Eclipse. Right-click on the OSB configuration project, and select New | Oracle Service Bus Project. In the dialog box, enter a name for the project (
InvokeJSONCreditCardService
) and click on Finish.We need to import the web service definition used in the Java project in the previous recipe, as we will implement the
DebitCreditCard
operation of theCreditCardService
.Right-click on the OSB project, and select Import | Import from the context menu.
In the Import...