2

I'm trying to create service, that writes input and output pipeline(xmldata) every time, that one of installed services is invoked. How my service should know, when other service is invoked? Is there any builtin tool to catch in&out pipeline and save to file or any other source?

gudek
  • 37
  • 1
  • 5

1 Answers1

3

You can use one of webMethods' build-in service in WmPublic package:

pub.flow:savePipelineToFile

Note that it's not recommended to use "savePipelineToFile" in production for obvious performance/resources reasons. And of course, to load the pipeline from the file use:

pub.flow:restorePipelineFromFile

The usual work flow to debugging in webMethods is:

  1. Add the "savePipelineToFile" step as the first instruction in your flow service.
  2. Execute flow service or execute from some client that will trigger the flow service.
  3. Disable the "savePipelineToFile" step in the flow service.
  4. Add the "restorePipelineFromFile" step at the very top in your flow service.
  5. Run webMethods Designer in Debug mode and step through. Once it goes over the "restorePipelineFromFile" step, you should see the entire content of the pipeline including the inputs as passed by the client. If you continue stepping through your flow service step by step then you should see the what the final output is.

The services "savePipelineToFile" and "restorePipelineFromFile" are very useful to debug your services. The "pipeline" file will be located at:

IntegrationServer\pipeline

If your requirements dictate that you need to produce xml flat files then use the following:

To serialize documents to xml (WmPublic package)

pub.xml:documentToXMLString

To write xml string to file (WmPublic package)

pub.file:stringToFile

Hope it helps!

EDIT:

By default the soap headers are hidden. Most of the time you don't need the soap headers but you can force webMethods to add the soap headers to the pipeline by doing the following.

1) Click on the web service descriptor.

enter image description here

2) In the properties panel, set "Pipeline Headers Enabled" to true.

enter image description here

The soap headers won't appear in your pipeline at design time. It will only exist at runtime. If you want to see the content of the soap header then you will need to use the "savePipelineToFile" / "restorePipelineFromFile" technique that I described previously.

To make the soap header appear at design time then you will have to do implicit mapping to the soap header fields as if they were there.

TchiYuan
  • 4,258
  • 5
  • 28
  • 35
  • But will savePipelineToFile save all xmldata from document including soap header? – gudek Aug 31 '15 at 14:38
  • You should have mentioned in your original question that you also need the soap headers (updated my answer). The savePipelineToFile will save everything that's in your pipeline at runtime in webMethod's own pipeline XML structure. If this is not what you want then you will have to serialize pipeline documents yourself using "documentToXmlString" as described in my answer. – TchiYuan Sep 10 '15 at 14:07