2 Replies Latest reply: Mar 4, 2010 6:55 AM by 843830 RSS

    HTTPBC POST does not contain any values on the recieving end.

    843830
      I have a BPEL which reads the content of a file as String and send it to a Servlet using the HttpBC Post method.
      But when I want to get this value on the recieving end (The Servlet), the httpRequest object is empty and it returns Null value?

      If I do the same thing using HttpBC Get method, it works fine (I can't use the Get method because the content of the file is sometimes too long, and for that reason I HAVE to use the Post method).

      I was just wandering where the Object is, when I use the Post method? How do I have to read the httpRequest object if I used the Post on HttpBC?

      Thanks in advance.

      Here is more info about my code:


      The WSDL:
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      targetNamespace="caPostOverHttp"
      xmlns:tns="caPostOverHttp" xmlns:ns="http://j2ee.netbeans.org/wsdl/bpPostOverHttp/wsdlABSFile" xmlns:file="http://schemas.sun.com/jbi/wsdl-extensions/file/" xmlns:ns1="http://j2ee.netbeans.org/wsdl/bpPostOverHttp/wsdlError" xmlns:ns2="http://j2ee.netbeans.org/wsdl/bpPostOverHttp/wsdlHttp" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:fi="http://java.sun.com/xml/ns/wsit/2006/09/policy/fastinfoset/service" xmlns:tcp="http://java.sun.com/xml/ns/wsit/2006/09/policy/soaptcp/service" xmlns:wsp="http://www.w3.org/ns/ws-policy">
      <import namespace="http://j2ee.netbeans.org/wsdl/bpPostOverHttp/wsdlABSFile" location="../jbiServiceUnits/bpPostOverHttp/wsdlABSFile.wsdl"/>
      <import namespace="http://j2ee.netbeans.org/wsdl/bpPostOverHttp/wsdlHttp" location="../jbiServiceUnits/bpPostOverHttp/wsdlABSHttp.wsdl"/>
      <portType name="dummyCasaPortType"/>
      <binding name="casaBinding1" type="ns:wsdlABSFilePortType">
      <file:binding/>
      <operation name="wsdlABSFileOperation">
      <file:operation verb="poll"/>
      <input name="input1">
      <file:message fileName="EP.xml" pollingInterval="1000" part="file_IN"/>
      </input>
      <output name="output1">
      <file:message fileName="output.xml" part="file_OUT"/>
      </output>
      </operation>
      </binding>
      <binding name="casaBinding2" type="ns2:wsdlHttpPortType">
      <http:binding verb="POST"/>
      <operation name="wsdlHttpOperation">
      <http:operation location=""/>
      <input name="input1">
      <http:urlEncoded/>
      </input>
      <output name="output1"/>
      </operation>
      </binding>
      <service name="casaService1">
      <port name="casaPort1" binding="tns:casaBinding1">
      <file:address fileDirectory="C:\Temp\input" lockName="filebc.lck" workArea="filebc-in-processing" seqName="filebc.seq"/>
      </port>
      </service>
      <service name="casaService2">
      <port name="casaPort2" binding="tns:casaBinding2">
      <http:address location="http://localhost:8080/waPollFileToHttp/Process"/>
      </port>
      </service>
      <wsp:Policy wsu:Id="casaBinding2Policy">
      <wsp:ExactlyOne>
      <wsp:All/>
      </wsp:ExactlyOne>
      </wsp:Policy>
      </definitions>
      The Servlet:
      public class Process extends HttpServlet {
      
      protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
      String httpIn = request.getParameter("http_IN"); // http_IN is the string variable used in the BPEL which contains the content of the file. Using Post returns null for this parameter, but using GET it returns the actual value.
      System.out.println("SERVLET PROCESS:");
      System.out.println(request.getQueryString()); // using POST returns null but using GET returns the actual value.
      System.out.println("HTTP_IN:");
      System.out.println(httpIn);
      } 
      
      protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
      processRequest(request, response);
      } 
      
      protected void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
      processRequest(request, response);
      }
      }