Get XML code from a WebPage

Get XML code from a WebPage

  
Hi,

I need to build a webpage that contains a XML code that I get through a webService or Data Base. When I call this WebPage through the method POST, It must return only the XML code.

I tried this 2 situations but none worked:

On the preparation of the webpage I get the XML through a webService and then...
  •  I call the file download widget to return the XML (solution posted by Miguel Ventura in the topic "Converting C# source code").
               In this situation, when I call that webpage through the method POST it doesn´t return nothing.
  • I put an expression on the screen with the XML code.
               In this situation , when I call that webpage through the method POST it returns the HTML and XML code and I want only the XML.

Anyone knows the solution to that problem...?

Thanks.

Regards,

Filipe Godinho
Hi Filipe,

Using the download widget should work just fine, We've done that in several occasions.
  • Are you converting the XML to binary data prior to putting it in the download "File Content" parameter (You can use the Binary
  • Did you set the property "Save to disk" to false? if it is true, a special header is added to the http response which may influence your client when interpreting the response.
  • What kind of client do you have? are you trying to see the html directly in the browser or is an application reading the response of your page?
  • Can you post an example?
Cheers.
Hi,

Thanks Gonçalo.

I found the problem. The input parameter of the page was not filled with the respective value. I had to get it's value with the action GetRequestContent of the extension "HTTPRequestHandler".

Cheers.

Hi Filiipe,

Remember that you can use the OutSystems debugger to inspect how your code is being executed. You can do that by simply running your eSpace and adding your personal testing area to the URL that you invoke. This way you can easily find out what is wrong seeing your flow executing step-by-step.

In case you are accessing an entry point with the name MyEntry in an eSpace with the name MyEspace and your username in Service Center is Filipe, all you have to do to be able to debug your screen is:
  1. Run your eSpace (MyEspace) while logged in to the OutSystems platform with the user Filipe;
  2. Add a break point to the preparation of your screen;
  3. Invoke your screen with the URL http://MyServer/MyEpace/Filipe/MyEntry.aspx?Param1=Value1&Param2=Value2....
By doing this, once your screen is invoked, you will see it executing in Service Studio (it will stop in the break point in the preparation of your screen). Now, just use the debugger to see how it executes and inspect the variable values. See the video at Debug Applications Visually.

Regards,

Daniel Lourenço
OutSystems