Web app to consume web service

I am new to web services.

 Basically I need to create a web app to consume the web service located here: http://babbage2.sosu.edu/winuser/hw04/proj01/proj01.asmx

 It just needs two text boxes and a button, I'm not sure how to do this.

 

Any help?
 

0
turk
4/24/2007 2:26:49 AM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

5 Replies
731 Views

Similar Articles

[PageSpeed] 32

Add a Web reference to your project, its like adding a dll reference but instead of poiting it to a dll you do point it to the url.

Right click the project name and select Web Reference, use it as a dll.

Hope this helps


Cheers
Al
My Blog
MapStats.NET
Please click on 'Mark as Answer' if this post answered your question!
0
albertpascual
4/24/2007 2:48:26 AM

Thanks for the response.

I got that far, I'm just not sure how to invoke the service into my web app.

 

0
turk
4/24/2007 2:54:02 AM

Once you've added the Web Reference to your project you should have a folder structure like this - App_WebReferenes > Services > Service1.

To invoke the web methods of this service do the following:

using Services.Service1

public partial class MyPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Service1 oService = new Service1();

        oService.Method1();
    }
} 
0
Meridicus
4/24/2007 12:50:05 PM

Thank you.

I am really dumb at this.

 

here is the code i have so far:


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim WebService As service.proj01
        WebService = New service.proj01()
     


        result.Text = WebService.Power(TextBox1, TextBox2).ToString()

 

and it does not work

Suggestions? 

0
turk
4/24/2007 4:33:39 PM

Does it give you a "401 - Unauthorized" error?

The 401 error has been the biggest problem for me recently, as we can't allow anonymous access to the web service on our intranet.

What I have had to do is on the IIS server, specify "Integrated Windows Authentication" for the services web application, then, in the code, add the following lines before you make the call to any service methods:

oService.PreAuthenticate = true;
oService.Credentials = System.Net.CredentialCache.DefaultCredentials;
This passes the credentials of the user accessing the web application on to the web service.
0
Meridicus
4/25/2007 7:12:47 AM
Reply:

Similar Artilces:

What action by a web service requires an app to update their web reference to a Web Service
I create a web reference to a web service in my aspx web application which returns an XML object. If the owner of the web service makes a change to their object am I required to do an update web reference? What if I dont use the information from the new object? thanks Larry You should make the change only if the contract b/w the two has changed (e.g. parameters, return values), etc.-Mathew Nolton Website=www.cybral.com Email=mnolton@cybral.com Blog=weblogs.asp.net/mnolton If the web service now returns a new element and my class reference doesn't match their new class ref...

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

