SWS GetInsuranceBrokerLocations Method
Returns all of the Store sites for an organization insurance broker services. 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 insurance companies’ system generated organization id number. This is not the same as the OrgID. |
Returned Parameters
Name | DataType |
---|---|
Locations | String |
Description | An XML string of Store sites and organizations for an insurance broker that can be read into a .Net DataSet or parsed using an XML parser. |
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 GetInsuranceBrokerLocations request object, and a GetInsuranceBrokerLocations response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetInsuranceBrokerLocations_Request request = new SWS.GetInsuranceBrokerLocations_Request();
SWS.GetInsuranceBrokerLocations_Response response;
Here is a sample code of the request object:
// GetInsuranceBrokerLocations Request
request.InsBrokerOrgID = 123456;
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.GetInsuranceBrokerLocations(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 return sites that have since been marked as inactive as it may take several weeks to update data after the site is closed. This change did not affect the method signature.