ASMX web service client .NET 6 (IOS)

Copper Contributor

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 6 projects. We have only Connected Services but it's not supported. Have you an idea for that? Connected services will be supported?

 

You will find more information here: https://docs.microsoft.com/en-us/answers/questions/689592/asmx-web-service-client-net-6-ios.html?chi...

6 Replies
Can 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.

@JamesMontemagno 

 

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…}

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>
``

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

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…}

You can check more here at https://apkislove.com/

@Johnmuller2255 

 

My exception is also the same.

 

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…}