473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Need help publishing web service

Hello,

I created a simple web service for testing purpose in Visual Studio 2005:

[WSTest.asmx]
<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs"
Class="WSTest" %>

[App_Code/Service.cs]
using System;

using System.Web;

using System.Web.Services;

using System.Web.Services.Protocols;

[WebService(Namespace = "http://bonusnaweb.com.br/WebService/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class WSTest : System.Web.Services.WebService
{

[WebMethod]
public int Sum(int num1, int num2) {
return num1+num2;
}

}

I tested it locally creating a virtual directory on my local IIS, and added
a web reference for the address http://localhost/WSTest/WSTest.asmx on a
test web site project, which worked correctly.

After that, I uploaded the files on a web server, which already has a site
running on it. I created a folder "WebService" and uploaded the WSTest.asmx
file, created an App_Code folder and uploaded the Service.cs file to it.

With the test web site, when I add a web referente for
http://www.bonusnaweb.com.br/WebService/WSTest.asmx (real web server), I get
the error:

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not create type 'WSTest'.

Source Error:

Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs"
Class="WSTest" %>

Source File: /WebService/WSTest.asmx Line: 1

After that, because the ~\App_Code would point the the App_Code folder on
the web site root directory, I changed the WSTest.asmx file to:

<%@ WebService Language="C#" CodeBehind="App_Code/Service.cs" Class="WSTest"
%>

That is, I changed the App_Code path. When I reference the web service
again, I get

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: Could not create type 'WSTest'.

Source Error:

Line 1: <%@ WebService Language="C#" CodeBehind="App_Code/Service.cs"
Class="WSTest" %>

Source File: /WebService/WSTest.asmx Line: 1

What am I doing wrong? What is the appropriate way to publish a web service?
I tried the Publish Web Site option from VS2005, where a PrecompiledWeb
folder was created, but It didn't work too.

Jeová
Jun 27 '08 #1
0 1299

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Brad | last post by:
I am having problems publishing to IIS. I have my static ip address now nad have redirected my domain name to it. Before in using VWD, I just copied the site to IIS and internally useing...
0
by: marc.derider | last post by:
I was making a change to a Web service. It was something extremely trivial, such as adding a single parameter to extend the functionality exposed through that method. It got me to thinking...
3
by: Francesc | last post by:
Hi, I'm new at this newsgroup and I want do ask some questions and opinions about this subject. I'm developing an application focused in a very specific task: clean and labelling text documents...
6
by: Roberto Hernández | last post by:
Something was wrong with my IIS 'Service unavailable', I decided to uninstall IIS and then reinstall it, then the simple pages can be viewed but the aspx pages not. Then I uninstall SQL server 2005...
3
by: EqDev | last post by:
Hello I have set up a new windows server 2003 standard edition for training (on new software we have developed) and am having problems publishing webs to it from VS 2005. I have a C# Web...
9
by: Coward 9 | last post by:
HI, I created the simplest "ASP .NET Web Service" by using VS 2005 and Visual C#( File | New | Web Site). However, when I tried to access the service from IE 7.0 ...
1
by: vikjohn | last post by:
I have a new perl script sent to me which is a revision of the one I am currently running. The permissions are the same on each, the paths are correct but I am getting the infamous : The specified...
3
by: K Viltersten | last post by:
I published the software i've designed but it seems that since it's designed as a service, i'm not able to use the usual publishing tools in VS05. When i try to install the software, it says i...
1
by: pankajit09 | last post by:
Can you tell me whether license is required for publishing C#.Net Web Service ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.