Page 1 of 1
TM1 connecting to a Web Service
Posted: Wed Nov 26, 2014 2:12 pm
by recoliveira
Hi all!
I need to read some information that is available through a web service. What do I do in TM1 to access this information and save in a cube?
Thanks a lot!
Renata
Re: TM1 connecting to a Web Service
Posted: Wed Nov 26, 2014 2:45 pm
by blackhawk
Renata,
If you have 10.2, you can use the REST API
https://www.ibm.com/developerworks/comm ... I%2010.2.2
EDIT: Oh...oops...I read that the wrong direction.
Are you trying to get data into TM1 from a web service via a TI script?
Re: TM1 connecting to a Web Service
Posted: Wed Nov 26, 2014 3:51 pm
by recoliveira
Hi blackhawk!
Yes, via TI script. Is it possible? If not, should I use only the REST API?
Thank you!
Re: TM1 connecting to a Web Service
Posted: Wed Nov 26, 2014 4:03 pm
by Harvey
TM1 does not have any built in functionality to connect to external web services.
If you would like to import data from a web source, you would need to write a custom executable or script to do the work.
Many approaches are possible. For instance, the program/script might poll the web service periodically and write the data to the file system. You could pick this up with a scheduled chore that imports the local file into a TM1 cube. Alternatively, you might opt to write executable application that gets the data, then uses the TM1 API to fire off a TI process to import it.
How you approach it really depends on the scenario, connectivity and nature of the data.
Re: TM1 connecting to a Web Service
Posted: Wed Nov 26, 2014 4:41 pm
by Wim Gielis
Harvey wrote:..., then uses the TM1 API to fire off a TI process to import it.
Or TM1runti.exe can be used.
Re: TM1 connecting to a Web Service
Posted: Wed Nov 26, 2014 5:21 pm
by blackhawk
Actually, the way I would consider doing it is create a Java extension to pull the data from a web service and then write it to a file. The java extensioni could be called from the TI script in the prolog section. Then, the TI processes like normal using this new file.
Code: Select all
vWSUrl = 'http://myserver/getdata';
vTempFile = 'filename.tmp';
retVal = ExecuteJavaN( 'com.sample.GetWSData',vWSUrl, vTempFile );
If( retVal > 0 )
ProcessQuit;
EndIf;
DatasourceNameForServer = vTempFile
You can make the GetWSData dumb, in that all it does is take the data from the web service and write it to a CSV or tab delimited file. Then leave it up to the TI process to understand what columns it should load or not load.
Hope that helps.
Re: TM1 connecting to a Web Service
Posted: Fri Nov 28, 2014 1:55 am
by tianoklein
Hi blackhawk,
Did you try this ???
http://tm1server:9510/pmpsvc/services
http://www.tm1forum.com/viewtopic.php?f=3&t=11028
OR
Did you try to create a TI - TM1 SDK JavaExtensions??
http://www.tm1forum.com/viewtopic.php?p=51180
Please let me know if you have succeeded, because I have the same problem and could not find a solution.
