有关silverlight中调用webservice的问题!!
有关silverlight中调用webservice的问题!!
【为什么我一定要发在silverlight版??因为我在winform程序里面用的好好的~~在sl项目里面就不能用了!!!】
System.InvalidOperationException was unhandled by user code
客户端配置部分中,找不到引用协定“webxmlWeather.WeatherWebServiceHttpGet”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。
我在里面sl调用 webservice 老是出错哦~~
说是找不到函数。恩 服务端确实没这些异步的函数。。额 是sl产生的。
哪里没配置呢??。。
该这么办呢?
错误提示:
System.InvalidOperationException was unhandled by user code
Message=在 ServiceModel 客户端配置部分中,找不到引用协定“webxmlWeather.WeatherWebServiceHttpGet”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。
StackTrace:
位于 System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
位于 System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
位于 System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
位于 System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
位于 System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)
位于 System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
位于 System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
位于 System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
位于 System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
位于 System.ServiceModel.ClientBase`1..ctor()
位于 midwareproj.webxmlWeather.WeatherWebServiceHttpGetClient..ctor()
位于 midwareproj.MainPage..ctor()
位于 midwareproj.App.Application_Startup(Object sender, StartupEventArgs e)
位于 System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
位于 MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
InnerException:
我的代码:
我的服务引用地址是:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
webxmlWeather.WeatherWebServiceHttpGetClient webxmlWeather_client = new WeatherWebServiceHttpGetClient();
在这里报的错!!