Page 1 of 1

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

Posted: Thu Sep 18, 2014 12:05 pm
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.

Posted: Thu Sep 18, 2014 4:25 pm
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.

Posted: Fri Sep 19, 2014 2:05 pm
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