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 / September 2004

Tip: Looking for answers? Try searching our database.

Why doesn't WSE2.0 work with the autogenerated proxy?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shell - 08 Sep 2004 10:12 GMT
I'm trying to get a basic web service up and running with WSE 2.0, but
it always fails with the exception:

--------- Exception below -----------
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.
---------- End of exception ----------

Here's what I've been trying: I downloaded and installed the WSE 2.0
files. I fired up VS.NET and created a simple web service and
uncommented the HelloWorld method. I setup the WS to use WSE 2.0 by
right clicking on the project, selected WSE Settings 2.0 and enabling
both the checkboxes on the General tab. I hit F5. So far, so good. But
when I invoke the method from IE, all I get is an HTTP 500 Internal
Server Error page.

OK, so I figure this might be because WSE2.0 and 1.0 are incompatible.
(I dunno, I'm just shooting in the dark here).

Anyway, so then I made a WinForms application and enabled WSE2.0
support. Then I added a reference to my service and inserted the
following code:

--------------- Exception  text below ---------------

localhost.Service1Wse svc = new
WindowsApplication1.localhost.Service1Wse();
svc.HelloWorld();

When I try to run this code, I get the following exception. This is the
full exception text below:

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 SimpleService.Service1..ctor() in
c:\inetpub\wwwroot\simpleservice\service1.asmx.cs:line 18
--- End of inner exception stack trace ---

Unhandled Exception: System.Web.Services.Protocols.SoapException:
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 SimpleService.Service1..ctor() in
c:\inetpub\wwwroot\simpleservice\service1.asmx.cs:line 18
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at WindowsApplication1.localhost.Service1Wse.HelloWorld() in
C:\Documents and Settings\rageshk\My Documents\Visual Studio
Projects\SimpleService\WindowsApplication1\Web
References\localhost\Reference.cs:line 37
at WindowsApplication1.Form1.button1_Click(Object sender, EventArgs
e) in c:\documents and settings\rageshk\my documents\visual studio
projects\simpleservice\windowsapplication1\form1.cs:line 90
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsApplication1.Form1.Main() in c:\documents and
settings\rageshk\my documents\visual studio
projects\simpleservice\windowsapplication1\form1.cs:line 84

--------------- End of exception text ---------------

I can't understand why it says my proxy isn't right. It was
autogenerated by VS.NET 2003. Do I need to do something else to get it
to work with WSE2.0?
Shell - 08 Sep 2004 10:51 GMT
Oops. Never mind. I made a mistake while playing around with the
classes. Somehow, I managed to change the WebService itself to derive
from WebServiceClientProtocol. Sorry for the trouble...

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.