webService服务
http://www.jiexincard.com/pda/WebService.asmx 可以用浏览器打开
但是为什么添加web服务却连不上呢
[解决办法]
能看到服务描述吗?
http://www.jiexincard.com/pda/WebService.asmx?WSDL
[解决办法]
这个,我试了试,我都连上了,是不是你那。。方法不对啊
[解决办法]
的确可以打开,进入.net自己带的VS 命令提示工具 运行
wsdl /n:webRefNameSpace /out:'D:\webProxyClass.cs' http://www.jiexincard.com/pda/WebService.asmx?WSDL
生成的代理类
//------------------------------------------// <auto-generated>// 此代码由工具生成。// 运行时版本:2.0.50727.4961//// 对此文件的更改可能会导致不正确的行为,并且如果// 重新生成代码,这些更改将会丢失。// </auto-generated>//------------------------------------------// // 此源代码由 wsdl 自动生成, Version=2.0.50727.3038。// namespace TestInfos { using System.Diagnostics; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Xml.Serialization; /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Web.Services.WebServiceBindingAttribute(Name="WebServiceSoap", Namespace="http://cx.org/")] public interface IWebServiceSoap { Authentication AuthenticationValue { get; set; } /// <remarks/> [System.Web.Services.Protocols.SoapHeaderAttribute("AuthenticationValue")] [System.Web.Services.WebMethodAttribute()] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://cx.org/GetMemberInfo", RequestNamespace="http://cx.org/", ResponseNamespace="http://cx.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] MemberInfo GetMemberInfo(string cardNumber); } /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://cx.org/")] [System.Xml.Serialization.XmlRootAttribute(Namespace="http://cx.org/", IsNullable=false)] public partial class Authentication : System.Web.Services.Protocols.SoapHeader { private string userField; private string passwordField; private System.Xml.XmlAttribute[] anyAttrField; /// <remarks/> public string User { get { return this.userField; } set { this.userField = value; } } /// <remarks/> public string Password { get { return this.passwordField; } set { this.passwordField = value; } } /// <remarks/> [System.Xml.Serialization.XmlAnyAttributeAttribute()] public System.Xml.XmlAttribute[] AnyAttr { get { return this.anyAttrField; } set { this.anyAttrField = value; } } } /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://cx.org/")] public partial class MemberInfo { private string cardNumberField; private string userNameField; private string cardTypeField; private decimal moneyField; private decimal scoreField; private string shopField; private string mobileField; private System.DateTime extDateField; private System.DateTime startDateField; /// <remarks/> public string CardNumber { get { return this.cardNumberField; } set { this.cardNumberField = value; } } /// <remarks/> public string UserName { get { return this.userNameField; } set { this.userNameField = value; } } /// <remarks/> public string CardType { get { return this.cardTypeField; } set { this.cardTypeField = value; } } /// <remarks/> public decimal Money { get { return this.moneyField; } set { this.moneyField = value; } } /// <remarks/> public decimal Score { get { return this.scoreField; } set { this.scoreField = value; } } /// <remarks/> public string Shop { get { return this.shopField; } set { this.shopField = value; } } /// <remarks/> public string Mobile { get { return this.mobileField; } set { this.mobileField = value; } } /// <remarks/> public System.DateTime ExtDate { get { return this.extDateField; } set { this.extDateField = value; } } /// <remarks/> public System.DateTime StartDate { get { return this.startDateField; } set { this.startDateField = value; } } }}
[解决办法]
不行把VS重启下,
方法是对的
抑或用 上面方法生成代理类
[解决办法]
可以引用 已经帮您试验过了 你可以设置重启一下VS 或者电脑 还有看看 是否你的一些服务关了(猜的)