Bug 60386 - Webservice functions inaccessible since BETA version (TimeOut Error)
Summary: Webservice functions inaccessible since BETA version (TimeOut Error)
Status: RESOLVED DUPLICATE of bug 60317
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: XI 11.4 (d15-5)
Hardware: PC Mac OS
: High critical
Target Milestone: 15.5
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-26 07:01 UTC by Alain
Modified: 2017-11-08 22:39 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 60317

Description Alain 2017-10-26 07:01:13 UTC
Hello,

since version BETA Xamarin.IOS 11.4.93 and Xamarin.MAC 4.0.93 (see below), can not access the functions of webservices.

When I execute a function of the webservice, it blocks and I am ejected by a TimeOut with the following error:

{System.Net.WebException: The request timed out at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object [] parameters) [0x000a7] in /Library/Frameworks/Xamarin.Mac.framework /Versions/4.0.0.97/src/mono/mcs/class/...}

I have no problems with Xamarin.IOS 11.2 and Xamarin.MAC 3.8 and 3.99.

My webservices are in https.

=== Visual Studio Professional 2017 for Mac (Preview) ===

Version 7.3 Preview (7.3 build 708)
Installation UUID: af98516b-7b3c-413e-ba1b-95a1baeaccc6
Runtime:
	Mono 5.4.1.4 (2017-06/c6605763a36) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010004

=== NuGet ===

Version : 4.3.1.4445

=== .NET Core ===

Runtime : Non installé
SDK : Non installé
SDK MSBuild : /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version : 1.6.0
Emplacement : /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version : 8.1.0.21 (Visual Studio Professional)
Android SDK: /Users/macbookrogister/Library/Developer/Xamarin/android-sdk-macosx
	Versions Android prises en charge :
		6.0(Niveau d’API 23)
		7.1(Niveau d’API 25)

Version des outils du SDK : 25.2.5
Version des outils de plateforme du SDK : 25.0.5
Version des outils de génération du SDK : 25.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Code EPL d'Android Designer disponible ici :
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 9.0.1 (13249)
Build 9A1004

=== Xamarin.iOS ===

Version: 11.4.0.93 (Visual Studio Professional)
Hash: 1b460cb9
Branch: d15-5
Build date: 2017-10-13 18:49:56-0400

=== Xamarin.Mac ===

Version: 4.0.0.97 (Visual Studio Professional)

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 703000708
Git revision: 8280d69b96e85b524aeda11210fdc2e54cc7f30c
Build date: 2017-10-15 06:04:33-04
Xamarin addins: b7cbc5837cf6fa3ba63d613a47480cc4ecd4759c
Build lane: monodevelop-lion-d15-5

=== Operating System ===

Mac OS X 10.13.0
Darwin 17.0.0 Darwin Kernel Version 17.0.0
    Thu Aug 24 21:48:19 PDT 2017
    root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
Comment 1 Timothy Risi 2017-10-26 17:47:40 UTC
This looks to be the same issue as https://bugzilla.xamarin.com/show_bug.cgi?id=60317

*** This bug has been marked as a duplicate of bug 60317 ***
Comment 2 Sebastien Pouliot 2017-11-07 21:27:39 UTC
It's not clear enough to me that this is a duplicate and I rather have a different bug for XI (versus XM) for tracking purposes.
Comment 3 Sebastien Pouliot 2017-11-07 21:28:14 UTC
@Alain we'll need a test case to investigate this. Thanks!
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2017-11-08 22:39:21 UTC
## Example test case

I was able to replicate this behavior by adding the following methods in the ViewController of a template Xamarin.Mac app:

[System.Web.Services.WebServiceBindingAttribute(Name = "TempConvertSoap", Namespace = "https://www.w3schools.com/xml/")]
public class MyTemperature : System.Web.Services.Protocols.SoapHttpClientProtocol
{

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    public MyTemperature()
    {
        this.Url = "https://www.w3schools.com/XML/tempconvert.asmx";
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("https://www.w3schools.com/xml/FahrenheitToCelsius", RequestNamespace = "https://www.w3schools.com/xml/", ResponseNamespace = "https://www.w3schools.com/xml/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    public string FahrenheitToCelsius(string input)
    {
        object[] results = this.Invoke("FahrenheitToCelsius", new object[] { input });
        return ((string)(results[0]));
    }
}

public override void ViewDidLoad()
{
    base.ViewDidLoad();
    Console.WriteLine((new MyTemperature()).FahrenheitToCelsius("100"));
}


(Note: I don't have much experience with `SoapHttpClientProtocol`, so I think I didn't quite manage to match up the `FahrenheitToCelsius()` method correctly with the actual service, but this works well enough to check the timeout behavior.)




## BAD results

If I pause the debugger before the request times out, the call stack shows that SoapHttpClientProtocol calls `HttpWebClientProtocol.GetWebResponse()`, and that matches the scenario from Bug 60317.  And as expected, the patch from Bug 60317, Comment 21 resolves the timeout problem in this case too.  I will accordingly mark this bug as a duplicate.


### Sample call stack, for reference

> System.Threading.WaitHandle.WaitOne_internal() in 
> System.Threading.WaitHandle.WaitOneNative(Microsoft.Win32.SafeHandles.SafeWaitHandle waitableSafeHandle, uint millisecondsTimeout, bool hasThreadAffinity, bool exitContext) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/corlib/System.Threading/WaitHandle.cs:104
> System.Threading.WaitHandle.InternalWaitOne(Microsoft.Win32.SafeHandles.SafeWaitHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs:250
> System.Threading.WaitHandle.WaitOne(long timeout, bool exitContext) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs:239
> System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/referencesource/mscorlib/system/threading/waithandle.cs:206
> System.Net.SimpleAsyncResult.WaitUntilComplete(int timeout, bool exitContext) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/System/System.Net/SimpleAsyncResult.cs:171
> System.Net.HttpWebRequest.EndGetResponse(System.Net.WebAsyncResult asyncResult) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1023
> System.Net.HttpWebRequest.GetResponse() in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1043
> System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(System.Net.HttpWebRequest request) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs:173
> System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(System.Net.HttpWebRequest request) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs:171
> System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(string method_name, object[] parameters) in /Library/Frameworks/Xamarin.Mac.framework/Versions/4.0.0.98/src/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs:354
> CocoaAppMac1.ViewController.MyTemperature.FahrenheitToCelsius(string input) in /Users/macuser/Projects/CocoaAppMac1/CocoaAppMac1/ViewController.cs:46

*** This bug has been marked as a duplicate of bug 60317 ***