Skip to content

appulate/appulate-acordxml-svc-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ACORD XML Web Service Sample

ACORD XML Web Service Sample is a simple implementation of Web API Service to receive submissions from Appulate with ACORD XML payload.
This service

  • can help you to set up your own service to receive submissions from Appulate
  • receives HTTP request with XML content
  • generates HTTP response with XML content
  • is based on the following documentation
  • is based on ACORD PCS v2.2.0, Worker's Compensation insurance line

Repository Structure

  • The sources folder contains AcordXmlServiceSample solution folder
  • The testing folder contains
    • Postman collection for testing ACORD XML Web Service Sample API
    • Subfolders with ACORD XML payload samples

Implemented cases

Case1

AcordXmlServiceSample API receives request, reads ACORD XML from request body and creates a text file.
The text file will contain the following data from request XML:

  • Agency Name, Address, Phone and Code
  • Producer Name, Phone, Email and Code
  • Insured Name, FEIN, Entity, Mailing Address, Date Business Started, Contacts
  • Locations (addresses)
  • Rating Information
  • some Underwriting questions
  • WC Insurance and Loss History
    Response will contain ResultUrl which you can use to open the created text file in your browser.
Case2

AcordXmlServiceSample API receives the request, reads ACORD XML and verifies the data.

  1. The following information is required:
    • Agency Name and Address should be present
    • Insured Name and FEIN should be present
    • at least one Location should be present
      If some required information is missing, AcordXmlServiceSample response will contain an "Error" message.
  2. AcordXmlServiceSample service declines requests with locations in FL state. Response will contain a "Rejected" message.
Case3

AcordXmlServiceSample API receives request, reads ACORD XML and verifies the authentication data from XML.

Request ACORD XML XPaths:

Response XML documentation: Response XML Mapping v2.2.0

*Response XML Statuses - StatusCd, MsgStatusCd values

Case# Sub-case Controller Request XML sample Response XML Statuses Response XML structure sample
Case1 Save data to txt file file file 0, Success file
Case2 Not all required data file file 0, Error file
Case2 Unsupported state file file 0, Rejected file
Case2 Valid data set file file 0, Success
Case3 Invalid credentials file file 1740, Error file
Case3 Empty credentials file file 1740, Error file
Case3 Valid credentials file file 0, Success

ACORD XML processing

Useful information about ACORD XML can be founded in ACORD XML documentation > ACORD XML Mapping tips & tricks.
The XML from the request body is processed as a string. This string is used to create an XDocument object.
ACORD XML Web Service Sample uses XPath to get data from XDocument object (from the request XML).
Processing examples:

  • Repeatable aggregates:
    • Transferring locations and buildings from repeating aggregates Location and SubLocation to collections - Location.cs, GetLocations method. Buildings are processed under each location because SubLocation aggregate is a child of Location aggregate.
    • Transferring additional information about location/building from repeating aggregate LocationUWInfo to collection - Case1ReadSaveRequestDataController.cs, method Post, locationsUWInfo list creating. Data from LocationUWInfo aggregates is read separately from locations and linked to locations/buildings via attribute values from XML. The SubLocationRef attribute of LocationUWInfo aggregate correlates with the id attribute of SubLocation aggregate. The LocationRef attribute of LocationUWInfo aggregate correlates with the id attribute of Location aggregate.
    • Transferring rating information from repeating aggregate WorkCompLocInfo to collection - RatingInfo.cs - GetRatingInformation method. Data from WorkCompLocInfo aggregates is read separately from locations and linked to locations via attribute values from XML. In addition, you can read this data under each location like buildings. For that, you will need to map WorkCompLocInfo to Location by attribute value during the step of selecting WorkCompLocInfo aggregates from XML.
  • XML attributes processed with XElement.Attribute(XName) method. See examples in Location.cs - GetLocations method, RatingInfo.cs - GetRatingInformation method.

How to test

You can use Swagger or Postman for test requests.
Sample of postman collection is included in the Testing folder.

  • If the application is launched over HTTPS, set the Current value of the base_url collection variable to "https:\\localhost:7226"
  • If the application is launched over HTTP, set the Current value of the base_url collection variable to "http:\\localhost:5055"

Built With

  • ASP .NET Core Web API
  • C#

Run application

Clone the repository

git clone https://github.com/appulate/appulate-acordxml-svc-sample.git

You can use free Visual Studio Community (Windows) to run an app

  1. Make sure ASP.NET and web development tools are installed
  2. Open AcordXmlServiceSample solution in Visual Studio
  3. Start the app without debugging (press Ctrl+F5 to run without the debugger).
    Swagger page will be opened automatically

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages