Balaji Singh A
Balaji Singh A

Reputation: 21

Http Request Send To BW

I have a html page with some form fields (like textbox, submit button etc) I want to call the BW process on click of the submit button, which will send the form fields value (textbox values) to the BW process definition.

BW Process definition will do some operation (like retrieve the database record) and send the result to the html page.

When I use http://localhost:9999, it will only call the BW process (Http receiver and Send HTTP Response) and the html page will populate with the string which i get from "Send HTTP Response" palette.

How can I embed that HTTP response into some text field of the response webpage along with few images and other fields already present in HTML page.

Upvotes: 2

Views: 6763

Answers (2)

Ants
Ants

Reputation: 1338

Have you tried using the Generate Web Service form the Tools menu in Designer? Select the process you need to use then run this.

You first need to make sure that the process start & end has the correct parameters. I think it is best to use xml and an xsd, i.e. in output editor select content of XML Element Reference type, then select the correct schema and element.

Once you have the wsdl and the url you can call this just like any other web service.

Upvotes: 1

Miklos Csuka
Miklos Csuka

Reputation: 1499

It is not clear from your description, but I suppose your HTML Form is a .html file on your local filesystem. That probably means all your images are also files on your local file system. The HTTP Response HTML cannot contain any references to resources on the client's local filesystem. If you'd like to have images or other resources embedded in your response page you've 3 possibilities, in order of complexity:

  1. Set up a web server (e.g. Apache HTTPd or Tomcat) to store your images and reference them from the HTTP Response HTML (img src="http://my.web.server/images/logo.jpg"). In this case you can also put your input form on this server.
  2. Base-64 encode your images (e.g. logo.jpg) to store them as text in a BW Mapper resource. Extend your BW process, so if it receives a request for an image (e.g. RequestURI="/images/logo.jpg") then HTTP Response returns with the image binary data, base-64 encoded (of course you also need to set response Content-Type="image/jpeg"). In this case you can reference images from the response as local resources (img src="/images/logo.jpg")
  3. Make your presentation layer intelligent, use Javascript/Flash/Applet/... to render the form page and post the HTTP request from the Javascript/Flash/Applet/... instead of a simple HTML form. In this case the image resources can be on the client local file system and you can even show the result inside a text area of the request form

Upvotes: 4

Related Questions