GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET
Go To First  |  Previous Question  |  Next Question 
 ASP.NET  |  Question 136 of 164    Print  
What must be done before you can consume a web service?
Build a proxy library by using the wsdl.exe utility


  
Total Answers and Comments: 2 Last Update: October 21, 2009     Asked by: mahathi_mani 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 18, 2008 12:45:55   #1  
kingsalami Member Since: January 2008   Contribution: 4    

RE: What must be done before you can consume a web service?
1) First find a web service for example:
http:// www . nanonull . com/TimeService/TimeService . asmx

2) Create a web service proxy using the WSDL.exe in your
SDK folder like this:
WSDL http:// www . nanonull . com /TimeService/TimeService . asmx?WSDL


If you are successful you should see this:

Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'C:Program FilesMicrosoft Visual Studio 8SDKv2.0BinTimeService.cs'.

3)
Create a project in C# and add this file to your project.
4) Declare an instance of the class for this one: TimeService and then you can start calling the functions in your proxy file (TimeService.cs).


 
Is this answer useful? Yes | No
October 20, 2009 12:09:19   #2  
kirangiet Member Since: June 2009   Contribution: 24    

RE: What must be done before you can consume a web service?

There are 2 ways one can consume a webservice.


1) By creating a proxy manually

2) By adding web reference


Creating Proxy manually:


1) Browse the webservice

2) Add ?wsdl at the end of the URL

3) Save the wsdl file in local system

4) Use visual studio command line utility type WSDL.exe

5) It will create a .cs file inside the same folder where wsdl file is present

6) Type csc /t:library

7) It will create a .dll file add the file in the reference and you are done

8) Now you can use the webservice like any other C# class.


Adding Web Reference:


1) Right click on the project select Add Web Reference

2) Type the URL of the webservice

3) Give the reference name and you are done


In case of creating proxy manually when there is some addition or deletion
of new methods are happening we need to follow the same process each time. we
need not to create proxy if only implementation inside methods change because
our proxy does not contain implementation part. In case of using web service
through adding web reference we need to select web reference right click and
select update. It will update the proxy with latest changes.


 
Is this answer useful? Yes | No

 Related Questions

By default the ASP.Net app runs in the context of a local user ASPNet on IIS version 5. On IIS version 6 on windows 2003 it is called Network service 
Latest Answer : ASPNET is the account name for the asp.net application running on IIS 5.0. ...

Latest Answer :  ASP.NET Web Services.NET RemotingProtocol Can be accessed only over HTTPCan be accessed over any protocol (including TCP, HTTP, SMTP and so on)State Management Web services work in a stateless environmentProvide support for both stateful and stateless ...

Build a proxy library by using the wsdl.exe utility 
Latest Answer : There are 2 ways one can consume a webservice. 1) By creating a proxy manually 2) By adding web reference Creating Proxy manually: 1) Browse the webservice 2) Add ?wsdl at the end of the URL 3) Save the wsdl file in local system 4) Use visual ...


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

Switched Multi Megabit Data Service (SMDS)

Switched Multi Megabit Data Service SMDS SMDS or Switched Multi Megabit Data Service is used to communicate on the Public Data Networks using the WAN networking technology The SMDS technology uses fiber or copper wires for networking There are many components in the SMDS networking environment that
 

Service Autonomy

Service Autonomy As Businesses continue to step up the process of constructing enterprise automation logic in the service format there is also an increasing need to step up both the efficiency and reliability that the services are intended to take on at run time This dire need is increased when it c
 

Service Oriented Infrastructure

Service Oriented Infrastructure Service Oriented Infrastructure is a systematic means for describing Information Technology infrastructures in the terms of a service The underlying principles of Service Oriented Infrastructure revert back to LDAP and Mainframe technologies among others Where Service
 

Service Reusability

Service Reusability One of the most vital principles of Service Oriented Architecture is that of service reusability And in today’ s day and age it can be said that we have been making a lot of progress towards improving both this central tenet and Service Oriented Architecture in general
 

Standardized Service Contract

Standardized Service Contract Standardized service contracts are one of the key Service Oriented Architecture principles They ensure that services that are in the same inventory of services are kept in compliance with contract design standards The services in a Service Oriented Architecture are able
 

Service Discoverability

Service Discoverability Service discovery protocols can be thought of as network protocols that allow for the automatic detection of both services and devices that are offered by a computer network’ s various devices There are a lot of service discovery protocols available In this article
 

Service Loose Coupling

Service Loose Coupling Loose coupling can be thought of as the resilient relationship that exists among two or more systems or companies that have some sort of relationship based on exchange Each transactional end should make its requirements explicit somehow and make very few if any assumptions abo
 

Service Encapsulation

Service Encapsulation What is Encapsulation In the realm of computer networking the term encapsulation is utilized to include data from an upper layer protocol in to a protocol on a lower layer Such a method of abstraction through networking allows many different layers to add on functionality and f
 

Service Composability

Service Composability The principle of Service Oriented Architecture known as Service Composability can be broken up into two basic principles Service Discoverability and Service Composition When it comes to the realm of Service Design a lot of attention is paid to the enabling of those characterist
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape