powershell - Equivalent of .NET WebClient.uploadFile in Java -


we trying upload file horribly non-standard 'soap' web service using java. web service not soap, in fact file uploader takes xml files formatted soap envelopes. yes, know it's yuck.

i've got following powershell code works in windows:

$webclient = new-object system.net.webclient $webclient.headers.add('content-type','text/xml') $webclient.headers.add('accept','text/xml') $response = $webclient.uploadfile('https://uat.xxxxxx.com.au/soap/upload.aspx', 'c:\temp\soap.xml') [system.text.encoding]::ascii.getstring($response) 

but how do same in java?

i've had @ apache httpclient , tried using multipartentitybuilder filebody part, endpoint keeps giving me soap fault stating "no http posted files found."


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -