|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
General - Error - Asp.net webservice error
Hai all,
Am a newbie to this group and .net platform.For my flex project I need to with a asp.net webservice. Am having the most difficult time trying to deploy a web service created with Visual Studio 2005.* I'm hoping that I'm just missing one small detail and that someone can point it out to me. I have stripped this down to the most basic "Hello World" web service.* In fact, all I did for this was create a new web site, ASP.NET web service Here are the steps to reproduce: 1) In Visual Studio 2005, create a new web site, ASP.NET web service and place it in flle system c:/inetpub/wwwroot/sample and a virtual directory sample was created in my IIS 5.1.*When I create the webservice the service.asmx, web.config, App_Code , App_Data are created automatically. Ok 2) Then Right click on the service.asmx file in the Solution Explorer and select View in Browser.* The webservice runs in asp.net development server.That works fine 3) Then fire up my web browser and navigate to the web service.* For example: http://localhost/sample/service.asmx. 4) Now it shows the following error Code:
The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. A name was started with an invalid character. Error processing resource 'http://localhost/sample/Service.asmx'. Line 1, Positi... <%@ WebService Language="vb" CodeBehind="~/App_Code/Service.vb" Class="Service" %> What am I missing here .* What do I need to do to get the web service to work * I know that it actually does work from the results in step 2.* I'm missing something ....For my urgent anybody direct me in right way plz? Thank you for any help with this! Sorry for long such code.Hope this helps. Here is my service.cs : Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols <WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicPro file1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.Desi gnerGenerated()> _ Public Class Service Inherits System.Web.Services.WebService <WebMethod()> _ Public Function HelloWorld() As String Return "Hello World" End Function End Class Here is my service,asmx: <%@ WebService Language="vb" CodeBehind="~/App_Code/Service.vb" Class="Service" %> Here is my web.config: <?xml version="1.0"?> <!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config --> <configuration> <appSettings/> <connectionStrings/> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. Visual Basic options: Set strict="true" to disallow all data type conversions where data loss can occur. Set explicit="true" to force declaration of all variables. --> <compilation debug="false" strict="false" explicit="true" /> <pages> <namespaces> <clear /> <add namespace="System" /> <add namespace="System.Collections" /> <add namespace="System.Collections.Specialized" /> <add namespace="System.Configuration" /> <add namespace="System.Text" /> <add namespace="System.Text.RegularExpressions" /> <add namespace="System.Web" /> <add namespace="System.Web.Caching" /> <add namespace="System.Web.SessionState" /> <add namespace="System.Web.Security" /> <add namespace="System.Web.Profile" /> <add namespace="System.Web.UI" /> <add namespace="System.Web.UI.WebControls" /> <add namespace="System.Web.UI.WebControls.WebParts" /> <add namespace="System.Web.UI.HtmlControls" /> </namespaces> </pages> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows" /> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> </system.web> </configuration> Regards: quotez. ![]() |
|
#2
|
||||
|
||||
|
please use code tags when posting code.
regarding your problem: in step #2 when the browser opens with the web service, what is the full address? usually the Studio will use some random port, not virtual directory. also, if the Service is not hosted in IIS you must have the browser with the service from step #2 still opened while trying to browse with other browser, otherwise there will be no server to host it. |
|
#3
|
|||
|
|||
|
Thanks for the kind reply Mr.Shadow.Now i findout the error
Regards, quotez |
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > General - Error - Asp.net webservice error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|