Could not create type 'MyGolfMart.WebServices.ccService'

Discussion in 'ASP .Net Web Services' started by OsamaBG, Aug 30, 2005.

  1. OsamaBG

    OsamaBG Guest

    Hi all
    i made a web service but when i tried to use it i faced some troubles, an
    error msg from the IExplorer :

    Parser Error Message: Could not create type
    'MyGolfMart.WebServices.ccService'.

    Source Error:


    Line 1: <%@ WebService Language="c#" Codebehind="ccService.asmx.cs"
    Class="MyGolfMart.WebServices.ccService" %>

    Source File: c:\inetpub\wwwroot\MyGolfMart\WebServices\ccService.asmx
    Line: 1

    so pls can u take a closer look to my code and tell me what is the error?
    thanx alot

    here is my code:
    ===================


    namespace MyGolfMart.WebServices

    {

    using System;

    using System.Collections;

    using System.ComponentModel;

    using System.Data;

    using System.Diagnostics;

    using System.Web;

    using System.Web.Services;

    public class ccService : System.Web.Services.WebService

    {

    public ccService()

    {

    InitializeComponent();

    }

    [WebMethod(Description="The OrderItem method enables a remote client to
    programmatically place an order using a WebService.", EnableSession=false)]

    public bool LundCheck( string ccNum )

    {

    int iSum = 0;

    int iLength = ccNum.Length;

    int iOddEven = iLength & 1;

    char[] sCardNumber = ccNum.ToCharArray();

    for(int i = 0; i < iLength; i ++)

    {

    int iDigit = System.Int32.Parse(sCardNumber.ToString());

    if (!(((i & 1) ^ iOddEven)==0))

    {

    iDigit *= 2;

    if(iDigit > 9)

    {

    iDigit -= 9;

    }

    }

    iSum += iDigit;

    }



    if (iSum % 10 == 0)

    return true;

    else

    return false;

    }

    [WebMethod(Description="The OrderItem method enables a remote client to
    programmatically place an order using a WebService.", EnableSession=false)]

    public string GetAuthorization(string ccNum)

    {

    if( LundCheck( ccNum ) )

    {

    return "APPROVED";

    }

    else

    {

    return "DECLINED";

    }

    }

    #region Component Designer generated code



    private IContainer components = null;



    private void InitializeComponent()

    {

    }

    protected override void Dispose( bool disposing )

    {

    if(disposing && components != null)

    {

    components.Dispose();

    }

    base.Dispose(disposing);

    }



    #endregion

    }

    }

    ===================
    OsamaBG, Aug 30, 2005
    #1
    1. Advertising

  2. Hello OsamaBG,

    I've tried your code, but everything works fine

    could u explain when do u get this error

    O> Hi all i made a web service but when i tried to use it i faced some
    O> troubles, an error msg from the IExplorer :
    O> Parser Error Message: Could not create type
    O> 'MyGolfMart.WebServices.ccService'.
    O> Source Error:
    O> Line 1: <%@ WebService Language="c#" Codebehind="ccService.asmx.cs"
    O> Class="MyGolfMart.WebServices.ccService" %>
    O> Source File: c:\inetpub\wwwroot\MyGolfMart\WebServices\ccService.asmx
    O> Line: 1
    O> so pls can u take a closer look to my code and tell me what is the
    O> error? thanx alot

    ---
    WBR,
    Michael Nemtsev
    "At times one remains faithful to a cause only because its opponents do not
    cease to be insipid. (c) Friedrich Nietzsche
    Michael Nemtsev, Aug 30, 2005
    #2
    1. Advertising

  3. OsamaBG

    OsamaBG Guest

    Hi Michael
    this error appears when I tried to use my web service, when I tried to add
    web reference to my application, I searched to services on local machine
    where my service is located and when I tried to use it this error appeared :-(
    can u help?

    Kinly Regards

    "Michael Nemtsev" wrote:

    > Hello OsamaBG,
    >
    > I've tried your code, but everything works fine
    >
    > could u explain when do u get this error
    >
    > O> Hi all i made a web service but when i tried to use it i faced some
    > O> troubles, an error msg from the IExplorer :
    > O> Parser Error Message: Could not create type
    > O> 'MyGolfMart.WebServices.ccService'.
    > O> Source Error:
    > O> Line 1: <%@ WebService Language="c#" Codebehind="ccService.asmx.cs"
    > O> Class="MyGolfMart.WebServices.ccService" %>
    > O> Source File: c:\inetpub\wwwroot\MyGolfMart\WebServices\ccService.asmx
    > O> Line: 1
    > O> so pls can u take a closer look to my code and tell me what is the
    > O> error? thanx alot
    >
    > ---
    > WBR,
    > Michael Nemtsev
    > "At times one remains faithful to a cause only because its opponents do not
    > cease to be insipid. (c) Friedrich Nietzsche"
    >
    >
    >
    OsamaBG, Aug 30, 2005
    #3
  4. Hello OsamaBG,

    strange, coz everything is ok
    try generete proxy manually by

    wsdl.exe http://<yourWebServiceUrl>?wsdl


    O> Hi Michael
    O> this error appears when I tried to use my web service, when I tried
    O> to add
    O> web reference to my application, I searched to services on local
    O> machine
    O> where my service is located and when I tried to use it this error
    O> appeared :-(
    O> can u help?
    O> Kinly Regards
    O>

    ---
    WBR,
    Michael Nemtsev
    "At times one remains faithful to a cause only because its opponents do not
    cease to be insipid. (c) Friedrich Nietzsche
    Michael Nemtsev, Aug 30, 2005
    #4
  5. OsamaBG

    OsamaBG Guest

    Hello again
    I tried with the same error
    =================
    C:\Inetpub\wwwroot\MyGolfMart\WebServices>wsdl.exe
    http://localhost/MyGolfMart/W
    ebServices/ccService.asmx?wsdl
    Microsoft (R) Web Services Description Language Utility
    [Microsoft (R) .NET Framework, Version 1.1.4322.573]
    Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

    Error: There was an error processing
    'http://localhost/MyGolfMart/WebServices/cc
    Service.asmx?wsdl'.
    - There was an error downloading
    'http://localhost/MyGolfMart/WebServices/ccSe
    rvice.asmx?wsdl'.
    - The request failed with the error message:
    --
    <html>
    <head>
    <title>Parser Error</title>
    <style>
    body {font-family:"Verdana";font-weight:normal;font-size:
    ..7em;c
    olor:black;}
    p
    {font-family:"Verdana";font-weight:normal;color:black;margin-t
    op: -5px}
    b
    {font-family:"Verdana";font-weight:bold;color:black;margin-top
    : -5px}
    H1 {
    font-family:"Verdana";font-weight:normal;font-size:18pt;col
    or:red }
    H2 {
    font-family:"Verdana";font-weight:normal;font-size:14pt;col
    or:maroon }
    pre {font-family:"Lucida Console";font-size: .9em}
    .marker {font-weight: bold; color: black;text-decoration:
    none;}

    .version {color: gray;}
    .error {margin-bottom: 10px;}
    .expandable { text-decoration:underline; font-weight:bold;
    color
    :navy; cursor:hand; }
    </style>
    </head>

    <body bgcolor="white">

    <span><H1>Server Error in '/MyGolfMart' Application.<hr
    width=100% s
    ize=1 color=silver></H1>

    <h2> <i>Parser Error</i> </h2></span>

    <font face="Arial, Helvetica, Geneva, SunSans-Regular,
    sans-serif ">


    <b> Description: </b>An error occurred during the parsing of a
    resou
    rce required to service this request. Please review the following specific
    par
    se error details and modify your source file appropriately.
    <br><br>

    <b> Parser Error Message: </b>Could not create type
    'MyGolfMart.WebS
    ervices.ccService'.<br><br>

    <b>Source Error:</b> <br><br>

    <table width=100% bgcolor="#ffffcc">
    <tr>
    <td>
    <code><pre>

    <font color=red>Line 1: <%@ WebService Language="c#" Codebehind=&q
    uot;ccService.asmx.cs" Class="MyGolfMart.WebServices.ccService" %
    >

    </font></pre></code>

    </td>
    </tr>
    </table>

    <br>

    <b> Source File: </b>
    c:\inetpub\wwwroot\MyGolfMart\WebServices\ccSe
    rvice.asmx<b> Line: </b> 1
    <br><br>

    <hr width=100% size=1 color=silver>

    <b>Version Information:</b> Microsoft .NET Framework Version:1.
    1.4322.573; ASP.NET Version:1.1.4322.573

    </font>

    </body>
    </html>
    <!--
    [HttpParseException]: Could not create type
    'MyGolfMart.WebServices.ccService'.
    at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName)
    at System.Web.UI.SimpleWebHandlerParser.GetCompiledTypeInternal()
    at System.Web.UI.SimpleWebHandlerParser.GetCompiledType()
    at System.Web.UI.SimpleWebHandlerParser.GetCompiledTypeFromCache()
    at System.Web.UI.WebServiceParser.GetCompiledType(String inputFile,
    HttpConte
    xt context)
    at
    System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpCont
    ext context, String verb, String url, String filePath)
    at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
    requ
    estType, String path, String pathTranslated, Boolean useAppConfig)
    at
    System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionSt
    ep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    compl
    etedSynchronously)
    -->
    --.

    If you would like more help, please type "wsdl /?".
    =================

    "Michael Nemtsev" wrote:

    > Hello OsamaBG,
    >
    > strange, coz everything is ok
    > try generete proxy manually by
    >
    > wsdl.exe http://<yourWebServiceUrl>?wsdl
    >
    >
    > O> Hi Michael
    > O> this error appears when I tried to use my web service, when I tried
    > O> to add
    > O> web reference to my application, I searched to services on local
    > O> machine
    > O> where my service is located and when I tried to use it this error
    > O> appeared :-(
    > O> can u help?
    > O> Kinly Regards
    > O>
    >
    > ---
    > WBR,
    > Michael Nemtsev
    > "At times one remains faithful to a cause only because its opponents do not
    > cease to be insipid. (c) Friedrich Nietzsche"
    >
    >
    >
    OsamaBG, Aug 30, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roxanne
    Replies:
    0
    Views:
    1,221
    Roxanne
    Jul 4, 2003
  2. The unProfessional

    Could not create type...

    The unProfessional, Oct 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,914
    The unProfessional
    Oct 15, 2004
  3. Adam Knight
    Replies:
    1
    Views:
    1,108
    Ken Cox - Microsoft MVP
    Dec 5, 2005
  4. krabhi
    Replies:
    1
    Views:
    9,267
    Marco Meschieri
    Aug 9, 2006
  5. DevMountain
    Replies:
    7
    Views:
    1,452
    DevMountain
    Apr 17, 2009
Loading...

Share This Page