New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't call WCF methods in Xamarin.Forms (Cross-Platform) #2940
Comments
Under iOS you can't use dynamic proxy generation. Here is an example for implementing how to get a client with iOS: https://forums.xamarin.com/discussion/15148/how-to-access-wcf-service-in-ios-platform-using-xamarin |
@TillAlex I checked the link and couldn't find even where should i put those code to get working. Right now my project create a Reference.cs in a folder with name ServiceReference1 under Connected Services. I should say this is a auto generate file even i change it, It will back to normal if i update my WCF connection in case i republish my web service on web. |
Sorry, I do not have any experience with autogenerated clients, but it seems they use dynamic proxy generation. We were able to implement a client ourselves (manually) the way it is done in that thread and it's working with iOS. |
duplicate of #2463 |
this same my problem . what solution for this issue? @AliParLouS |
System.InvalidOperationException: MonoTouch does not support dynamic proxy code generation. Override this method or its caller to return specific client proxy instance at System.ServiceModel.ChannelFactory1[TChannel].CreateChannel (System.ServiceModel.EndpointAddress address, System.Uri via) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:141 at System.ServiceModel.ChannelFactory1[TChannel].CreateChannel (System.ServiceModel.EndpointAddress address) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:115 this description for this error |
With iOS dynamic proxy generation does not work. See my first post in this issue. |
@TillAlex How to use this code in xamarin forms project ? |
So far nothing, Still WCF not work in iOS and Android for me, I changed my WCF to WebAPI for now, But it's not a solution... |
@musab-alrmmah: Did you try to implement your own ServiceChannel deriving from ChannelBase<> and a Servive overriding CreateChannel like it is described in the post I am linking? |
I have exactly the same issue, WCF is returning value only in UWP but NOT in Android or IOS. Any solution? |
Hi,
I just create a simple WCF project with default values (without change even a single line of code), i publish it in web, Consume it in EXE application and it work fine, Cosume it in asp.net webform and it work fine.
Now i create another simple Xamarin Cross-Platform with .Net Standard 2 (UWP, iOS, Android), Used "Microsoft WCF Web Service Reference Provider" and i checked all 3 project in UWP work fine but in android and iOS project load and after click the button can't call GetDataAsync().
Xamarin button clicked code :
Android runtime error after clicked button :
iOS runtime error after clicked button :
Funny thing is UWP work fine and return method string just fine.
This is my first experience to consume WCF in xamarin.forms and i feel maybe i do something wrong.
The text was updated successfully, but these errors were encountered: