SoapBinding.Address Свойство

Определение

Возвращает или задает URL-адрес веб-службы XML, реализующей SOAP-привязку.

public string Address { get; set; }

Значение свойства

URL-адрес веб-службы XML, реализующей SOAP-привязку. Значение по умолчанию — Empty.

Примеры

// 'dataservice.disco' is a sample discovery document.
string myStringUrl = "http://localhost/dataservice.disco";

// Call the Discover method to populate the Documents property.
DiscoveryClientProtocol myDiscoveryClientProtocol =
    new DiscoveryClientProtocol();
myDiscoveryClientProtocol.Credentials =
    CredentialCache.DefaultCredentials;
DiscoveryDocument myDiscoveryDocument =
    myDiscoveryClientProtocol.Discover(myStringUrl);

Console.WriteLine("Demonstrating the Discovery.SoapBinding class.");

// Create a SOAP binding.
SoapBinding mySoapBinding = new SoapBinding();

// Assign an address to the created SOAP binding.
mySoapBinding.Address = "http://schemas.xmlsoap.org/disco/scl/";

// Bind the created SOAP binding with a new XmlQualifiedName.
mySoapBinding.Binding = new XmlQualifiedName("string",
    "http://www.w3.org/2001/XMLSchema");

// Add the created SOAP binding to the DiscoveryClientProtocol.
myDiscoveryClientProtocol.AdditionalInformation.Add(mySoapBinding);

// Display the namespace associated with SOAP binding.
Console.WriteLine("Namespace associated with the SOAP binding is: "
    + SoapBinding.Namespace);

// Write all the information of the DiscoveryClientProtocol.
myDiscoveryClientProtocol.WriteAll(".","results.discomap");

Применяется к

Продукт Версии
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1