Author: dandiep
Date: Thu Jul 26 16:42:40 2007
New Revision: 560032
URL: http://svn.apache.org/viewvc?view=rev&rev=560032
Log:
CXF-824: Pay attention to the SOAPAction and use it to select the right
operation!
Added:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
(with props)
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
- copied, changed from r559818,
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
(with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
(with props)
Removed:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java
Modified:
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapConstants.java
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
incubator/cxf/trunk/testutils/pom.xml
incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/customer/bare/CustomerService.java
Modified:
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java
(original)
+++
incubator/cxf/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/ClientTest.java
Thu Jul 26 16:42:40 2007
@@ -49,6 +49,7 @@
sf.getServiceFactory().setWrapped(false);
sf.setAddress("http://localhost:9001/foo/");
sf.setServiceBean(new CustomerService());
+ //sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
Map<String, Object> props = new HashMap<String, Object>();
props.put("contextMatchStrategy", "stem");
Modified:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Thu Jul 26 16:42:40 2007
@@ -19,11 +19,11 @@
package org.apache.cxf.binding.soap;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+
import javax.wsdl.BindingInput;
import javax.wsdl.BindingOutput;
import javax.wsdl.Definition;
@@ -47,7 +47,8 @@
import org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor;
import org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor;
import org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapActionOutInterceptor;
import org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor;
import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
@@ -332,8 +333,9 @@
if (!Boolean.TRUE.equals(binding.getProperty(DATABINDING_DISABLED))) {
sb.getInInterceptors().add(new AttachmentInInterceptor());
sb.getInInterceptors().add(new StaxInInterceptor());
-
- sb.getOutInterceptors().add(new SoapActionInterceptor());
+ sb.getInInterceptors().add(new SoapActionInInterceptor());
+
+ sb.getOutInterceptors().add(new SoapActionOutInterceptor());
sb.getOutInterceptors().add(new AttachmentOutInterceptor());
sb.getOutInterceptors().add(new StaxOutInterceptor());
Modified:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapConstants.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapConstants.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapConstants.java
(original)
+++
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapConstants.java
Thu Jul 26 16:42:40 2007
@@ -29,6 +29,6 @@
// public static final String STYLE_RPC = "rpc";
// public static final String STYLE_BARE = "bare";
// public static final String STYLE_WRAPPED = "wrapped";
- public static final String ACTION = "action";
+ public static final String SOAP_ACTION = "SOAPAction";
public static final String BINDING_ID = null;
}
Added:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java?view=auto&rev=560032
==============================================================================
---
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
(added)
+++
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
Thu Jul 26 16:42:40 2007
@@ -0,0 +1,102 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.binding.soap.interceptor;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.model.SoapOperationInfo;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+public class SoapActionInInterceptor extends AbstractSoapInterceptor {
+
+ public SoapActionInInterceptor() {
+ super(Phase.READ);
+ addAfter(ReadHeadersInterceptor.class.getName());
+ addAfter(EndpointSelectionInterceptor.class.getName());
+ }
+
+ public void handleMessage(SoapMessage message) throws Fault {
+ if (message.getVersion() instanceof Soap11) {
+ Map<String, List<String>> headers =
CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
+ if (headers != null) {
+ List<String> sa = headers.get("SOAPAction");
+ if (sa != null && sa.size() > 0) {
+ String action = sa.get(0);
+ if (action.startsWith("\"")) {
+ action = action.substring(1, action.length() - 1);
+ }
+ getAndSetOperation(message, action);
+ }
+ }
+ } else if (message.getVersion() instanceof Soap12) {
+ String ct = (String) message.get(Message.CONTENT_TYPE);
+
+ if (ct == null) {
+ return;
+ }
+
+ int start = ct.indexOf("action=");
+ if (start != -1) {
+ int end;
+ if (ct.charAt(start + 7) == '\"') {
+ start += 8;
+ end = ct.indexOf('\"', start);
+ } else {
+ start += 7;
+ end = ct.indexOf(';', start);
+ if (end == -1) {
+ end = ct.length();
+ }
+ }
+
+ getAndSetOperation(message, ct.substring(start, end));
+ }
+ }
+ }
+
+ private void getAndSetOperation(SoapMessage message, String action) {
+ if ("".equals(action)) {
+ return;
+ }
+
+ Exchange ex = message.getExchange();
+ Endpoint ep = ex.get(Endpoint.class);
+
+ Collection<BindingOperationInfo> bops =
ep.getBinding().getBindingInfo().getOperations();
+ for (BindingOperationInfo boi : bops) {
+ SoapOperationInfo soi = (SoapOperationInfo)
boi.getExtensor(SoapOperationInfo.class);
+ if (soi != null && soi.getAction().equals(action)) {
+ ex.put(BindingOperationInfo.class, boi);
+ }
+ }
+ }
+
+}
Propchange:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
------------------------------------------------------------------------------
svn:executable = *
Propchange:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied:
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
(from r559818,
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java)
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java?view=diff&rev=560032&p1=incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java&r1=559818&p2=incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java
(original)
+++
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
Thu Jul 26 16:42:40 2007
@@ -26,6 +26,7 @@
import org.apache.cxf.binding.soap.Soap11;
import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapConstants;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.model.SoapOperationInfo;
import org.apache.cxf.helpers.CastUtils;
@@ -34,9 +35,9 @@
import org.apache.cxf.phase.Phase;
import org.apache.cxf.service.model.BindingOperationInfo;
-public class SoapActionInterceptor extends AbstractSoapInterceptor {
+public class SoapActionOutInterceptor extends AbstractSoapInterceptor {
- public SoapActionInterceptor() {
+ public SoapActionOutInterceptor() {
super(Phase.POST_LOGICAL);
}
@@ -54,17 +55,7 @@
boi = boi.getWrappedOperation();
}
- String action = null;
- if (boi == null) {
- action = "\"\"";
- } else {
- SoapOperationInfo soi = (SoapOperationInfo)
boi.getExtensor(SoapOperationInfo.class);
- action = soi == null ? "\"\"" : soi.getAction() == null ? "\"\"" :
soi.getAction();
- if (!action.startsWith("\"")) {
- action = new
StringBuffer().append("\"").append(action).append("\"").toString();
- }
-
- }
+ String action = getSoapAction(message, boi);
if (message.getVersion() instanceof Soap11) {
Map<String, List<String>> reqHeaders =
CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
@@ -88,6 +79,26 @@
message.put(Message.CONTENT_TYPE, ct);
}
}
+ }
+
+ private String getSoapAction(SoapMessage message, BindingOperationInfo
boi) {
+ // allow an interceptor to override the SOAPAction if need be
+ String action = (String) message.get(SoapConstants.SOAP_ACTION);
+
+ // Fall back on the SOAPAction in the operation info
+ if (action == null) {
+ if (boi == null) {
+ action = "\"\"";
+ } else {
+ SoapOperationInfo soi = (SoapOperationInfo)
boi.getExtensor(SoapOperationInfo.class);
+ action = soi == null ? "\"\"" : soi.getAction() == null ?
"\"\"" : soi.getAction();
+ if (!action.startsWith("\"")) {
+ action = new
StringBuffer().append("\"").append(action).append("\"").toString();
+ }
+ }
+ }
+
+ return action;
}
}
Modified:
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
(original)
+++
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
Thu Jul 26 16:42:40 2007
@@ -24,7 +24,7 @@
import javax.xml.namespace.QName;
-import org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapActionOutInterceptor;
import org.apache.cxf.binding.soap.model.SoapOperationInfo;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.message.ExchangeImpl;
@@ -42,7 +42,7 @@
@Test
public void testSoapAction() throws Exception {
- SoapActionInterceptor i = new SoapActionInterceptor();
+ SoapActionOutInterceptor i = new SoapActionOutInterceptor();
Message message = new MessageImpl();
message.setExchange(new ExchangeImpl());
@@ -53,7 +53,7 @@
assertTrue(message instanceof SoapMessage);
SoapMessage soapMessage = (SoapMessage) message;
assertEquals(Soap11.getInstance(), soapMessage.getVersion());
- (new SoapActionInterceptor()).handleMessage(soapMessage);
+ (new SoapActionOutInterceptor()).handleMessage(soapMessage);
Map<String, List<String>> reqHeaders =
CastUtils.cast((Map)soapMessage.get(Message.PROTOCOL_HEADERS));
assertNotNull(reqHeaders);
assertEquals("\"\"", reqHeaders.get("SOAPAction").get(0));
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
Thu Jul 26 16:42:40 2007
@@ -38,7 +38,7 @@
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
-import org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapActionOutInterceptor;
import org.apache.cxf.binding.soap.interceptor.SoapInterceptor;
import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
@@ -191,7 +191,7 @@
// well for outbound case, as many outbound interceptors
// have their ending interceptors.
// For example, we can not skip MessageSenderInterceptor.
- chain.doInterceptStartingAfter(responseMsg,
SoapActionInterceptor.class.getName());
+ chain.doInterceptStartingAfter(responseMsg,
SoapActionOutInterceptor.class.getName());
}
} else {
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Thu Jul 26 16:42:40 2007
@@ -27,6 +27,7 @@
import javax.xml.namespace.QName;
import org.apache.cxf.Bus;
+import org.apache.cxf.binding.BindingConfiguration;
import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.databinding.DataBinding;
import org.apache.cxf.endpoint.Client;
@@ -231,5 +232,12 @@
public void setDataBinding(DataBinding dataBinding) {
this.dataBinding = dataBinding;
}
+
+ public void setBindingConfig(BindingConfiguration config) {
+ getClientFactoryBean().setBindingConfig(config);
+ }
+ public BindingConfiguration getBindingConfig() {
+ return getClientFactoryBean().getBindingConfig();
+ }
}
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java?view=auto&rev=560032
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
Thu Jul 26 16:42:40 2007
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.soap;
+
+import javax.jws.WebService;
+
+import org.apache.hello_world_soap_action.Greeter;
+
[EMAIL PROTECTED](endpointInterface =
"org.apache.hello_world_soap_action.Greeter",
+ serviceName = "SOAPService")
+public class SoapActionGreeterImpl implements Greeter {
+
+ public String sayHi(String in) {
+ return "sayHi";
+ }
+
+ public String sayHi2(String in) {
+ return "sayHi2";
+ }
+
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
------------------------------------------------------------------------------
svn:executable = *
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionGreeterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java?view=auto&rev=560032
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
Thu Jul 26 16:42:40 2007
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.soap;
+
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapBindingConfiguration;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.hello_world_soap_action.Greeter;
+import org.junit.Test;
+
+public class SoapActionTest extends AbstractCXFTest {
+
+
+ @Test
+ public void testEndpoint() throws Exception {
+ String add = "http://localhost:8080/test";
+ JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+ sf.setServiceBean(new SoapActionGreeterImpl());
+ sf.setAddress(add);
+ sf.setBus(getBus());
+ sf.create();
+
+ JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
+ pf.setServiceClass(Greeter.class);
+ pf.setAddress(add);
+ pf.setBus(getBus());
+ Greeter greeter = (Greeter) pf.create();
+
+ assertEquals("sayHi", greeter.sayHi("test"));
+ assertEquals("sayHi2", greeter.sayHi2("test"));
+
+ }
+
+ @Test
+ public void testSoap12Endpoint() throws Exception {
+ String add = "http://localhost:8080/test";
+ JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+ sf.setServiceBean(new SoapActionGreeterImpl());
+ sf.setAddress(add);
+ sf.setBus(getBus());
+ SoapBindingConfiguration config = new SoapBindingConfiguration();
+ config.setVersion(Soap12.getInstance());
+ sf.setBindingConfig(config);
+ sf.create();
+
+ JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
+ pf.setServiceClass(Greeter.class);
+ pf.setAddress(add);
+ pf.setBindingConfig(config);
+ pf.setBus(getBus());
+
+ Greeter greeter = (Greeter) pf.create();
+
+ assertEquals("sayHi", greeter.sayHi("test"));
+ assertEquals("sayHi2", greeter.sayHi2("test"));
+ }
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
------------------------------------------------------------------------------
svn:executable = *
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap/SoapActionTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/testutils/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/pom.xml?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
--- incubator/cxf/trunk/testutils/pom.xml (original)
+++ incubator/cxf/trunk/testutils/pom.xml Thu Jul 26 16:42:40 2007
@@ -227,6 +227,9 @@
<wsdl>${basedir}/src/main/resources/wsdl/hello_world_doc_lit.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
+
<wsdl>${basedir}/src/main/resources/wsdl/hello_world_soap_action.wsdl</wsdl>
+ </wsdlOption>
+ <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/doc_lit_bare.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
Modified:
incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/customer/bare/CustomerService.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/customer/bare/CustomerService.java?view=diff&rev=560032&r1=560031&r2=560032
==============================================================================
---
incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/customer/bare/CustomerService.java
(original)
+++
incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/customer/bare/CustomerService.java
Thu Jul 26 16:42:40 2007
@@ -80,14 +80,14 @@
return c;
}
- @Get
- @HttpResource(location = "/customers/details/{id}")
- @WebMethod
- public String getSomeDetails(@WebParam(name = "GetCustomer") GetCustomer
getCustomer)
- throws CustomerNotFoundFault {
- return "some details";
- }
-
+// @Get
+// @HttpResource(location = "/customers/details/{id}")
+// @WebMethod
+// public String getSomeDetails(@WebParam(name = "GetCustomer") GetCustomer
getCustomer)
+// throws CustomerNotFoundFault {
+// return "some details";
+// }
+//
@Put
@HttpResource(location = "/customers/{id}")
@WebMethod