Trust Online Web Service - Documentation


 

 

 

 


Claim Web Service

  • You must be able to construct a SOAP message that conforms to the WSDL for the web service.

You can use any SOAP compliant toolkit to generate your proxy objects or you can craft your XML by hand.
We recommend using Microsoft Visual Studio .NET and we provide sample code in C# but any development platform (Java, Perl, ColdFusion, etc) will work provided you use the platform's appropriate toolkit or extension to support standard SOAP webservices.


The code below first gets an attorney number and then proceeds to add a new claim with all the relevant child objects. The web service is designed to mirror the Trust Online web application so the data requirements are the same. There is also a working sample application for download.


  1 WebServiceBW webservice = new WebServiceBW();
  2 webservice.Url = "https://tostage.delawarecpf.com/tows/webservicebw.asmx";
  3 User user = new User();
  4 user.UserName = webservice.EncryptValue("rsmith");
  5 user.Password = webservice.EncryptValue("password1");
  6 
  7 WebServiceResult result = webservice.AttorneysGet(user);
  8 Console.Write("Received {0} attorneys, {1} errors\n{2}", result.attorneysgetresult.attorneys.Length, result.errors.Length, String.Join("\n", result.errors));
  9 foreach (attorney attorney in result.attorneysgetresult.attorneys)
 10 {
 11 	Console.WriteLine("Attorney {0}, {1}({2})", attorney.lastname, attorney.firstname, attorney.id);
 12 }
 13 Console.WriteLine("Press ENTER to continue...");
 14 Console.ReadLine();
 15 
 16 injured wsInjured = new injured();
 17 wsInjured.firstname = "John";
 18 wsInjured.lastname = "FiggenWoogle";
 19 wsInjured.ssn = "912032831";
 20 wsInjured.attorneynum = 12;
 21 dependent dependent1 = new dependent();
 22 dependent1.birthdate = DateTime.Parse("2/2/1988");
 23 dependent1.financiallydependent = yesnounspecified.yes;
 24 dependent1.firstname = "Melissa";
 25 dependent1.lastname = "Person";
 26 dependent1.relationshipcode = relationship.SPO;
 27 dependent1.relationshipcodeSpecified = true;
 28 
 29 dependent dependent2 = new dependent();
 30 dependent2.birthdate = DateTime.Parse("1/1/1984");
 31 dependent2.birthdateSpecified = true;
 32 dependent2.financiallydependent = yesnounspecified.no;
 33 dependent2.firstname = "Alex";
 34 dependent2.lastname = "Child";
 35 dependent2.relationshipcode = relationship.CHI;
 36 dependent2.relationshipcodeSpecified = true;
 37 
 38 wsInjured.dependents = new dependent[] {dependent1, dependent2};
 39 wsInjured.litigations = new litigation[] {};
 40 wsInjured.exposures = new exposure[] {};
 41 wsInjured.secondaryexposures = new secondaryexposure[] {};
 42 
 43 result = webservice.ClaimAdd(user, wsInjured);
 44 Console.Write("Created claim with {0} errors, claimnumber is {1}\n{2}", result.errors.Length, result.claimaddresult.claimnumber, String.Join("\n", result.errors));
 45 Console.WriteLine("Press ENTER to continue...");
 46 Console.ReadLine();


The order of the processing for a claim add is as follows:
  • Input data is validated against the appropriate Schema
  • Authentication of username/password is performed
  • Claim is created and claim number is assigned
  • Digital Signature of input and assigned information is generated




The order of the processing for a claim edit is as follows:
  • Input data is validated against the appropriate Schema
  • Authentication of username/password is performed
  • Verify access to requested claim
  • New version of injured information is added
  • Change requests are generated for processing by trust
  • Digital Signature of input is generated



Document Web Service

Web Service Enhancements (WSE) 1.0.
You need to download WSE and add a reference to the Microsoft.Web.Services.dll to your project. Library also included into the Sample Project and can be copied from it.

If you are using Microsoft Visual Studio .NET to create a web reference, then note that you must make the following change to the Reference.cs inside the Web Reference to get access to the RequestSoapContext (as shown in the example code):

For example, in Reference.cs:

	public class DocumentWebService : System.Web.Services.Protocols.SoapHttpClientProtocol

	=>

	public class DocumentWebService : Microsoft.Web.Services.WebServicesClientProtocol
	                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


DIME is an efficient format for uploading and downloading attachments through a web service.
MSDN - DIME: Sending Binary Data with Your SOAP Messages


