Web Services implementation in iMIS for .NET

iMIS for .NET provides a facility to make a Web Service available. This Web service allows a user to submit the name of a query, already defined in iMIS using the Query Architect, along with optional parameters, and receive an XML representation of the query results.

There are numerous techniques and tools for interrogating and receiving results from Web Services. A useful .NET Framework-based tool called “Web Service Studio” is available at http://www.gotdotnet.com/team/tools/web_svc/default.aspx . A tool like this is useful for checking setup and behavior, prior to writing a script or code implementation to utilize the Web Service.

Configuration

First, iMIS for .NET must be installed on a Web server, and an iMIS database upgraded to use it. The WSDL endpoint for the iMIS for .Net Web Service is imis/AsiCommon/services/query/queryservice.asmx. It can be reached via
http:///imis/AsiCommon/services/query/queryservice.asmx?WSDL .
This .asmx page is included in the standard iMIS for .NET server installation. Access to this page must be granted to any users of the Web Service.

For Web Services login, a user called “ADMIN” must be created, using the standard mechanism in iMIS10 Customer Maintenance for creating a new non-staff user. This user should be included in the SysAdmin role.

Queries for use by Web Services users are created using the Query Architect tool in iMIS. Query paths are delimited by periods. For example, a query called “MyQuery”, stored under the “UserQueries” subfolder of the “Common” folder under the “Root” level, has a path of “$.Common.UserQueries.MyQuery”. The delimited query path, and query parameters if applicable, are used as input to the Web Service.

There are two QueryService items available from the Web Service, GetResults and GetResultsWithParameters. Get Results takes as input the full delimited path to a query, and returns an XML representation of the query results. GetResultsWithParameters takes as input the full delimited path to a query, along with input parameters to the query, and returns an XML representation of the query results.

Example

Create a simple query called “CsContactQuery”, using the CsContact business object as its source. Select a few display columns – ID, Full Name, etc. Save it under a folder called Test.Queries.

You can then exercise GetResults by providing it a queryPath value of "$.Test.Queries.CsContactQuery". This will return an XML string with a list of contact information (ID, Name, etc.).

Next, Edit the query, add a Filter on JoinDate, set Prompt to “Yes”, and save it as “CsContactQueryByJoinDate”.

You can then exercise GetResultsWithParameters by providing it a queryPath value of "$.Test.Queries.CsContactQueryByJoinDate", and a parameters value of "1/1/1990" . This will return an XML string with a list of contact information (ID, Name, etc.), but filtered by Join Date >= 1/1/1990.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I tried the following code i

I tried the following code i wrote to accessIQA Webservices. But this GetResults webmethod returns " " but when run from iMIS 15 it is working fine.

If it is possible can you please send some sample code to proceed further.

IQA.QueryService _iqa = new IQA.QueryService();
string text1 = (_iqa.GetResults("$.Common.Queries.Utility.StateProvinceList.All Countries"));
Response.Write(text1);