Step by Step Guide - .NET Warrants and Protection Order Service

·  Create a New Web Site in Visual Studio and select 'ASP.net webservice'

·  Save the project with the appropriate name.

·  WIJIS distributes 3 classes that were programmed by WIJIS Developers and 1 class that was autogenerated. The autogenerated class is WarrantServiceInterfaces.cs for the Warrants Service and ProtectionOrderServiceInterfaces.cs for the Protection Order Service. To autogenerate these classes using WSDL.exe, type the following:

Warrants Service

wsdl.exe /si http://www.wijiscommons.org/warrants/wsdl/WarrantService.wsdl

Protection Order Service

wsdl.exe /si http://www.wijiscommons.org/warrants/wsdl/ProtectionOrderService.wsdl

Here is the output generated by wsdl.exe for the Warrant Service:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>wsdl.exe /si http://www.

wijiscommons.org/warrants/wsdl/WarrantService.wsdl

Microsoft (R) Web Services Description Language Utility

[Microsoft (R) .NET Framework, Version 2.0.50727.42]

Copyright (C) Microsoft Corporation. All rights reserved.

Writing file 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\WarrantSer

viceInterfaces.cs'.

·  Once you have generated WarrantServiceInterfaces.cs or ProtectionOrderServiceInterfaces.cs, you will have to modify the following line (Warrant Example given below, do the same 'object' to 'XmlDocument' conversion for Protection Orders):

Change

object submit([System.Xml.Serialization.XmlElementAttribute(Namespace="http://wijis.wisconsin.gov/services/WarrantService/")] object Submission);

To:

XmlDocument submit([System.Xml.Serialization.XmlElementAttribute(Namespace="http://wijis.wisconsin.gov/services/ProtectionOrderService/")] object Submission);

Also add the include:

using System.Xml;

·  Please note that you can either use wsdl.exe to generate the service interfaces or use the one distributed by WIJIS. The choice is yours.

·  Then in the Solution Explorer, right click on App_Code and choose “add existing item...”, Find and add the files (they are located on the wijiscommons.org website where you found this doc): ApplicationEventLog.cs, HelperMethods.cs, and service.cs. If you are writing a Warrant Service, add WarrantServiceInterfaces.cs. If you are writing a Protection Order Service, add ProtectionOrderServiceInterfaces.cs.

·  Due to difficulties with wsdl.exe, WIJIS was unable to generate objects mappings to Dot Net for the schemas. WIJIS elected to use xpath expressions to access the different elements present in the input document and then used Dot Net xml capabilities to generate a response document. If you need assistance with using this code example, please contact WIJIS for an Xpath working session.