udir
asked on
Web Services (C#)...Need Help!!
Hi experts,
I'm new at ASP.NET so pleeeeease answare step by step if it is possible.
I created a new project (ASP.NET Web Service called "Calc" (the library located
at c:\inetpub\wwwroot\Calc\Ca lc1.asmx
the code is simple (becuase i just want to understand how to deal with Web Service)
-------------------------- ---------- ---------- ---------- ---------- ----------
<%@ WebService Language="C#" Class="Calc1" %>
using System.Web.Services;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Conform sTo = WsiProfiles.BasicProfile1_ 1)]
public class Calc1 : System.Web.Services.WebSer vice
{
[WebMethod]
public int Add(int x, int y)
{
return x + y;
}
}
-------------------------- ---------- ---------- ---------- ---------- ---------- --
lets say that there is another project - ASP.NET Web Site called - "Result" which is located
at : c:\inetpub\wwwroot\Result\ Result1.as px
i know that i need to make a proxy call and a disco file and etcw....which i don't know how.
i'm so comfused (:
Please help me (with the example i just wrote - but again - step by step)
Thanks
Udir
I'm new at ASP.NET so pleeeeease answare step by step if it is possible.
I created a new project (ASP.NET Web Service called "Calc" (the library located
at c:\inetpub\wwwroot\Calc\Ca
the code is simple (becuase i just want to understand how to deal with Web Service)
--------------------------
<%@ WebService Language="C#" Class="Calc1" %>
using System.Web.Services;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Conform
public class Calc1 : System.Web.Services.WebSer
{
[WebMethod]
public int Add(int x, int y)
{
return x + y;
}
}
--------------------------
lets say that there is another project - ASP.NET Web Site called - "Result" which is located
at : c:\inetpub\wwwroot\Result\
i know that i need to make a proxy call and a disco file and etcw....which i don't know how.
i'm so comfused (:
Please help me (with the example i just wrote - but again - step by step)
Thanks
Udir
ASKER
Hi joechina,
Do you meen that in the "Result" project in the "Result.asmx.cs" in
the load event (for example) i should write a reference?
can you give an example?
(also don't i have to add a proxy file, and a disco file?)
Do you meen that in the "Result" project in the "Result.asmx.cs" in
the load event (for example) i should write a reference?
can you give an example?
(also don't i have to add a proxy file, and a disco file?)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
I get a massage :
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
A name was started with an invalid character. Error processing resource 'http://localhost/WebSite1/calc.asmx'. Line 1, Pos...
<%@ WebService Language="C#" CodeBehind="~/App_Code/cal c.cs" Class="calc" %>
-^
Do you have any idea what is the problem? (becuase i have already seen xml files on my IE6.) Thanks
Udir
I get a massage :
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------
A name was started with an invalid character. Error processing resource 'http://localhost/WebSite1/calc.asmx'. Line 1, Pos...
<%@ WebService Language="C#" CodeBehind="~/App_Code/cal
-^
Do you have any idea what is the problem? (becuase i have already seen xml files on my IE6.) Thanks
Udir
If it's on your local PC, can you browse to the webservice (for example: http://localhost/WebSite1/calc.asmx) and test the webmethod?
ASKER
Oh i see what you meen:
i can't get in that address!!!!!
when i run the WebService "WebSite1/calc" i get an address:
http://localhost:1130/WebSite1/calc
Why??? what is the 1130?
Thanks
Udir
i can't get in that address!!!!!
when i run the WebService "WebSite1/calc" i get an address:
http://localhost:1130/WebSite1/calc
Why??? what is the 1130?
Thanks
Udir
It's a debug IIS server for your web project running on port 1130.
You need to deploy your web service first.
Just publish your web service project. (I mean click 'Build -> Publish web site')
It will compile the project to a precompiled folder.
Then you can copy all files to a desired folder(or use the precompiled folder).
Then create a new virtual directory under your IIS.
You need to deploy your web service first.
Just publish your web service project. (I mean click 'Build -> Publish web site')
It will compile the project to a precompiled folder.
Then you can copy all files to a desired folder(or use the precompiled folder).
Then create a new virtual directory under your IIS.
ASKER
OK
Thanks a lot.
Thanks a lot.
Then you can call it in your asp.net code.