Transferring a gifjpeg files from one location to other using webMethods

Hi,
I have a business case where i need to get a gif/jpeg file (a map) from one location and send that file to another location. The middleware involved is off course webMethods v6.1. what could he the best methods to do this…??
Thanks,
KK

Hi KK,

Could you please elaborate a bit the “location” in your business case? It could be something like receiving your map file into a webMethods flow service as FTP, persisting it into DB and may be sending it over an MQ channel. But if we are clear about your back-ends (location, as you said), then may be people here can suggest better solutions.

Rgds
San
“Be Good, Do Good”.

Hi San,
One approach we can think of is that the sender will put the jpg file in a specified location and based on file poling we can process the file. But i am not sure if jpg file can be handled by file poling. Once we are able to receive the file we are required to ftp the file to some fixed location…Any idea/experience handling with this kind of scenario…
Thanks,
KK

How about this:

  1. Read the file from the file system using pub.io:getFile as an InputStream
  2. Use pub.string:base64Encode to convert the InputStream to a string
  3. Create a simple document with a string field to hold your base64 encoded image
  4. Map the base64 string to your document
  5. Convert your document to an XML string using pub.xml:documentToXMLNode and pub.xml:XMLNodeToXMLString
  6. Use pub.client:http to post the xmldata to your target server
  7. The target server extracts the base64 encoded string, decodes it and does something useful with it.

This approach assumes that the target server is capabile of receive an http post and that the image files are reasonably small.

HTH,

Mark

In re-reading your previous post you mention that you may receive the image file via FTP and then have to FTP it somewhere else. Why is webMethods IS in the middle of this process? Can’t the source simply FTP the image to the target?