4 Replies Latest reply on Nov 23, 2011 7:13 PM by spilon

    Web Services Binding Problem with PIDataServiceTestHarness


      I'm looking for a quick code example to test my PI Web Services implementation.


      I tried Lonnie's KPIDemo13 but it requires SL and has the added complication for me of cross domain authentication.


      I looked long and hard on vcampus for a simple test example and could only find the code from the webinar - Nov 30th 2010.  If there is something simpler I would be happy to try that.


      So I'm trying to modify  the PIDataServiceTestHarness to run against my server ( from 'Builders Café' webinar series, "PI Web Services 2010 and Beyond" held on November 30th, 2010)


      This would be a great example as it has all the possible data retrieval scenarios in it.  BUT I'm running into problems with the matching of bindings between my Host web.config and what is in the example.


      I could not get the TestHarness wsbindings to match with Host's default PIWebServices web.config.


      Do you have a version of the TestHarness which only uses basicHttpBinding as I would think that could most easily match the web config version on my Host which uses no security? 


      This will require new app.config and configuration.svcinfo files for the project.


      Thanks - Tony

        • Re: Web Services Binding Problem with PIDataServiceTestHarness

          Hi Tony,


          You can find a sample config file for basicHttp binding when PI Web Services is installed. Just look for it in the ..\PIWebServices\Help\Samples folder on the web server. I think the file should be web_config_basic_no_security.config


          Once you have changed the web.config of PI Web Services, you should be able to update or re-configure the service reference pointing to PI Web Services in Visual Studio, which should update the app.config of the sample project to match the new settings.


          Hope this helps

            • Re: Web Services Binding Problem with PIDataServiceTestHarness

              To add to Han Yong's point, I would recommend you delete the app.config file from your test harness altogether, and then update or re-add your service reference - this will re-generate your app.config with the appropriate bindings, etc.

                • Re: Web Services Binding Problem with PIDataServiceTestHarness

                  Thanks. I used the web_config_basic_no_security.config on the Host end and got Lonnies example working and then used her basic bindings to get the PIDataTestHarness example connected BUT the webservices it tries to find dont exist ie. PIWSTimeSeriesRef.PITimeSeriesClient("BasicEndpoint") doesnt find the webservice.  I'm guessing as this example code was written over a year ago and PI Web Services has changed since then.


                  Is there a compatible version of PIDataTestHarness OR something similar which I can try?


                  Thanks again.

                    • Re: Web Services Binding Problem with PIDataServiceTestHarness

                      Actually, you might want to look into the PIDataService.TestHarness.exe.config file, rather than the app.config I talked about earlier (my bad, I was working with a Silverlight app lately and it has a standard app.config file for these purposes). In there you should see the binding/endpoint configurations which you can use to initialize your proxy in code (your PITimeSeriesClient object).


                      In the version of the test harness I have, there is an endpoint called "TimeSeriesEndpoint"... if that's the case for you as well, then you probably want to change your code to PIWSTimeSeriesRef.PITimeSeriesClient("TimeSeriesEndpoint").


                      Hope this helps!