all groups > dotnet web services > january 2007 >
You're in the

dotnet web services

group:

System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes.


System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. Joseph Geretz
1/16/2007 7:25:54 PM
dotnet web services:
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 -

Re: System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. Joseph Geretz
1/16/2007 8:12:52 PM
Well knock me down - Is that the correct error message????

[quoted text, click to view]

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(Name = "RepositorySoap",
Namespace = "http://srssoft.com/webservices/")]
public class Repository : Microsoft.Web.Services2.WebServicesClientProtocol
// System.Web.Services.Protocols.SoapHttpClientProtocol
{...

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 -

[quoted text, click to view]

Re: System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. Joseph Geretz
1/16/2007 8:57:00 PM
Well, I'm further along, but this is still not working.

At least I'm now able to trace into the Web Service methods, however, on the
server, the following statement returns a null object reference.

SoapContext RespContext = SoapContext.Current;

So why is this object null? How do I send a response back to the client?

Looking into this a bit further, I see my Web Service class defined as
inheriting from base class
Microsoft.Web.Services2.WebServicesClientProtocol. Is this correct? I guess
this is the correct definition for the client, but how about for the server?
I wish I could find a WebServices*Server*Protocol class to inherit from but
I just can't find this. Can you tell me what is the correct base class for
my Web Service class on the server and what object I use to send back a
response to the client.

Thanks for your help!

- Joe Geretz -

[quoted text, click to view]

Re: System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. Joseph Geretz
1/17/2007 10:23:10 PM
Forget it.

WSE 2.0 DIME is dead - long live WSE 3.0 MTOM!

Because I don't want to go through another such conversion anytime soon!!!

- Joe Geretz -

[quoted text, click to view]

AddThis Social Bookmark Button