开发者

wpf legacy server call

开发者 https://www.devze.com 2023-02-02 00:31 出处:网络
We have a legacy application running tomcat that publishe开发者_如何学Gos data in a simple html table.

We have a legacy application running tomcat that publishe开发者_如何学Gos data in a simple html table. I have no control on the remote server publishing the data. I am looking to extract the data into a WPF desktop application and display it as a table.

Is there any way a WPF application can make a url call, get the result and parse the data. This would be similar to AJAX from JSP.

Any thoughts/ideas? Please advice.

Regards,


This isn't really a WPF question (as that's just the mechanism to display the information once you've retrieved and parsed it).

You could use something like HttpWebRequest to open the URL and retrieve the data, then write some code to parse the HTML and then you can use WPF to finally display it any way you like.


Yes, you can use a web service proxy class if the service is SOAP or use the WebClient class to request the data.

Once you get the data, use LINQ to parse it.

To get a more specific answer, you need to make your question more specific.


It depends on the condition of the HTML that you're receiving from the legacy application.

If it's XHTML, it can be parsed by an XML parser, and you can use the WebClient class to retrieve it from the server and LINQ or the XmlDocument to parse and query the data returned./

If it's not well-formed XML, you'll need to use an HTML parser to parse it, which probably means that you'll want to use the HTML Agility Pack.

Of course, you may not need to parse it at all. You might be able to get away with simply using a WebBrowser control to display it. It all depends on your requirements.

0

精彩评论

暂无评论...
验证码 换一张
取 消