Web Service consuming other Web Services for caching purpose
Hello, I'm quite a newbie in Web Service programming. I'm using Visual Studio .NET 2003 on Windows XP Pro. I would like to write a Web Service on my local network that call Internet Web Service. Is there some writing rules for that or any tutorial. I want this new Web Service to cache the objects of other Web Services in order to reduce the response time. Furthermore, I wanted to test that with Babelfish Web Service on www.xmethods.net But when I make a Web Reference to the wsdl, I've a failure. VS success to access to the wsdl file but doesn't allow the web reference (&q...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

Web Site Project: How to configure web service URL in web.config (web service defined in a referenced DLL)
I have a web site that references a business logic DLL project. In the business logic project, there is a web service defined in its app.config file something like this: <applicationSettings>  <MyNamespace.BLL.Properties.Settings>    <setting name="MyNamespace_BLL_MyServer_ServiceName" serializeAs="String">    <value>http://blah.blah.blah.asmx</value>  </setting>  </MyNamespace.BLL.Properties.Settings></applicationSettings> When the web site is published, the web ...

Can WSE 3.0 Web Service be exposed to the web and can it be consumed by non .Net apps?
If I write a WSE 3.0 web service in .Net 2.0, can I expose it to the web like an IIS XML web service.?Also, can this web service be consumed by non .Net apps or .Net 1.1. apps?sun21170 Yes, simply enable your web service project for WSE 3, and this will alter web.config to support WSE 3 web services in IIS.The web service can be consumed by non .Net clients, however .Net 1.1 clients may struggle unless you add WSE support ans generate specific WSE proxies at the client end.  JamesMy Blog: http://www.wintersfamily.plus.com/blogs/JamesWinters...

New to web services...need help consuming web service
Hi guys. I am trying to use the NBA standing web service(developed by 4guysfromrolla) on my website and I cant seem to get it to work correctly. Its listed below. http://nbaweblog.com/nba/standings.asmx Tutorial is on the below page--http://aspnet.4guysfromrolla.com/articles/111203-1.aspx I made a web reference in my asp.net web project but when I go to create the object it gives me the Type "NBA.standings " not defined. I am copying the code exactly from the page. I put the imports system.web.services at the top of the page. This is my code from the page load event Dim proxy As N...

web web web
Name: bahadir Email: sensiz_olmuyor_t1_at_hotmail.com Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

what are web services and what are the advantages of web services?
 Hello  i am new to this .net stuff and i was ask on the job interview what a web services is?and if i did not know given that i had a project ( as a project manager,  or a web developer)   what  is it? how do i start a >NET project on it? what are the main advantages is?  HOW DO I START THIS IN THE INTERVIEW>  and what basic books do i buy?   Hi There, There plenty of source on the net about webservice Definiton: http://en.wikipedia.org/wiki/Web_service http://www.codeproject.com/Purgatory/Defining_Web_Services.asp...

Calling a Web Service from a Web Service
Hello,I was looking for some feedback on calling a web service from within a web service. I've heard that it's not good practice (or not possible). I have a scenario where I think it might make some sense.Within our infrastructure, we've created a web service that handles incoming updates on the statuses of all processes. This has proven to be a good thing since it allows applications to communicate across server to make status updates. It's also used by third party developers and applications to communicate with our infrastructure.Along these lines ... we are planning to create a new compon...

Is web services a part of web Service?
  I have a question: Is web services a part of web server?? And when the client calls web service, it means that client calls web server?? Or is it a different entity in itself which communicates separately both with client and server and acts as middleware application.. I am very confused.. Can someone explain me the architecture...??? Thanks..Dont forget to click "Mark as Answer" on the post that helped you.This credits the member,earns you a point & marks your thread as Resolved so that new users will know where to search for their queries. When you build and dep...

How do I merge web services' app.config with web app's web.config? Help!!
I have a web application project that uses a separate class library containing web service references (service layer). I want to be able to configure the web reference URLs dynamically and I know you can set this up by setting the URL behavior to  'Dynamic', etc, etc. The problem is VS2005 puts the URLs in the project's app.config file. When the class library becomes a DLL component, I have no way of accessing the app.config file.Is there a way to make the web reference project to look for the URLs in the web.config instead of its app.config? Or is there a way to merge this app.config w...

Web resources about - Web app to consume web service - asp.net.xml-web-services

Marginal propensity to consume - Wikipedia, the free encyclopedia
... it lacks inline citations . Please improve this article by introducing more precise citations. In economics , the marginal propensity to consume ...

STUDY: Facebook Users Aren’t Necessarily Looking For News, But They Find And Consume It
... users, 47 percent of that group “ever” gets news from the social network, leading Pew to call 30 percent of U.S. adults “Facebook news consumers.” ...

Consume fresh and clean content with Skimpage
Skimpage searches for a feed in a web page and extracts just the content. You can consume it easier, faster, more efficient, and always fresh. ...

Chemistry (physical science) : Which commonly-stocked laboratory alcohols can I safely consume without ...
Answer (1 of 4): I absolutely do not recommend drinking any solvents, alcohol based or otherwise, in a lab. Your common lab solvents, methanol ...

Consume for iPhone, iPod touch, and iPad on the iTunes App Store
Get Consume on the App Store. See screenshots and ratings, and read customer reviews.

They Live - Obey, Consume, This is your God - YouTube
Clip from They Live, a classic from 1988. John Carpenter's slow and deliberate immersion of the daunting and worrying fable of the corrupt, deceiving ...

Party's silence deafening as bear market consumes Chinese shareholdings
As market panic melted $1.5 trillion off the value of Chinese shares in two days, the flagship newspaper of the Communist Party had its attention ...

Canberrans consume tonnes of prawns in Christmas binge
The early bird catches the prawns, crayfish and oysters at your fishmongers for Christmas dinner.

Crazy new way to consume alcohol
NEWS.com.au Crazy new way to consume alcohol NEWS.com.au NOTHING says hiking like a nice refreshing shot of vodka. That's the bizarre argument ...

One dead as US wildfires consume homes
Firefighters are battling devastating wildfires in California that have reduced hundreds of homes to ruins.

Resources last updated: 12/8/2015 3:25:40 AM