PHP Web Service in C# : Invoke() function returns null

前端 未结 1 1015
情深已故
情深已故 2021-01-15 01:24

I have a problem with consuming a third-party web service in .NET C#. It runs on Apache (NuSoap). Everything works normally up to deserialization (probably...). When I call

1条回答
  •  梦毁少年i
    2021-01-15 02:08

    I solve this, but it wasn't easy. At least i learned controling xml deserialization.. :)

    [SoapDocumentMethod(ResponseElementName = "EncodingTestResponse", ResponseNamespace = "http://schemas.xmlsoap.org/soap/envelope/")]
    [return: XmlArray("item", Namespace = "", IsNullable = false)]
    [SoapTrace]
    public item[] EncodingTest()
    {
        object[] result = this.Invoke("EncodingTest", new object[] { });
        return (item[])result[0];
    }
    
    
    [SoapType(TypeName = "Map", Namespace = "http://xml.apache.org/xml-soap")]
        public class item
        {
            [XmlElement(Form = XmlSchemaForm.Unqualified)]
            public string key { get; set; }
    
            [XmlElement(Form = XmlSchemaForm.Unqualified)]
            public string value { get; set; }
    
            public item[] items { get; set; }
        }
    

    0 讨论(0)
提交回复
热议问题