473,503 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9317
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
2239
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
1674
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
2801
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
400
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
10376
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
3574
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
6024
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
998
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
2957
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
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
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,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.