You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by wc...@locus.apache.org on 2000/11/29 01:23:55 UTC

cvs commit: xml-soap/java/src/org/apache/soap/server/http MessageRouterServlet.java

wcloeten    00/11/28 16:23:55

  Modified:    java/src/org/apache/soap/server/http
                        MessageRouterServlet.java
  Log:
  patch to fix build process even though MessageRouterServlet doesn't support MIME multipart yet
  
  Revision  Changes    Path
  1.6       +4 -52     xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java
  
  Index: MessageRouterServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MessageRouterServlet.java	2000/11/15 13:38:32	1.5
  +++ MessageRouterServlet.java	2000/11/29 00:23:54	1.6
  @@ -177,33 +177,6 @@
     public void doPost (HttpServletRequest req, HttpServletResponse res)
       throws ServletException, IOException
     {
  -    /*
  -     * Begin Transport-Hook-Extension
  -     */
  -    // Invokes EnvelopeEditor (editIncoming)
  -    Reader in;
  -    int contentLength;
  -    String opt = System.getProperties().getProperty(TRANSPORT_HOOK_EXTENSION);
  -    if (opt != null && editor != null) {
  -      try {
  -        StringWriter sout = new StringWriter();
  -        editor.editIncoming(req.getReader(), sout);
  -        String xml = sout.getBuffer().toString();
  -        in = new StringReader(xml);
  -        contentLength = xml.length();
  -      } catch (SOAPException e) {
  -        e.printStackTrace();
  -        // SOAPException must be handled here.
  -        return;
  -      }
  -    } else {
  -      in = req.getReader();
  -      contentLength = req.getContentLength();
  -    }
  -    /*
  -     * End Transport-Hook-Extension
  -     */
  -
       ServletConfig config = getServletConfig();
       ServletContext context = config.getServletContext ();
       HttpSession session = req.getSession ();
  @@ -232,7 +205,10 @@
         Envelope msgEnv =
           ServerHTTPUtils.readEnvelopeFromRequest(xpl,
                                                   req.getContentType(),
  -                                                contentLength, in, res);
  +                                                req.getContentLength(),
  +                                                req.getInputStream(),
  +                                                editor,
  +                                                res);
         if (msgEnv == null)
             return;
         /*
  @@ -312,30 +288,6 @@
         out.close ();
       }
       
  -    /*
  -     * Begin Transport-Hook-Extension
  -     */
  -    // Translates response from server application with EnvelopeEditor
  -    opt = System.getProperties().getProperty(TRANSPORT_HOOK_EXTENSION) ;
  -    if (opt != null && editor != null) {
  -      byte[] data = bytes.toByteArray();
  -      in = new InputStreamReader(new ByteArrayInputStream(data));
  -      bytes = new ByteArrayOutputStream();
  -      Writer tout = new OutputStreamWriter(bytes);
  -      try {
  -        editor.editOutgoing(in, tout);
  -      } catch (SOAPException e) {
  -        e.printStackTrace();
  -        // SOAPException must be handled here.
  -        return;
  -      }
  -      tout.flush();
  -      tout.close();
  -    }
  -    /*
  -     * End Transport-Hook-Extension
  -     */
  -
       // ship it out
       res.setStatus (status);
       res.setContentType (Constants.HEADERVAL_CONTENT_TYPE_UTF8);
  
  
  

Re: cvs commit: xml-soap/java/src/org/apache/soap/server/http MessageRouterServlet.java

Posted by Ryo Neyama <ne...@trl.ibm.co.jp>.
Wouter,

Thank you for the commit of your code.

I just tried the new code.
As for the request message, the hook extension worked well.
But, unfortunately, the hook didn't work for the response message.

As long as I saw your patch to the codebase, the hook to the response
message seems to be just pulled out(See the diff I attached).

Could you tell me how I can put my EnvelopeEditor to hook the response
messages?

Thanks in advance.

    Ryo Neyama @ IBM Research, Tokyo Research Laboratory
    Internet Technology
    neyama@trl.ibm.co.jp
    +81-46-215-4322 (Phone) / +81-46-273-7428 (FAX)

From: wcloeten@locus.apache.org
Subject: cvs commit: xml-soap/java/src/org/apache/soap/server/http MessageRouterServlet.java
Date: 29 Nov 2000 00:23:55 -0000