DIME is more efficient and provides better performance than MIME for use in web services.
MSDN - Using Web Services Enhancements to Send SOAP Messages with Attachments


Yes. Below is a snippet of how to add a document to claim.

There is also the Sample Project which adds a claim and a document.


  1 int claimNumber = 9000000;
  2 WebServiceDocument webservice = new WebServiceDocument();
  3 webservice.Url = "https://tostage.delawarecpf.com/tows/document.asmx";
  4 User user = new User();
  5 user.UserName = webservice.EncryptValue("rsmith");
  6 user.Password = webservice.EncryptValue("password1");
  7 
  8 WebServiceResult result = webservice.TrustsGet(user);
  9 Console.Write("Received {0} trusts, {1} errors\n{2}", result.trustsgetresult.trusts.Length, result.errors.Length, String.Join("\n", result.errors));
 10 foreach (trust currentTrust in result.trustsgetresult.trusts)
 11 {
 12 	Console.WriteLine("Trust {0}({1})", currentTrust.name, currentTrust.id);
 13 }
 14 Console.WriteLine("Press ENTER to continue...");
 15 Console.ReadLine();
 16 
 17 
 18 string fileName = "Document.pdf";
 19 int documentTypeId = 1;
 20 string comment = "my comment";
 21 int trustId = 2;
 22 
 23 FileStream stream = File.OpenRead(fileName);
 24 DimeAttachment dime = new DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, stream);
 25 webservice.RequestSoapContext.Attachments.Add(dime);
 26 DocumentAddResult documentAddResult = webservice.DocumentAdd(user, claimNumber, trustId, documentTypeId, comment, fileName, "", true, true, true, true);
 27 Console.Write("Added document id:({0}), {1} errors\n{2}", documentAddResult.DocumentId, documentAddResult.Errors.Length, String.Join("\n", documentAddResult.Errors));
 28 Console.WriteLine("Press ENTER to continue...");
 29 Console.ReadLine();
General

Download the sample project and try it yourself. The sample project is a Visual Studio .NET solution containing 4 projects each of which demonstrates a different aspect of the webservices.
  • Unzip the file
  • Open the solution file in Visual Studio .NET
  • Set the "Set as Startup Project" for any of the 4 projects
  • Run the code
  • See a claim number for the newly added claim
  • See a document id for the newly added document
Note: The sample code runs against our staging environment using a test firm and claimowner


You need to install the necessary certificates to allow a trusted SSL connection to be established between your computer and the Web Service.




Please look at the appropriate schema (XSD) definition. The lookup display names are given in the XML comments next to each enumeration.




The web service methods all return a result object that contains requested information (if any), an errors property, and if necessary, a digital signature. The errors property is a string array. When a web method completes, the client code should immediately check the errors property to determine if any errors occurred. If the array is not empty, the web method detected an error before processing the request, returning the error(s) directly to the client.

In addition to errors return in the result object, exceptions may also occur. The web service throws an exception when an unexpected error occurs. For example, if the web service were unable to contact the database server, the resulting exception would bubble through the various software tiers on the server resulting in a non-SOAP response. Client code should check responses from the web service to ensure they conform to SOAP specifications. Proxies generated by Microsoft's Visual Studio .NET will automatically generate a SoapException when a non-SOAP response is encountered.

In general, client code should rarely see an exception response. Should one occur, the web service automatically notifies the Trust that the error occurred allowing technical personnel the opportunity to investigate the error.


When a client calls a web method that changes claim information, the web service generates a digital signature that contains the request made by the client and appropriate information about the resulting status from the request. The Digital Signature is your "receipt" for any additions or changes made to claims being processed by the Trust. The fact that it is signed by Trust's private key ensures that the contents are legitimate.

Please see An Introduction to XML Digital Signatures for an overview of Digital Signatures.

Here is an example in C# to verify a digital signature:


  1 XmlDocument signatureDocument = new XmlDocument();
  2 signatureDocument.PreserveWhitespace = true;
  3 signatureDocument.LoadXml(digitalSignature);
  4 SignedXml signed = new SignedXml();
  5 signed.LoadXml(signatureDocument.DocumentElement);
  6 if (!signed.CheckSignature())
  7 {
  8 	Console.Write("Signature failed.");
  9 }


TrustOnline will be inaccesible during scheduled maintenence windows. During this time consumers of the TrustOnline web services will receive a Soap Exception that wraps a SystemIsDownException that indicates "TrustOnline is down".


Please contact the Trust with any additional questions.