Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP.net VB.net project using Java

Posted on 2012-08-13
3
Medium Priority
?
466 Views
Last Modified: 2012-08-16
Hi. I have an ASP.net project where I have to call an XML engine. I was given the following Java code. Can this be converted to VB.net or used in my project?

  try {

      // This will Post the xml string data...    
      URL url = new URL("http://IPAddress:Port/APIWebModule/APIServlet");
      HttpURLConnection connection = (HttpURLConnection)url.openConnection();
      connection.setRequestMethod("POST");
      connection.setDoOutput(true);
      PrintWriter out = new PrintWriter( connection.getOutputStream());
      String data = "The XML string request";
      out.print(data);
      out.flush();
      out.close();



      // This will read the XML response data...
      InputSource inSource = new InputSource(connection.getInputStream());
      DOMParser dp = new DOMParser();
      dp.parse(inSource);
      Document doc = dp.getDocument();
      // This gives you an XML DOM document to work with
     
    }
    catch (SAXException ex) {
    }
    catch (MalformedURLException ex) {
    }
    catch (IOException ex) {
    }
0
Comment
Question by:Murray Brown
3 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 38289937
That code is not for a web application, ASP, Java or otherwise. It's code for a java 'desktop' application to invoke a web app

You should probably simply ask the ASP people how to parse XML returned from the service in question
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 38289960
0
 

Author Closing Comment

by:Murray Brown
ID: 38300841
Thanks very much
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question