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.  set Accept Language

    Posted Mon November 22, 2010 10:00 AM

    Dear Helper

    I’d like to know if there is a way to change the accept header of the http request then set it back to its original value?

    eg.
    I am calling a flow service which I want to set the accept language to “en-US”, but the original language was “ar-OM”.
    Once I done from the service I set the Accept Language back to “ar-OM”

    Thanks & Regards
    Ameer


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: set Accept Language

    Posted Mon November 22, 2010 04:29 PM

    I’m not sure I understand the need. Is your service doing something specific to honor (or override) the accept lanuage? Perhaps if you describe what you’re trying to achieve with this approach someone can provide guidance. E.g. what is leading you to want to override the accept language header?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: set Accept Language

    Posted Tue November 23, 2010 09:05 AM

    Dear reamon

    Thanks for your quick reply

    I built a flow service called PIRS and this service is getting the Accept language from the pub.flow:getTransportInfo from the transportInfo document type (transportInfo/http/requestHdrs/Accept-Language)
    And based on the headers language I display my output.
    I built another service called CRS, this service is calling PIRS when I call the PIRS I have only to set the accept language to “en-US” because some times when I call the CRS remotely I can set the accept language to “ar-OM”
    I hope you get what I want


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: set Accept Language

    Posted Tue November 23, 2010 04:44 PM

    If you can, modify PIRS to accept a new input parameter. When it runs, check if that new input is set. If it is use it, else use the requestHdrs/Accept-Language.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 5.  RE: set Accept Language

    Posted Wed November 24, 2010 07:48 AM

    Thank you reamon for your reply

    But what if there is another service calling CRS which calls PIRS. Do I have to do the same?

    Thanks


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: set Accept Language

    Posted Wed November 24, 2010 02:41 PM

    You’re going to need to figure out the logic to be supported and make the appropriate coding changes. My suggestion was simply one way to have PIRS honor a specific language instead of using the accept language header.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: set Accept Language

    Posted Sat November 27, 2010 04:20 AM

    Ummm

    I know its all about logic, but its a matter of how to implement it.
    I thought of another way is by using a config file which contain the defalut language.
    if the default is en then set the langauge to en, if * then the language from the Accept-Language.

    Thanks reamon


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services