Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia IMasters!
Aqui vai o codigo do Service.cs
using System;
//using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
//using System.Xml.Linq;
WebService(Namespace = "[http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Jhonatas : System.Web.Services.WebService
{
public Jhonatas () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
public int somar(int val1, int val2)
{
int result = val1 + val2;
return result;
}
}
Service.asmx:
<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Jhonatas" %>
Ok, localmente esta funcionando bem, como eh pra ser.
Quando upo a pasta com os arquivos do web service (web.config,Service.asmx,app_code) para o host(asp.spider) e tento acessálo aparece o seguinte erro..
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Line 39: ASP.NET to identify an incoming user.
Line 40: -->
Line 41: <authentication mode="Windows"/>
Line 42: <!--
Line 43: The <customErrors> section enables configuration
Ja li algumas coisas, mudei aqui ali mas, ainda nao encontrei soluçao..
Alguem sabe oq pode estar acotnecendo?
Obrigado desde ja pessoal!
Carregando comentários...