I think there may be a disconnect somewhere so I'm going to give a high-level overview and then feel free to ask specific questions.
There are 2 OSIsoft web service products: PI Web API and PI Web Services.
PI Web API is the newer of the two products and our main focus for future development. It is a REST based web service. PI Web Services is an older product that continues to be maintained but no new functionality is being added, as of right now. It is a SOAP based web service. Assuming you have the necessary license you can download either product from the OSIsoft Technical Support Download Center. Once installed and configured, the web service can be consumed from a variety of different languages.
Thus far everything above is referring to the web service which needs to be installed and exposed on a web server machine. You can get more info from user/install manuals for those products. Continuing the discussion, now we want to create something to consume the web service. You can use an existing external product just to get a feel for what is available (WcfStorm, Postman, modern-day web browsers) or you can program your own client using any programming language that supports consuming a web service. Generally this refers to a programming language that support HTTP requests, but with PI Web Services your not limited by just HTTP.
On to the use of Java to consume a web service (not specific to PI), specifically referring to HTTP requests/responses. There is a lot of information out there but here is a common library for HTTP and an associated SO article with examples,
Hope that all helps, please let me know if something needs to be clarifies/expanded or any other questions you have.
Thank you for helping me to understand the nature of the services. Sweet avatar, by the way. To help describe my perspective, I am looking to access PI data services from a partner that is running a Web Services product. I don't have any licenses or OSISoft products myself.
I am happy to hear that I may be able to interface with the older Web Services product by using standard Java HTTP libraries. What threw me was the use of the following in the code example I linked to:
The code example makes use of specific classes to interact with the web service, so I imagine there is a lot of protocol hidden to users like me, that may be necessary to interact with the web service, which may include authentication.
To save the most time, here is a very clear question of what I am looking for:
1) pidataservice Java library and usage documentation
2) REST documentation for interfacing with PI data services purely with HTTP calls
Thank you very much for your time!
1 of 1 people found this helpful
To answer part of your question... the import com.osisoft.xml.services.pidataservice.*; is actually slightly misleading because it makes it seem like the example was importing some private OSIsoft library. However, it's actually importing a proxy java class file that's generated from the WSDL hosted at the Web Service's endpoint. In the post you linked, the author is using a tool "wsimport" to automatically generate the file from his endpoint http://ultralisk/piwebservices/pitimeseries.svc?wsdl. I quote the key section below:
bin\wsimport -extension -keep -Xnocompile -b PIWebservices.xml http://ultralisk/piwebservices/pitimeseries.svc?wsdl
Again, make sure that the URL in red is the URL to your PITimeSeries.svc file. The PIWebservices.xml file is the XML file we created previously. You should get the following output:
If you look closely, you will see that a new directory called 'com' has been created in your Metro installation directory. If you browse to it, you will notice that it is a few levels deep ('\com\osisoft\xml\services\pidataservice'). You will see that a lot of .java files have been created. If you are familiar with PI Web Services, you will notice that these files are named after PI Web Services operations and data structures.
Thus, if you have access to your partner's endpoint, you should be able to generate proxy class files from the wsdl in like manner. After that, if you open the class files you'll be able to see what calls are available to you within the generated class, which should give you what you need to consume the service.
Regarding #2. PI Web Services does not provide a RESTful endpoint. Does your partner host a PI Web API server you can access? That product provides RESTful access to the PI System.
Just to add on, the equivalent in .NET for this utility would be SvcUtil.exe.
If you would like to see the documentation as well, you can find it here:
Specifically I think you'd want to see the web services calls listed here:
As I mentioned, if you successfully generate the proxy class like that example did, you should see the same calls in your local java class files that you import.
I have moved this thread to 'Other OSIsoft Technologies' section as it involves more about PI Web Services.