473,698 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Serv ices;

using System.Web.Serv ices.Protocols;

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

[WebServiceBindi ng(ConformsTo = WsiProfiles.Bas icProfile1_1)]

public class WSTest : System.Web.Serv ices.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 1321

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

Similar topics

11
1583
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 localhost/default.aspx this worked. Now I cannot even do that. Is there a problem using Visual Studio 2005 Standard and IIS 5.1? When I go to the URL, I get a HTTP 500 - Internal server error. There was a time when it was displaying the folders...
0
1084
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 however if there was a standard methodology for advertising and of course subscribing to changes. E.g. is there a standard for publishing/notifying changes that are made to a web service. I think that with all the supposed great push towards a more...
3
1893
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 with user-defined structural tags (title, cite, date, paragraph, itemList, ...). It makes the typical pre-processing tasks needed for computational linguistics in order to work with big corporas to use statistical tools. But I'm worried that...
6
5107
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 and Visual Studio 2005 and reinstall it. Now I can view simple pages but not aspx pages, but when running from the debugger of Visual Studio, it Works good.
3
1653
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 Service and a test web site. I can publish to other servers but not the one for training. Notice that the message states that publish succeeded, but no files are copied.
9
5231
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 http://www.aztao.org/WebService/Service.asmx (the fie DOES exist which can be verified by typing http://www.aztao.org/WebService/ in address bar only).
1
2929
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 CGI application misbehaved by not returning a complete set of HTTP headers. The scripts are very long but here are the opening statements: The One that works .... #!C:\Perl\bin\perl.exe # openresolver.cgi # # OpenResolver - a CGI script for...
3
1696
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 need to run installutil.exe by hand and i'd like the installer to do that for me.
1
2260
by: pankajit09 | last post by:
Can you tell me whether license is required for publishing C#.Net Web Service ?
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7725
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.