Sunday, 31 May 2009

ODI Series – Web Services Part 4

In this last instalment of data services I am going to be looking at the ODI tool ODIInvokeWebService, in the previous blogs I have looked at methods of invoking scenarios through web services, using web services on top of datastores, creating your own apps and today the provided tool that can invoke web services from within the ODI environment.

There are many different reasons that would need to invoke a web service to satisfy the requirements of your integration, keeping tradition in the Hyperion arena I am going use this opportunity to call an EPMA web service. The EPMA web services are not too well documented but they are out there and can be used, if you are using version 9.3.1 there is a document available here.
I am not sure where the documentation is for version 11 but the web services do still exist and fully functional.

If you are going to consume the web services of EPMA with ODI then I recommend making sure you are running an ODI release of 10.1.3.5.0_02 or later as it seems to fix a bug with resolving WSDLs correctly, I hit the bug in the past and couldn't call some web services.

The object of this simple example is to connect to EPMA, retrieve a session id and then create a new folder in EPMA. The first step is to create a package and add the tool ODIInvokeWebService to the diagram.



The tool takes a WSDL URL as one of the parameters, if you are going to use any of the EPMA web services then you will need a session id so the first URL to use is :- http://<epma machine>/hyperion-bpma-server/Sessions.asmx?wsdl

Once you have entered the URL, you can click on the advanced button and connect to the WSDL and that will retrieve all the available operations, the advanced editor lets you enter values for the operation variables then send the soap request and review the results.



The CreateSession operation takes a UserName, Password and connectionString (the connectionString is optional)



Invoking the SOAP request from the editor returns the required SessionID, once applied the parameters “Port Type”, “Operation” and “XML Request” are automatically populated.



There is a parameter “Request File” which allows the use of a file to be as the request instead of using editor.

Now after the session id is retrieved we need a way of storing the value so it can be used with the next call, there are a number parameters that come into play.

“Storage Mode for Response File” that takes the values “NO_FILE” (no response is stored), “NEW_FILE” (A new
response file is generated.If the file already exists, it is overwritten) and “APPEND” (The response is appended to the file. If the file does not exist, it is created)

“File Encoding for Response File” - character encoding for the response file.

“XML Encoding for Response File” - Character encoding that will be indicated in the XML declaration header of the response file.

“Response File” - File storing the web service soap response.



Executing the package produces the following XML file.



So now we have the XML file containing the session id but we need to be able to read in the id, like most technologies there is one available for XML documents and allows the ability of reversing XML files into a set of datastores.

As usual the physical details have to be created in the topology manager.



Only a name is required in the definition.



In the JDBC Url the location of the xml file is entered.

In the physical schema definition any values can be entered for the schema and a logical schema has to be given and applied to context.



The process for reversing the XML file follows the same process as other technologies in the Designer.



Once reversed a separate dataStore is created in the Model for each element of the XML file.



Now the XML has been converted to datastores you can use standard SQL to query the information, as I am only interested in the session id I can query the value simply.

To store the session id I created a variable that is refreshed by using SQL to query the dataStore.



This variable can then be added to the package.



For the final step I want to create a new folder in EPMA, to do this there is a WSDL available for Folder operations.



By using the variable the SessionID value can be populated, without using the session id the soap request will fail, as the request will not be authenticated.



In the parameters of the operation the only other value that needs to be entered is for “Storage Mode for Response File” and this is set to “NO_FILE”

Executing the package will first send a soap request for a session id, the response will write to an xml file, a refreshing variable will pick up the session id from the xml file and store it, the last step uses the Create folder operation and passes in the stored session id and creates a new folder in EPMA.



So there we have a really simple example of how to use the ODIInvokeWebService tool with a bit of XML and EPMA thrown in.

6 comments:

Anonymous said...

Hello John!

Respect for your articles! I have a question...Can we invoke web services out of ODI environment??? And how?

Thanks!

website design,web design said...

Your blog is very nice... i like your blog ....

web design company, web designer, web design India

123 said...

喜餅禮盒 喜餅價格 訂婚禮盒 訂婚喜餅
素食月子餐 飛梭雷射 柔膚雷射 獸醫師 創業鞋之澡堂 洗鞋子 洗包包加盟彌月禮盒 彌月禮 玻尿酸 皮膚科 皮膚科診所 肉毒桿菌 肉毒桿菌瘦臉 脈衝光 除斑 Flex PCB PCB Electronic PCB 衝孔網 菱型網 不鏽鋼 壯陽 成人用品春藥 壯陽藥品 持久 手工水餃 中華湯包 mini usb 催情 增大 模具廠 104法拍網 信義房屋 房屋買賣 台北法拍屋 塑膠射出成型 模具 Odm 塑膠射出模具 Oem代工廠 塑膠射出 塑膠射出廠 模具設計 Precision Mold加盟創業 冷凍宅配 宅配美食 Light guide panels Plastic Products Mold design 沖孔網

123 said...

馬桶不通 food forming patty machine boiling machine 化妝品包 裝 紙盒 breading machine vegetable machine日立冷氣 Plastic Drinking Cups宜蘭民宿 宜蘭旅遊教育訓練 品質管理 Ohsas 18001casino gaming machine 泰國清邁 iso認證 iso團體旅遊簽證 slot game machine slot machine cabinet 便宜機票展場設計 二手車 中古車 Bmw 中古車買賣 汽車借款gaming machine manufacturer gaming machine 大陸直航新竹餐廳下午茶特色餐廳景觀餐廳親子餐廳

123 said...

彌月禮盒團購美食 印刷 彩色印刷 包裝 設計pe膜 冬令營 food processing equipment frying machine Telecom PCB 泡菜 團購美食油飯麻糬
創業加盟 水餃 壯陽食品 早洩 情趣用品 湯包 DC Jack tact switch Slide switch Phone Jack USB connector RCA Jack開 關 製網 菱形網 不鏽鋼網 金屬網 無塵室射出 Disposable plastic cups Disposable plastic cups Disposable products 宜蘭住宿 ECO products Biodegradable plastic PLA 律師事務所 律師 寵物醫院polylactic acid Biodegradable

123 said...

搬家公司 月子中心 seo 關鍵字廣告 關鍵字 google關鍵字廣告 關鍵字行銷 網路行銷 通姦 徵信社 外遇 桃園房屋仲介 桃園房屋買賣 桃園房屋 醫學美容診所 淨膚雷射 雷射溶脂 飛梭雷射 微晶瓷 植髮 團體服 團體服訂做 醫學美容診所 肉毒桿菌 肉毒桿菌瘦臉 醫學美容 整型診所 美國月子中心 徵信 徵信公司 出軌 清潔公司台北搬家公司 整形 韓風整形 整形 韓風整形 老人癡呆症 情緒管理 訂房網 線上訂房