Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to config system.net.servicePointManager.expect100Continue=false in PCL for Xamarin.Forms

$
0
0

Howdy,

We're recreating our Xamain 2.0 iPhone and Droid apps in Xamarin.Forms for their next version. Our apps talk to a WCF compliant endpoint to do CRUD operations. In all our other .NET apps we have to configure the system.net.servicePointManager.expect100Continue=false either in the app.config for WPF apps or its done in the application classes of our existing iPhone and Droid apps.

We are attempting to creating our WCF access via a PCL that is targetted iOS, Droid and WinPhone, Windows 8. How to set this config parameter in a Xamarin.Forms apps? We've had to jump through a lot of hoops to make TAP work for WCF and now we hit this. Hopefully, its easy and we are just missing something, but since servicePointManager isn't in the PCL profile and we can't get down to the HTTPRequest object, we're stumped.

This is the exception we get which we know is attributed to the servicePointManager.expect100Continue flag not being set to false.

``{System.Net.WebException: There was an error on processing web request: Status code 417(ExpectationFailed): Expectation Failed
  at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd () [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.String].GetResult () [0x00000] in <filename unknown>:0 

Any help?


Viewing all articles
Browse latest Browse all 58056

Trending Articles