473,388 Members | 1,574 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,388 software developers and data experts.

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.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.

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 2976

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

Similar topics

5
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...
12
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...
3
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
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....
1
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
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...
0
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...
0
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
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.