Hello World in OSB
Scenario:- In this service we give input as your name, for example Rupesh, so the output will come as Hello Rupesh.
Answer:-
Create a project as HelloWorld
for this we create a schema like:-
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org" elementFormDefault="qualified">
<xsd:element name="Request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Input" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Response">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Output" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Save schema as HelloWorld.xsd, you can save schema name as your wish.
Right-click on the proxy service panel then Insert transports--->HTTP
then we appear below screen
Click on Next button, then a window will appear like this
Click on setting button which is round by red mark above, then select Interface Type as Synchronous Interface, Select Input as Helloworld.xsd Request and Output as Helloworld.xsd Response.
then window will appear like
Click on Ok, Next window will come as
Click on next button then finish
Now go to pipeline double click on it.
Drag-drop pipeline pair from the component palette
It contains Request pipeline and response pipeline like below window
In response pipeline drag-drop replace action, double click on replace set some parameter like
Location:- body
set xpath as . (dot)
set value expression as
Click on Ok.select replace option as replace node content
Click on save button. now build is complete for HelloWorld, deploy the composite and test.
I am providing input as Rupesh, then the response is HelloRupesh
Comments
Post a Comment