Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2007

Tip: Looking for answers? Try searching our database.

System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joseph Geretz - 17 Jan 2007 00:25 GMT
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 -
Joseph Geretz - 17 Jan 2007 01:12 GMT
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(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 -

> System.InvalidOperationException: WebServiceBindingAttribute is required
> on proxy classes.
[quoted text clipped - 49 lines]
>
> - Joseph Geretz -
Joseph Geretz - 17 Jan 2007 01:57 GMT
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 -

> Well knock me down - Is that the correct error message????
>
[quoted text clipped - 79 lines]
>>
>> - Joseph Geretz -
Joseph Geretz - 18 Jan 2007 03:23 GMT
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 -

> Well, I'm further along, but this is still not working.
>
[quoted text clipped - 102 lines]
>>>
>>> - Joseph Geretz -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.