PwsGetMileageRate

Overview


This web service retrieves one mileage rate using the identity of a resource (PwsResourceRef), the identity of an expense document (PwsExpenseDocumentRef), or both.  If both identities are provided, the resources must match or an error is returned in the response. 

Request Format


PwsGetMileageRate Request

Request Elements


Element

Data Type

Required?

Default

Description

Sample Data

RequestId

Int32

No


Click here for more information.


SessionTicket

String

Yes


Click here for more information.

ARNkL4C1bp7KLtsSXQW6/g==

DisbursedCurrencyIdentity

PwsCurrencyRef

Either DisbursedCurrencyIdentity or ExpenseDocumentIdentity must be provided


The disbursed currency for mileage rate. If both DisbursedCurrencyIdentity and ExpenseDocumentIdentity are provided, the disbursing currency of the expense document must match the specified disbursed currency. Otherwise, an error is returned in the response. If both DisbursedCurrencyIdentity and ResourceIdentity are provided and there is a mismatch between the resource's disbursed currency and the specified currency, a null mileage rate is returned in the response. Click here for more information.


EffectiveDate

DateTime

No


The effective date for which to retrieve the mileage rate.

2018-03-01z

ExpenseDocumentIdentity

PwsExpenseDocumentRef

See DisbursedCurrencyIdentity above


The identify of the expense document whose resource's location is what the mileage rate is based on. The document's disbursed currency must match the one in DisbursedCurrencyIdentity if provided, and the document's resource must match the one in ResourceIdentity if provided. Otherwise, an error is returned in both cases. Click here for more information.


ResourceIdentity

PwsResourceRef

No


The resource whose mileage rate is requested. If both ExpenseDocumentIdentity and ResourceIdentity are both provided, this resource must match the resource on the expense document. If neither is provided in the request, requesting user/resource is used to locate the mileage rate. If this user is not a resource, an error is returned in the response. Click here for more information.


Request Usage Example(s)


Request 01
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pws="http://projectorpsa.com/PwsProjectorServices/" xmlns:req="http://projectorpsa.com/DataContracts/Requests/" xmlns:tim="http://projectorpsa.com/DataContracts/Shared/TimeAndCost/" xmlns:com="http://projectorpsa.com/DataContracts/Shared/Common/">
   <soapenv:Header/>
   <soapenv:Body>
      <pws:PwsGetMileageRate>
      <pws:serviceRequest>
            <req:SessionTicket>ARNkL4C1bp7KLtsSXQW6/g==</req:SessionTicket>
            <tim:DisbursedCurrencyIdentity>
               <com:CurrencyCode>USD</com:CurrencyCode>
            </tim:DisbursedCurrencyIdentity>
            <tim:EffectiveDate>2018-03-08z</tim:EffectiveDate>
            <tim:ExpenseDocumentIdentity>
               <com:DocumentNumber>ER00163</com:DocumentNumber>
            </tim:ExpenseDocumentIdentity>
            <tim:ResourceIdentity>
               <com:ResourceDisplayName>David Katz</com:ResourceDisplayName>
            </tim:ResourceIdentity>
         </pws:serviceRequest>
      </pws:PwsGetMileageRate>
   </soapenv:Body>
</soapenv:Envelope>


Response Format


PwsGetMileageRate Response


Response Elements


Element

Data Type

Description

Sample Data

Messages

PwsMessage[]

The web service response status and message. Click herefor more information


ResponseId

Int32

Click here for more information.

0

Status

RequestStatusClick here for more informationOk

ServerTimestampUtc

DateTime

Click here for more information.

2018-03-08T15:50:59.35176Z

EffectiveEndDate

DateTime

The mileage rate's effective end date

9999-12-31T00:00:00Z

EffectiveStartDate

DateTime

The mileage rate's effective start date

2013-01-01T00:00:00Z

MileageRate

Double

The mileage rate for this resource based on resource's location

0.565

MileageUom

String

The unit of the Mileage. 'M' is for miles and 'K' for kilometers.

M


Response Usage Example(s)


Example 01
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <PwsGetMileageRateResponse xmlns="http://projectorpsa.com/PwsProjectorServices/">
         <PwsGetMileageRateResult xmlns:a="http://projectorpsa.com/DataContracts/Shared/TimeAndCost/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <Messages xmlns="http://projectorpsa.com/CommonServices/" xmlns:b="http://projectorpsa.com/DataContracts/Shared/Common/"/>
            <ResponseId xmlns="http://projectorpsa.com/CommonServices/">0</ResponseId>
            <Status xmlns="http://projectorpsa.com/CommonServices/">Ok</Status>
            <ServerTimestampUtc xmlns="http://projectorpsa.com/CommonServices/">2018-03-08T16:03:15.5611309Z</ServerTimestampUtc>
            <a:EffectiveEndDate>9999-12-31T00:00:00Z</a:EffectiveEndDate>
            <a:EffectiveStartDate>2018-01-01T00:00:00Z</a:EffectiveStartDate>
            <a:MileageRate>0.6571</a:MileageRate>
            <a:MileageUom>M</a:MileageUom>
         </PwsGetMileageRateResult>
      </PwsGetMileageRateResponse>
   </s:Body>
</s:Envelope>

PwsGetMileageRate - Common Errors and Warnings

ErrorNumberErrorCodeErrorText
57545ResourceNotFoundThe specified resource does not exist.
65629ResourceNotOwnerOfExpenseReportThe specified resource does not match the expense report resource.
65630GivenCurrencyNotSameAsReportCurrencyThe specified currency does not match the expense document's disbursed currency.
65631ExpenseDocumentOrDisbursingCurrencyRequiredEither an expense document or a disbursing currency must be specified when retrieving mileage rates.
65678ResourceCannotBeDeterminedForMileageRateResource cannot be determined in order to look up mileage rate. (ex. when authenticated user is not a resource ...)