void GetCompanies(string accessToken, string clusterUrl) { var processXmlService = new ProcessXmlSoapClient( new BasicHttpsBinding(), new EndpointAddress(clusterUrl + "/webservices/processxml.asmx")); var result = processXmlService.ProcessXmlString( new Header { AccessToken = accessToken }, "<list><type>offices</type></list>"); var doc = XDocument.Parse(result); var offices = doc.Root?.Elements("office").ToArray(); Log($"Found {offices?.Length} companies"); if (offices != null) { foreach (var office in offices) { Log($"{office.Attribute("name")?.Value} [{office.Value}]"); } } }
public ProcessXmlSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(ProcessXmlSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public ProcessXmlSoapClient(EndpointConfiguration endpointConfiguration) : base(ProcessXmlSoapClient.GetBindingForEndpoint(endpointConfiguration), ProcessXmlSoapClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }