System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes.



System.InvalidOperationException: WebServiceBindingAttribute is required on
proxy classes.

My environment: Visual Studio 2005, targeting FX 2.0; I've developed a Web
Service which uses DIME to transfer file attachments to and from the server.
I'm using WSE 2.0 SP3 which is supposed to support FX 2.0, as far as I know.
(We will soon move on to MTOM, however I'm stuck with DIME for now; the
solution was originally written for FX 1.1, and I need to remain with WSE
and DIME until I can complete the migration to MTOM.)

I'm getting the following error on my first method call into the Web Service
(via the client's Proxy class):

---------------------------------------------
An unhandled exception of type 'System.Web.Services.Protocols.SoapException'
occurred in System.Web.Services.dll

Additional information: System.Web.Services.Protocols.SoapException: Server
was unable to process request. ---> System.InvalidOperationException:
WebServiceBindingAttribute is required on proxy classes.
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at Microsoft.Web.Services2.WebServicesClientProtocol..ctor()
at SRSFreedom.Repository..ctor() in C:\VBProjects\SRSDev\Source Code\WSL
Components\Repository.asmx.cs:line 30
--- End of inner exception stack trace ---

In order to diagnose this, I created a brand new driver project, a very
simple WinForm project to simply create an instance of the Web Service and
call a single method. The proxy is absolutely untouched since it was
generated automatically by VS 2005 when I referenced the Web Service.

Here are the attributes which decorate the definition of the Proxy class:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="RepositorySoap",
Namespace="http://srssoft.com/webservices/";)]
public partial class Repository :
System.Web.Services.Protocols.SoapHttpClientProtocol { ...

The WebServiceBinding attribute *IS* specified, so what is the runtime
complaining about?

Can anyone help straighten this out for me?

Thanks!

- Joseph Geretz -


.



Relevant Pages