Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

AppointmentRequest result in SoapException

$
0
0

Hi

I have created the following method to return vacant time slots for a service appointment booking project

       public BookingProposals GetVacantTimes(Guid serviceId)

       {

           var ctx = new SkandiaCrmDataContext("CRMCONN");

           var svc = ctx.CreateService();

           var search = new SearchRequest

           {

               AppointmentRequest = new AppointmentRequest

               {

                   Direction = SearchDirection.Forward,

                   ServiceId = serviceId,

                   Duration = 60,

                   NumberOfResults = 10,

                   SearchWindowStart = new CrmDateTime(DateTime.Now.ToUniversalTime().ToString()),

                   SearchWindowEnd = new CrmDateTime(DateTime.Now.AddDays(7).ToUniversalTime().ToString()),

                   UserTimeZoneCode = 1,

               }

           };

           var response = (SearchResponse)svc.Execute(search);

           return new BookingProposals { Proposals = response.SearchResults.Proposals.Select(o => new BookingProposal { Start = o.Start.UniversalTime, End = o.End.UniversalTime }) };

       }

But the Execute results in a SoapException

It is using my Administrator credentials, so i dont think it is a problem with authentication


Viewing all articles
Browse latest Browse all 82002

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>