Skip to Content
Object-Oriented Programming with Visual Basic .NET
book

Object-Oriented Programming with Visual Basic .NET

by J.P. Hamilton
October 2002
Beginner
312 pages
7h 22m
English
O'Reilly Media, Inc.
Content preview from Object-Oriented Programming with Visual Basic .NET

10.3. Using Web Services from .NET Remoting

To get the best of both worlds—that is, cross-platform compatibility and performance—you can access web services from .NET remoting. Imagine a scenario in which a service is not only provided to the world at large, but internally—within the company providing it. There is no reason why the internal clients should suffer from potential performance problems and implementation limitations because the objects they need are web services.

Achieving this compatibility takes little effort. Just add an additional attribute to the web method to let it know that RPC-encoding is needed. The attribute is called SoapRpcMethodAttribute, and it is applied like this:

<SoapRpcMethod( ), _
 WebService(Namespace:="http://www.mydomainhere.com/")> _
Public Class ZipService : Inherits MarshalByRefObject

Additionally, the class needs to derive from MarshalByRefObject. If not, SoapSuds generates the wrong type of proxy.

10.3.1. Configuration

A Web.config file must be provided for the web service (placed into the ZipService virtual directory) to register any channels that might be needed and to define well-known object entries. In Example 10-4, a TCP channel is configured to listen on port 1969 and a Singleton that is accessible at ZipService.soap is specified for ZipService.

Example 10-4. Web.config for ZipService
<configuration> <system.runtime.remoting> <application> <channels> <channel ref="tcp" port="1969" /> </channels> <service> <wellknown mode="Singleton" ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Programming Visual Basic .NET

Programming Visual Basic .NET

Dave Grundgeiger

Publisher Resources

ISBN: 0596001460Catalog PageErrata