Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to call my webservice?

0 views
Skip to first unread message

Lasse Edsvik

unread,
Sep 24, 2003, 7:42:03 AM9/24/03
to
Hello

I have a slight problem, im not sure how to call my function in my newly
created webservice.

I have this in the asmx-file:

<%@ WebService language="VB" class="NorthwindDB" %>

Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Imports System.Data
Imports System.Data.SqlClient


Public Class NorthwindDB

<WebMethod()> Public Function ListCustomers() As DataSet

Dim Conn As SqlConnection = New
SqlConnection("server=192.168.8.5;database=Northwind;User
ID=myuser;Pwd=mypass")
Dim Sql As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM
Customers", Conn)

Dim DS As New DataSet
Sql.Fill(DS, "Customers")

Conn.Close()

Return DS

End Function

End Class

I gave it the namespacename Northwind when i compiled it...... but I cant
create an instance of it in my asp.net code nomatter how i try :(

could someone show me how to do it?

Best regards
/Lasse


Fredrik Normén NSQUARED

unread,
Sep 24, 2003, 7:56:36 AM9/24/03
to
You must add the web service to your application.

In VS.Net select references from your project and then
add a web resference and choose your web serivces and
then add it to the project.

/Fredrik Normén NSQUARED

>.
>

Ravikanth[MVP]

unread,
Sep 24, 2003, 8:04:34 AM9/24/03
to
Hi

Check the following on how to call webservice
http://www.csharphelp.com/archives/archive83.html

HTH
Ravikanth[MVP]

>.
>

Johan Normén

unread,
Sep 24, 2003, 8:10:36 AM9/24/03
to
Hi,

You must create one proxy and use that instead.
Is VS .Net your dev tool? then add one web reference,
that's it.

JN
NSQUARED2

>.
>

Lasse Edsvik

unread,
Sep 24, 2003, 8:14:54 AM9/24/03
to
Fredrik,

I dont have vistual studio :) too expensive for me :)

/Lasse


"Fredrik Normén NSQUARED" <fno...@hotmail.com> wrote in message
news:daf801c38292$e810b130$a601...@phx.gbl...

Fredrik Normén NSQUARED

unread,
Sep 24, 2003, 8:27:55 AM9/24/03
to
Ok, I see.

Within the SDK, there is a tool called the Web Services
Description Language tool (WSDL.exe). This command-line
tool is used to create proxy classes from WSDL. For
example, you could enter:

WSDL http://someDomain.com/someFolder/HelloWorld.asmx?WSDL

to create a proxy class called HelloWorld.cs.

Compile this proxy class into your application and then
calling this proxy class's like this:

[VB.NET]

Dim myHelloWorld As New HelloWorld()
Dim sReturn As String = myHelloWorld.AMethod()

[C#]

HelloWorld myHelloWorld = new HelloWorld();
string sReturn = myHelloWorld.SayHelloWorld();

/Fredrik Normén NSQUARED

>.
>

David E

unread,
Sep 24, 2003, 9:27:26 PM9/24/03
to
Good article to get people started.

Do you know of a similar one that formats a soap message from an aspx file
to a web service.

I also am stuggling on this.

cheers

David.


"Ravikanth[MVP]" <dvrav...@hotmail.com> wrote in message
news:1be001c38294$04d56350$a101...@phx.gbl...

0 new messages