Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2004, 05:31 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default Passing Class object to WS

Hi Experts,

I have a web application in which I dont want to do any database updations. I want the database updations through a web service. I have created a class for the data access in which I have provided methods whcih calls the web service methods.

Can I have such a similar class in my web service so that I can pass the object of the class to the webservice from my web application. I want the details of the methods in the webservice class whereas my class in the web application will contain only call to the webservice using the instance of the class as a parameter (i mean using "this").

Is there some way to achieve this wherein I can expose a class in the web service to my web application?

Thanks in advance

Regards
Ganesh
__________________
Regards
Ganesh
http://ganeshprof.blogspot.com
Find your solution here...
 
Old October 2nd, 2004, 10:22 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

When you expose a web method that expects or returns a class, the web service will provide a description of that class thru the WSDL. When you make a web reference to the service, you'll get stub classes for not only the web service itself, but also for all the classes required by the web service. You can then use these classes with the web method.
 
Old October 3rd, 2004, 11:08 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Thanks planoie.

So can I use such a class type object in my web application that consumes the web service

Regards
Ganesh
 
Old October 4th, 2004, 11:41 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Most definately. That is best part. Once you have a web reference to the web service you have all the objects that it requires so you use the web service as if it's just a local class with some methods. You can create an instance of the class that the web method expects to see and pass it to the method. You get back whatever type (simple or complex/class) that the web method returns. From the viewpoint of the consuming code you don't even see what's going on in the background (i.e. the call to the web service over HTTP and all that).
 
Old October 4th, 2004, 11:12 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Thanx Peter

Regards
Ganesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to INVOKE any WS on server by WS on client ? Abhinavnaresh ASP.NET 2.0 Professional 1 April 4th, 2008 01:09 PM
Object reference not set - WebReference WS agfjesus .NET Web Services 2 August 1st, 2007 06:23 AM
(axis) Return object in WS, with style="wrapped" u wakeup J2EE 0 July 17th, 2006 01:51 AM
C# passing parameters to custom control class booksnore2 General .NET 1 October 5th, 2004 11:44 AM
Passing a class by reference James Diamond VB How-To 13 February 16th, 2004 06:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.