A recent enquiry about web service support for Enterprise has promted me to spend some time writing up how to do it here ... our docs are somewhat lacking :o( we'll address that in the next release.
Firstly, it can be done, secondly its pretty simple once you understand the limitations and the of course what the WSDL behind the service can actually do.
Im going to use the service described here, http://www.webservicex.net/stockquote.asmx?WSDL. In the WSDL there is a getQuote method that we canuse to get stock quote information. It requires of course a quote parameter value such as 'orcl'. Today it will return:-
<StockQuotes>
<Stock>
<Symbol>ORCL</Symbol>
<Last>18.47</Last>
<Date>11/1/2006</Date>
<Time>4:23pm</Time>
<Change>0.00</Change>
<Open>18.56</Open>
<High>18.65</High>
<Low>18.34</Low>
<Volume>31724216</Volume>
<MktCap>95.960B</MktCap>
<PreviousClose>18.47</PreviousClose>
<PercentageChange>0.00%</PercentageChange>
<AnnRange>11.75 - 19.25</AnnRange>
<Earns>0.666</Earns>
<P-E>27.73</P-E>
<Name>ORACLE CORP</Name>
</Stock>
</StockQuotes>
..... nice run up Oracle has had recently!
Anyhoo, how do you get this working in Enterprise.
Step 1: Create a new report
So give the report a name, description, etc then add a new Data Model
Step 2: Define the data model
Give it a name, the type should be set to 'Web Service', the Details section will update for you. now enter:
WSDL URL - http://www.webservicex.net/stockquote.asmx?WSDL
Method - GetQuote
At this point we can not add the parameter, we need to create in the UI first andthen add it later.
Step3: Add the quote parameter
Click on Parameters and click New to create a new parameter.
Enter the following:
Identifer - whatever you wish
Data Type - String
Default Value - if you want
Parameter Type - Text
Display Label - the user will see this so make it something obvious
Text Field Size - I guess 4 is going to be the max you'll need
Step 4: Add the parameter to the Data Model
Save your work and go back to your new Data Model and click on the 'Add' link next to the Parameters label. The drop box will default in the new parameter.
You're done. Now click on the 'View'link and enter a stock quote and hit the 'View' button and the quote XML will appear. Now all you need is a layout template.
Of course you can create multiple data sources adding a query to the web service and then combine the result into a single report. For those of you with Enterprise installed you can get the report definition here so you can load it to your instance. Remember that the URL is going to be outside of your company firewall so you'll want to start the server up with the proxy parameters.
-DproxySet=true -DproxyHost=www-proxy.us.oracle.com -DproxyPort=80
Comments (4)
can u please tell me how can I incorporate two different data sources with in a single template?
Posted by Raj | July 23, 2008 10:07 PM
Posted on July 23, 2008 22:07
Hi Raj
You can not present two sources to the template layer. they need to be combined in the data extract layer prior to the template formatting stage.
There are other articles on this and there are also examples in the user docs.
Tim
Posted by Tim | August 4, 2008 9:36 AM
Posted on August 4, 2008 09:36
Hi tim,
I am referring two seperate tables from database having no common fields.how can i combine in the data extract layer prior to the template formatting stage for two different data sources?
Can you please tell me where can I find articles and examples in the user docs?
Posted by jay | September 9, 2008 1:55 AM
Posted on September 9, 2008 01:55
Hi Tim,
This example is working fine. However we have an xml like
ORCL
18.47
and we don't see any data in our report. Any suggestions ? (By the way, removing the namespace works in the preview but is not an option for us)
Regards,
David
Posted by David | January 30, 2009 6:40 AM
Posted on January 30, 2009 06:40