ServiceRouterAddLaborLevelDetail Method | |
Namespace: AppOne.Services.V2Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax Exceptions Exception | Condition |
---|
ServiceException | Invalid/missing data and general error exceptions |
Remarks Example {
"AuthToken":"...",
"ValidateCustomFieldName" : false,
"Payload":[{
"Code":"custom-code",
"CustomFields":[{
"Name":"Multi_LL_CF",
"Value":"test2"
}],
"EmployeeNotesRequired":false,
"EndDate":"\/Date(1578121200000-0700)\/",
"Name":"custom-name",
"ParentID":${Data#LLID},
"StartDate":"\/Date(1262588400000-0700)\/"
},
{
"Code":"custom-code-1",
"CustomFields":[{
"Name":"Multi_LL_CF",
"Value":"test2"
}],
"EmployeeNotesRequired":false,
"EndDate":"\/Date(1578121200000-0700)\/",
"Name":"custom-name-1",
"ParentID":1,
"StartDate":"\/Date(1262588400000-0700)\/"
}]
}
{
"Report": {
"APIVersion": "2.0",
"ProcessTime": "0.0321037",
"RequestTime": "/Date(1485295445783-0700)/",
"ResponseTime": "/Date(1485295445815-0700)/",
"Results": 2
},
"Results": [
{
"ID": 23947,
"Messages": ["PASS: Labor level detail successfully added for code 'custom-code'."],
"Status": 1
},
{
"ID": 0,
"Messages": ["FAIL: Labor level with ID (ParentID) '1' does not exist in the system. Labor level details require a valid labor level ParentID."],
"Status": 0
}
]
}
public void V2_AddLaborLevelDetail_SOAP_Test()
{
try
{
var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
{
int countTest_1 = 0;
SoapServiceV2.AddLaborLevelDetailRequest request1 = new SoapServiceV2.AddLaborLevelDetailRequest();
List<AddLaborLevelDetailModel> payload = new List<AddLaborLevelDetailModel>();
AddLaborLevelDetailModel model = new AddLaborLevelDetailModel {
Code = DateTime.Now.ToShortDateString(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
Name = "Name_" + DateTime.Now.ToShortDateString(),
ParentID = 89
};
payload.Add(model);
request1.input = new SoapServiceV2.AddLaborLevelDetailIn
{
AuthToken = AuthToken,
ValidateCustomFieldName = false,
Payload = payload
};
SoapServiceV2.AddLaborLevelDetailResponse response1 = client.AddLaborLevelDetail(request1);
countTest_1 = (response1.AddLaborLevelDetailResult.Results != null) ? response1.AddLaborLevelDetailResult.Results.Count : 0;
Assert.IsTrue(countTest_1 > 0);
});
RunServiceClient(actionTestLogic);
}
catch (FaultException<SoapServiceV2.ServiceException> fe)
{
Assert.Fail(fe.Detail.Message);
}
}
See Also