Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1048
  • Last Modified:

bind web service response to grid view

I have a webservice that I am connecting to and receiving a response in xml format. How can I bind this response to a data grid view?

wsdl link

any help would be greatly appreciated.

Cheers,
Brendan
PartnerService partnerService = new PartnerService();
            EMSystems_HaveBed.com.emsystem.test.getUpdate requestArguement = new EMSystems_HaveBed.com.emsystem.test.getUpdate();
            EMSystems_HaveBed.com.emsystem.test.getUpdateResponse updateResponse = default(EMSystems_HaveBed.com.emsystem.test.getUpdateResponse);

            partnerService.Credentials = new NetworkCredential("user", "password");
            partnerService.PreAuthenticate = true;

            try
            {
                requestArguement.String_1 = "<?xml version='1.0'?><requestDefinition actionName='getHAvBEDStatus' systemName='EMResource' divisionName='1821'></requestDefinition>";
                updateResponse = partnerService.getUpdate(requestArguement);

                txtResult.Text = updateResponse.result.ToString();
            }
            catch(Exception ex)
            {
                txtResult.Text = ex.Message.ToString();

Open in new window

get-response.xml
0
brendanlefavre
Asked:
brendanlefavre
  • 3
  • 2
2 Solutions
 
Bob LearnedCommented:
I would think that you could use an XmlDataSource, which would be configured to load the XML, and then bind to the GridView with the DataSourceID property.
0
 
brendanlefavreAuthor Commented:
how can I bind the XMLDataSource to the response from the web service?
0
 
Bob LearnedCommented:
The XmlDataSource.Data property is used to load a string into the data source:

XmlDataSource.Data Property
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.xmldatasource.data.aspx#Y499
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
kumarnimavatCommented:
0
 
brendanlefavreAuthor Commented:
I have been looking over the last sample, and have a couple questions.

-There is a reference to a database, but the database doesn't exist. Do I need to create a database for the sample to work?

-On line 33 of the default.aspx.cs
      byte[] buf = System.Text.ASCIIEncoding.ASCII.GetBytes(neNode.OuterXml);

Open in new window


when i run the code, I get an error "Object reference not set to an instance of an object"


- I am trying to figure out how I can take the output of the web service call, and apply it using the sample. I understand how they bind the xml document to the grid view, but I'm not seeing how to take the web service response and do the same.

Cheers,
Brendan
0
 
brendanlefavreAuthor Commented:
Thank you for all of your help. I have realized that it is a bit more complicated than just binding directly to the web service. I am going to do some more research, and then give this another try.

Cheers,
Brendan
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now