Paul Muaddib
Paul Muaddib

Reputation: 5

WCF Web Service / Visual Studio Community 2022 / Compiler Error CS0120

I want to access a web page in a Windows Forms app via SOAP.

Unfortunately, the compiler spits out many errors after I added the WCF Web Service to the project. What am I doing wrong here? The possible options don't tell me anything. The examples I found on the Internet could not help me with the errors.

Visual Studio Community 2022

WCF Web Service URI: https://www.onlinembe.de/wsdl/OnlineMbeSOAP.wsdl

[ ] Always generate message contracts
[X] Reuse types in referece assemblies

Access level for generated classes:
[X] Public

Compiler Error CS0120
An object reference is required for the non-static field, method or property "ShipmentRequestType.System".

Upvotes: 0

Views: 461

Answers (1)

der_entwickler
der_entwickler

Reputation: 26

In 'Reference.cs' add 'using System.Xml.Schema;' and replace 'Form=System.Xml.Schema.XmlSchemaForm.Unqualified' with Form='XmlSchemaForm.Unqualified'.

Upvotes: 1

Related Questions