1
我有一個看起來像這樣的asmx服務:移動ASMX服務,WCF基本綁定服務
[WebService(Namespace = "http://www.zzz.com/ema/xml/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class AService : System.Web.Services.WebService, IAServiceSoap
的IAServiceSoap接口看看下面
[WebService(Namespace = "http://www.zzz.com/ema/xml/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class AService : System.Web.Services.WebService, IAServiceSoap
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Web.Services.WebServiceBindingAttribute(Name = "AsmbServiceSoap", Namespace = "http://www.zzz.com/ema/xml/")]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(SOAPXmlEventEntry))]
public interface IAsmbServiceSoap {
/// <remarks/>
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapRpcMethodAttribute("http://www.zzz.com/ema/xml/Login", RequestNamespace="http://www.zzz.com/ema/xml/", ResponseNamespace="http://www.zzz.com/ema/xml/")]
void Login(string url, string id, int ClientType, out int ClientID);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.SoapTypeAttribute(Namespace="http://www.zzz.com/ema/xml/")]
public partial class SOAPXmlEventEntry {
private int datatypeField;
private string dataField;
private int idField;
/// <remarks/>
public int datatype {
get {
return this.datatypeField;
}
set {
this.datatypeField = value;
}
}
/// <remarks/>
public string data {
get {
return this.dataField;
}
set {
this.dataField = value;
}
}
/// <remarks/>
public int id {
get {
return this.idField;
}
set {
this.idField = value;
}
}
}
的問題是我怎麼動的東西,看起來像這樣WCF的Web服務與基本綁定?
對於初學者來說,可以使用一組不同的屬性:'ServiceContract'和'OperationContract'。你的配置現在主要存在於你的'app.config'中的[](http://msdn.microsoft.com/en-us/library/ms731354.aspx)中。 –
EthanB
但我如何設置所有這些名稱空間? –
您可以在屬性中設置命名空間,請參閱http://rebuildall.umbraworks.net/2010/11/10/WCF_service_namespaces – stuartd