473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Consume WebService in C#

I am trying to consume my first WebService in a C# Windows Form in
VS.NET 2003. I have created a Web Reference using the WSDL URL
(http://www.capescience.com/webservic...tWeather.wsdl),
which created the Proxy class. I can see the WebService and its
methods in the Object Browser.

It was my impression that I should be able to simply instantiate the
webservice now and use its methods, so I have the following code:

<code>
CallWebService.com.capescience.www.AirportWeather weather =
new CallWebService.com.capescience.www.AirportWeather();
string summary = weather.getSummary( "KLAX" ).ToString();
</code>

When I run this, I get a 404 not found message. Out of curiosity, I
added a call to ".Discover":

<code>
CallWebService.com.capescience.www.AirportWeather weather =
new CallWebService.com.capescience.www.AirportWeather();
weather.Discover();
string summary = weather.getSummary( "KLAX" ).ToString();
</code>

Now when I run it, I receive a System.Net.WebException "there was an
error downloading 'http://www.capescience.com/ccgw/GWXmlServlet'."

I hate to sound foolish, but does this mean the WebService is not
available? I thought it might be a proxy issue, so I created an
App.config file and added a defaultProxy bypass (found in the
newsgroup) but it made no difference.

Why would I be able to see the Classes and Methods in the Object
Browser but not be able to call it? Does anyone know of a WebService I
can use to test with?

Thanks,

Joel

Nov 23 '05 #1
2 9312
I think I've answered my own question. The web service must not be
available. I found this article:

http://www.scientificfinance.com/pap...BestMonths.asp

I followed the exact same steps:
1) Add Web Reference (to the new web service)
2) Create Object and use methods

Simple as pie and this time it worked lickity split, no messing with
proxies or anything like that. Eventually, I'll use this approach in a
commercial application, so should I leave the "App.config" settings in
place? Will this help if the user is behind a firewall? I'm not a
network guy, so any advice would be appreciated.

Thanks,

Joel

Nov 23 '05 #2
I think I've answered my own question. The web service must not be
available. I found this article:

http://www.scientificfinance.com/pap...BestMonths.asp

I followed the exact same steps:
1) Add Web Reference (to the new web service)
2) Create Object and use methods

Simple as pie and this time it worked lickity split, no messing with
proxies or anything like that. Eventually, I'll use this approach in a
commercial application, so should I leave the "App.config" settings in
place? Will this help if the user is behind a firewall? I'm not a
network guy, so any advice would be appreciated.

Thanks,

Joel

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Abeslom via .NET 247 | last post by:
Hi, I am trying to create a simple .NET http-Get client that willconsume a java webservice on a mainframe. If I type the URL forthe webservice in the Browser, the service works and I get theexpected...
1
by: Paul Hermans | last post by:
Hello, Are there code samples, technical information to consume a php webservice in a dotnet environment like asp.net? Thx in advance, Paul
2
by: Mauricio Correa | last post by:
Hello, i try to consume a java web service from a asp .net page, i make without problems the web reference tu wsdl file http://machine/WebService/nameWebService?WSDL in the asp .net page put the...
0
by: joelcochran | last post by:
I am trying to consume my first WebService in a C# Windows Form in VS.NET 2003. I have created a Web Reference using the WSDL URL...
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
1
by: Nattydreadlock | last post by:
Hi, I've written an ASP.Net webservice which takes somes specific .net objects. Now I want to caal this service by PHP, which normally would be possible, after all that's the main reason of...
2
by: hharry | last post by:
hello all, trying to consume a simple web service using httpwebrequest instead of generating a proxy class. code for simple web service: Imports System.Web.Services ...
0
by: UnglueD | last post by:
Hello. I have a webservice located on a machine within our network. I have developed and tested this webservice internally without having to worry about credentials. Now I wish for web...
2
by: =?Utf-8?B?Z2FuY3k=?= | last post by:
Hi, I have created a webservice in .net and deployed on server. I tested the webservice using windows client it's working fine. My webservice going to consume by SAP client. 1.Will SAP systems...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.