// ----------------------------------------------------------------------------------------------- // Call the web service proxies using Rpc style soap. // Serialising the Payload does not work for RPC without modifing the information generated from // the web reference file. Therefore just pull out some of the information for display. // ----------------------------------------------------------------------------------------------- private void UseStronglyTypedRpcSearch() { ServiceReferenceAbnLookupRpc.Payload SearchPayload = null; try { if (this.radioButtonAbn.Checked) { // SearchPayload response will contain a Buisness Entity when searching By ABN SearchPayload = ProxyXmlRpcSearch.AbnSearch(this.textBoxCriteria.Text, SetFlag(this.checkBoxHistory.Checked), this.textBoxGuid.Text); this.richTextBoxResults.Text = ResultsInterpreter.SerialisePayload(SearchPayload); } else if (this.radioButtonAsic.Checked) { // SearchPayload response will contain a Buisness Entity when searching by ASIC SearchPayload = ProxyXmlRpcSearch.AsicSearch(this.textBoxCriteria.Text, SetFlag(this.checkBoxHistory.Checked), this.textBoxGuid.Text); this.richTextBoxResults.Text = ResultsInterpreter.SerialisePayload(SearchPayload); } else if (this.radioButtonName.Checked) { // SearchPayload response will contain a Search Results List when searching By name SearchPayload = ProxyXmlRpcSearch.NameSearch(this.textBoxGuid.Text, InitialiseRpcNameSearchCriteria()); DisplayNamesInGrid(SearchPayload); } else if (this.radioButtonPostcode.Checked) { // SearchPayload response will contain a ABN List when searching By postcode SearchPayload = ProxyXmlRpcSearch.PostcodeSearch(this.textBoxGuid.Text, this.textBoxCriteria.Text); this.richTextBoxResults.Text = ResultsInterpreter.SerialisePayload(SearchPayload); } } catch (Exception e) { ShowException(e.ToString()); } }
// ----------------------------------------------------------------------------------------------- // Extract names from the xml string // ----------------------------------------------------------------------------------------------- private void DisplayNamesInGrid(string payload) { this.richTextBoxResults.Visible = false; this.dataGridNames.Visible = true; try { this.dataGridNames.DataSource = ResultsInterpreter.DisplayNamesInGrid(payload); this.dataGridNames.Refresh(); } catch (Exception exp) { ShowException(exp.ToString()); throw; } }