EndpointAddress 构造函数 (Uri, EndpointIdentity, AddressHeaderCollection)
2012-05-09 14:10
218 查看
EndpointAddress 构造函数 (Uri, EndpointIdentity, AddressHeaderCollection)
使用指定的 URI、标识和标头集合初始化 EndpointAddress 类的新实例。
命名空间: System.ServiceModel
程序集: System.ServiceModel(在 System.ServiceModel.dll 中)
语法
public EndpointAddress(
Uri uri,
EndpointIdentity identity,
AddressHeaderCollection headers
)
标识终结点位置的 Uri。
identity类型:System.ServiceModel..::.EndpointIdentity
终结点的 EndpointIdentity。
headers类型:System.ServiceModel.Channels..::.AddressHeaderCollection
包含用于与终结点交互的地址信息的 AddressHeaderCollection。
示例
下面的代码演示如何使用 Uri、EndpointIdentity
和 AddressHeaderCollection 对象来构造
EndpointAddress 对象。
//Create new address headers for special services and add them to an array
AddressHeader addressHeader1 = AddressHeader.CreateAddressHeader("specialservice1", "http://localhost:8000/service", 1);
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
AddressHeaderCollection addressHeaderColl = new AddressHeaderCollection(addressHeaders);
// <Snippet#15>
EndpointIdentity endpointIdentity = EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
EndpointAddress endpointAddress = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"),
endpointIdentity,
addressHeaderColl);
EndpointIdentity thisEndpointIdentity = endpointAddress.Identity;
// </Snippet#15>
版本信息
平台
Windows 7, Windows Vista SP1 或更高版本, Windows XP SP3, Windows Server 2008(不支持服务器核心), Windows Server 2008 R2(支持 SP1 或更高版本的服务器核心), Windows Server 2003 SP2
.NET Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
请参见
EndpointAddress 重载
System.ServiceModel 命名空间
使用指定的 URI、标识和标头集合初始化 EndpointAddress 类的新实例。
命名空间: System.ServiceModel
程序集: System.ServiceModel(在 System.ServiceModel.dll 中)
语法
Public Sub New ( _ uri As Uri, _ identity As EndpointIdentity, _ headers As AddressHeaderCollection _ )
public EndpointAddress(
Uri uri,
EndpointIdentity identity,
AddressHeaderCollection headers
)
public: EndpointAddress( Uri^ uri, EndpointIdentity^ identity, AddressHeaderCollection^ headers )
new : uri:Uri * identity:EndpointIdentity * headers:AddressHeaderCollection -> EndpointAddress
参数
uri类型:System..::.Uri标识终结点位置的 Uri。
identity类型:System.ServiceModel..::.EndpointIdentity
终结点的 EndpointIdentity。
headers类型:System.ServiceModel.Channels..::.AddressHeaderCollection
包含用于与终结点交互的地址信息的 AddressHeaderCollection。
示例
下面的代码演示如何使用 Uri、EndpointIdentity
和 AddressHeaderCollection 对象来构造
EndpointAddress 对象。
//Create new address headers for special services and add them to an array
AddressHeader addressHeader1 = AddressHeader.CreateAddressHeader("specialservice1", "http://localhost:8000/service", 1);
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
AddressHeaderCollection addressHeaderColl = new AddressHeaderCollection(addressHeaders);
// <Snippet#15>
EndpointIdentity endpointIdentity = EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
EndpointAddress endpointAddress = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"),
endpointIdentity,
addressHeaderColl);
EndpointIdentity thisEndpointIdentity = endpointAddress.Identity;
// </Snippet#15>
版本信息
.NET Framework
受以下版本支持:4、3.5、3.0.NET Framework Client Profile
受以下版本支持:4、3.5 SP1平台
Windows 7, Windows Vista SP1 或更高版本, Windows XP SP3, Windows Server 2008(不支持服务器核心), Windows Server 2008 R2(支持 SP1 或更高版本的服务器核心), Windows Server 2003 SP2
.NET Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
请参见
参考
EndpointAddress 类EndpointAddress 重载
System.ServiceModel 命名空间
相关文章推荐
- EndpointAddress——不只是一个Uri[上篇]
- EndpointAddress——不只是一个Uri[下篇]
- Endpoint--Address
- 艾伟:WCF安全之EndPointIdentity
- HTML5学习笔记简明版(3):新元素之hgroup,header,footer,address,nav
- REST URI设计:版本号放在http header中,rewrite配置
- SharePoint2010 IT Professional - Create Host Header Site Collection
- asp.net当修改header时提示:The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- hibernate-collection---address
- Tomcat 6 Missing Host Header Internal IP Address Disclosure
- 在.net中使用wcf做服务时,千万不要使用127.0.0.1作为Endpoint的address
- 关于ArrayList构造函数ArrayList(Collection c);
- WCF endpoint binding address contract
- Error initializing endpoint java.net.BindException :Address already in use:JVM_Bind:80 (8080).
- Specifying an Endpoint Address
- java.net.MalformedURLException: Invalid address. Endpoint address cannot be null.
- Host Header Site Collection身份验证失败,无法登陆的解决方案
- 在DOc的构造函数中得到VIew类指针引起的问题(GetActiveView()引起的Access Violation;this->GetFirstViewPosition()=NULL;ASSERT(AfxIsValidAddress(this, siz
- 艾伟_转载:WCF安全之EndPointIdentity
- header元素和hgroup元素和footer元素和address元素