Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Web服务未被调用和崩溃_C#_Android_Web Services_Xamarin.android - Fatal编程技术网

C# Web服务未被调用和崩溃

C# Web服务未被调用和崩溃,c#,android,web-services,xamarin.android,C#,Android,Web Services,Xamarin.android,我是MonoDroid的新手,我已经在MonoTouch上开发了一个使用web服务的应用程序,我正在尝试将它移植到Android上。我正在Mac(MacOSX)上使用MonoDevelop 我曾尝试从Xamarin()运行“消费Web服务”教程,但无论是在我的2.2模拟器上,还是在我的HTC Legend设备上,它都不起作用 当我点击按钮时,应用程序冻结3-4秒,在状态栏上看不到任何网络活动,然后它崩溃并关闭应用程序 以下是控制台跟踪: I/MonoDroid( 1358): UNHANDLED

我是MonoDroid的新手,我已经在MonoTouch上开发了一个使用web服务的应用程序,我正在尝试将它移植到Android上。我正在Mac(MacOSX)上使用MonoDevelop

我曾尝试从Xamarin()运行“消费Web服务”教程,但无论是在我的2.2模拟器上,还是在我的HTC Legend设备上,它都不起作用

当我点击按钮时,应用程序冻结3-4秒,在状态栏上看不到任何网络活动,然后它崩溃并关闭应用程序

以下是控制台跟踪:

I/MonoDroid( 1358): UNHANDLED EXCEPTION: System.InvalidOperationException: A Binding must be configured for this channel factory
I/MonoDroid( 1358): at System.ServiceModel.ChannelFactory.EnsureOpened () <0x000f0>
I/MonoDroid( 1358): at System.ServiceModel.ChannelFactory`1<TestWS.soatest.parasoft.com.ICalculator>.CreateChannel () <0x00013>
I/MonoDroid( 1358): at System.ServiceModel.ClientBase`1<TestWS.soatest.parasoft.com.ICalculator>.CreateChannel () <0x0001f>
I/MonoDroid( 1358): at System.ServiceModel.ClientBase`1<TestWS.soatest.parasoft.com.ICalculator>.get_InnerChannel () <0x00033>
I/MonoDroid( 1358): at System.ServiceModel.ClientBase`1<TestWS.soatest.parasoft.com.ICalculator>.get_Channel () <0x00013>
I/MonoDroid( 1358): at TestWS.soatest.parasoft.com.CalculatorClient.add (single,single) <0x0001b>
I/MonoDroid( 1358): at TestWS.ThreadDemo.button_Click (object,System.EventArgs) <0x0007f>
I/MonoDroid( 1358): at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) <0x0005f>
I/MonoDroid( 1358): at Android.Views.View/IOnClickListenerAdapter.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) <0x00063>
I/MonoDroid( 1358): at (wrapper dynamic-method) object.191f2c9a-a458-4c04-ae08-d2241fd3ff65 (intptr,intptr,intptr) <0x00033>
E/mono    ( 1358): 
E/mono    ( 1358): Unhandled Exception: System.InvalidOperationException: A Binding must be configured for this channel factory
E/mono    ( 1358):   at System.ServiceModel.ChannelFactory.EnsureOpened () [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at System.ServiceModel.ChannelFactory`1[TestWS.soatest.parasoft.com.ICalculator].CreateChannel () [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at System.ServiceModel.ClientBase`1[TestWS.soatest.parasoft.com.ICalculator].CreateChannel () [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at System.ServiceModel.ClientBase`1[TestWS.soatest.parasoft.com.ICalculator].get_InnerChannel () [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at System.ServiceModel.ClientBase`1[TestWS.soatest.parasoft.com.ICalculator].get_Channel () [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at TestWS.soatest.parasoft.com.CalculatorClient.add (Single x, Single y) [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at TestWS.ThreadDemo.button_Click (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
E/mono    ( 1358):   at Android.Views.View+IOnClickListenerImplementor.OnClick (Android.
I/MonoDroid(1358):未处理的异常:System.InvalidOperationException:必须为此通道工厂配置绑定
I/MonoDroid(1358):在System.ServiceModel.ChannelFactory.com上重新打开()
I/MonoDroid(1358):位于System.ServiceModel.ChannelFactory`1.CreateChannel()
I/MonoDroid(1358):位于System.ServiceModel.ClientBase`1.CreateChannel()
I/MonoDroid(1358):位于System.ServiceModel.ClientBase`1.get_InnerChannel()
I/MonoDroid(1358):位于System.ServiceModel.ClientBase`1.get_通道()
I/MonoDroid(1358):位于TestWS.soatest.parasoft.com.CalculatorClient.add(single,single)
I/MonoDroid(1358):在TestWS.ThreadDemo.button_点击(object,System.EventArgs)
I/MonoDroid(1358):位于Android.Views.View/IOnClickListenerImplementor.OnClick(Android.Views.View)
I/MonoDroid(1358):在Android.Views.View/IOnClickListenerAdapter.n_OnClick_Landroid_View_View_View(intptr,intptr,intptr)
I/MonoDroid(1358):at(包装器动态方法)对象191f2c9a-a458-4c04-ae08-d2241fd3ff65(intptr、intptr、intptr)
E/mono(1358):
E/mono(1358):未处理的异常:System.InvalidOperationException:必须为此通道工厂配置绑定
E/mono(1358):在System.ServiceModel.ChannelFactory.com中重新打开()[0x00000]在:0
E/mono(1358):位于System.ServiceModel.ChannelFactory`1[TestWS.soatest.parasoft.com.ICalculator].CreateChannel()[0x00000]中:0
E/mono(1358):位于System.ServiceModel.ClientBase`1[TestWS.soatest.parasoft.com.ICalculator].CreateChannel()[0x00000]中:0
E/mono(1358):位于System.ServiceModel.ClientBase`1[TestWS.soatest.parasoft.com.ICalculator].get_InnerChannel()[0x00000]中:0
E/mono(1358):位于System.ServiceModel.ClientBase`1[TestWS.soatest.parasoft.com.ICalculator].get_Channel()[0x00000]in:0
E/mono(1358):位于TestWS.soatest.parasoft.com.CalculatorClient.add(单x,单y)[0x00000]in:0
E/mono(1358):在TestWS.ThreadDemo.button_处单击(System.objectsender,System.EventArgs E)[0x00000]in:0
E/mono(1358):在Android.Views.View+IOnClickListenerImplementor.OnClick(Android)。
(是的,它以Android结尾,我没有剪掉它)

有人能帮我吗

问候,,
C.Hamel

显然,这是因为当我不得不使用.NET 2.0时,我正在使用web服务的WCF实现。

请您写下您正在访问的web服务的URL好吗?