Author: chris.laprun(a)jboss.com
Date: 2010-01-14 07:30:58 -0500 (Thu, 14 Jan 2010)
New Revision: 1288
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java
Log:
- Supposedly, disable chunked encoding for better interoperability. Doesn't seem to
work at the moment, though. :/
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java 2010-01-14
12:14:41 UTC (rev 1287)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/SOAPServiceFactory.java 2010-01-14
12:30:58 UTC (rev 1288)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, 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.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, 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.gatein.wsrp.services;
@@ -58,6 +59,7 @@
private boolean failed;
private boolean available;
private int msBeforeTimeOut = DEFAULT_TIMEOUT_MS;
+ private static final String JBOSS_WS_STUBEXT_PROPERTY_CHUNKED_ENCODING_SIZE =
"http://org.jboss.ws/http#chunksize";
public <T> T getService(Class<T> clazz) throws Exception
{
@@ -100,8 +102,15 @@
if (portAddress != null)
{
log.debug("Setting the end point to: " + portAddress);
-
((BindingProvider)service).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
portAddress);
+ Map<String, Object> requestContext =
((BindingProvider)service).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, portAddress);
+ // Set org.jboss.ws.core.StubExt.PROPERTY_CHUNKED_ENCODING_SIZE to 0 to
deactive chunked encoding for
+ // better interoperability as Oracle's producer doesn't support it,
for example.
+ // See
https://jira.jboss.org/jira/browse/JBWS-2884 and
+ //
http://community.jboss.org/wiki/JBossWS-NativeUserGuide#Chunked_encoding_...
+ requestContext.put(JBOSS_WS_STUBEXT_PROPERTY_CHUNKED_ENCODING_SIZE, 0);
+
T result = ServiceWrapper.getServiceWrapper(clazz, service, this);
// if we managed to retrieve a service, we're probably available