webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

webMethods Ezine Writing Custom Handlers for TN and the IS

  • 1.  webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue July 16, 2002 04:10 AM

    Questions or comments about this webMethods Ezine article?

    Click here to read the original text.


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 2.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed July 17, 2002 08:16 AM

    I found Igor’s advice on IS memory related issues and the com.wm.app.b2b.server.* to be extremely educational.

    Excellent article!


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 3.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Thu May 08, 2003 08:53 PM

    How do I write content handler for the posting where header data ( mime types) are more then one. Example

    Content-type: text/plain
    From: ABCCustomer
    To: SomePartner

    This is the payload for processing

    In this case if I write content handler just for text/plain how do I get values From and TO to be passed to the service being invoked. Any insight would be greatly appreciated. Example would be perfect.

    Khushhal


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Thu May 08, 2003 11:08 PM

    Which component you are using (Rosettanet or EDIINT or CIDX)etc…??


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Fri May 09, 2003 12:57 AM

    RMG

    I am using EDIINT component. But problem is that we are moving data through a proxy server ( which is webMethods server) . This works for rosettanet since content type is only aplication/x-rosettanet-agent and mime does not have other values and we have written our own content handler for that and while httping to the customer we hardcode content-type and it works but EDIINT has several values in header and I want to be able to pick all values so that I could pass those to the http and same is true while inbound.

    Khushhal
    Thanks


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 6.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue August 26, 2003 11:11 PM

    Hi! Dan,

    Taking into consideration the content handler article, i am trying to implement the same. When i am trying to compile the TXTContentHandler.java, it is not able to get the jar for the InvokeState class.

    Is it that this can only be done when the server is running. I am trying to do this from a client machine, after copying the server.jar from the server.

    server.jar contains the InvokeState class.

    Please suggest.


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue August 26, 2003 11:34 PM

    Hi!

    I managed to compile it. Is was wrong on my part. ClassPath setting was giving me problems.

    thanx anyway.

    sandip


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 8.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Fri September 26, 2003 01:17 PM

    Hi

    Build the content handler (for multipart/form-data), and the factory, installed them, registered the handler, and then… everything seems to work fine except for 2 things:

    1. The browser I use to submit a file gives me a “save/open” dialogue after submission(?)
    2. No data is to be located in the pipeline, where it should have been put by the content handler.

    I’m running wM IS 6.0.1 SP1 & using MSIE 6+ to submit the file. Can you tell me if there is any other resource for creating content handlers? I already went through Advantage and WmUsers.

    Thanks


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 9.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Fri October 24, 2003 02:18 PM

    Hi,
    I’m trying to replace webMethods default content type (“application/x-www-form-urlencoded”) with a new content handler I built.Everything seems to work fine with unregister and register of the handler but when a service is invoked only the method “putOutputValues” is called, the method “getInputValues” is never called.

    Any idea about this ?

    Thanks


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 10.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Mon October 27, 2003 02:26 PM

    Hi again,
    I´ve one more doubt :
    When a service is invoked via URL like (“http://host:port/invoke/service_path?input1=xxx&input2=yyy”) what is the content-type associated ? “text/html” or “application/x-www-form-urlencoded” ?

    Thanks


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed October 29, 2003 08:06 PM

    Hi,
    After some more investigations and tests I saw that if I invoked a service via HTTP with POST the method “getInputValues” of the ContentHandler is called but is not called if service is invoked with HTTP GET.

    Anybody know the reason for this ?

    Thanks


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 12.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue January 20, 2004 04:11 PM

    Hi,

    I know this post is pretty old, but therefore not unimportant. It took me a while to figure this all out and I still have a question:

    I wrote the example code of Igor in jcode and fragged everything with jcode. I got no compile errors, but my ContentHandler doesn’t get “written” while my ContentHandlerFactory and the create JavaService does!

    So I see the ContentHandlerFactory with the create JavaService in the Developer, but not the ContentHandler.

    When I shutdown the IS and restart it the package only gets partially reloaded, so I figure the ContentHandler needs to be written.

    Attached is my java code for the ContentHandler, does anyone see something wrong with it?

    Thx
    B.

    ContentHandler
    SignedXMLContentHandler.java (1.4 k)


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 13.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed January 21, 2004 09:23 AM

    Hi,

    I have good news, there is nothing wrong with the code I posted!

    We ran the service again, even without physically seeing the ContentHandler in wm Developer and with a partially loaded package and it works!

    Still I would like to now why I can’t see the content handler in wm Developer and why the package only gets partially loaded. Is it because the content handler class implements an interface?

    Anybody got a clue?

    Thx
    B.


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 14.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Thu January 22, 2004 02:22 AM

    Hi Bart I saw this post and wanted to clarify couple of things. First of all ContentHandler and ContentHandlerFactory are classes that are not intended to be used as WM java service directly. They are classes that will be used by IS to process incoming data with your custom registered type. The only services you do need to expose to Developer are really only registration and unregistration. Becasue these services need to be used as package startup and shutdown services respectively. This is to make it conviniet for use. As package loaded or reloaded your new content handler will be registered or unregistered along with the data type. You can see clear example use of this in WM samples package. My article did not discuss Unregitering content handler as its not important for overall functionality of the handler. But its really easy services to create 1 line Java code: ServerAPI.removeContentHandler(“Content/type”); That is it for unregistering.
    Another fact is if you look at methods that ContentHandler and ContentHandlerFactory provides you will find that Input/output for these are more like regular Java methods instead on WM service. Therefore if you did expose them as driect services in Developer you will not be able to pass data as IData or Values objects to them directly.
    Since you did frag them and try to expose all that code as services but some of it not shown in your developer. I can only speculate why it may have hapened without seeing your full package. If you want me to look at it you are welcome to send me your package and I may be able to explain why things did not show up as you expect them to. Even though they are not suposed be use this way.

    Now if you did wanted to use you content handler code as a service you can place it in a java service and my article discusses that option as Custom Content Handlers. Although its not really a Contenthandler more of a custom Java service that can porcess custom type of data incoming directly to the service. That data will bypass all standard IS handlers.

    Hope this clears things for you


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 15.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Thu January 22, 2004 08:57 AM

    Hi Igor,

    Thanx for your answer.

    I solved my problem by deleting the jcode tags in my two classes (ContentHandler and ContentHandlerFactory) as you say in your answer they are classes and not services so they don’t need to be exposed hence, you don’t see them (but they are there). Thanx for clearing this up.

    I wrote the register and unregister java services (with jcode tags) and these work perfectly! I can see them in my package.

    It seems that your example in the ezine was completely correct, I only didn’t know how to implement it as I never worked with the jcode before. But I have succeeded now.

    I have a new question for you: Is it possible to make a custom handler
    that takes in to account the content/type, but also the protocol?

    Thanx a million for your answer and example.
    B.


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 16.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Mon January 26, 2004 05:53 AM

    Bart not sure why you need handler to use protocol information? Normally handler is invoked after listener got the portocol and soket data passed to handler as strem to parse it. But if you must know there is object InvokeState passed into your Handler’s Java method. From that object you can get all current info about invokation of your service such as session, user, socket object, content encoding and more check WM API docs on InvokeState object. Among those you can find API getProtocolInfoif() it returns com.wm.app.b2b.server.ProtocolInfoIf its not documented class but you may get portocol info from it using String getProtocolPropertyList() and getProtocolProperty(String). Although I do not see why you need such low level details about invoke protocol inside your handler?
    Hope this is helpfull.


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 17.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue April 27, 2004 04:40 PM

    Hi,

    I have a situation that needs to be addressed with the help of a custom Content Handler. The situation we are having is that the client sends us data via an HTTP Post ( the protocol they use is RFC 1867). While receiving in our system we are missing the ‘NAME’ attribute and hence the data is split into 2 parts - the first part going to the ‘NAME’ field and the part going to the Value field. We need to be able to pass the entire data in the Value field.
    Has anybody come across this. Any help is highly appreciated.

    Thanks
    Surresh


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 18.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue September 14, 2004 04:22 PM

    Hi IGOR,

    How are you doing ?

    Actually i have a requirement to handle large inbound
    documents to IS/TN. I have read your article about ‘Custom Conent
    Handlers’. But actually i havent developed a single content handler
    so i dont know how to start. If you guide me where can i get step by
    step guide to create and use custom content handler, it would be a
    great help.

    My requirement is to get the inbound file, identify it . The inbound
    file is always PGP entrypted, so decrypt it first and check the file
    size. And if it is a large file, then handle it by some efficient way
    without any or little performance cost.

    Thanks in Advance.

    If other folks, can throw light on this post, u r always welcome.

    Regards,
    Nilesh


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 19.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue September 14, 2004 04:32 PM

    Nilesh,

    For handling large files routing to TN there is documentation available for TN LargeDoc handling.

    Please get this pdf from Advantage site and it explanis well how to configure and setup.

    HTH,
    RMG.


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 20.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Tue September 14, 2004 05:48 PM

    Thanks RMG for prompt response.

    But my requirement is litter different. We have requirement first to get inbound documents submitted to IS ,then decrypt them, check the size of the document and decide whether its large. After performing this operation, we want to submit those document to TN. So it goes like this:

    Partner FTPs document to IS Service –> IS Service decrypts it, checks the file size and decides whether doc is large –> Submit the document to TN.

    What do u suggest in this scenario ? Should we develop a custom content handler ? so all the documents inbound to IS will be submitted to a single service …( you can consider that service as a gateway to IS ) …

    Regards,
    Nilesh


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 21.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Fri March 18, 2005 03:23 PM

    Nilesh,

    did you ever get this custom content handler development guide ? I would be quite interested to get it

    thanks

    Philippe


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 22.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed November 16, 2005 02:26 AM

    Hi,
    We are sending documents to our partners through HTTP.
    When we tried to send the documents to our
    partner through TN, They said the Request
    Method was “GET”, but they require us “POST”.

    1. Can webMethods Trading Network configure the “POST” when sending ?
    2. If we are sending documents under “GET”, how we can change the
      Request Method to “POST” ?

    Thnaks in advance,
    Roshan.


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 23.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed November 16, 2005 04:42 AM

    The immediate delivery methods built-in to TN for HTTP/S use the post method, not get. How specifically are you using TN to deliver the data?


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 24.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed November 16, 2005 06:42 AM

    Hi Rob,

    Thanx for the respone.

    We are using HTTP. I am unable to send xml data to my parteners using TN console. I have done all the configuration for parteners info in TN. We are able to get request but unable to send.
    We are using webmethod version: 6.1 on Linux.

    Is there any patches we need to update?

    Thanks in advance.

    Regards,
    Roshan.


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 25.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Wed November 16, 2005 02:33 PM

    How exactly do you have TN configured to send the documents? How is the processing rule defined? I understand that HTTP is involved but we need to know precisely how you have things set up. The TN delivery methods (that is, when you select “Immediate Delivery” with one of the HTTP options, or “Receiver’s Preferred Protocol” and the protocol is HTTP) use HTTP POST. I suspect that you’re not using TN delivery and instead are calling a service which is calling pub.client:http with the method parameter set to “get”.

    Strictly speaking, “TN Console” doesn’t send anything. TN Console is the UI to configure TN and view activity. TN itself does the work to send and uses pub.client:http underneath the covers with the method parameter set to “post”.


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 26.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Mon November 21, 2005 04:58 AM

    Hi Rob,

    Thanx for ur reply. We resolved the above problem. We have one more problem.
    Can you please advice us as it is very urgent.

    We have 2 WM servers running. Development server (DEV) and Productuon server (Prd). When we are importing the package from DEV server to Prd server, after completing all the imports to Prd server, the Prd server is automatically shutting down. When we tried to restart, Prd server is not starting properly. When we look Prd server logs, it is stopping at " TRANET: Starting webMethods Trading Networks, TRANET: Loading system configuration".

    We couldn’t able to proceed further. Please let us know mistake where we are doing.

    Thanks in advance,
    Roshan.


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 27.  RE: webMethods Ezine Writing Custom Handlers for TN and the IS

    Posted Mon November 21, 2005 04:14 PM

    How did you resolve the first problem? It would be helpful for those who come across this same issue in the future and search the forums.

    Which package(s) did you migrate from dev to prd? How exactly did you migrate the settings? Have you tried an IS restart with the debug level set higher than 4?


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB