Well knock me down - Is that the correct error message????
System.InvalidOperationException: WebServiceBindingAttribute is required
on proxy classes.
After fiddling around for hours, in desperation, just for the kick of it, I
inserted this attribute into the declaration of the Web Service itself (i.e.
the asmx page). So here's what it looks like now:
[WebService(Namespace="http://srssoft.com/webservices/")]
[System.Web.Services.WebServiceBindingAttribute(Nam e = "RepositorySoap",
Namespace = "http://srssoft.com/webservices/")]
public class Repository : Microsoft.Web.Services2.WebServicesClientProtocol
// System.Web.Services.Protocols.SoapHttpClientProtoc ol
{...
BINGO! Everything starts working again. (WOW - just like it did under FX
1.1. :-\ )
So the point wasn't that the attribute was missing on the client Proxy, but
rather the attribute was missing on the Web Service itself! Nothing like a
well defined error message to shed some light on the problem.
Well I hope this helps the next guy who decides to migrate a WSE Web Service
from FX 1.1 to 2.0. If my experience is any indicator - it's not going to be
painless.
- Joe Geretz -
"Joseph Geretz" <jg*****@nospam.comwrote in message
news:Ow**************@TK2MSFTNGP02.phx.gbl...
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.SoapHttpClientProtoc ol..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("Sy stem.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="RepositorySoap",
Namespace="http://srssoft.com/webservices/")]
public partial class Repository :
System.Web.Services.Protocols.SoapHttpClientProtoc ol { ...
The WebServiceBinding attribute *IS* specified, so what is the runtime
complaining about?
Can anyone help straighten this out for me?
Thanks!
- Joseph Geretz -