[jboss-svn-commits] JBL Code SVN: r21257 - in labs/jbossesb/trunk/product: services/soap/src/main/java/org/jboss/soa/esb/actions/soap and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 28 09:52:45 EDT 2008


Author: kevin.conner at jboss.com
Date: 2008-07-28 09:52:44 -0400 (Mon, 28 Jul 2008)
New Revision: 21257

Added:
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletResponse.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletContext.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletInputStream.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletOutputStream.java
Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
Log:
Support multipart messages/attachments: JBESB-1528

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java	2008-07-28 11:30:53 UTC (rev 21256)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -116,6 +116,26 @@
         //boolean isError = isErrorReturn(metadata);
         //if(isBinary || isError)
 
+        if (metadata != null) {
+            Object value = metadata.get("Content-Type");
+            if (value == null) {
+                value = metadata.get("content-type");
+            }
+            if (value != null) {
+                if (value instanceof List) {
+                    List valueList = (List) value;
+                    if (valueList != null && valueList.size() > 0) {
+                        value = valueList.get(0);
+                    }
+                }
+                final String contentType = (String)value ;
+                if (contentType.startsWith("multipart/"))
+                {
+                    return totalByteArray ;
+                }
+            }
+        }
+        
         try {
             ret = new String(totalByteArray);
         }

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java	2008-07-28 11:30:53 UTC (rev 21256)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -19,31 +19,37 @@
  */
 package org.jboss.soa.esb.actions.soap;
 
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
 import org.jboss.internal.soa.esb.publish.Publish;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
 import org.jboss.soa.esb.actions.ActionProcessingException;
 import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorHttpServletRequest;
+import org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorHttpServletResponse;
+import org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorServletContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.MessagePayloadProxy;
+import org.jboss.soa.esb.message.Properties;
 import org.jboss.soa.esb.message.ResponseHeader;
 import org.jboss.soa.esb.message.body.content.BytesBody;
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
 import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.InvocationContext;
 import org.jboss.wsf.spi.invocation.RequestHandler;
 import org.jboss.wsf.spi.management.EndpointRegistry;
 import org.jboss.wsf.spi.management.EndpointRegistryFactory;
 
