Trouble calling WebServices 
Author Message
 Trouble calling WebServices


Today I tried to invoke some .NET (asmx) WebServices from

I build a quick WebForms app, add the desired WebService using
Project|Add Web Reference and use the following .NET code. The weird
thing is, the only thing that worked was the piece of code for getting
the CNN news, that returns an HTML string but does not need

The other two, Exchange Rate and Babelfish, only give 0 or an empty
string as a result, resp. Why? What am I doing wrong? Help!

Protected Sub btnNews_Click(ByVal sender As Object, ByVal e As
    Dim objNews As New com.securewebs.aspx.BreakingNews()
    txtNews.Text = objNews.GetCNNNews
End Sub

Protected Sub btnExchange_Click(ByVal sender As Object, ByVal e As
    Dim objExchange As New net.xmethods.services31.CurrencyExchange()
    lblExchangeRate.Text = CStr(objExchange.GetRate( _
                                                   lstFrom.Text, _
End Sub

Protected Sub btnTranslate_Click(ByVal sender As Object, ByVal e As
    Dim objTrans As New net.xmethods.services3.Babelfish()
    lblMessage.Text = "Please wait..."
    txtTo.Text = objTrans.Translate("en_de", txtFrom.Text)
    lblMessage.Text = "Ready"
End Sub


Jeroen Hartsuiker
The Netherlands

Sat, 06 Dec 2003 05:31:21 GMT  
 [ 1 post ] 

 Relevant Pages 

1. System.InvalidCastException when moving Com based WebService to distributed platform

2. VB6-SOAP-WEBSERVICE Question: Receiving an object of a class defined in the webservice

3. Calling a WebService asynchronously

4. Call a WebService from vbscript

5. Using PocketSOAP in eVB to call .Net webservice?

6. Calling COM EXE from VB.NET Service leaves COM EXE in Memory

7. one COM call another COM situation

8. COM DLL calling external non-COM DLL problem.

9. Call to Java COM inside VB COM

10. com object will not read registry when com object called from asp (vb works fine)

11. Call VB DLL or COM object from within VB COM object or EXE

12. Calling a COM call back object's method fails if it is in Windows 98


Powered by phpBB® Forum Software