Namespaces


Note that the services built in the chapter have no defined namespaces. If you looked at the WSDL files that were produced, you would see that the namespace provided is http://tempuri.org. Obviously, you don’t want to go live with this default namespace. Instead, you need to define your own namespace.

To accomplish this task, the interface’s <ServiceContract()> attribute enables you to set the namespace, as shown here:

 <ServiceContract(Namespace:="http://www.lipperweb.com/ns/")> _ Public Interface IHelloCustomer     <OperationContract()> _     Function HelloFirstName(ByVal cust As Customer) As String     <OperationContract()> _     Function HelloFullName(ByVal cust As Customer) As String End Interface

Here, the <ServiceContract()> attribute uses the Namespace property to provide a namespace.




Professional VB 2005 with. NET 3. 0
Professional VB 2005 with .NET 3.0 (Programmer to Programmer)
ISBN: 0470124709
EAN: 2147483647
Year: 2004
Pages: 267

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net