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
  • 1.  http post to webMethods [IS]

    Posted Wed June 14, 2006 09:18 PM

    We are trying to create a java web application that posts to a webMethods flow. We were successfully posting to a flow when we append the name/value pairs as part of the url. The problem we found is when the data is too long, we are getting a 414 error.

    We are trying to do the post with the data as part of body but are having difficulty with webMethods seeing the inbound name/value pairs. (We have content-type set to “text/xml”.) Can anyone show me some sample java code that successfully posts to a webMethods flow where the data being posted is contained in the body?


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 2.  RE: http post to webMethods [IS]

    Posted Wed June 14, 2006 09:30 PM

    There are couple of examples on the forums here that demonstrate how to post to Integration Server using Java. Use the search facilities to find them. If you use text/xml as the content-type, then you don’t want the body to be name/value pairs. The body will need to be XML. If you really want to post name/value pairs, you’ll need to use a different content-type although I can’t remember exactly which one off the top of my head. Perhaps someone else can provide that answer?


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: http post to webMethods [IS]

    Posted Wed June 14, 2006 09:41 PM

    Thanks. I did look around for some examples none jumped out at me. Interesting about “text/xml”, I thought that was a requirement on a post into wM.


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: http post to webMethods [IS]

    Posted Wed June 14, 2006 10:07 PM

    Integration Server (not wM or webMethods–webMethods is a company, not product) can accept data in a number of different ways. Name/value pairs is simply one of them. It excels in working with XML–that’s its main strength.

    Search using the terms http post java and you’ll get some hits. Here’s one.


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 5.  RE: http post to webMethods [IS]

    Posted Thu June 15, 2006 01:34 PM

    Thanks. We were able to get it working. Content-Type was the key. We needed to set it to “application/x-www-form-urlencoded”.


    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 6.  RE: http post to webMethods [IS]

    Posted Fri June 16, 2006 04:48 PM

    Snolan,

    Be careful with just setting the content-type to to something that “Works!” without knowing the implications. For example, if you set the content-type to application/x-www-form-urlencoded, one of the things that you’re telling the receiver is that your data is “URL-encoded.” Therefore, if you do not URL encode it and you happen to have a special character within the data (example, &), you will most likely run into an error.

    Like Rob was saying, if all you want to do is to post an XML message to a Flow service from a Java application, then set your content-type to “text/xml” and send the XML in the body of the HTTP POST request. The IS content handler will then pass the XML as an XML node to your Flow service.

    • Percio

    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport