Archive

Posts Tagged ‘rental’

SWS RemoveRentalFromAuction Method

May 23, 2011 Leave a comment

Removes the selected rental or rentals from the auction to which they are assigned.

Parameters

Name DataType Is Required
RentalIDs ArrayOfLong5 Required
Description The rental ID or an array of rental IDs to be removed from auction. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
RentalsSucceeded ArrayOfLong7
Description The array of rental IDs that were successfully removed from the auction.
RentalsFailed ArrayOfLong8
Description The array of rental IDs that failed to be removed from the auction.

Example

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

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a RemoveRentalFromAuction request object and a RemoveRentalFromAuction response object. We can define and create those like this:

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

Here’s my sample code of the Request object.

// RemoveRentalFromAuction Request
request.SiteID = 123456;
request.RentalIDs  = new long[] { 123456, 456789, 789123 };

Finally we can call the method and pass across the login object and the request object to remove our rental from auction. 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.RemoveRentalFromAuction(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS GetScheduledFees Method

May 23, 2011 Leave a comment

Retrieves a list of scheduled fees for the specified rental.

Parameters

Name DataType Is Required
RentalID Long Required
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
BASE_FEE_TYPE Integer
Description The scheduled fee type’s numeric value.
Available values:

  • 1 – Fixed
  • 2 – Percentage(%)
  • 3 – Greater Amount
  • 4 – Lesser Amount
FEE_ACTIVE Boolean
Description Indicates if the scheduled fee is active (“True”) or not (“False”).
FEE_AMT String
Description The fee amount.
FEE_AMT_DESC String
Description The description of the fee amount.
FEE_DESC String
Description The site fee’s description.
FEE_OBJECT_ID Decimal
Description The site fee’s ID number.
ICON String
Description The URL for the site revenue class icon that displays in the Store application.
ORG_FEE_OBJECT_ID Long
Description The organization fee’s ID number.
REF_TYPE Decimal
Description A numeric value for the assessment type.
RENTAL_ID Long
Description The rental item’s ID number.
SITE_ID Long
Description The site’s ID number.
TAXABLE Boolean
Description Indicates if the fee is taxable (“True”) or not (“False”). If a tax exempt ID is used, the fee will not be taxed even if this returns “True”.

Example

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

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a GetScheduledFees request object and a ScheduledFee response collection.  We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetScheduledFees_Request request = new SWS.GetScheduledFees_Request();
SWS.ScheduledFee[] response;

Here’s my sample code of the Request object.

// GetScheduledFees Request
request.OrgID = 123456;
request.SiteID = 123456;
request.RentalID = 123456;

Finally we can call the method and pass across the login object and the request object to get our scheduled fees. 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.GetScheduledFees(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.