
446
|
Chapter 13, Enhancing Visual Studio
#99 Generate Web Services Code
HACK
/// <remarks/>
[System.Web.Services.WebServiceBindingAttribute(
Name="UserValidationSoap",
Namespace="http://namespaces.infozerk.com/")]
[System.Web.Services.WebServiceAttribute(
Namespace="http://namespaces.infozerk.com/")]
public class UserValidationImpl : UserValidation
{
/// <remarks/>
[System.Web.Services.WebMethodAttribute( )]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("
http:/namespaces.infozerk.com/ValidateUser",
RequestNamespace="http://namespaces.infozerk.com/",
ResponseNamespace="http://namespaces.infozerk.com/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public override bool ValidateUser(int userID)
{
return new bool( );
}
}
}
Notice that the tool simply adds a stub return into the method—in this
example, it will return a new
bool value. From here, your job would be to
implement this Web Service by writing the contents of this method, doing
the actual work of determining whether this is a valid user.
Generate Client-Side Proxies
The other way that Visual Studio makes working with Web Services easy is
the ability to add a web reference to a Web Service. After adding a web refer-
ence, you can then access that Web Service just as if it were a local class in
your project, due to Visual Studio generating ...