.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old May 9th, 2008, 11:52 PM
quotez quotez is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 8 quotez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 19 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old May 10th, 2008, 11:37 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,747 Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)  Folding Points: 332327 Folding Title: Super Ultimate Folder - Level 1Folding Points: 332327 Folding Title: Super Ultimate Folder - Level 1Folding Points: 332327 Folding Title: Super Ultimate Folder - Level 1Folding Points: 332327 Folding Title: Super Ultimate Folder - Level 1Folding Points: 332327 Folding Title: Super Ultimate Folder - Level 1Folding Points: 332327 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 23 h 9 m 14 sec
Reputation Power: 1492
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.

Reply With Quote
  #3  
Old May 12th, 2008, 01:34 AM
quotez quotez is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 8 quotez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 19 sec
Reputation Power: 0
Thanks for the kind reply Mr.Shadow.Now i findout the error

Regards,
quotez

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > General - Error - Asp.net webservice error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway