locked
C# WSDL API how to access an array? RRS feed

  • Question

  • User295618578 posted
    var results = client.CancelRx(new ServiceReference2.CancelRxRequest()
                {
                    PracticeLocation = new ServiceReference2.PracticeLocationType()
                    {
                        Identification = new ServiceReference2.FacilityID()
                        {
                            ID = "101",
                            MedicareNumber = "101",
                            Ogrn = "101"
                        },
                        BusinessName = "Name №1",
                    }
    }

    How to access methods is clear, according to this principle, but how to access an array, I don't know, can anyone help?

    Monday, September 21, 2020 8:53 AM

All replies

  • User475983607 posted

    How to access methods is clear, according to this principle, but how to access an array, I don't know, can anyone help?

    You have to understand the community does not have the WSDL or the service documentation.   We have no idea what array you are asking about.

    If CancleRx returns an collection then the first item in the array is results[0].  Use a standard foreach if you need to loop over the array.  

    foreach(var item in results)
    {
        //Do something with item
    }

    If the above does not answer your question, then contact the service owner for assistance.  The service owners will be able to explain how the service works.

    Monday, September 21, 2020 11:43 AM
  • User295618578 posted
     public partial class DrugCoded : object, System.ComponentModel.INotifyPropertyChanged {
            
            private object[] itemsField;
            
            /// <remarks/>
            [System.Xml.Serialization.XmlElementAttribute("CompositeProductCode", typeof(DrugProductCodeWithDoseText), Order=0)]
            [System.Xml.Serialization.XmlElementAttribute("IndividualManufactured", typeof(BooleanCode), Order=0)]
            [System.Xml.Serialization.XmlElementAttribute("ProductClarifyingFreeText", typeof(string), Order=0)]
            [System.Xml.Serialization.XmlElementAttribute("ProductCode", typeof(DrugProductCodeWithText), Order=0)]
            public object[] Items {
                get {
                    return this.itemsField;
                }
                set {
                    this.itemsField = value;
                    this.RaisePropertyChanged("Items");
                }
            }
            
    how to contact "ProductCode"



    Monday, September 21, 2020 1:09 PM
  • User475983607 posted

    What are you showing us?  It looks like an object that can be different types.  Why do you not know the type to expect?  Have you read the service documentation?  Or if this is an internal service contact the service owners for assistance.

    Monday, September 21, 2020 3:09 PM