XML over HTTP between client and server

We are trying to pass XML between a client and servlet over HTTP.
          We used the code from the StockClient/StockServlet examples as a
          starting point but cannot get it to work. Basically we
          have a simple command line java client that is trying to access
          a VERY simple servlet. When the client tries to write data into
          the output stream associated with the connection I get:
          "Connection rejected: 'Login timed out after: '15000' ms....."
          I have read several postings that instruct me to raise the
          timeout limit, but as you can see, I surely don't need 15 seconds
          to write this data out! Is there something special I need to do?
          Does this have anything to do with known issue #10065
          (http://www.weblogic.com/docs51/release_notes/rn_knownprob51.html)
          I have followed all of the instructions in the example code
          (http://www.weblogic.com/docs51/classdocs/xml.html)...
          Any assistance is appreciated...
          here is the client code:
          import java.io.*;
          import java.net.*;
          public class TestClient
          public static void main(String aa[])
          URL url = null;
          HttpURLConnection urlc = null;
          PrintWriter pw = null;
          file://Commented lines indicate other things I have tried
          try
          url = new URL("http://localhost:7001/ParserServlet");
          file://urlc = url.openConnection();
          urlc = (HttpURLConnection)url.openConnection();
          file://urlc.setRequestProperty("Content-Type", "text/xml");
          urlc.setDoOutput(true);
          urlc.setDoInput(true);
          file://urlc.connect();
          pw = new PrintWriter(new OutputStreamWriter
          (urlc.getOutputStream()), true);
          pw.println("<?xml version='1.0'?><test>testing123</test>");
          pw.flush();
          file://urlc.disconnect();
          } catch(IOException ex) {
          System.out.println(ex.getMessage());
          Here is the servlet code:
          import javax.servlet.*;
          import javax.servlet.http.*;
          import java.io.*;
          import java.net.*;
          public class TestServlet extends HttpServlet
          public synchronized void init(ServletConfig config) throws
          ServletException
          super.init(config);
          System.out.println("Inside init()");
          public final void doPost(HttpServletRequest request, HttpServletResponse
          response)
          throws ServletException, IOException
          System.out.println("Inside doPost()");
          protected void doGet(HttpServletRequest req,
          HttpServletResponse resp)
          throws ServletException,
          java.io.IOException
          System.out.println("Inside doGet()");
          

          Jon,
          One thing is missed in your client code. When you use HTTP POST to send request,
          you have two ways to tell the Web server when to stop reading from your input and
          to start process your input: the first one is using "Content-Lenght" header property
          to specify how many bytes you want to send to your servlet, the seocnd is use "Transfer-Code:
          Chunked" and is much more complicated. I didn't see you pass "Content-Length" in
          your client code, in which case, the Web server (Weblogic) cannot know the end of
          your request data and could keep waiting for last byte to come out or waiting for
          the socket time out (that is what you get).
          Since you use servlet, not JSP, I would recommend to code in this way (it works fine
          for me, no guranttee for your situation):
          Client code: Use a big temprary string, or StringBuffer, or StringWriter to store
          all the request data (your xml file content) before you send out the request. After
          you finish to form your XML string, calculate the number of bytes (should equal to
          the length of the string) and add the request header as
          urlc.setRequestProperty("Content-Length", bytes_length);
          I will not suggest you using PrintWriter. Think use BufferedOutputStream constructed
          from URLConnection and write the bytes (use String.getBytes()) to the servlet and
          then flush.
          Servlet code: in the doPost() of your servlet, try to find the request data length
          by calling request.getContentLength(), then open the InputStream (think to use BufferedInputStream
          for performance). Read the contents from the InputStream byte by byte and counter
          the number of bytes. Once you get the number of bytes as specified via request Content-Length,
          break your reading loop and start whatever you want.
          Hope it helps.
          "Jon Clark" <[email protected]> wrote:
          >We are trying to pass XML between a client and servlet over HTTP.
          >We used the code from the StockClient/StockServlet examples as a
          >starting point but cannot get it to work. Basically we
          >have a simple command line java client that is trying to access
          >a VERY simple servlet. When the client tries to write data into
          >the output stream associated with the connection I get:
          >"Connection rejected: 'Login timed out after: '15000' ms....."
          >I have read several postings that instruct me to raise the
          >timeout limit, but as you can see, I surely don't need 15 seconds
          >to write this data out! Is there something special I need to do?
          >Does this have anything to do with known issue #10065
          >(http://www.weblogic.com/docs51/release_notes/rn_knownprob51.html)
          >I have followed all of the instructions in the example code
          >(http://www.weblogic.com/docs51/classdocs/xml.html)...
          >
          >Any assistance is appreciated...
          >
          >here is the client code:
          >import java.io.*;
          >import java.net.*;
          >
          >public class TestClient
          >{
          > public static void main(String aa[])
          > {
          > URL url = null;
          > HttpURLConnection urlc = null;
          > PrintWriter pw = null;
          >
          > file://Commented lines indicate other things I have tried
          > try
          > {
          > url = new URL("http://localhost:7001/ParserServlet");
          > file://urlc = url.openConnection();
          > urlc = (HttpURLConnection)url.openConnection();
          > file://urlc.setRequestProperty("Content-Type", "text/xml");
          > urlc.setDoOutput(true);
          > urlc.setDoInput(true);
          > file://urlc.connect();
          > pw = new PrintWriter(new OutputStreamWriter
          > (urlc.getOutputStream()), true);
          > pw.println("<?xml version='1.0'?><test>testing123</test>");
          > pw.flush();
          > file://urlc.disconnect();
          > } catch(IOException ex) {
          > System.out.println(ex.getMessage());
          > }
          > }
          >}
          >
          >
          >
          >Here is the servlet code:
          >
          >import javax.servlet.*;
          >import javax.servlet.http.*;
          >import java.io.*;
          >import java.net.*;
          >
          >public class TestServlet extends HttpServlet
          >{
          > public synchronized void init(ServletConfig config) throws
          >ServletException
          >
          >
          > super.init(config);
          > System.out.println("Inside init()");
          > }
          >
          > public final void doPost(HttpServletRequest request, HttpServletResponse
          >response)
          > throws ServletException, IOException
          > {
          > System.out.println("Inside doPost()");
          > }
          >
          > protected void doGet(HttpServletRequest req,
          > HttpServletResponse resp)
          > throws ServletException,
          > java.io.IOException
          > {
          > System.out.println("Inside doGet()");
          > }
          >}
          >
          >
          >
          >
          

Similar Messages

  • Socket communication between client and server

    Hi all,
    I am doing an assignment for communication between java client and java server using sockets. This communication is in the form of XML documents. I am facing a problem in this communication.
    Actually at Server side I'm creating an XML document(Document type object) using DocumentBuilderFactory in javax.xml.parsers package and transforming this Document into a stream using StreamResult.
    My code is :
    Transformer xmlTransformer = TransformerFactory.newInstance().newTransformer();
    StreamResult xmlString = new StreamResult(currentClientHandler.getSocketOutputStream());
    DOMSource xmlDocSource = new DOMSource(xmlDocument); // xmlDocument is Document type reference
    xmlTransformer.transform(xmlDocSource, xmlString);
    so, this xmlString(i.e. StreamResult) is passed directly into the output stream. Here I need to close() output stream after transform() call to help SAX parser to know about end of stream.
    Now at Client side, I am parsing this stream using SAX parser. It parses this correctly. But when sending some another data back to Server when client opens output stream, it given Socket closed exception. I know that closing input or output stream closes socket. But in my problem, I have to send data in streams and not by using files or byte[] etc.
    So what is nearest solution to problem ??
    Plz help me. Any kind of help will be greatly appreciated.

    hi
    thanks for ur reply.
    I didnt get any error msg while getting the back the datas.
    Actually i divided my application into two parts.
    My application will act as both server and client.
    server ll get the browser request and send to the client and the client will send that data to the c++ server.
    Im able to do that.and unable to get the data from server.
    Didnt get any error.
    can u tell me how to make an application to act as both client and server.
    I think im wrong in that part.
    thanks a lot

  • Communication between client and server

    I am using sockets for communication between the client and the server. is there any other way that i can use for communication between the client and server???

    Plenty of ways: JMS, SOAP, RMI, a RESTful API, writing-files-to-a-shared-directory-on-the-disk, Sneakernet, ...
    Some of them use sockets (or better TCP/IP) as the underlying protocol.
    But to give you a good answer, you would have to tell us why you want a different way. I hope you're not searching for a different way just for the sake of being different.

  • Oracle returns redicrect when there is NAT between client and server

    I have Oracle 8i on Linux sitting behind a firewall/NAT. I have two Apache webservers that run both Tomcat and WebLogic webapps, also behind the NAT. One of them is on the same machine as the Oracle server. Those all connect just fine. I recently had to load a JBoss/Tomcat webapp (no Apache) outside the NAT which needs to talk to the Oracle server. It's using a JDBC driver, I believe calling on this class: oracle.jdbc.driver.OracleDriver. The configured URL is "jdbc:oracle:thin:@localhost:1521:qlink". Using ethereal (A GUI frontend to the packet sniffer tcpdump, which understands the TNS protocol) showed me that this is the connection request being made: "(DESCRIPTION=(CONNECT_DATA=(SID=qlink)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle)))
    (ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))))". I notice it uses SID, where it seems everything else I've analyzed with Ethereal is using SERVICE_NAME. I was first trying to pipe the data through an SSH tunnel. This technique works with all of Oracle's tools that I have tried it with, and with TOAD. I can connect to this Oracle server with the DBA Studio and sqlplus, over an ssh tunnel. But as soon as this JBoss/Tomcat webapp tries, Oracle returns a REDIRECT message. There are two things that strike me as odd: The REDIRECT message returns the hostname of the Oracle server and a nonstandard port; and the JBoss/Tomcat webapp doesn't seem to do anything about it. I has assumed the TNSLSNR forwarded data between 1521 and the appropirate port for requested databse. The port is the same every time, so I made sure that the hostname/port returned was reachable from the client side. But like I said, the client seemed to just ignore it and hang. Getting desparate, I then tried to open up the Oracle ports on the NAT, and use ipchains to restrict what IPs could connect to it, that yielded the same results. I've seen this webapp work with Oracle running on the same machine, both configured identically. (Running Oracle behind the NAT and using SSH tunnels gives the same configuration for JBoss/Tomcat as if I was running Oracle on the same machine)

    I'm pretty uninitiated with Oracle. I don't know how to verify/disprove your guess about the shared server dispatcher, or even what it means. Should I try to pursue the observation that the JDBC client specifies a SID to connect to and everything else specifies a SERVICE_NAME, or is that of little consequence? I'm not sure how to interpret the output from 'lsnrctl serv'. Here's the chunk pertaining to the database in question:
    qlink has 3 service handler(s)
    DISPATCHER established:120 refused:0 current:120 max:254 state:ready
    D000 <machine: sark.unboundtech.com, pid: 15801>
    (ADDRESS=(PROTOCOL=tcp)(HOST=sark.unboundtech.com)(PORT=41714))
    qlink has 3 service handler(s)
    DEDICATED SERVER established:46 refused:0
    LOCAL SERVER
    DISPATCHER established:0 refused:0 current:0 max:254 state:ready
    D001 <machine: sark.unboundtech.com, pid: 15803>
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sark.unboundtech.com)(PORT=41716))(PRESENTATION=oracle.aurora.server.SGiopServer)(SESSION=RAW))
    Presentation: oracle.aurora.server.SGiopServer
    The (ADDRESS=...) is what is returned in the redirect. I created the database with dbassist using the default setup type. I'll have a look at listener.log (the name/location of a log file is actually a question I had but forgot to ask, so thanks), I don't know how to check trace output. The webserver is able to resolve the hostname being returned, and knows how to route to it.
    Localhost is the correct entry. If you've never used SSH tunnels here's a quick rundown. You can tell most SSH clients to listen on an arbitraty port on your machine, and forward data to a remote IP/port from the other side. So from the webserver, I would say to forward localhost:1521 to localhost:1521 on the oracle server. So for sqlplus, for example, I setup tnsnames.ora to route connections to a particular SERVICE_NAME to localhost:1521, which is forwarded through my SSH connection, to localhost:1521 on the Oracle server. This lets gains me two things, all connections look like localhost, making my firewall rules simpler, and I get encryption through SSH (I know Oracle can do encrypted connections, but some clients might not support it, and I don't know how to set it up yet.) I am able to connect to the database over an SSH tunnel using sqlplus, from the webserver (since I ended up installing Oracle on it), so I know the connection is possible.
    After reading that, you might wonder if the hostname:port returned in the redirect were accessible from the web server. They weren't at first, but opening port 1521 and 41714 for sark.unboundtech.com at the NAT, and firewalling requests from IPs other than the webserver, then giving the JDBC config sark.unboundtech.com instead of localhost with an SSH tunnell yielded identical behavior. After recieving the REDIRECT, the JDBC code doesn't seem to do anything except hang, nothing is sent to the location given in the REDIRECT response.

  • Signal tranmission between client and server through tcp/ip

    Hi everyone,I want to transmit analog signal from server to the client,I enclosed one file which is used to transfer an array of string,how can I modify the enclosed example for analog signal tranmission(numeric) and save the signal into a file "load to an ASCII file"".kindly help me to modify this code.
    Thanks
    regards,
    Khan_khan
    Attachments:
    ConcatenatedStringToArray.vi ‏11 KB
    Simple Data Client.vi ‏20 KB
    Simple Data Server.vi ‏19 KB

    Dear thanks for your reply and suggestion.I solve somehow the problem as enclosed in the zip file but now there is one problem that i am not getting with. When I run the project, the first array with the name of "array" gives the wrong result in some position.First all slots of array are filled with the right data but then the first index and few other index gives the wrong result.Kindly correct my error.
    The second problem is ,when i increase the frequency of the signal considering also the sampling rate, it gives me unexpected data at multiple locations.Kindly correct my design so that it should work perfectly.I shall be very thankful.
    Attachments:
    ConcatenatedStringToArray.vi ‏13 KB
    Simple Data Client.vi ‏23 KB
    Simple Data Server.vi ‏27 KB

  • Xml over http form post and response example

    can some one point me to http form post/get  syntax to send and receive xml...let me know

    Use the cfhttp tag. For example, suppose the xmlDoc is already defined. Then you could post the document using
    <cfhttp url="the_url" method="post">
        <cfhttpparam type="header" name="content-type" value="text/xml">
        <cfhttpparam type="header" name="content-length" value="#len(xmlDoc)#">
        <cfhttpparam type="header" name="charset" value="utf-8">
        <cfhttpparam type="xml" name="message" value="#xmlDoc#">
    </cfhttp>

  • Designing services for xml over http client requests

    Hi
    I am new to WebServices and Weblogic Integration. I have been using it for only over a month. I have a very basic design issue.
    We have to provide a service that
    1. accepts xml over http requests
    2. Returns a request ack
    3. Process Form a response -This activity consumes time so it will be made asynchronous
    4. Send the response as xml over http
    5. Wait for response ack
    6. Get another type of request from client, the processign of which depends on the result of the previous request .. and so on..
    The problem here is that Webservices accepts only SOAP messages but our client will send raw xml messages. Also we need to remember the condition of the previous state.
    I dont know if my assumption that SOAP is used is right.
    Please tell me how to design a raw xml based system without using SOAP messages.
    Thanks
    nithya

    I don't see nothing wrong with your code, there must be something else happening.
    You sure you are not being some proxy server?? but even then you are making a post request so it shouldn't be happening.
    MeTitus

  • Client call using   XML over Http using HttpClient

    Using HTTPClient while calling HTTPPost method to generate request for external system using XML over http using below code
    client.getState().setCredentials(new AuthScope(ipAddress,portNumber),new UsernamePasswordCredentials(username, password));
         PostMethod method = new PostMethod(url);
         String str = accDoc.toString();
    method.setRequestEntity(new InputStreamRequestEntity(new ByteArrayInputStream(str.getBytes())));
    method.setDoAuthentication( true );                
    int result = client.executeMethod(method);
    server system getting 2 request. first request without basic authentcation details and second request with full auhentication details.
    So unnecessary eatra call without authentication details is going during calling the client program using above code.
    Please let me know which part of the above code is generationg extra call.
    Thanks in advance for your help

    I don't see nothing wrong with your code, there must be something else happening.
    You sure you are not being some proxy server?? but even then you are making a post request so it shouldn't be happening.
    MeTitus

  • Accessing Java webservice (XML over http) via WCF or HTTP adapter with content-type and authorization HTTP headers with POST method

    Hi Team,
    I need to access Java web service which is simple service and accepts and returns XML over HTTP. No credentials are needed to access the service. We need to pass following two HTTP headers (Content-Type and Authorization) along with XML request message:
    <GetStatus> message is being constructed in the orchestration and URI is constant to access.
    Which adapter shall I use to get the response back? I tried using WCF-WSHttp with Security Mode = Transport, and different options of client credential types but every time, error returned stating:
    System.Net.WebException:
    The HTTP request is unauthorized with client authentication scheme 'Basic'. The
    authentication header received from the server was 'Basic realm='.
    Authentication failed for principal Basic. Message payload is of type:
    String 
    In Fiddler, request looks line following
    POST <https://URL/GetServiceReopnse HTTP/1.1
    Content-Type: application/xml
    Authorization: Basic cmVmU3RhdHN2Y19kgeRfsdfs=
    Host: <Server name>
    <GetStatus XMLNS="http://server.com/.....">
    <OrgId>232323</OrgId>
    <HubId>3232342323</HubId>
    </GetStatus>
    MMK-007

    First, you should not use the HTTP Adapter because it's been deprecated and replaced by WCF.
    Start with the WCF-Custom Adapter and select the customBinding.
    You should start with the textMessageEncoder and httpTransport and go from there.

  • Communication between two jvm (client and server)

    Hi ,
       I want to access the UME service of the SAP J2EE Container using a stanalone client application.
    So the client would be running on remote JVM.
    Here we use the JNDI service to communicate between the client and server.
    p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
                        p.put(Context.PROVIDER_URL, providerURL.trim());
                        p.put(Context.SECURITY_PRINCIPAL, securityPrinciple.trim());
                        p.put(Context.SECURITY_CREDENTIALS, securityCredentials.trim());
                        Context ctx = (Context) new InitialContext(p);
                        Object objRef = ctx.lookup(ejbName.trim());
    I want to know that is the communication between the client and server secured in this scenario
    Best Regards
    Manoj

    Okay, the client and server VMs are different implementations of the Hotspot engine. Hotspot basically takes the Java bytecode from your .class files and turns it into native machine instructions at runtime. (The optimizations are actually much more complex than that, but that's the basic concept.)
    The client VM is so named because it's designed to be used for GUI-type applications interacting with the user. It is designed to have a quicker startup and smaller memory footprint.
    The server VM uses more memory and is typically slower at starting up than the client VM, but can often perform ridiculously fast. This of course depends completely on the particular code being run, and you should probably profile and see which VM works better for your application.
    Some interesting optimizations are performed by the 1.4.1 server VM, such as: removal of array-bounds checks (when it determines that the index can't become out of bounds), inlining of methods, and more.
    Here is a link to more info if you're interested:
    http://java.sun.com/products/hotspot/docs/whitepaper/Java_HotSpot_WP_Final_4_30_01.html

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • Post XML over HTTPS

    We are trying to do the following. Can anyone help by providing any pointers as how to do it.
    1. A java client will be posting XML over http(s) to the Tomcat server.
    2. The Tomcat server has to do the following:
    - Validate the user credentails and verify that it is an valid user on IDM
    - Do some DB operations and return back a response XML
    We are trying to do this by having the Java client post XML over http to a jsp hosted on the Tomcat server
    How do i retrieve the XML data from the HTTP post (from the HTTP body) ?
    Thanks

    try the below example to read data over https,
    import java.net.*;
    import java.io.*;
    import javax.net.ssl.*;
    public class SSLSocketClient {
    public static void main(String[] args) throws Exception {
         String url="https://secure.com";
              try {
                   SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
                SSLSocket socket = (SSLSocket)factory.createSocket(url, 443);
                socket.startHandshake();
                /* read response */
                BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                String inputLine;
                while ((inputLine = in.readLine()) != null)
                    System.out.println(inputLine);
                in.close();
                socket.close();
            } catch (Exception e) {
                e.printStackTrace();
    }

  • Basic Question: plain XML over HTTP

    I would be getting messages in plain XML over HTTP. What should I use to receive those messages. Server is not SOAP based, so client cannot be SOAP based. Should I use JAX-RPC, but when I looked at the documentation, it is giving info regarding SOAP and plain xml over http. Can anyone help me?
    Thanks

    From my understanding, you would be getting a plain xml string by connecting to a server over http.
    You can is DOM or SAX apis to parse this xml input stream.
    For eg: if you are using DOM apis, then you can pass the input stream of the HttpURLConnection as follow...
         DocumentBuilderFactory buildFactory = DocumentBuilderFactory.newInstance();
         buildFactory.setIgnoringElementContentWhitespace(false);
         buildFactory.setValidating(false);
         DocumentBuilder docBuilder = buildFactory.newDocumentBuilder();
         URL url=new URL("http://someserver.com/abc.jsp");
         HttpURLConnection conn= (HttpURLConnection)url.openConnection();
         InputStream in= conn.getInputStream();
         Document doc = docBuilder.parse(in);
         ..Hope this helps...

  • XML over HTTP using BPEL (not using SOAP)... is this possible?

    Hi there.
    We're trying to expose a BPEL process which will be exclusively triggered from a HTTP POST. The Client Partner Link in the BPEL process models Oracle's Transparent PunchOut standard. This standard is strict XML-over-HTTP, SOAP is not involved.
    However, I am getting issues when I POST the XML to BPEL. It is telling me that it requires a SOAPAction in the header. Again, the design dictates that this is raw XML over HTTP, so we are not to use any SOAP specific header values nor any kind of SOAP wrapper.
    I deployed the sample 'HTTPPostService' process which was delivered with BPEL. I am seeing the same error when I try to POST XML to this process as well. I get a response (in a SOAP wrapper) saying that it wants a SOAPAction in the header. The WSDL used to create this sample process clearly does not bind to SOAP, (there are no mentions of the SOAPAction in the operation, etc) so I do not understand.
    So, my question is: Is is possible to POST raw XML to a BPEL process? Or does BPEL require all processes to follow the SOAP 'protocol' ?
    Thanks for any help.
    Message was edited by:
    [email protected]

    I am also trying to do the same stuff. If i deploy the sample application HttpGetService, will i be able to send the request from browser the way we send typical http get request?
    here is the url which i want to use to invoke Http get BPEL
    http://cybage1:9700/httpbinding/default/HTTPGetService?ssn=10&id=20
    but i am getting following exception
    500 Internal Server Error
    java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
         at java.util.ArrayList.RangeCheck(ArrayList.java:507)
         at java.util.ArrayList.get(ArrayList.java:324)
         at com.collaxa.cube.ws.http.HttpBindingServlet.call(HttpBindingServlet.java:113)
         at com.collaxa.cube.ws.http.HttpBindingServlet.doGet(HttpBindingServlet.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:798)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:278)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)

  • Query regarding encoding/decoding of XML over HTTP Post request

    Hello,
    I am working on a project where I need to put SMS inside XML and
    eventually transfer this XML via HTTP post from/to server/client.
    Assuming the SMS to be 7-bit text the XML may look something like
    <?xml+version="1.0"?>
    <SMS
    TESTMESSAGE
    </SMS>
    This XML when encoded in a HTML post may look something like
    http://<IP Address>:<port>/
    POST /MessageReceiver.jsp HTTP/1.0
    Host: www.SomeHost.net
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 90
    xmlMsg=%3C%3Fxml+version%3D%221.0%22%3F%3E%0D%0A%3CSMS%0D%0A%09TESTMESSAGE0D%0A%3C%2FSMS%3E
    This xml is UTF-8 (7-bit ASCII) by default since no encoding format has been specified.
    My question - how will the encoding of xml change to - when 8 bit binary data
    is transferred via xml.
    for e.g.
    <?xml+version="1.0"?>
    <SMS
    <!!!!!BINARY DATA!!!!!>
    </SMS>
    for such a file how/what shld the encoding be set to.
    Further my spec-states the following.
    "The content of the XML must respect the encoding. Thus a SMS
    containing typically french characters must use ISO-8859-1 encoding"
    "This code needs to work with both UTF-8 and UTF-16 standards (ASCII and Unicode). Because of this the parsing code should work internally with UTF-16 and translate up/down to/from UTF-8 (ASCII) only when dealing with the basic HTTP."
    could anyone clarify this for me.

    The first thing you need to do is clear up some fundamental misconceptions about character encodings. UTF-8 is not the same thing as "7-bit ASCII", and UTF-16 is not the same as "Unicode". Anyway, you're making this a lot more difficult than it needs to be. Just use UTF-8 to encode and decode all messages; it can handle all the characters from any language you're likely to run into.

Maybe you are looking for