renaming webservice-class ?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.

Post a new message to this list...

Chris
Hi,

I use my Webservice in IE : http://localhost/CalcWS/CalcService.asmx
That works well.

Then, in visual Studio.NET :
I rename the name of the WebService-class from the default name 'Service1'
to 'CCalc'
, rebuild the project, but, using it again in IE :
http://localhost/CalcWS/CalcService.asmx
results in a parser error.
" Could not create type 'CalcWS.CCalc'.

how come ?
how can I still rename the class ?

thnx
Chris

Reply to this message...
 
    
Jared
When you create a web reference, vs generates a proxy class. Click the Show
All Files button in the solution explorer to follow allong. Choose
<references><web references><CalcWS><reference map><reference.vb>
Open it, and you will see all the methods of your web service as well as
their asynchronous signatures. In any sense, that just demonstrates what the
proxy class is. Calls to your web service are invoked by this class. Since
you made a change to the name of the web service the proxy class is no
longer valid. To fix this you will have to right click on the CalcWS
reference and choose <update web reference>. Hope this makes sense.

Jared

"Chris" <Click here to reveal e-mail address> wrote in message
news:S6A0d.243069$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Chris
hi Andre, you wrote :
>Have you ranemd/changed it in both the Code file and de ASMX file ?

Yes:
so the asmx-file looks like this :
<%@ WebService Language="c#" Codebehind="CalcService.asmx.cs"
Class="CalcWS.CCalc" %>

and the code behind file :
public class CCalc : System.Web.Services.WebService
{...}

hi Jared:
I'm using the WebService directly from within IE, so not via a Web reference
set in VisStudio.

any ideas ?

"Jared" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> When you create a web reference, vs generates a proxy class. Click the
Show
[Original message clipped]

Reply to this message...
 
    
Jared
Did you change the targetNamespace attribute to reflect the change.
Make sure it's correct. Try to browse to the page using
http://localhost/CalcWS/CalcService.asmx?wsdl
Is the targetNamespace attribute correct?

"Chris" <Click here to reveal e-mail address> wrote in message
news:ULE0d.243334$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Chris
Hi jared,

I added the attribute, the code-behind looks like this now :
[WebService(Namespace="http://localhost/webservices/";)]
public class Calculator : System.Web.Services.WebService
{...}

but I still have the same problem : I cannot browse to
http://localhost/CalcWS/Calculator.asmx
nor to
http://localhost/CalcWS/Calculator.asmx?wsdl" target="_blank">http://localhost/CalcWS/Calculator.asmx?wsdl

still getting the parser error.

some other place where I have to change it, maybe directly in the asmx-file
using a text-editor ?
actually I tried that as well :
<%@ WebService Language="c#" Namespace="http://localhost/webservices/";
Codebehind="Calculator.asmx.cs" Class="CalcWS.Calculator" %>

but no improvement :-((

what now ?

thanks
Chris

"Jared" <@Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Jared
Chris,

What is the physical file names that is stored in the virtual directory?
This is your entry point, you may have changed the class name but if the
file name remains the same you will still have to tell IIS what file you
want to access. Try accessing it
http://localhost/virtualDirectoryName/Filename.asmx

What happens when you try to debug the program, what is the URL? Can you
debug? Step through the code to see where the reference to service1 is.
Have you tried to add a web reference to you application through visual
studio, there is an option to search the local machine, try it. Can you see
your service in the list? If so, add a reference it and look at the url,
does it match the one you are trying to browse to? Does it work?

You didn't change you web.config to include a custom IE page using the
wsdlHelpGenerator file, if you did remove it and see if it works.

<webServices>
<wsdlHelpGenerator href="SomeCustomForm.aspx"/>
</webServices>

Try to generate a discovery document
http://localhost/CalcWS/Calculator.asmx?disco" target="_blank">http://localhost/CalcWS/Calculator.asmx?disco look at the contactRef
attribute and the docRef attribute. Do they point to the correct locations?

Search your project for the old name of the service?

"Chris" <Click here to reveal e-mail address> wrote in message
news:ZBU0d.243928$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
A.Mens
Have you ranemd/changed it in both the Code file and de ASMX file ?

Greetings Andre

Reply to this message...
 
 
System.Web.Services.WebService




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com