469,631 Members | 1,284 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

USING WEBSERVICE

hello,

i try´d to use an webservice like
Global Weather http://www.webservicex.net/globalweather.asmx?WSDL

i have add a reference to my asp.net-website and write the follwing
code(button1_click)

Dim ProxyWeather As New Weather.GlobalWeather()

Label1.Text = ProxyWeather.GetWeather("munich", "germany")

and i get an error, "connection is refused and closed"

what i am doing wrong??? any suggestions?

best regards

tommy
Nov 18 '05 #1
4 2496
Add a reference to the webservice to your project and rename it
GlobalWeatherSvc

Add a button and a label named lblResult

The following code should do the trick. It produced a weather report for
me.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim MyWeather As New GlobalWeatherSvc.GlobalWeather
Dim Results As IAsyncResult = MyWeather.BeginGetWeather("Munich",
"Germany", Nothing, Nothing)
Dim Result As String
Result = MyWeather.EndGetWeather(Results)
Me.lblResult.Text = Result
End Sub

"Tommy" <th***********@hannover-leasing.de> wrote in message
news:u5**************@TK2MSFTNGP09.phx.gbl...
hello,

i try´d to use an webservice like
Global Weather http://www.webservicex.net/globalweather.asmx?WSDL

i have add a reference to my asp.net-website and write the follwing
code(button1_click)

Dim ProxyWeather As New Weather.GlobalWeather()

Label1.Text = ProxyWeather.GetWeather("munich", "germany")

and i get an error, "connection is refused and closed"

what i am doing wrong??? any suggestions?

best regards

tommy

Nov 18 '05 #2
hello william,

thanks for reply....

i changed my code like yours... but the failure is the same

The underlying connection was closed: The connection with the remote
server cannot be made.
maybe i have to fix some security-reasons???
any suggestion?

best regards

tommy

----------------------------------------
HangulHanjaFastConversion-Eigenschaft

True if Microsoft Word automatically converts a word with
only one suggestion during conversion between hangul
and hanja. Read/write Boolean.
----------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
did you check your http proxy setting?
Some companies or organizations require outgoing connections to be made
through a proxy server.

[One indication that this is the case for you is if IE has a proxy server
setting. Within IE:
Tools > Internet Options > Connections > LAN Settings

....check to see if the proxy server is checked.

If so then you probably need to set a proxy server on the webservice client
proxy. ]

Note, here I am using proxy to refer to 2 distinct entities. The
webservice client proxy in your code is called ProxyWeather. The other
proxy is a network proxy server; I am suggesting one may be in use on your
network.

In your app, something like

Dim ProxyWeather As New Weather.GlobalWeather()
ProxyWeather.Proxy= New WebProxy("http://MyProxyServer:80", true)

....where MyProxyServer is the thing used by IE (above), or otherwise
communicated to you by your network admin.

-D

"RASTA" <th***********@hannover-NOSPAM-leasing.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
hello william,

thanks for reply....

i changed my code like yours... but the failure is the same

The underlying connection was closed: The connection with the remote
server cannot be made.
maybe i have to fix some security-reasons???
any suggestion?

best regards

tommy

----------------------------------------
HangulHanjaFastConversion-Eigenschaft

True if Microsoft Word automatically converts a word with
only one suggestion during conversion between hangul
and hanja. Read/write Boolean.
----------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4
DINO!!!!!

YOU ARE REALLY GOOD!!

THATS IT!

NOW IT WORKS FINE!!

Thank You Very Much

Best Regard
Tommy

----------------------------------------
HangulHanjaFastConversion-Eigenschaft

True if Microsoft Word automatically converts a word with
only one suggestion during conversion between hangul
and hanja. Read/write Boolean.
----------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by AliR | last post: by
5 posts views Thread by David Lozzi | last post: by
4 posts views Thread by =?Utf-8?B?ZmFpcnl2b2ljZQ==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.