cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP UPLOAD using HTTP receiver adapter

hemant_chahal
Contributor
0 Kudos

Hello Experts,

I am facing a problem where i have to upload a file to webserver using POST , I am using a file adapter to pick the file and http or soap adapter to post the file to webserver. Here the request structure expected by the webserver is a file.

below is the form based web request:

<form enctype="multipart/form-data" name="Upload_File" method="POST" action="https://-------/servlet/zxcdsf">

Choose File:&nbsp;&nbsp;<input type=file name="Upload_File" value="fileUpload" ><br><br>

<input type=submit value="upload">

</form>

Please guide me how to achieve this using SOAP or HTTP.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Hemant

You can do a HTTP post method from HTTP adapter using either a URL which can receive the post or a HTTP destination .

But to do a UPLOAD_FILE kind of methods you need a Java code.

If the server is able to interpret the URL then you can even parse the complete file into a URL and send it to receiver using a custom Module.

Else to define in exact format you need to go to Java Proxies. and Java proxy receiver will be able to send such message to server you require.

Thanks

Gaurav

hemant_chahal
Contributor
0 Kudos

Hi Gaurav,

Thanks for your reply,

Here the web server is expecting "html web request" from XI box.

And in XI we have the file in the local directory.

First i want to check using prolog and epilog if its possible in the HTTP outbound adapter generating the required html web request.

Otherwise I have to look for any alternative like JAVA proxy or developing module as u said.

Have you already developed any java proxy or module for this kind of problem. If yes please share with me.

Thanks

Hemant

Former Member
0 Kudos

Hi Hemant

Yes you can try with proglog and epilog

Develop the Java mapping to convert the paylaod to HTML tags and replace the tags with corresponding (&, +, =, and %) . This may be able to post the data.

Try to create generic mapping to convert the payload to HTML this will help if you have more than one interface for the same requirement.

Java proxy code is having an advantage that you can always have that as a receiver for any of these request instead of dealing with individual Java mappings.

Try with epilog and prolog and as you said next step can be Java proxy.

Thanks

Gaurav

hemant_chahal
Contributor
0 Kudos

Hello Gaurav,

I am not using epilog and prolog also,

as i am simply sending the file as such.

Now the problem i am facing is url with https://

Can you suggest something that is how to connect to webserver with URL https.

Former Member
0 Kudos

Hi

When you are sending the file without that. Use HTTP destnation. and creating the RFC destination of type G you can configure for HTTPS.

Thanks

Gaurav

hemant_chahal
Contributor
0 Kudos

that i have done alrady. I want normal HTTP adapter settings. As i could not find any https thing in the HTTP adapter configurations. Using RFC destination would be the last option.

Former Member
0 Kudos

Hi Hemant,

How did you achieve this ?

We have also same kind of requirement to upload the file into Webserver using either SOAP or HTTP_AAE adapter.

Please share your thoughts on this.

Thanks

Sridhar Goli

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi !

Check this blog:

Another solution could be to develop a Java Proxy as a receiver, there you could use your own java code to manipulate the message coming from PI to make the multipart upload and then return the response back to PI.

Regards,

Matias.

hemant_chahal
Contributor
0 Kudos

Hi Matias

Thanks for the reply,

In my case the Adapter is HTTP Outbound that is the PI is Sending data to the External Web server. So the blog doesnt help me on that,

Any ways your suggesetion is very helpful.

And if you have developed any Java proxy for changing flat file to html web request. Please share your ideas.