开发者

Web service not getting called and crashing

I am new to MonoDroid, I have developed an application on MonoTouch which uses web-services and i'm trying to port it on Android. I am using MonoDevelop on a Mac ( Mac OS X ).

I've tried to run the "Consuming Web Services" tutorial from Xamarin ( http://android.xamarin.com/index.php?title=Documentation/Guides/Consuming_Web_Services&file=58 ) but it doesn't work, neither on my 2.2 simulator, nor on my HTC Legend device.

When i click on the button, the application freeze for 3-4 seconds, I don't see any network activity on the status bar and then it crashes and cl开发者_Go百科ose application.

Here's the console trace :

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.

( yes it ends with Android. , i didn't cut it )

Could anyone help me on that ?

Regards, C.Hamel


Apparently it was coming from the fact that I was using WCF implementation of web services when i had to use .NET 2.0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