How to send XML via HTTPS in Servlet

I am new to Java. I need to make a servlet which can send a message via HTTPS with a content type of XML to another web server when it is called. each msg is proceeded with a header in the following format:
requestID=rid&userID=uid&password=mypd
and a detail information in XML:
<S_Request>
<requestControllID>1-rf200</requestControlID>
<zipCode>99012</zipCode>
<orderQuantity>35</orderQuantity>
</S_Request>
I have basic idea of how to send an http post with parameter string by using the Redirect function but don't know how to deal with the XML detail. Any one has idea about this? Any help will be greatly appreciated!

This is what I did for one of my projects;
String myXML = "all the xml tags and fields";
URL url = new URL("https://www.somesite.com");
HttpsURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
OutputStream outXML = connection.getOutputStream();
outXML.write(myXML.getBytes());
I think you can add the requestID and all to the begining of the string myXML
Good luck
Rajesh

Similar Messages

  • 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

  • How to Send Appointment via mail adapter

    Hi Guys,
         I need to send the appointment and vTodo via mail adapter, any way i need to develop a mail adapter module. Till now i have finished this part,and i can send normal mail even normal mail with attachment. But i don't know how to send appointment via mail adapter.
    This is payload content of appointment which got from Exchange server to gmail:
    _=_NextPart_001_01C71EC0.97A011C6
    Content-Type: text/plain;
        charset="GB2312"
    Content-Transfer-Encoding: quoted-printable
    When: 2007=C4=EA6=D4=C227=C8=D5=D0=C7=C6=DA=C8=FD 3:30 =CF=C2=CE=E7-4:00 = =CF=C2=CE=E7 (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi.
    Where: China
    ~*~*~**
    This is calendar content
    _=_NextPart_001_01C71EC0.97A011C6
    Content-class: urn:content-classes:calendarmessage
    Content-Type: text/calendar;
        method=REQUEST;
        name="meeting.ics"
    Content-Transfer-Encoding: 8bit
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+01.00) Sarajevo/Warsaw/Zagreb
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20061213T141132Z
    DTSTART;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T140000
    SUMMARY:This is calendar test
    UID:040000008200E00074C5B7101A82E0080000000030D51864C81EC701000000000000000
    010000000CA9F127EA8947844BC4DD47F269BDEA9
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky":MAILTO:rocky@***.com
    ORGANIZER;CN="Xu":MAILTO:rocky@**.com;roc*@gmail.com
    LOCATION:Shanghai
    DTEND;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T160000
    DESCRIPTION:This is calendar content\N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20061213T141132Z
    LAST-MODIFIED:20061213T141133Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    X-MICROSOFT-CDO-OWNERAPPTID:367904726
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20061213T141132Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20061213T141132Z
    END:VEVENT
    END:VCALENDAR
    _=_NextPart_001_01C71EC0.97A011C6--
    My question is
      1. How to generate this kind of payload in mail adapter module?
      2. It is possible to send appointment via mail adapter?
    Following i can get from other system, even using mail package check or not using mail package check.
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+08.00) Kuala Lumpur/Singapore
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20070608T025852Z
    DTSTART;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T110000
    SUMMARY:This is meeting request with attachment
    UID:040000008200E00074C5B7101A82E0080000000000A9BD0BA7A9C701000000000000000
    010000000C5E16D144D1612498C0EF7E2115EFEC4
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky
    ":MAILTO:roc*@**
    ORGANIZER;CN="Xu,y":MAILTO:roc*@**
    LOCATION:India labs
    DTEND;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T113000
    DESCRIPTION:This is content!  &#60;&#60;shanghai.txt&#62;&#62; \N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20070608T025925Z
    LAST-MODIFIED:20070618T033505Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    ATTACH:CID:008501c7b159$a9d41d3b$_CDOEX
    X-MICROSOFT-CDO-OWNERAPPTID:1468557271
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20070608T025852Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20070608T025852Z
    END:VEVENT
    END:VCALENDAR
    Thanks & regards
    Rocky

    Hi
    have a look at this
    You can use Java/ABAP proxies to do this job for you..
    Java Proxy >> will read the mail(with the attachments) with the help of Java APIs and send the message into XI ABAP Proxy >> for this you will have to first convert the attachment into a message and then you can proceed in the regular fashion.
    Not all adapters can process attachments, I'm not sure why you are having trouble with using module processor in the mail adapter. Just check if the service pack that you are using supports this feature.
    If you are on WAS 6.10 and above you can achieve this and there is an excellent weblog by Thomas Jung on this topic at
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    reading Pdf Through mail easly done with Java Proxy, which will read the mail(with the attachments) with Java APIs and send the message into XI and then map with the Target ABAP proxy structure .
    Thanks

  • Server to Rich Client sending XML over Http

    I need to send XML data from a Servlet to a rich client over http.
    Currently I am using HttpURLConnection and SaxTransformerFactory to do this.
    Is it better to use SOAP or XML-RPC in this scenario?
    Are there any good online tutorials comparing SOAP, XML-RPC and AXP-Java Net API?
    What are the factors that I need to consider for choosing between these alternatives?
    Please advice. Thanks in advance.

    XML-RPC and SOAP use XML as a way to communicate, but they are used to invoke certain function calls in an application independend manner, not to be used to send XML data. So I'd say it depends on:
    a) what do you do with the XML data?
    b) will you be expanding the application?
    c) how difficult is it to rework the current implementation?

  • Send xml with HTTP Sender

    How can I send a xml via HTTP Sender from a Visual Basic 6.0 application? Do I have to use an ActiveX Control to send the HTTP Request with the XML as payload?
    Thanks in advance,
    Ruben.

    Ruben,
    You need to create your interface objects in the integration repository and  setup your interfase using SOAP adapter in the integration directory.
    After that you'll need to publish a webservice using the integration builder objects that you have already created.
    Mount the WSDL into a web server and try to implement a webservice call into your VB  application to invoke the WS.
    read this blog:
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1442 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    i hope it helps you...
    BR,
    Gerardo.
    Plz reward points

  • How to send XML using UTL_HTTP

    I am trying to workout how to send XML data to a webserver using UTL_HTTP but am not getting any reply
    I need to submit the following XML document to a server "http://api.fastsms.co.uk/api/xmlapi.php"  Their instructions are "The XML Document should be posted unencoded, with a UTF-8 character set as parameter 'xml'"
    If I submit the following XML on their test form
    <?xml version="1.0"?>
    <apirequest version="1">
    <user>
      <username>**USER**</username>
      <password>**PASSWORD**</password>
    </user>
    <application>
      <name>Example Application</name>
      <version>1.0</version>
    </application>
    <inboundcheck lastid="10711399"/>
    </apirequest>
    I get an XML response back with the messages in my inbox. 
    This is the code I am trying to use to accomplish the same from PL/SQL : I know a response is coming back as there is header information - just no content.  What am I doing wrong ?
      l_xml VARCHAR2(5000);
      req utl_http.req;
      resp utl_http.resp;
      header_name VARCHAR2(256); -- Response header name
      header_value VARCHAR2(1024); -- Response header value
      response_text VARCHAR2(4000); -- Response body
      l_url VARCHAR2(100);
    BEGIN
      l_xml := 'xml=<?xml version="1.0"?>';
      l_xml := '<apirequest version="1">';
      l_xml := '<user>';
      l_xml := '<username>**USER**</username>';
      l_xml := '<password>**PASSWORD**</password>';
      l_xml := '</user>';
      l_xml := '<application>';
      l_xml := '<name>Example Application</name>';
      l_xml := '<version>1.0</version>';
      l_xml := '</application>';
      l_xml := '<inboundcheck lastid="10711399"/>';
      l_xml := '</apirequest>';
      -- Open HTTP connection
      l_url := 'http://api.fastsms.co.uk/api/xmlapi.php';
      req := utl_http.begin_request(l_url,'POST',utl_http.HTTP_VERSION_1_1);
      -- Set headers for type and length
      utl_http.set_header(req,'Content-Type','application/x-www-form-urlencoded');
      utl_http.set_header(req,'Content-Length',to_char(length(l_xml)));
      -- Write parameter
      utl_http.write_text(req,l_xml);
      -- Read response file
      resp := utl_http.get_response(req);
      -- Print out the response headers
      FOR i IN 1 .. utl_http.get_header_count(resp) LOOP
        utl_http.get_header(resp,i,header_name,header_value);
        logging_pkg.info(header_name || ': ' || header_value);
      END LOOP;
      -- Print out the response body
      BEGIN
        LOOP
          utl_http.read_text(resp,response_text);
          logging_pkg.info(response_text);
        END LOOP;
      EXCEPTION
        WHEN utl_http.end_of_body THEN
          logging_pkg.info('End of body');
      END;
      -- close http connection
      utl_http.end_response(resp);
      EXCEPTION
        WHEN utl_http.end_of_body THEN
          utl_http.end_response(resp);
    END;
    Cheers,
    Brent

    Hi Billy
    Yikes - how embarassing !  Thanks for pointing out my beginners mistake there.  I've fixed my code - and also implemented the substitutions of parameters like you suggested - I like that approach.
    Unfortunately the end result is no better - the line
    utl_http.read_text(resp,response_text);
    Still returns nothing back
    The headers that are coming back are
    Date: Thu, 04 Jul 2013 08:31:56 GMT
    Server: Apache/2.2.16 (Ubuntu)
    X-Powered-By: PHP/5.3.3-1ubuntu9.3
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Vary: Accept-Encoding
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Connection: close
    I guess I will need to try chasing it with the fastsms vendor so see if they can check my incoming request and see if there are any glaring problems. I know the xml is correct as I am now logging the xml string just before I send it and when I take that string and put it in their test form it works perfectly - something else in the puzzle is missing. I've had no experience using utl_http before - perhaps it's no possible to read the xml repsonse using this ?
    Anyway, thanks for your help Billy.
    ps - How do you paste your code into your message to get that formatting ?
    Cheers,
    Brent

  • Send XML by HTTP from ext. System to XI and process

    Hi XI Experts,
    I want to configure a typical XI Scenario. Send XML by HTTP to XI. I know the URL, to send data to my XI test machine.
    I'm struggling with the HTTP Parameters and the necessary Configuration in the Integration Directory. In the URL I have to provide for our XI 3.0 machine
    service
    namespace
    interface
    Namespace and interface is clear to me, but not the "Service". I know, that the "Service" could be an SLD Business System. In my scenario I don't want to configure all potential senders (e.g. customers) as a business system.
    I want to have a "partner" in the Directory. There are partner services and services without a partner. Does someone can provide me the configuration steps. At minimum so that I receive the XI message in the integration engine.
    Routing and mapping I will configure. But at the moment I really don't know how to configure the "Service", if I want to use a "Partner" as sender, and not a business system.
    Thanks in advance
    Klaus
    P.S. My configuration scenario is a purchase order from a customer (in XML), which I want to transfer to an R/3 Backend to create a sales order.

    Hi Klaus,
    Check this SAP help-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/64db4daf9f30b4e10000000a11466f/frameset.htm
    In the Service , either you can have Business System created in the SLD or you can create your Own Business Service in the Directory. So create the service and go continue further.
    For creating a Party services
    This blog may give some hints-/people/sravya.talanki2/blog/2005/08/17/outbound-idocs--work-around-using-party
    Regards,
    Moorthy

  • Send xml via mail (IPhone SDK)

    HI all,
    i have some problem sending xml via mail(mailto). When the amil program caming up il see the subjet but the xml tag there aren't???
    any one has an idea how do this??
    thanks in advanced
    Claudio

    Go into settings - mail - account - and then look for the outgoing server - click in there and there should be a place for you to enter your password - just as you would when you first set up your email account.

  • 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 messages via shareobject in FMS

    How to send messages via shareobject in FMS
    I need some codes.
    I want to send some string messages via shareobject, the
    string messages can be retrieve in client.
    Can you give me some codes? Thank you for your help..
    /

    Thanks for your comment.
    en....I want to do something..I will maintenance a users list
    in charroom.
    I write a function in main.asc file , client can get users
    list via call the function.
    I write some codes in application.onConnect
    when a user connect, it will add users list.
    In application.onDisconnect, when a user disconnect, it will
    remove from users list.
    My hope when a user disconnect, I send a message to
    shareobject. the shareobject is called in other clients.
    Other client can retrieve the remove user message, they will
    call the function to get new users list.
    It is my idea. Can you give me some codes for my idea?
    Thank you very much.

  • How to send photo via facebook

    How to send photo via facebook

    Do you have the Facebook app from the App Store installed? You should be able to upload photos taken with your iPhone camera to Facebook using that app.

  • How to send attachments using HTTP Binding Adapter?

    How to send attachments using HTTP Binding Adapter in Jdeveloper?
    Requirement: I need to send attachments to a system which can communicate with the middleware using https only.
    Kindly suggest..
    Edited by: Richa Juneja on Jan 28, 2013 4:03 AM

    Hi,
    Following links may help U
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
    to know the basics about soap adapter u cn check out this link
    /people/padmankumar.sahoo/blog/2005/02/15/an-overview-of-soap
    to get in detail about the attachments chk out this link
    hi i am unable to attach an attachment in File to mail scenario
    Regards
    Pullarao

  • Can we send  XML  over HTTPS ?

    Can we send XML over HTTPS ?

    malcolmmc wrote:
    meacod wrote:
    rabbits?
    Rabbits
    http://www.rabbitmq.com/
    They wrote
    +RabbitMQ is designed from the ground up to interoperate with other messaging systems: it is the leading implementation of AMQP, the open standard for business messaging, and, through adapters, supports XMPP, SMTP, STOMP and HTTP for lightweight web messaging.+
    They mentioned only HTTP ....Does HTTPS implied here ?

  • 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 xml over http

    I have a WLS 6.0 servlet that receives XML transactions via a post method.
              Code snippet as follows:
              public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
              int txContentLength = req.getContentLength();
              //get entire input xml stream and store in a stringbuffer
              InputStream inp = req.getInputStream();
              BufferedReader br = new BufferedReader(new InputStreamReader(inp));
              byte[] ba = new byte[txContentLength];
              System.out.println("Reading...");
              int bytesRead = inp.read(ba);
              System.out.println("bytesRead= " + bytesRead);
              while(bytesRead < txContentLength) {
              int moreRead = inp.read(ba, bytesRead, (ba.length - bytesRead));
              if(moreRead == -1)
              break;
              bytesRead += moreRead;
              System.out.println("finished reading buffer...");
              StringBuffer sb = new StringBuffer(new String(ba));
              I have a java client on my PC that takes an XML file as input and sends the
              information to the servlet without any problems.
              The problem is a client that is connecting to our network via a T1
              connection. When they send transactions, about 1 out of every 4
              transactions makes it past the "Reading..." statement above. The other
              transactions appear to 'hang' when it hits the inp.read(ba) line above.
              From all indications, that servlet's execute thread appears 'hung' as if the
              inp.read() is waiting forever.
              I've tried using readLine() on the InputStream() and my local client program
              is unaffected - it works OK. The remote client is having problems using
              either method. The only difference I've noted with the remote client is
              that they are using HTTP 1.0 and I'm using HTTP 1.1. Initially, their
              mime-type was null but they've changed it to text/xml and no luck. I've
              even sent them my client code that is working and they are still having
              problems...
              Another strange anomoly is that req.getContentLength() is returning a valid
              number on the transactions that fail. For example, I had some debug code
              that showed the content length and it was always something like 4012 or
              3500, etc. Not -1 as I would expect...
              Has anyone run into this problem with receiving XML transactions?
              Thanks
              Rob Mason
              

    Thanks for the suggestion - I went back and added a check on the
              contentLength to make sure it had a valid number before trying to call any
              'read' methods... still no luck.
              I did go in and put a try/catch around the read() logic below. The
              exception thrown is an InterruptedIOException. The docs say that this is
              thrown 'to indicate that an input or output transfer has been terminated
              because the thread performing it was terminated.'
              This would seem to indicate that WLS is having the problem - not the client?
              Via the console, under the Configuration section, my HTTP section has the
              following values:
              POST timeout secs: 10
              Max POST time: 10
              Max POST size: -1
              Is there anything else I can try on the server level?
              Thanks
              Rob Mason
              "Xiang Rao" <[email protected]> wrote in message
              news:[email protected]...
              >
              > T1 shouldn't be the problem. We even use dialup to upload file via HTTP
              POST. HTTP
              > 1.0 shouldn't be problem. If you think this is the only difference, you
              can ask
              > other developers to change it to HTTP 1.1 when they request your servlet.
              >
              > The hang at read(ba) most likely means no request data are sent to your
              servlet
              > even if you think there should be some data. In your code, you are better
              to add
              > a block to check if the content_length is GREATER THAN 0 (-1 or 0), if
              not, you
              > shouldn't open any inputstream and shouldn't call any read method. If the
              content_length
              > is 0, your character buffer will have length 0 and I really don't know
              what you
              > can put into such buffer. It is not necessary to set a buffer with the
              length
              > of expected Content_Length. Since you use BufferedReader, you can create a
              buffere
              > with large enough size (see 1K, 8K, 16K, etc)and the return value of read
              will
              > give you the exact length you get for each read call, then append result
              to your
              > Stringbuffer. On the other hand, it is better for you to handle
              IOException in
              > your servlet.
              >
              > Ask the other side developers to send you their client code and compare
              their
              > code with your test code word by word. Check how they compute the
              Content_Length
              > and how they send Content_Length field to you. If this field is not
              explicitly
              > set, I think you should get -1 or 0, even there are request data out. Also
              you
              > should check how the data are sent out to make sure they really send you
              request
              > data.
              >
              >
              >
              >
              > "Rob Mason" <[email protected]> wrote:
              > >I have a WLS 6.0 servlet that receives XML transactions via a post
              method.
              > >Code snippet as follows:
              > >
              > > public void doPost(HttpServletRequest req, HttpServletResponse res)
              > > throws ServletException, IOException
              > > {
              > > int txContentLength = req.getContentLength();
              > >
              > > //get entire input xml stream and store in a stringbuffer
              > > InputStream inp = req.getInputStream();
              > > BufferedReader br = new BufferedReader(new InputStreamReader(inp));
              > >
              > > byte[] ba = new byte[txContentLength];
              > > System.out.println("Reading...");
              > > int bytesRead = inp.read(ba);
              > > System.out.println("bytesRead= " + bytesRead);
              > > while(bytesRead < txContentLength) {
              > > int moreRead = inp.read(ba, bytesRead, (ba.length - bytesRead));
              > > if(moreRead == -1)
              > > break;
              > > bytesRead += moreRead;
              > > }
              > >
              > > System.out.println("finished reading buffer...");
              > > StringBuffer sb = new StringBuffer(new String(ba));
              > >}
              > >
              > >
              > >I have a java client on my PC that takes an XML file as input and sends
              > >the
              > >information to the servlet without any problems.
              > >The problem is a client that is connecting to our network via a T1
              > >connection. When they send transactions, about 1 out of every 4
              > >transactions makes it past the "Reading..." statement above. The other
              > >transactions appear to 'hang' when it hits the inp.read(ba) line above.
              > >From all indications, that servlet's execute thread appears 'hung' as
              > >if the
              > >inp.read() is waiting forever.
              > >
              > >I've tried using readLine() on the InputStream() and my local client
              > >program
              > >is unaffected - it works OK. The remote client is having problems using
              > >either method. The only difference I've noted with the remote client
              > >is
              > >that they are using HTTP 1.0 and I'm using HTTP 1.1. Initially, their
              > >mime-type was null but they've changed it to text/xml and no luck. I've
              > >even sent them my client code that is working and they are still having
              > >problems...
              > >
              > >Another strange anomoly is that req.getContentLength() is returning a
              > >valid
              > >number on the transactions that fail. For example, I had some debug
              > >code
              > >that showed the content length and it was always something like 4012
              > >or
              > >3500, etc. Not -1 as I would expect...
              > >
              > >Has anyone run into this problem with receiving XML transactions?
              > >
              > >Thanks
              > >Rob Mason
              > >
              > >
              > >
              >
              

Maybe you are looking for

  • How to setup a new network with a new Airport Express

    I need help setting up a brand new Airport Express and creating its own wireless network. I have a Motorola SB6141 cable modem that is connected to a Airport Extreme. The new Airport Express will be connected by an ethernet cable in another room. To

  • Problem with Canon XF100.

    I have many files already saved on my network drive from my documentary project.  CS6 deals with the files satisfactorily but Premiere Pro can not.  What is the deal.  How can I take MXF files already on my drive and make them function?  I've tried t

  • My sms messages are not being received by another orange phone

    Hi, my Dad is on an orange network and so am I. i have an iphone4s but he is not receiving any of my sms texts. I am receiving his ok though. Any suggestions please? Thanks. My Dad has a Samsung X.

  • Approval process in oracle purchasing

    hi, when i am about to approve one purchase order i dont see the fax, email it is disabled ? how do i enable it? Regards sudharshan

  • Am I able to submit an idea to apple for a future product?

    I have a new idea for an ipad.  Very futruistic, very sleck.  It is called the Smart Pad.  It has veriety of features like slide-out keyboard and sideboards.    It can be compressed in to four sections.  It can be used like an iPad, iPhone, and Macbo