• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Spring application, soap webservice returning Html response

 
Greenhorn
Posts: 24
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a scenario, where in from my spring application I am communicating with a soap webservice that returns HTML response something like below:

<![CDATA[<HTML><HEAD></HEAD><BODY>................<script language="javascript">...</script>></BODY></HTML>]]>

Now I have to render this response in the browser, this HTML code is basically redirecting to another site.

My approach: we can set this html response in the request in spring controller, and after this we can forward the request to a blank jsp, and onload of blank jsp we can retrieve the html set in the request and render it using innerHtml,
and once the html is rendered it can redirect to a different site.

Please suggest if this is good appraoach or there is some other to achieve this.

Thanks,
Shiv
 
Ranch Hand
Posts: 37
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just so I understand, you get back HTML from a web service response and the HTML contains JavaScript that redirects the user? Is there an alternate way you may be able to parse out the redirect location and redirect from your controller?
 
Shiv Vishwakarma
Greenhorn
Posts: 24
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A correction to the requirement, webservice is returning a html page, which has hidden fields and in the body tag itself there is a function which submit the form with hidden fields and action path of the form is of a third application, my earlier was based on assumptions, but now it is bit more clear...
so from controller we cannot redirect to the url, we have to navigate it the user to the client, but now the question about rendering the html received from webservice, was approach to it was correct.

Thanks,
Shiv
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic