How To: Attach file to a web service to upload?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

How To: Attach file to a web service to upload?

Post by MrBlack »

Can anyone tell me how to upload a file through a web service? There's not thing special about the file, it could be a csv, an image, or whatever. The web service is just a glorified FTP that I should be able to upload any file to.

This is what I've started with:

Code: Select all

Folder Stage ---> Transformer ---> Web Service
And all the columns are declared as varchars. Here's the error that I'm getting:

Code: Select all

Transformer_1: com.ascentialsoftware.wsclient.ServiceInvocationException: Service invocation exception: <Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   <faultcode xmlns="">HTTP</faultcode>
   <faultstring xmlns="">(400)Bad Request</faultstring>
   <detail xmlns="">
    <string>return code:  400
</string>
   </detail>
  </Fault>
	at com.ascentialsoftware.wsclient.OperationCall.handleRemoteException(OperationCall.java:388)
	at com.ascentialsoftware.wsclient.OperationCall.invoke(OperationCall.java:293)
	at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1685)
	at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1591)
	at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1544)
	at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:105)
	at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
	at com.ascentialsoftware.jds.StageFactory.runTarget(StageFactory.java:348)
All the examples on the web that I'm seeing talk about reading rows of a sequential file or sending XML. I just want to send a file in it entirety.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'm not aware of any web service that can accept a file.

I guess that's why there exists an ftp protocol as well as http.

Perhaps I've had a protected existence.
Last edited by ray.wurlod on Thu Sep 18, 2014 4:27 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Hard to say. "SOAP with Attachments" was an up and coming protocol for awhile, but kinda died, and was more often used for download purposes.

They key is to speak with the author of the service....find out what they are "expecting" in the file contents. Ultimately, it will mean being able to get the "whole file" into a single column (do-able up to reasonable sizes), and get it into the format (base64 encoded, something else?) desired by that service.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply