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.
Parameters
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. |
Example
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
try
{
response = service.GetInsuranceBrokerData(user_request,request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
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.
Updated July 18, 2014: This method was updated to increase performance. Neither the logic nor the WSDL signature was changed.
Updated Jun 23, 2014: Updated the method to improve performance and data accuracy.