Send xml file over https - urgent

Helo everybody.
I need to solve next problem:
1. Build/Use a client program that can operate with the HTTPS protocol. There are no restrictions on the type of client program used, providing it can use this protocol and deal with transactions synchronously.
2. Build/Use a program that can build a valid request XML document and attach it via a POST parameter to a HTTPS request.
POST /<URL_TO_SUBMISSION_SITE> HTTP/1.0
Example
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 9999999
<XML_DOCUMENT> &#1048773;Post Payload
or
POST /<URL_TO_SUBMISSION_SITE> HTTP/1.0
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 9999999
xml=<XML_DOCUMENT>
3. Ensure the program can retrieve the HTTPS response and parse the returned XML payload.
4. Ensure the program can correctly interpret the inquiry response information within the XML return.
Please help me in point 2. I don't know how to attach xml document to https request.
I'm trying something like this :
System.setProperty("java.protocol.handler.pkgs",
     "com.sun.net.ssl.internal.www.protocol");
     try {
url = new URL("https://" + path);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
URLConnection con = null;
try {
con = url.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setAllowUserInteraction(true);
con.setRequestProperty("Content-type", "application/x-www-form-urlencoded;charset=Cp1250");
con.setRequestProperty("Content-Length","9999999");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
but without success. Please help

Just saw a link, may be this will help you : http://resellers.tucows.com/documentation/xmlhttpspost.pdf

Similar Messages

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • How to send XML file to https server using POST

    Hi, I am having an requirement, that I have to connect to https server and I have to pass an input XML file as a response server will give me output XML file.
    The certificate validation part is over, I am using FileInputStream to read the XML file and attaching this to connection.getOutputStream(); but server is throwing me DTD does n't match.
    Can any body tell me how to send XML file, I have to use any DOM parser to send the XML file, suggest me and give me sample code.
    Thanks,

    Can anybody give me the solution

  • Sending XML documents over HTTP

    Hello,
    I have read a number of similar questions, but they were all posted last year.
    I don't know if a solution was found...
    Here is my problem:
    I have an ASP page using the object XMLHTTP that sends an XML document to another application server using HTTPS, and gets an immediate response.
    Is there an equivalent in the Java world to this feature? I need to transcript my ASP page to JSP.
    I have seen things like HttpServlet, JAXM, SOAPConnection.... But I don't know what that means...
    Thanks for you help.
    Caillou_QC

    URL url = new URL("http://java.sun.com/etc/etc");
         URLConnection connection = url.openConnection();
         connection.setDoOutput(true);
         PrintWriter out = new PrintWriter(
    connection.getOutputStream());
         out.println("string to send");
         out.close();
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        connection.getInputStream()));
         String inputLine;
         while ((inputLine = in.readLine()) != null)
         System.out.println(inputLine);
         in.close();

  • How to send XML file into XI using sender HTTP adapter

    I am using HTTP sender adapter to post the XML file into XI. I tried to form the URL by using the following String query , but I am unable to execute file.
    String urlString = "http://<servername:portno>/sap/xi/adapter_plain?namespace=<namespace>&interface=<interface name>&service=<service name>&party=&agency=&scheme=&QOS=BE&sap-user=xiappluser&sap-password=satyam&sap-client=100&sap-language=EN";
    How can I execute xml file by using HTTP sender adapter.
    Any one with better suggestions, about this idea?
    Thanks in advance for all.
    Ram Raj

    Hi
    Just use the following parameter to send xml file using HTTP adapter.
    "http://xiserver:8000/sap/xi/adapter_plain?namespace="senderNamespace"&interface=senderinterface&service=sender service";
    "&party=sender party"&agency=&scheme=&QOS=BE&sap-user=userid &sap-password=password&sap-client=100&sap-language=D";
    with the help of this you are able to point out which interface you would like to use.
    And in payload pass the xml.
    and thats it
    carry on
    Cheers
    Regards
    Piyush

  • Sending audio data over http problem

    Hi Guys,
    We are trying to create a little servlet in Tomcat, which is capable to send audio files over http to an embedded media player. The definition of the player looks like:
    <OBJECT ID="Mp" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" TYPE="application/x-oleobject" WIDTH="0" HEIGHT="0">
    <PARAM name="uiMode" value="none">
    <PARAM NAME="ShowControls" VALUE="0">
    <PARAM NAME="AutoStart" VALUE="1">
    <PARAM NAME="ShowPositionControls" VALUE="0">
    <PARAM NAME="ShowStatusBar" VALUE="0">
    <PARAM NAME="ShowDisplay" VALUE="0">
    </OBJECT>
    <script language="javascript">document.Mp.URL = "here comes the url of the servlet with item ID";</script>
    The servlet reads the audio file and writes its content to the response with the following http header settings:
    getResponse().setContentType("audio/x-wav");
    getResponse().setHeader("Content-Transfer-Encoding", "binary");
    getResponse().setHeader("Pragma", "Public");
    getResponse().setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
    getResponse().setHeader("Content-Disposition", "inline; filename=Media.wav");
    getResponse().setHeader("Content-Length", new Integer(MediaBytes.length).toString());
    getResponse().setHeader("Accept-Ranges", "bytes");
    So, everything works fine for wav files in Internet Explorer, but we are facing problems with Firefox, where it does not work. The embedded Media Player says that "Windows Media Player cannot play the file. One or more codecs required to play the file could not be found."
    But if we set the url to directly to the file on the server, everything works fine.
    We have analyzed the HTTP traffic in both situation, but we cannot understand how Internet Explorer/Firefox and Media Player works together:
    - how does Media Player know that the audio file is playable?
    - if the url points directly to the file, the HTTP headers does not contain any kind of information about the file type, only the extension is available; Media Player checks the file extenion in the url?
    - if the url points to the servlet, why Media Player in Firefox cannot determine the file type and throws error?
    Any help is greately appreciated!
    Thanks!
    Gabor

    If you haven't already, I would try breaking down the problem. First confirm you're getting serial data then confirm that netcat can send some data. Like this:
    xxd < /dev/tty.usbmodemfa121 | less
    nc -u 10.0.1.3 7000 <<< 'hello over there'

  • How can i send xml file with a http servlet request

    Hi
    Please tell me how can I send a xml file into http servlet request.
    I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
    Dave.

    When you say you have generated an XML file what do you mean?
    Is it a file stored on disk? Then pass the file path as a string to the servlet.
    Is it stored in memory as an object? The pass a reference to the object to the servlet.
    Or are you asking how to communicate between servlets?
    Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

  • Java library to send a payload over HTTP

    Hi All,
    I want to create a stand alone Java application which should be able to send a payload(XML doc) over HTTP to a server (an Integration Server). Are there any APIs which can create this HTTP request given a payload and send it to a specified URL over the network.
    This doesn't need to be a SOAP message, just an HTTP request with a payload. And this should be asynchronous too, ie no response is required from the server. Can this be specified in the QoS?
    Any thoughts?
    Thanks,
    Sandeep

    Hi, your idea seems to be interesting. I guess you have a web site, and you want to feed the Http request to a specific URI under the web site. This is nothing new, since WSDL supports HTTP Binding, you can use HTTP Binding to send your HTTP requests to the web site. As to the java library, I thinks JAXWS can do the job. you may turn to WSDL specification for further details about HTTP Binding. I didn't write something like this, but I think it is practical. And if you work it out, it would be very kind of you to tell me how you do it in details by sending me an email: [email protected]
    Best Regards:)
    @smile@

  • Send wav files over a network

    Hi folks,
    I need to send sound files over a network. The files I'm wanting to send are wav files. I kinda have the mechanism that sends a file, but I am not sure how to convert wav files into something that I can easily send. Do I need to convert them into bytes, serialize them...etc I don't know.
    Can anyone please point me in the right direction? An example would be very much appreciated.
    Thank you,
    E

    hi
    this is very simple
    convert voice to bytearray
    just create one server socket and client socket then connect a sockets and transmit
    download sample from
    http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html

  • Need help : how to send 3 parameters over http using Java POST

    I am trying to sending some data to agency company over http using Java POST
    They need 3 parameters and some contents like below
    1. Cmd : cmd=_RequestInsertNewLead
    2 Live : False
    3 XMLData : 3C%3Fxml+version%3D%........
    I already have XML done ,but I don't know how to send these guy over http
    is that like
    this.out = new DataOutputStream(os);
    out.writeBytes("Cmd");
    out.writeBytes(" cmd=_RequestInsertNewLead");
    out.writeBytes(" Live ");
    out.writeBytes("False");
    anyone could give help :)

    First of all, are you getting any exception?
    You didn't put much logging information in your code.
    You can also try this.Instead of doing sos.println(".....") try to build the output string using string buffer.
    Like:
    StringBuffer sb = new StringBuffer();
    sb.append("Some output");
    sb.append("More output");
    sos.print(sb.toString());
    sos.flush();Let me know if this works.

  • Send xml file and recieve xml in response from servlet

    hi
    i want to send a xml file to http address and in response recieives an xml file from which i want to fetch value in java
    can everybody help me out by giving me some help code
    thanks
    haryy

    I think you can do this with the DOM API .
    Go through this: http://www.javaworld.com/javaworld/jw-07-2000/jw-0728-jdom2.html

  • How to send xml file from local folder to azure storage

    Hi,
    My plan is i have xml files which are under folders in my local.
    I want to use mobile service to send xml files to azure storage,
    how shall i do that, either by c# or mobile service.
    If internet stop, I will use my mobile service to transfer all xml files to azure storage and run web job to do to update azure
    sql by xml file.
    please advice.
    Superman

    Hi,
    You could refer the following link for assistance with uploading image files to Azure Blob Storage using Mobile Services:
    http://azure.microsoft.com/en-us/documentation/articles/mobile-services-windows-phone-upload-data-blob-storage/
    And for image files you could refer the following link:
    http://stackoverflow.com/questions/25977406/upload-a-text-file-with-azure-mobile-services
    Regards,
    Malar.

  • Application or Front end to send  XML file to Webservice in 7.0

    Hi,
    Can anyone send me sample code how to send XML file to Webservice datasource,I have tested it through Navigator and it works fine.
    Kindly send me the sample code how to pass XML data.
    Thanks,
    Arvind M

    Hi Arvind,
    Please check out below links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e698aa90-0201-0010-7982-b498e02af76b
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d3219af2-0c01-0010-71ac-dbb4356cf4bf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1530ab90-0201-0010-6791-f31512d75e6a
    Hope its Helps u.
    Thanks
    SRS

  • Hi, I am using HP11 and iPlanet web server. When trying to upload files over HTTP using FORM ENCTYPE="multipart/form-data" that are bigger than a few Kilobytes i get a 408 error. (client timeout).

    Hi, I am using HP11 and iPlanet web server. When trying to upload files over HTTP using FORM ENCTYPE="multipart/form-data" that are bigger than a few Kilobytes i get a 408 error. (client timeout). It is as if the server has decided that the client has timed out during the file upload. The default setting is 30 seconds for AcceptTimeout in the magnus.conf file. This should be ample to get the file across, even increasing this to 2 minutes just produces the same error after 2 minutes. Any help appreciated. Apologies if this is not the correct forum for this, I couldn't see one for iPlanet and Web, many thanks, Kieran.

    Hi,
    You didnt mention which version of IWS. follow these steps.
    (1)Goto Web Server Administration Server, select the server you want to manage.
    (2)Select Preference >> Perfomance Tuning.
    (3)set HTTP Persistent Connection Timeout to your choice (eg 180 sec for three minutes)
    (4) Apply changes and restart the server.
    *Setting the timeout to a lower value, however, may    prevent the transfer of large files as timeout does not refer to the time that the connection has been idle. For example, if you are using a 2400 baud modem, and the request timeout is set to 180 seconds, then the maximum file size that can be transferred before   the connection is closed is 432000 bits (2400 multiplied by 180)
    Regards
    T.Raghulan
    [email protected]

  • Flat file over HTTP or SOAP

    Hey Guys,
    I need to post a Flat file over HTTP (or SOAP), is this possible without developing my own Adapter module?
    I just need to get a Flat file from a FTP server and post to another server via HTTP,since there is no message mapping involved, i developed the scenario without any Integration Repository objects, it is just a pass-through scenario.
    Now i am stuck on the receiver side since i am unable to post Flat file over HTTP.
    Secondly i have Login URL, Logout URL and upload URL from the receiver system, i don't see any place in receiver HTTP adapter to put all these 3 URL's, can i use SOAP adapter to put all these URL anywhere?
    Any help would be appreciated.
    Thanks
    Saif
    Edited by: Saif Manzar on Jan 19, 2010 2:51 AM

    Hey Guys,
    I need to post a Flat file over HTTP (or SOAP), is this possible without developing my own Adapter module?
    I just need to get a Flat file from a FTP server and post to another server via HTTP,since there is no message mapping involved, i developed the scenario without any Integration Repository objects, it is just a pass-through scenario.
    Now i am stuck on the receiver side since i am unable to post Flat file over HTTP.
    Secondly i have Login URL, Logout URL and upload URL from the receiver system, i don't see any place in receiver HTTP adapter to put all these 3 URL's, can i use SOAP adapter to put all these URL anywhere?
    Any help would be appreciated.
    Thanks
    Saif
    Edited by: Saif Manzar on Jan 19, 2010 2:51 AM

Maybe you are looking for