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
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
>.
>
Check the following on how to call webservice
http://www.csharphelp.com/archives/archive83.html
HTH
Ravikanth[MVP]
>.
>
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
>.
>
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...
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
>.
>
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...