Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page