PlaybackServicepublic class PlaybackService extends org.apache.axis.handlers.BasicHandler A trivial service which simply echoes back a desired SOAP message. This
is useful for testing, as we can simulate responses from particular packages,
bugs, etc. This should be deployed with provider="Handler". |
Methods Summary |
---|
protected java.lang.String | getFilename(org.apache.axis.MessageContext context)Get the filename which contains the response message. Looks in
the MessageContext/service/engine for a "responseFile" property, and
if found simply returns that value. Otherwise defaults to
"response.xml" in the current directory of the server.
This mechanism can be configured in two ways. First, anyone can set
the "responseFile" property based on the message contents, etc. As long
as this happens earlier in the handler chain, the value will be picked
up and used here. Second, this class can be subclassed and this
method overriden to do the right thing.
String filename = context.getStrProp("responseFile");
if (filename == null) {
filename = "response.xml";
}
return filename;
| public void | invoke(org.apache.axis.MessageContext context)
try {
FileInputStream stream = new FileInputStream(getFilename(context));
context.setResponseMessage(new Message(stream));
} catch (FileNotFoundException e) {
throw AxisFault.makeFault(e);
}
|
|