Could not create type 'MyGolfMart.WebServices.ccService'

O

OsamaBG

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

}

}

===================
 
M

Michael Nemtsev

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
 
O

OsamaBG

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
 
M

Michael Nemtsev

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>
 
O

OsamaBG

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></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 /?".
=================
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top