> wcloeten    00/11/28 16:23:55
> 
>   Modified:    java/src/org/apache/soap/server/http
>                         MessageRouterServlet.java
>   Log:
>   patch to fix build process even though MessageRouterServlet doesn't support MIME multipart yet
>   
>   Revision  Changes    Path
>   1.6       +4 -52     xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java
>   
>   Index: MessageRouterServlet.java
>   ===================================================================
>   RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- MessageRouterServlet.java	2000/11/15 13:38:32	1.5
>   +++ MessageRouterServlet.java	2000/11/29 00:23:54	1.6
(...snip...)
>   -    /*
>   -     * Begin Transport-Hook-Extension
>   -     */
>   -    // Translates response from server application with EnvelopeEditor
>   -    opt = System.getProperties().getProperty(TRANSPORT_HOOK_EXTENSION) ;
>   -    if (opt != null && editor != null) {
>   -      byte[] data = bytes.toByteArray();
>   -      in = new InputStreamReader(new ByteArrayInputStream(data));
>   -      bytes = new ByteArrayOutputStream();
>   -      Writer tout = new OutputStreamWriter(bytes);
>   -      try {
>   -        editor.editOutgoing(in, tout);
>   -      } catch (SOAPException e) {
>   -        e.printStackTrace();
>   -        // SOAPException must be handled here.
>   -        return;
>   -      }
>   -      tout.flush();
>   -      tout.close();
>   -    }
>   -    /*
>   -     * End Transport-Hook-Extension
>   -     */
>   -
>        // ship it out
>        res.setStatus (status);
>        res.setContentType (Constants.HEADERVAL_CONTENT_TYPE_UTF8);

Re: cvs commit: xml-soap/java/src/org/apache/soap/server/http MessageRouterServlet.java

Posted by Ryo Neyama <ne...@trl.ibm.co.jp>.
Wouter,

Thank you for the commit of your code.

I just tried the new code.
As for the request message, the hook extension worked well.
But, unfortunately, the hook didn't work for the response message.

As long as I saw your patch to the codebase, the hook to the response
message seems to be just pulled out(See the diff I attached).

Could you tell me how I can put my EnvelopeEditor to hook the response
messages?

Thanks in advance.

    Ryo Neyama @ IBM Research, Tokyo Research Laboratory
    Internet Technology
    neyama@trl.ibm.co.jp
    +81-46-215-4322 (Phone) / +81-46-273-7428 (FAX)

From: wcloeten@locus.apache.org
Subject: cvs commit: xml-soap/java/src/org/apache/soap/server/http MessageRouterServlet.java
Date: 29 Nov 2000 00:23:55 -0000

> wcloeten    00/11/28 16:23:55
> 
>   Modified:    java/src/org/apache/soap/server/http
>                         MessageRouterServlet.java
>   Log:
>   patch to fix build process even though MessageRouterServlet doesn't support MIME multipart yet
>   
>   Revision  Changes    Path
>   1.6       +4 -52     xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java
>   
>   Index: MessageRouterServlet.java
>   ===================================================================
>   RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- MessageRouterServlet.java	2000/11/15 13:38:32	1.5
>   +++ MessageRouterServlet.java	2000/11/29 00:23:54	1.6
(...snip...)
>   -    /*
>   -     * Begin Transport-Hook-Extension
>   -     */
>   -    // Translates response from server application with EnvelopeEditor
>   -    opt = System.getProperties().getProperty(TRANSPORT_HOOK_EXTENSION) ;
>   -    if (opt != null && editor != null) {
>   -      byte[] data = bytes.toByteArray();
>   -      in = new InputStreamReader(new ByteArrayInputStream(data));
>   -      bytes = new ByteArrayOutputStream();
>   -      Writer tout = new OutputStreamWriter(bytes);
>   -      try {
>   -        editor.editOutgoing(in, tout);
>   -      } catch (SOAPException e) {
>   -        e.printStackTrace();
>   -        // SOAPException must be handled here.
>   -        return;
>   -      }
>   -      tout.flush();
>   -      tout.close();
>   -    }
>   -    /*
>   -     * End Transport-Hook-Extension
>   -     */
>   -
>        // ship it out
>        res.setStatus (status);
>        res.setContentType (Constants.HEADERVAL_CONTENT_TYPE_UTF8);