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

Home Posts Topics Members FAQ

Need help publish 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.

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 3002

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

Similar topics

5
2580
by: NoNickname | last post by:
Basically, how do I know that the release versions of all components are being published? The Build | Configuration Manager is confusing me a little in VS2005. I have three projects in my solution: 1) web service website. 2) SOAP Extension Class Lib that compiles to a dll 3) WinForm application with a proxy to test the web service.
12
5330
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
3
1631
by: taha | last post by:
Hi All How Can I Publish My XML Web Service To My Site My web site is www.Hageg.com
1
5578
by: Frank Uray | last post by:
Hi all I have some problems with creating a WebService ... :-( Here is what I did: - I have created a new WebSite Project (ASP.NET Web Service) - I did not modify any code in this new project. - The asmx File is now located on my local development drive. - On my IIS 6 (Win 2003 Server) I have created a new Virtual Directory. - The new Virtual Directory works fine.
1
1198
by: yahiawestlife | last post by:
Hello all, How can I publish my web-service, I have created a web service using asp.net 2.0 and I want to try to publish it free. Thanks in advance.
3
4364
by: Ludwig Wittgenstein | last post by:
Hello, all. Does anyone know of documentation about implementing a publish- subscribe model between a .NET Web service provide and a Java service consumer? I have this problem I am trying to solve, and would greatly appreciate it if someone can tell me what the best solution would be for it. I have a .NET 2.0 (ASMX) webservice on a server on a dedicated hosting server, and several clients in different cities running linux servers
0
977
by: Nic | last post by:
Hi, I am looking to publish a service and is currently developing an API that I intend to allow authenticated users to use. Having been away for a while from programming, I understand that things have moved on with the release of ..Net 3.0 and I would like some advice on what current best practice would be to do this. 1. I intend to use a Internet hosting provider to host my service, should I use webmethods in .asmx files or are there...
0
1322
by: Jeova Almeida | last post by:
Hello, I created a simple web service for testing purpose in Visual Studio 2005: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="WSTest" %> using System;
3
2244
by: =?Utf-8?B?Sm9obiBT?= | last post by:
Hi, I'm trying to publish a new web service that I've written. It's fine when I publish it on the local PC but I get Publish failed in the development environment when I try to publish it to another server.
0
8676
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
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9164
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
8898
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
8870
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
7734
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
4370
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...
1
3051
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
3
2006
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.