Home > API General, Insurance > SWS GetInsuranceBrokerData Method

SWS GetInsuranceBrokerData Method

Returns all of the insurance data on an insurance broker for the specified site and date. This method requires that the user has access to the insurance tables through special permissions; otherwise, an error is returned.


Name DataType Is Required
InsBrokerOrgID Long Required
Description The organization’s ID number.
LocationSiteID Long Required
Description The site ID for the site from which the insurance company wishes to pull data.
SnapshotDate DateTime Required
Description The date to generate a snapshot of the insurance data. If today, only the data up to the current time will be returned.

Returned Parameters

Name DataType
InsuranceData String
Description An XML string of insurance broker data that can be read into a .Net DataSet or parsed using an XML parser. Note: Any return parameter that does not have a value will not be displayed in the XML generated.


As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object, a GetInsuranceBrokerData request object, and a GetInsuranceBrokerData response object. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetInsuranceBrokerData_Request request = new SWS.GetInsuranceBrokerData_Request();
SWS.GetInsuranceBrokerData_Response response;

Here is a sample code of the request object:

// GetInsuranceBrokerData Request
request.InsBrokerOrgID = 123456;
request.LocationSiteID = 123456;
request.SnapshotDate = DateTime.Today;

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. It’s a good idea to do this in a Try Catch block.

‘ Call the method that will load the response object
  response = service.GetInsuranceBrokerData(user_request,request);
catch (Exception ex)

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

Categories: API General, Insurance
  1. swsBecky
    April 5, 2017 at 1:40 pm

    Updated July 18, 2014: This method was updated to increase performance. Neither the logic nor the WSDL signature was changed.

  2. swsBecky
    April 5, 2017 at 1:48 pm

    Updated Jun 23, 2014: Updated the method to improve performance and data accuracy.

  1. September 13, 2012 at 11:54 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s