Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WSDL web service in Windows 8 store C# application: The base class or interface could not be resolved

I have written a simple WSDL web service with Java in Eclipse. Here is the Java code prototype of the service:

public static String vriteAnnouncement(String title, String body){
    ...
}

I have generated a proxy class for this WSDL service using the Microsoft wsdl.exe tool and make it a dll by using following commands from the Developer Command Prompt Visual Studio 2012:

wsdl /l:CS /protocol:SOAP WriteAnnouncement.wsdl
csc /t:library /r:System.Web.Services.dll /r:System.Xml.dll WriteAnnouncementService.cs

In my Windows 8 Store application, I then added a reference to this dll, then added following code in MainPage.xaml.cs:

WriteAnnouncementService was = new WriteAnnouncementService();

When I tried to run the application, I got this error:

The type 'System.Web.Services.Protocols.SoapHttpClientProtocol' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
C:\Users...\MainPage.xaml.cs Line 27 Column 13

I then added a reference to System.Web.Service and rebuilt the application. Now I am getting the following error:

The base class or interface 'System.ComponentModel.Component' in assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' referenced by type 'System.Web.Services.Protocols.WebClientProtocol' could not be resolved c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.Services.dll

like image 800
Olcay Ertaş Avatar asked Oct 21 '22 20:10

Olcay Ertaş


1 Answers

Is there a reason you generate the proxy with wsdl.exe?

I am not an expert of the Windows 8 store subset of the bcl but I would recommend using the svcutil to generate the proxy from known wsdl as the generated proxy supports the newer web services subsystem. The generated proxies inherits from different classes in the base class library. To me it is more likely that the newer subsystem will seamlessly work in a constrained environment.

like image 139
Wiktor Zychla Avatar answered Oct 24 '22 18:10

Wiktor Zychla