473,725 Members | 2,264 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 1323

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

Similar topics

11
1585
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
1086
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
1897
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
5110
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
1657
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
5233
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
2931
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
1699
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
2264
by: pankajit09 | last post by:
Can you tell me whether license is required for publishing C#.Net Web Service ?
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8099
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...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
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
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
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
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.