IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.


#TechXchangePresenter
 View Only
Expand all | Collapse all

HTTPS PUT Methods

  • 1.  HTTPS PUT Methods

    Posted Thu November 17, 2011 07:38 PM

    I have the new 8.2 version installed and I am pretty sure it will accept the PUT HTTP method.

    How do I set this up? The customer wants to post S/MIME via HTTPS using PUT. I am doing a bunch of other HTTPS via GET and POST but nothing with put.

    The customer said when he hits the URL it should pop up a folder like an FTP site but I am not sure how to configure this.


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


  • 2.  RE: HTTPS PUT Methods



  • 3.  RE: HTTPS PUT Methods

    Posted Fri November 18, 2011 08:58 PM

    A client app or browser might pop up a dialog to support doing something along these lines but the mere use of HTTP PUT will not do that.


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


  • 4.  RE: HTTPS PUT Methods

    Posted Wed December 07, 2011 07:53 PM

    Ok. I used this doc and I can hit my PUT service on my internal server

    [url]http://server:5555/rest/PxGlobalBanking.RI.Banamex.topic[/url]

    This will bring me into the _put service. I want to expose this to my external customer. Can I do this through the reverse invoke? It doesn’t seem I can. If I add PxGlobalBanking.RI.Banamex.topic:_put to my allow list for services and go to [url]http://RIserver:5555/rest/PxGlobalBanking.RI.Banamex.topic[/url] I get a 404. We are doing other services but using the /invoke/. Do I need to do something special because partners aren’t allowed into our internal servers. They all come in through the RI server?


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


  • 5.  RE: HTTPS PUT Methods

    Posted Thu December 08, 2011 12:23 AM

    Check with wM support on if the wM Gateway supports the rest directive in the URL.


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


  • 6.  RE: HTTPS PUT Methods

    Posted Wed December 21, 2011 07:35 PM

    They were able to successfully post the data to me. I ran a getTransportInfo and then a save pipeline. I have all of the information in the transport document and I also have all of the text as the variable name not as the value. What should I make the input to this service?

    I want to store this text obviously in a value. I know for text/xml you just make the input a node, then do a xmlNodeToDocument and you have the information. It looks like the content type for this is coming over as application/x-www-form-urlencoded.


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


  • 7.  RE: HTTPS PUT Methods

    Posted Wed December 21, 2011 07:40 PM

    I created a service to post using the same content type just passing in the string “csdcscsdcsdc”. You see how it creates the null name as the input string value. I need to map that into something.

    \\Dansrv1\Webmethods\Development\Pipelines\BanamexMIMEIn1_20111221020755812.xml \\Dansrv1\Webmethods\Development\ DEV yyyyMMddhhmmssSS 20111221020755812 [B] [/b] http HTTP /invoke/PxGlobalBanking.RI:receiveBanamexMIME PUT Mozilla/4.0 [en] (WinNT; I) image/gif, */* usadanaswmd1:5555 Basic UklCYW5hbWV4Onc0NWZERGcy application/x-www-form-urlencoded ssnid=e71cc8202c0411e18b4fa1c9e95d0345 12
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport
    #webMethods


  • 8.  RE: HTTPS PUT Methods

    Posted Wed December 21, 2011 08:06 PM

    I am trying to get them to use text/plain and then i will read ffdata to String. I need to see if they can change it first.

    If not I need to know how to handle application/x-www-form-urlencoded


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


  • 9.  RE: HTTPS PUT Methods

    Posted Wed December 21, 2011 09:32 PM

    He said he can’t change his content type. I see this content type registered under webMethods MIME type. What should my input to the service be?


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


  • 10.  RE: HTTPS PUT Methods

    Posted Fri December 23, 2011 07:54 AM

    bjr149,
    IS 8.2 now handles GET, POST, PUT & DELETE http methods. Reverse invoke nodes only serve to proxy requests to your internal IS nodes, the benefit is typically through a firewall. Unless you have specific code or security in your RI nodes, which isn’t typical, the /rest directive will typically be proxied too.

    Your rest service 404, from the looks of your post:
    http://RIserver:5555/rest/PxGlobalBa....Banamex.topic
    is only a matter of changing (.'s & :'s) to /'s.

    This is because a rest service translates flow namespace into uri differently to how the /invoke directive does.
    Example:

    -PackageName:
    …|-- wmUsers
    …|-- forums
    …|-- webServices
    …|-- _get
    …|-- _put
    …|-- submitPost

    domainName:5555/invoke/wmUsers.forums.webServices:submitPost
    or
    PUT to domainName:5555/rest/wmUsers/forums/webServices

    A rest service will handle your situation nicely, whilst giving you “out-of-the-box” control of inputs ($resourceID & $path) and also any queryString values.

    Continuing with the above example:
    PUT to domainName:5555/rest/wmUsers/forums/webServices…
    /<thread_id>//<post_title>/
    |$resourceID| $path --------------------->

    With a rest service, you can do whatever you need with the services $resourceID and/or $path input from here.

    Alternatively any queryString values can be captured in the rest service’s input by creating input’s with the associative queryString keys.
    PUT to domainName:5555/rest/wmUsers/forums/webServices/
    <thread_id>?userName=abc&postTitle=REST&msg=Hello_World
    $resourceID|userName…|postTitle…|msg

    Though usage of queryStrings needs to be evaluated against how specific, by definition, you’re going to be with Resource Oriented Architecture.

    I’m initially running blanks about extracting postData into flowServices, but happy to post again if this is how your client is sending data, which I’m guessing is the case being s/mime. Until then, hope this is helpful.


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


  • 11.  RE: HTTPS PUT Methods

    Posted Tue December 27, 2011 02:28 PM

    I will move this service over as a rest service if I get some time. For now I would rather just keep it as a straight invoke service hit through our RI server.

    As stated before they are using PUT, but when the data comes over it is in variable name not a value so I can’t extract it. I need to catch the data from the post and do something with it. I have services that are catching text/xml and text/plain and they work great, I just cant figure out how to catch this data which is application/x-www-form-urlencoded. The first step now it just to save the pipeline to see what is coming. You can see the data is there but it is not a value it is a variable name. I can’t seem to catch it correctly…

    
    <?xml version="1.0" encoding="UTF-8"?>
    
    <IDataXMLCoder version="1.0">
    <record javaclass="com.wm.util.Values">
    <value name="fileName">\\Dansrv1\Webmethods\Development\Pipelines\BanamexMIMEIn1_20111226090749183.xml</value>
    <value name="pattern">yyyyMMddhhmmssSS</value>
    <value name="currentDate">20111226090749183</value>
    <value name="environmentPATH">\\Dansrv1\Webmethods\Development\</value>
    <value name="environment">DEV</value>
    <null name="CHECK NUMBER 3434234234"/>
    <record name="transport" javaclass="com.wm.util.Values">
    <value name="protocol">http</value>
    <value name="subprotocol">HTTP</value>
    <record name="http" javaclass="com.wm.util.Values">
    <value name="requestUrl">/invoke/PxGlobalBanking.RI/receiveBanamexMIME/SAPMT940TEST201112260907</value>
    <value name="method">PUT</value>
    <record name="requestHdrs" javaclass="com.wm.util.Values">
    <value name="Proxy-Connection">keep-alive</value>
    <value name="Date">Mon, 26 Dec 2011 14:07:49 GMT</value>
    <value name="Content-Length">175533</value>
    <value name="Content-Type">application/x-www-form-urlencoded</value>
    <value name="Accept">*/*</value>
    <value name="Authorization">Basic UklCYW5hbWV4Onc0NWZERGcy</value>
    <value name="Host">XXXXXXXXXX</value>
    <value name="User-Agent">Jigsaw/2.0.3</value>
    </record>
    </record>
    </record>
    </record>
    </IDataXMLCoder>

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


  • 12.  RE: HTTPS PUT Methods

    Posted Wed December 28, 2011 04:55 PM

    What is the invoking service input type you have set?

    You can debug more with first step flow:getTransportInfo before and savepipeline after it and check deeper:

    HTH,
    RMG


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


  • 13.  RE: HTTPS PUT Methods

    Posted Thu December 29, 2011 04:59 PM

    I tried to use an object, assuming it was an input stream, then convert the stream to a string but that doesn’t work. I also tried the object assuming it was bytes and it didn’t work either.


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


  • 14.  RE: HTTPS PUT Methods

    Posted Thu December 29, 2011 05:42 PM

    Probably you can try reserved var with contentStream (object) and try convert it stream to bytes/string etc…It’s worth a try:

    Else you should play with MIME handlers/custom java handlers if nothing works out:

    HTH,
    RMG


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


  • 15.  RE: HTTPS PUT Methods

    Posted Tue January 03, 2012 02:15 PM
    <IDataXMLCoder version="1.0">  <record javaclass="com.wm.util.Values">
    <value name="fileName">\\Dansrv1\Webmethods\Development\Pipelines\BanamexMIMEIn1_20120103083918866.xml</value>
    <value name="pattern">yyyyMMddhhmmssSS</value>
    <value name="environmentPATH">\\Dansrv1\Webmethods\Development\</value>
    <value name="environment">DEV</value>
    <null name="sdfdfdfsdafsdfsdaf"/>

    Same thing. I pass in using the content type and I have input as contentStream. First step is bytesToString. This is the pipeline I get.


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


  • 16.  RE: HTTPS PUT Methods

    Posted Tue January 03, 2012 03:59 PM
    <IDataXMLCoder version="1.0">  <record javaclass="com.wm.util.Values">
    <value name="fileName">\\Dansrv1\Webmethods\Development\Pipelines\BanamexMIMEIn1_20120103101355528.xml</value>
    <value name="pattern">yyyyMMddhhmmssSS</value>
    <value name="environmentPATH">\\Dansrv1\Webmethods\Development\</value>
    <value name="environment">DEV</value>
    <byte name="inputStream">
    c2RmZGZkZnNkYWZzZGZzZGFm    </byte>
    <value name="string">sdfdfdfsdafsdfsdaf</value>
    <value name="currentDate">20120103101355528</value>
    
    

    I didn’t want to have to register a content handler but I don’t see any other way around it. I registered a content handler for type “application/x-www-form-urlencoded”. I catch the input stream and map it to object inputStream. Then run a bytesToString and I get the string value in the pipeline above. This works I guess I just wasn’t sure how I wanted to handle this specific content type. This does work though so I will do some testing and run it through. I am getting the customer to send me a whole file to make sure the string is held up correctly to be mapped to file.


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


  • 17.  RE: HTTPS PUT Methods

    Posted Tue January 03, 2012 08:08 PM

    Your work around should work…But make sure you convert from streamToBytes and bytesToString and check if your file is as appropriate that source sending:

    HTH,
    RMG


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