Skip to Content
avatar image
Former Member

C# Web Service Proxy - Autogenerated Error

Hi all,

I'm trying to consume a SAP Webservice in a C# console application within Visual Studio 2005. I've added the web reference to the WSDL and as such Reference.cs has been automatically generated. My problem is that I'm receiving two different errors at multiple different locations within this file.

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string Type {
            get {
                return this.typeField;
            }
            set {
                this.typeField = value;
            }
        }

On the line System.Xml.Serialization.XmlElementAttribute(Form=_System_._Xml_.Schema.XmlSchemaForm.Unqualified) (Surrounded by square brackets, I'm not sure how to escape the hyperlink code), I'm receiving the following errors respectively:

System - An object reference is required for the nonstatic field, method, or property 'WSTest.dotnetWS.Bapiret2.System.get'

XML - 'string' does not contain a definition for 'Xml'

I'm not sure why, as this code has been automatically generated, that I'm receiving these errors, is there something that I need to change in order to rectify this problem?

Thanks,

Cal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 01, 2008 at 08:58 AM

    Hi Cal,

    is it maybe the error described in this thread ?

    Best regards,

    André

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Update: I'm not exactly sure what was causing the above error but the problem seemed to be solved once I fixed a problem in the Function Module that the WS was calling.

  • Sep 17, 2008 at 07:10 AM

    Hi Cal,

    Did you add a reference manually or by using ES Explorer for .NET ?

    Regards,

    Rima.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Rima Sirich

      Hi Rima,

      Thanks for you help, however the general consensus here is that we want to be able to add the Web Service 'manually', that is - adding the Web Service via WSDL into VS.net (2005) directly. As such I need to get around the original problem of the compiler errors found within the Reference.cs file (original post). Do you have any ideas on what may be causing this problem or how to get around it?

      Thanks,

      Cal