From: Jeova Almeida on
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

When 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�


From: Giovanni Dicanio on

"Jeova Almeida" <jeovaalmeida(a)yahoo.com> ha scritto nel messaggio
news:%23z$T$nouIHA.2064(a)TK2MSFTNGP05.phx.gbl...

> 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" %>

Hi,

this is a MFC and C++ native development newsgroup...

I think you may post your question to the C# newsgroup:

microsoft.public.dotnet.languages.csharp

If my knowledge of VS2005 is correct, you can't create neither consume web
services in C++ like you do (easily...) with C# or VB.NET (both managed
languages).

To use web service from C++, you might consider the ATL Server library
(IIRC). This library was recently put under shared-source licensing by VC++
Team (you may find that on CodePlex).

Giovanni


From: Jeova Almeida on
Hello Giovanni,

Thanks for the directions. It's a pity I can't get help in this newsgroup.
You see, I have tried posting questions about web services some newsgroups
on web services, but the folks there simply don't help, even when the
question is very basic for someone who has dealt with web services. (most
questions don't get any answer)

On the other hand, the folks in this newsgroup about MFC deserve
congratulations, because hardly a post is left without response.

Jeov�

"Giovanni Dicanio" <giovanni.dicanio(a)invalid.com> escreveu na mensagem
news:uqUCYvouIHA.4528(a)TK2MSFTNGP03.phx.gbl...
>
> "Jeova Almeida" <jeovaalmeida(a)yahoo.com> ha scritto nel messaggio
> news:%23z$T$nouIHA.2064(a)TK2MSFTNGP05.phx.gbl...
>
>> 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" %>
>
> Hi,
>
> this is a MFC and C++ native development newsgroup...
>
> I think you may post your question to the C# newsgroup:
>
> microsoft.public.dotnet.languages.csharp
>
> If my knowledge of VS2005 is correct, you can't create neither consume web
> services in C++ like you do (easily...) with C# or VB.NET (both managed
> languages).
>
> To use web service from C++, you might consider the ATL Server library
> (IIRC). This library was recently put under shared-source licensing by
> VC++ Team (you may find that on CodePlex).
>
> Giovanni
>
>


From: Giovanni Dicanio on
Hello Jeov�,

thank you very much.

Yes, this newsgroup is a very friendly and helpful community, and everyone
here try to do his best.

I believe that you will have a quality help from
microsoft.public.dotnet.languages.chsarp newsgroup, too.

Moreover, if you are interested in ATL Server library, I think that asking
some questions to the ATL newsgroup (microsoft.public.vc.atl) may help, too.

Giovanni



"Jeova Almeida" <jeovaalmeida(a)yahoo.com> ha scritto nel messaggio
news:%23guI6$puIHA.4492(a)TK2MSFTNGP02.phx.gbl...
> Hello Giovanni,
>
> Thanks for the directions. It's a pity I can't get help in this newsgroup.
> You see, I have tried posting questions about web services some newsgroups
> on web services, but the folks there simply don't help, even when the
> question is very basic for someone who has dealt with web services. (most
> questions don't get any answer)
>
> On the other hand, the folks in this newsgroup about MFC deserve
> congratulations, because hardly a post is left without response.
>
> Jeov�
>
> "Giovanni Dicanio" <giovanni.dicanio(a)invalid.com> escreveu na mensagem
> news:uqUCYvouIHA.4528(a)TK2MSFTNGP03.phx.gbl...
>>
>> "Jeova Almeida" <jeovaalmeida(a)yahoo.com> ha scritto nel messaggio
>> news:%23z$T$nouIHA.2064(a)TK2MSFTNGP05.phx.gbl...
>>
>>> 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" %>
>>
>> Hi,
>>
>> this is a MFC and C++ native development newsgroup...
>>
>> I think you may post your question to the C# newsgroup:
>>
>> microsoft.public.dotnet.languages.csharp
>>
>> If my knowledge of VS2005 is correct, you can't create neither consume
>> web services in C++ like you do (easily...) with C# or VB.NET (both
>> managed languages).
>>
>> To use web service from C++, you might consider the ATL Server library
>> (IIRC). This library was recently put under shared-source licensing by
>> VC++ Team (you may find that on CodePlex).
>>
>> Giovanni
>>
>>
>
>