Skip to Content
0
Former Member
May 04, 2015 at 08:10 AM

Send DateTime over C4C Webservice

178 Views

hello,

I created a webservice in C4C for the Business Object "Activity" and consume the webservice in .Net. The connection work fine and I also receive a response from the webservice. Unfortunately when I want to constrain the request with a date then I don't get any response back. When I only make a selection by ProcessingTypeCode then I receive many answers in msgResponse but when I also want to make a selection by ReportedDateTime then the msgResponse is empty althought there must be many acitivities between this date.

What could I do that the DateTime also work?

Many thanks for your help in advance,

BR Jasmin

Code Snippet:

// Selection by ReportedDateTime

DateTime beginDate = new DateTime(2014, 1, 1, 0, 0, 0);

DateTime endDate = new DateTime(2015, 12, 31, 0, 0, 0);

msgRequest.ActivitySimpleSelectionBy.SelectionByReportedDateTime = new SelectionByReportedDateTime[1];

msgRequest.ActivitySimpleSelectionBy.SelectionByReportedDateTime[0] = new SelectionByReportedDateTime();

msgRequest.ActivitySimpleSelectionBy.SelectionByReportedDateTime[0].InclusionExclusionCode = "I";

msgRequest.ActivitySimpleSelectionBy.SelectionByReportedDateTime[0].IntervalBoundaryTypeCode = "3";

msgRequest.ActivitySimpleSelectionBy.SelectionByReportedDateTime[0].LowerBoundaryReportedDateTime = beginDate;

msgRequest.ActivitySimpleSelectionBy.SelectionByReportedDateTime[0].UpperBoundaryReportedDateTime = endDate;

// Selection by ProcessingTypeCode

msgRequest.ActivitySimpleSelectionBy.SelectionByProcessingTypeCode = new SelectionByProcessingTypeCode[1];

msgRequest.ActivitySimpleSelectionBy.SelectionByProcessingTypeCode[0] = new SelectionByProcessingTypeCode();

msgRequest.ActivitySimpleSelectionBy.SelectionByProcessingTypeCode[0].InclusionExclusionCode = "I";

msgRequest.ActivitySimpleSelectionBy.SelectionByProcessingTypeCode[0].IntervalBoundaryTypeCode = "1";

msgRequest.ActivitySimpleSelectionBy.SelectionByProcessingTypeCode[0].LowerBoundaryProcessingTypeCode = "0001";

// Send Request

msgResponse = client.QueryByElements(msgRequest);