I added a service to my project, and when it was done adding I built. I get a bunch of messages saying:
The type 'Test_ERS_Web_Service.ERSDataWebService.WSObserver' already contains a definition for 'codeField' C:\Projects\CSCQIS\QISWeb\V1.0\QISWeb\Test ERS Web Service\Service References\ERSDataWebService\Reference.cs
etc...
Why does this happen?
What should I do for my project to use this web service? (We did not produce it, so we can't change the service.)
-
-
It’s hard to tell what the problem is from your brief description, but I would guess that you have an overloaded function named codeField. If so, you can try using more descriptive names.
-
What more information could I add?
codeField is in the Web Service which we didn't write, so we can't change it. -
There should be someone here who can help better than I can. In the mean time, I would check to make sure that you’re calling codeField with the correct arguments. You should be able to run the service directly and get the interface description.
Edit: otherwise, it could be something that they threw in to hide the interface, and the web service might still function.
-
No its not in the webservice, its in the proxy that svcutil created.. you can dig into the service reference generated proxy and edit it (if you believe its been malcreated).
-
Some more info on this. The Web Service is an Axis 2 web service.
I did go into the .wsdl file that was generated, and there were multiple ExceptionFault elements listed.
Also, the Reference.cs file that is generated declares the methods in this web service as classes, which makes things interesting.
So, yes, I think the proxy is malcreated. Any ideas how to clean this up? Rather than manually, can I get it to read correctly? In the Web Service wizard, it lists the methods correctly. -
If it helps, here's what we were given for addresses for the service:
http://www.evalware.com/ECERS-server/services/ers
http://www.evalware.com/ECERS-server/services/ers?wsdl
http://www.evalware.com/ECERS-server/services/ers?xsd -
Classes can be defined to act as service methods, this is one of the features of WCF.. mainly for interop I imagine.
It may also be that the WSDL file isn't well written and svcutil isn't doing enough sanity checks to see if the code being interpretted from the WSDL will actually compile..
I can't see a way you could avoid this specifically other than manually fixing the proxy, or editing the wsdl to help svcutil read it properly. -
Well, can't change the service, since it's not ours. But could you give more info on manually handling it? If we have to we have to.
-
The WSDL and the XSD's that are generated (at the urls given) are just descriptions of the service.. I would imagine that they aren't being written properly (or at least not in a way that svcutil understands)..
You can download the wsdl and xsds and do manual compilation with svcutil (usable via the vs sdk command prompt).
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.