Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2005

Tip: Looking for answers? Try searching our database.

Could not create type 'MyGolfMart.WebServices.ccService'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
OsamaBG - 30 Aug 2005 11:25 GMT
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[i].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

}

}

===================
Michael Nemtsev - 30 Aug 2005 12:27 GMT
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 - 30 Aug 2005 12:57 GMT
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

> Hello OsamaBG,
>
[quoted text clipped - 19 lines]
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid. (c) Friedrich Nietzsche"
Michael Nemtsev - 30 Aug 2005 13:50 GMT
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 - 30 Aug 2005 14:19 GMT
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 /?".
=================

> Hello OsamaBG,
>
[quoted text clipped - 19 lines]
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid. (c) Friedrich Nietzsche"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.