-import javax.management.ObjectName;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Set;
-
 /**
  * JBoss Webservices SOAP Processor.
  * <p/>
@@ -133,7 +139,6 @@
     public Message process(Message message) throws ActionProcessingException {
         Endpoint endpoint = getServiceEndpoint(jbossws_endpoint);
         byte[] soapMessage;
-        String response = null;
 
         if(endpoint == null) {
             throw new ActionProcessingException("Unknown Service Endpoint '" + jbossws_endpoint + "'.");
@@ -144,34 +149,93 @@
             messageTL.set(message);
 
             RequestHandler requestHandler = endpoint.getRequestHandler();
-            InvocationContext invocationContext = new InvocationContext();
-            ByteArrayOutputStream os = new ByteArrayOutputStream();
 
-            requestHandler.handleRequest(endpoint, new ByteArrayInputStream(soapMessage), os, invocationContext);
-
-            Object contentType = message.getProperties().getProperty("Content-Type");
-            if(!(contentType instanceof ResponseHeader)) {
-                message.getProperties().setProperty("Content-Type", new ResponseHeader("Content-Type", "text/xml"));
+            final Map<String, List<String>> headers = new HashMap<String, List<String>>() ;
+            final Properties properties = message.getProperties() ;
+            final String[] names = properties.getNames() ;
+            for(final String name: names)
+            {
+                final Object value = properties.getProperty(name) ;
+                if (value != null)
+                {
+                    final String normalisedName = name.toLowerCase() ;
+                    final List<String> values = headers.get(normalisedName) ;
+                    if (values == null)
+                    {
+                        final List<String> newValues = new ArrayList<String>() ;
+                        newValues.add(value.toString()) ;
+                        headers.put(normalisedName, newValues) ;
+                    }
+                    else
+                    {
+                        values.add(value.toString()) ;
+                    }
+                }
             }
-
-            response = new String(os.toByteArray()).trim();
+            
+            final String requestContentType = getHeaderValue(headers, "content-type") ;
+            if ("application/octet-stream".equals(requestContentType))
+            {
+                headers.remove("content-type") ;
+            }
+            final String path = getHeaderValue(headers, "path") ;
+            final SOAPProcessorHttpServletRequest servletRequest = new SOAPProcessorHttpServletRequest(path, soapMessage, headers) ;
+            final SOAPProcessorHttpServletResponse servletResponse = new SOAPProcessorHttpServletResponse() ;
+            final SOAPProcessorServletContext servletContext = new SOAPProcessorServletContext() ;
+            requestHandler.handleHttpRequest(endpoint, servletRequest, servletResponse, servletContext) ;
+            
+            // This may have been changed, make sure we get the current version.
+            message = messageTL.get();
+            final Properties responseProperties = message.getProperties() ;
+            final String contentType = servletResponse.getContentType() ;
+            final Map<String, List<String>> responseHeaders = servletResponse.getHeaders() ;
+            // We deal with Content-Type below
+            // HTTP Headers *should* be case-insensitive but not with JBR
+            responseHeaders.remove("content-type") ;
+           
+            for(Map.Entry<String, List<String>> header: responseHeaders.entrySet())
+            {
+                // We can only deal with the first value in the list.
+                responseProperties.setProperty(header.getKey(), new ResponseHeader(header.getKey(), header.getValue().get(0))) ;
+            }
+            
+            final byte[] responseData = servletResponse.getContent() ;
+            if(contentType != null) {
+                responseProperties.setProperty("Content-Type", new ResponseHeader("Content-Type", contentType));
+            } else {
+                responseProperties.setProperty("Content-Type", new ResponseHeader("Content-Type", "text/xml"));
+            }
+            
+            if ((contentType != null) && contentType.startsWith("multipart/")) {
+                payloadProxy.setPayload(message, responseData) ;
+            } else {
+                final String charset = servletResponse.getCharset() ;
+                if (charset == null) {
+                    payloadProxy.setPayload(message, new String(responseData)) ;
+                } else {
+                    payloadProxy.setPayload(message, new String(responseData, charset)) ;
+                }
+            }
         } catch (Exception ex) {
             throw new ActionProcessingException("Cannot process SOAP request", ex);
         } finally {
-            // Get the message instance set on the Threadlocal before removing it.  The Webservice endpoint
-            // may have reset it with a new Message instance.
-            message = messageTL.get();
             messageTL.remove();
-            try {
-                payloadProxy.setPayload(message, response);
-            } catch (MessageDeliverException e) {
-                throw new ActionProcessingException(e);
-            }
         }
 
         return message;
     }
 
+    private String getHeaderValue(final Map<String, List<String>> headers,
+            final String header)
+    {
+        final List<String> values = headers.get(header) ;
+        if (values != null)
+        {
+            return values.get(0) ;
+        }
+        return null ;
+    }
+
     private byte[] getSOAPMessagePayload(Message message) throws ActionProcessingException {
         byte[] soapMessage;
         Object messagePayload;

Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -0,0 +1,324 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.soap.adapter;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+/**
+ * This is an adapter used when integrating with JBossWS.
+ *  
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class SOAPProcessorHttpServletRequest implements HttpServletRequest
+{
+    private final Map<String, List<String>> headers ;
+    
+    private final byte[] content ;
+    
+    private final String path ;
+    
+    public SOAPProcessorHttpServletRequest(final String path, final byte[] content, final Map<String, List<String>> headers)
+    {
+        this.path = path ;
+        this.content = content ;
+        this.headers = headers ;
+    }
+
+    public String getHeader(final String name)
+    {
+        final List<String> values = headers.get(name) ;
+        if (values != null)
+        {
+            return values.get(0) ;
+        }
+        return null ;
+    }
+
+    public Enumeration getHeaderNames()
+    {
+        return Collections.enumeration(headers.keySet()) ;
+    }
+
+    public String getMethod()
+    {
+        // always use POST
+        return "POST" ;
+    }
+
+    public String getPathInfo()
+    {
+        return null ;
+    }
+
+    public String getQueryString()
+    {
+        return null ;
+    }
+
+    public String getRequestURI()
+    {
+        return (path == null ? "/" : path) ;
+    }
+    
+    public String getContextPath()
+    {
+        return "" ;
+    }
+
+    public HttpSession getSession(boolean arg0)
+    {
+        return null ;
+    }
+
+    public String getContentType()
+    {
+        return getHeader("Content-Type") ;
+    }
+
+    public ServletInputStream getInputStream() throws IOException
+    {
+        return new SOAPProcessorServletInputStream(new ByteArrayInputStream(content)) ;
+    }
+
+    public String getParameter(final String name)
+    {
+        return null ;
+    }
+
+    public Principal getUserPrincipal()
+    {
+        // TODO link this is with security
+        return null ;
+    }
+
+    public boolean isUserInRole(final String name)
+    {
+        // TODO link this is with security
+        return false ;
+    }
+
+    /*
+     * The following methods are not supported by this adapter.
+     */
+
+    public StringBuffer getRequestURL()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+    
+    public String getAuthType()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Cookie[] getCookies()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public long getDateHeader(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getHeaders(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public int getIntHeader(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getPathTranslated()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getRemoteUser()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getRequestedSessionId()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getServletPath()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public HttpSession getSession()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean isRequestedSessionIdFromCookie()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean isRequestedSessionIdFromURL()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean isRequestedSessionIdFromUrl()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean isRequestedSessionIdValid()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getAttributeNames()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getCharacterEncoding()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public int getContentLength()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Locale getLocale()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getLocales()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Map getParameterMap()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getParameterNames()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String[] getParameterValues(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getProtocol()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public BufferedReader getReader() throws IOException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getRealPath(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getRemoteAddr()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getRemoteHost()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public RequestDispatcher getRequestDispatcher(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getScheme()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getServerName()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public int getServerPort()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean isSecure()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void removeAttribute(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setAttribute(String arg0, Object arg1)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setCharacterEncoding(String arg0)
+            throws UnsupportedEncodingException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Object getAttribute(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletRequest.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletResponse.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletResponse.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletResponse.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -0,0 +1,291 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.soap.adapter;
+
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * This is an adapter used when integrating with JBossWS.
+ *  
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class SOAPProcessorHttpServletResponse implements HttpServletResponse
+{
+    private static final String CHARSET = "charset=" ;
+    
+    private Map<String, List<String>> headers = new HashMap<String, List<String>>() ;
+    
+    private int status ;
+    
+    private ByteArrayOutputStream baos ;
+    
+    private boolean streamReturned ;
+    
+    public SOAPProcessorHttpServletResponse()
+    {
+        baos = new ByteArrayOutputStream() ;
+    }
+
+    public void addHeader(final String name, final String value)
+    {
+        final String normalisedName = name.toLowerCase() ;
+        final List<String> values = headers.get(normalisedName) ;
+        if (values != null)
+        {
+            values.add(value) ;
+        }
+        else
+        {
+            final List<String> newValues = new ArrayList<String>() ;
+            newValues.add(value) ;
+            headers.put(normalisedName, newValues) ;
+        }
+    }
+
+    public void setHeader(final String name, final String value)
+    {
+        final List<String> values = new ArrayList<String>() ;
+        values.add(value) ;
+        headers.put(name.toLowerCase(), values) ;
+    }
+
+    public void setStatus(final int status)
+    {
+        this.status = status ;
+    }
+
+    public ServletOutputStream getOutputStream() throws IOException
+    {
+        if (streamReturned)
+        {
+            throw new IOException("Output stream already accessed") ;
+        }
+        streamReturned = true ;
+        return new SOAPProcessorServletOutputStream(baos) ;
+    }
+
+    public PrintWriter getWriter() throws IOException
+    {
+        if (streamReturned)
+        {
+            throw new IOException("Output stream already accessed") ;
+        }
+        streamReturned = true ;
+        final String charset = getCharset() ;
+        final OutputStreamWriter osw = (charset != null ? new OutputStreamWriter(baos, charset) : new OutputStreamWriter(baos)) ;
+        return new PrintWriter(new BufferedWriter(osw)) ;
+    }
+
+    public void setContentType(final String contentType)
+    {
+        setHeader("content-type", contentType) ;
+    }
+    
+    public int getStatus()
+    {
+        return status ;
+    }
+    
+    public Map<String, List<String>> getHeaders()
+    {
+        return headers ;
+    }
+    
+    public byte[] getContent()
+    {
+        return baos.toByteArray() ;
+    }
+    
+    public String getContentType()
+    {
+        final List<String> values = headers.get("content-type") ;
+        if (values != null)
+        {
+            return values.get(0) ;
+        }
+        return null ;
+    }
+    
+    public String getCharset()
+    {
+        final String contentType = getContentType() ;
+        if (contentType != null)
+        {
+            final int index = contentType.indexOf(CHARSET) ;
+            if (index >= 0)
+            {
+                final int beginIndex = index + CHARSET.length() ;
+                if (beginIndex < contentType.length())
+                {
+                    final int endIndex = contentType.indexOf(';', beginIndex) ;
+                    if (endIndex >= 0)
+                    {
+                        return contentType.substring(beginIndex, endIndex).trim() ;
+                    }
+                    else
+                    {
+                        return contentType.substring(beginIndex).trim();
+                    }
+                }
+            }
+        }
+        return null ;
+    }
+    
+    /*
+     * The following methods are not supported by this adapter.
+     */
+    
+    public void addCookie(Cookie arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void addDateHeader(String arg0, long arg1)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void addIntHeader(String arg0, int arg1)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean containsHeader(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String encodeRedirectURL(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String encodeRedirectUrl(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String encodeURL(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String encodeUrl(String arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void sendError(int arg0) throws IOException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void sendError(int arg0, String arg1) throws IOException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void sendRedirect(String arg0) throws IOException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setDateHeader(String arg0, long arg1)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setIntHeader(String arg0, int arg1)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setStatus(int arg0, String arg1)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void flushBuffer() throws IOException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public int getBufferSize()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getCharacterEncoding()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Locale getLocale()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public boolean isCommitted()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void reset()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void resetBuffer()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setBufferSize(int arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setContentLength(int arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setLocale(Locale arg0)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorHttpServletResponse.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletContext.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletContext.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletContext.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -0,0 +1,164 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.soap.adapter;
+
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+/**
+ * This is an adapter used when integrating with JBossWS.
+ *  
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class SOAPProcessorServletContext implements ServletContext
+{
+    public Object getAttribute(final String name)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getAttributeNames()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public ServletContext getContext(final  String name)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getInitParameter(final String param)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getInitParameterNames()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public int getMajorVersion()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public int getMinorVersion()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getMimeType(final String file)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public RequestDispatcher getNamedDispatcher(final String name)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getRealPath(final String path)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public RequestDispatcher getRequestDispatcher(final String path)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public URL getResource(final String path)
+        throws MalformedURLException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public InputStream getResourceAsStream(final String path)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Set getResourcePaths(final String path)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getServerInfo()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Servlet getServlet(final String name)
+        throws ServletException
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public String getServletContextName()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getServletNames()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public Enumeration getServlets()
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void log(final String msg)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void log(final Exception ex, final String msg)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void log(final String msg, final Throwable th)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void removeAttribute(final String name)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+
+    public void setAttribute(final String name, final Object value)
+    {
+        throw new UnsupportedOperationException("Not yet supported") ;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletContext.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletInputStream.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletInputStream.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletInputStream.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.soap.adapter;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.servlet.ServletInputStream;
+
+/**
+ * This is an adapter used when integrating with JBossWS.
+ *  
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class SOAPProcessorServletInputStream extends ServletInputStream
+{
+    private final InputStream is ;
+    
+    SOAPProcessorServletInputStream(final InputStream is)
+    {
+        this.is = is ;
+    }
+
+    @Override
+    public int read() throws IOException
+    {
+        return is.read() ;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletInputStream.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native

Added: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletOutputStream.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletOutputStream.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletOutputStream.java	2008-07-28 13:52:44 UTC (rev 21257)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.soap.adapter;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.servlet.ServletOutputStream;
+
+/**
+ * This is an adapter used when integrating with JBossWS.
+ *  
+ * @author <a href="mailto:kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class SOAPProcessorServletOutputStream extends ServletOutputStream
+{
+    private final OutputStream os ;
+    
+    SOAPProcessorServletOutputStream(final OutputStream os)
+    {
+        this.os = os ;
+    }
+    
+    @Override
+    public void write(final int byteVal)
+        throws IOException
+    {
+        os.write(byteVal) ;
+    }
+}


Property changes on: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/adapter/SOAPProcessorServletOutputStream.java
___________________________________________________________________
Name: svn:keywords
   + Rev Date
Name: svn:eol-style
   + native




More information about the jboss-svn-commits mailing list