Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Parser Error starting web service

Posted on 2007-10-04
22
Medium Priority
?
1,293 Views
Last Modified: 2013-12-17
Any ideas?  Here's what gets displayed in my browser.

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 'WebService1.Service1'.

Source Error:
Line 1:  <%@ WebService Language="C#" CodeBehind="Service1.asmx.cs" Class="WebService1.Service1" %>

Source File: E:\web\mydomain\htdocs\Service1.asmx    Line: 1

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
0
Comment
Question by:newbieweb
  • 12
  • 10
22 Comments
 
LVL 21

Accepted Solution

by:
surajguptha earned 2000 total points
ID: 20015216
You migh have forgotten to copy the bin folder contains the DLL when you deployed the webservice. make sure there is a bin folder with a dll (the dll should contains the class WebService1.Service1)

If this dll is present, the DLL may not have the class within it. Did you change the class name?
0
 

Author Comment

by:newbieweb
ID: 20017082
The bin folder and the DLL are there.  I can get it to work on another system.  And I changed the namespace to match the URL for this particular domain.

What else could it be?
0
 

Author Comment

by:newbieweb
ID: 20017111
does web.config look okay?

<?xml version="1.0"?>

<configuration>
 
    <appSettings/>
 
    <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.
        -->
        <compilation debug="true" />
        <!--
            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>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:surajguptha
ID: 20017227
Update your asmx file with the changed namespace.
0
 

Author Comment

by:newbieweb
ID: 20018005
Do you mean update the web reference?  I do that in the program which uses it, but that generates an error too.

Please be more specific about "Update your asmx file".
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018050
The asmx file of your web service should be changed .
Replace WebService1.Service1with the updated class and refresh your proxy
%@ WebService Language="C#" CodeBehind="Service1.asmx.cs" Class="WebService1.Service1" %>
0
 

Author Comment

by:newbieweb
ID: 20018073
I recompile my web service and FTP the bin directory, the Service1.asmx and the web.config file to the root directory of my website.

Is this what you mean?  Or were you describing something else?

Do I need to FTP my .cs file as well?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018083
>> Could not create type 'WebService1.Service1'.

This would occur only if this class isnt found or if there is something in the constructor of the class that is making it fail
0
 

Author Comment

by:newbieweb
ID: 20018107
I need to simplify the constructor down its most simple form.

I'll send it momentarily.
0
 

Author Comment

by:newbieweb
ID: 20018143
The attached code still fails, even though nothing happens in the constructor.  


using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;

namespace WebService1
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://texselogic.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class Service1 : System.Web.Services.WebService
    {
        private Handles handles = null;

        public Service1()
        {
        }

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World!";
        }

        [WebMethod]
        public string GetVersion()
        {
            return "1.0.01";
        }

        [WebMethod]
        public void Send()
        {
        }
    }
}
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018148
What are you doing in your constructor?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018159
What is the url to your asmx/ web service?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018182
I pasted the same code in my solution in vs2005 after removing "private Handles handles = null;" and it worked perfectly fine :)

using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;

namespace WebService1
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://texselogic.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class Service1 : System.Web.Services.WebService
    {
        public Service1()
        {
        }

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World!";
        }

        [WebMethod]
        public string GetVersion()
        {
            return "1.0.01";
        }

        [WebMethod]
        public void Send()
        {
        }
    }
}


This is my ASMX file <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="WebService1.Service1" %>
0
 

Author Comment

by:newbieweb
ID: 20018184
>> What are you doing in your constructor?

It's blank.  I deleted the one object as a test, but it still fails.

public Service1()
{
}

>> What is the url to your asmx/ web service?

it's texselogic.com

am I missing something?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018213
1) The same code worked for me like i have said in my previous post
2) Try deploying it in your local IIS instead of FTPing to ur website everytime
3) Generallty curious, are you trying to learn web services or trying to implement something ? If so what are u trying to implement"?
0
 

Author Comment

by:newbieweb
ID: 20018228
Mine still does not work, even with Handles removed.

Do I need to put the .cs file on the website? My ASMX file:
<%@ WebService Language="C#" CodeBehind="Service1.asmx.cs" Class="WebService1.Service1" %>

Maybe I will get a new ISP.  This is DiscountASP.Net and it's a website I have used many years as a testing site for web services.  Could there be something residual?  Is there anything else I should try before throwing in the towel?
0
 

Author Comment

by:newbieweb
ID: 20018233
Do I need to update something on their end to associate my domain with the ASMX file?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018468
Try deploying it in your local IIS instead of FTPing to ur website everytime
0
 

Author Comment

by:newbieweb
ID: 20018496
Sounds like a good idea, but I have not done that before.

Could you help me?
0
 

Author Comment

by:newbieweb
ID: 20018504
I do run it in my Visual Studio 2005 environment, but you mean to deploy it so that the web service is hosted locally, right?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20018508
yes thats right. Try hosting it locally and heck if it works.
0
 

Author Comment

by:newbieweb
ID: 20018536
Let me put this effort on hold.  I just started with a new ISP and hope I can make it work right out of the box.  Let me close this question and start a new one if my new ISP doesn't work.

thanks for all the help!

NBW
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question