Many a times in OUAF framework products, we have to create our own custom scripts. Since OUAF framework does do not offer an inbuilt testing/debugging option for scripts, we have to go through some round about way for achieving the same. Lets explore how to do the same for a service script.
One of the options for achieving the same in using XAI Inbound Service which is available as part of OUAF. Using this you can test your service script for various input options and verify the output for each.
Lets take up a sample service script which takes two numbers as inputs and gives their sum back as output.
Below is the script schema:
Following is the script code. As seen it takes the two inputs sums it up and sets the sum in the output field.
Now lets create a XAI Inbound Service For this service script.
Go to Admin Menu - X - XAI Inbound Service. Click on + sign.
<input2/>
<output/>
</schema>
<input2>2</input2>
</CM-TestSS>
<input2>4</input2>
</CM-TestSS>
Similarly we can use an XAI inbound service to test out any Service Script for any combination of inputs as per our requirement.
Using the WSDL Url present on the XAI Inbound Service screen, we can also create automated Web Service test scripts by passing the Url to a Web service testing application like SOAP UI.
One of the options for achieving the same in using XAI Inbound Service which is available as part of OUAF. Using this you can test your service script for various input options and verify the output for each.
Lets take up a sample service script which takes two numbers as inputs and gives their sum back as output.
Below is the script schema:
Following is the script code. As seen it takes the two inputs sums it up and sets the sum in the output field.
Now lets create a XAI Inbound Service For this service script.
Go to Admin Menu - X - XAI Inbound Service. Click on + sign.
XAI Inbound Service screen opens up. Enter a name for the service.
Select the Adapter as Business Adaptor
Select schema type as Service Script.
Select the service script name for testing. In this case it is CM-TestSS
Select the transaction type as Read.
Click on Save link at the top right of screen to save the service. As seen below the WSDL url for the Webservice is also available.
To register the XAI inbound service. Go to XAI Command.
Admin Menu - X - XAI Command
XAI command screen opens up.
On the screen select Refresh Registry from the Command Dropdown.
Then click on the Send Command button.
As seen below the command is executed successfully and the registry is refreshed.
To confirm that your inbound service is registered you can select Display Registry command and execute it. As seen below the service CM-TestSS is registered and visible.
Now to test the XAI inbound service. Go to XAI submission.
Admin Menu - X - XAI submission
The XAI submission screen opens up. Put your request xml for the service in the the XML request box.
The xml request format is as follows:
First tag should be the name of the XAI inbound service. In our case it was CM-TestSS. So the outermost tag will be <CM-TestSS>
The inner tags should replicate the tags present in the service script schema.
The script schema is
<schema>
<input1/> <input2/>
<output/>
</schema>
Since we require only the input tags, the final request will be as below
<CM-TestSS> (XAI inbound Service name)
<input1>1</input1> (Tags from service script schema)<input2>2</input2>
</CM-TestSS>
Paste the XML request. And click on the Save Link on top right corner.
The XML request gets executed and the response is visible in the response tab.
As seen we got the sum of the two input numbers in the output tag.
So as seen we were able to test/execute our test service script using XAI inbound service.
Now we can use the same XAI inbound service for testing out different inputs, by just changing the values being passed in the request xml. Lets change the inputs to 3 and 4.
<CM-TestSS>
<input1>3</input1><input2>4</input2>
</CM-TestSS>
As seen the output response for the above request is 7.
Using the WSDL Url present on the XAI Inbound Service screen, we can also create automated Web Service test scripts by passing the Url to a Web service testing application like SOAP UI.
Hi Sree,
ReplyDeleteThanks for the wonderful information !!!
Explained nicely with screenshots...good one. Thanks!
ReplyDeleteHi Sri,
ReplyDeletecan we have your contact, i am interested to work on OUAF frame work ,i had 2 yrs exp earlier want jump into this product , please suggest on it.
Hi Sri,
ReplyDeletecan we have your contact, i am interested to work on OUAF frame work ,i had 2 yrs exp earlier want jump into this product , please suggest on it.
You can put any queries on OUAF here. Will try to answer them. If you don't want your queries to be public. Just mark the comment as private. They will be sent to me but won't be published on the blog.
DeleteHi Sreeneeth,
ReplyDeleteNeed help to implement the same in Linux environment.
If you have any document please share here.
Thanks,
Sai
saitalakanti@gmail.com
888 638 1177
how upload tools are made from scratch, how can we upload csv data in data base using that particular tool?
ReplyDeleteDepends on the number of records you want to upload. If number of records is less and user is manually uploading the file, you can use UI map to load the data as xml and use it (Refer oraUploadData="type:embed;path:list xpath;useLabels:true;showCount:true" option) . Else if record count is high and user doesnt manually upload the file, create your own batch to read the data and process it. You can refer the OOB batch plugin 'F1-PDUPL' as reference. If you need more control, you can write the batch in java instead of using plugins.
Delete