Is it possible to have multiple output templates for the same service. If yes then how to handle that in the templates.
When you create an output template within a package, it is stored in the package’s “templates” folder with a filename “[Package][Interface][Service].html”. When the output template is invoked, the webMethods B2B/IS Server uses the default path – which a developer can override.
Use pipeline variable substitution and you will be able to make run-time decisions regarding the proper output template for a transaction.
To perform pipeline variable substitution for the output template, do the following:
Create your output templates and save them to the package’s “templates” directory.
Select the service to which you want to apply the template(s).
Select the “Settings” tab and specify “$template” for the name of the Service Output Template. Be sure to select Type “HTML | XML | WML | HDML”
In your Flow, assign the variable “$template” the name of the intended output template to designate your output template. You don’t have to include the full path to the template.
– OR –
You could always just use the pub.report: built-in services (pub.report:runFileTemplate, pub.report:runStringTemplate, pub.report:runTemplate). These services are described in the Built-In Service Guide PDF which can be found in the “docs/” directory of your B2B Server/Integration Server install directory.
Actually, you don’t need to specify $template as the template name. You can use a regular template name. $template is a special variable and can be used to over-ride the template name declared for the service.
It worked well with a single Variable. I am just curious about how can we do this with Nested Output Templates! Any suggetions on this.
Within the template, specify %include TemplateName%, with “TemplateName” equal to the name of the desired nested template. The nested template should reside in the same “templates” directory as the parent template.
You will be able to use the same pipeline variables within the nested template.
Can I have an html email by invoking runStringTemplateOnFile service. For example, I use html for setting value of $template in the serviceIn. Now, passsing the outputstring in the body of pub.client:smtp, but its not showing in the the email in html format, just showing tags as it is.
My requirement is I have to invoke a service in JSP page and the output is defined in service as output template. I am not getting how to display the output after invoking the service.
html->jsp->webMethods flow service->output tenplate->JSP.