Forum Discussion
jona-appl
Jan 12, 2022Copper Contributor
ASMX web service client .NET 6 (IOS)
Hello, We need to migrate own Xamarin iOS application to .NET 6 iOS. But we can't call ASMX web services (available with Xamarin iOS). Web References is not available with visual studio for .NET ...
JamesMontemagno
Microsoft
Jan 12, 2022Can you do ... Right Click -> Add -> Connected Service -> Service References (OpenAPI, gRPC, WCF) and that wsdl from your asmx url still should work when you add a wcf web service reference.
- jona-applJan 13, 2022Copper Contributor
Yes, I can use that. It works with Windows and Mac apps. But with iOS, I can call nothing.
I have this exception with each calls:
ex {System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Net.Http.NSUrlSessionHandler.set_ServerCertificateCustomValidationCallback(Func`5 value) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags i…}
- JamesMontemagnoJan 13, 2022
Microsoft
Gotcha, you may have had a different HTTP stack selected as https is required for NSURL based sessions unless you added a ATS exception.
https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/http-stack
and also https://docs.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/web-services/asmx
I would check your older project and se if you had the info.plis with different info or different settings in your csproj
for example
```
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
``- jona-applJan 14, 2022Copper Contributor
No, it doesn't work.
ATS is disabled and we use https (TLS 1.2).
<key>NSAllowsArbitraryLoads</key>
<true/>
My cproj: (My web services are called by DLLMedinect.dll)
https://pastebin.com/C8P0JA2V
My info.plist:
https://pastebin.com/UcZd7JC1
I created this also for avoid a lot of changes:
https://pastebin.com/tdtDU3C0