Implementing Custom Handler

I am trying to implement Custom Handler for handling non-XML contents
I had some basic doubts:

  1. Whats the benifits of using the Custom Handler. I have gone through the ezine articles
    But the way it described there …I am not very sure. Those handlers just converting the
    incoming bytes stream to String …I am not getting the intention of doing that. Can`t we
    handle the same through the WM services.???

  2. Whatever Custom Handler described in ezine articles …Do we need to create Java Services
    for them in the Developer…I can see the exact Java Classes there but when i tried to create in
    Developer how to mention package strucure …I think I am missing out here something. Can some body
    explain me step wise how to implement Content Handler

  3. Can`t the Flat Files Schema used to handle to incoming non-XML Content to TN ( 6.0)…
    Where does Custom Handler fits here

Please enlighten me with your comments

Thanks
Deepak

Hi Deepak,

1] To answer your first question, may be it will need more time to explain. Long story short, webMethods server sends 200 ok when it receives a document on any handler. If you want to send a specific acknowledge format to sender, in that case you customize the handler to send the acknowledgement with 200 ok.

2] You have to write a java service to handle the non xml docs, in any package structure(your company standards). set that java service as a startup service.

import com.wm.lang.ns.;
import com.wm.net.
;
import com.wm.app.b2b.server.;
import com.wm.util.
;
import java.io.*;

public class XYZContentHandler extends ContentHandlerFactory
{
public XYZContentHandler(String cType)
{
}
public ContentHandler create()
{
}
public String getContentType()
{
}

public Values getInputValues(InputStream istream, InvokeState istate) throws IOException
{
}

public void putOutputValues(OutputStream ostream, Values v, InvokeState istate)
{
}
}

if you still have question on this format, you can refere to the WmSamples which carrys with example of custom handler.

3] Using the flat file schema in the tn you should be able to handle the flatfile documents. I dont no why u r getting the problems in this procedure.

Let me know if you have any more…

-Srujan