Author: veithen
Date: Mon Jun 23 16:22:55 2014
New Revision: 1604850
URL: http://svn.apache.org/r1604850
Log:
AXIOM-447: Add SOAP version specific SoapBody and SoapFault implementations.
Added:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11BodyImpl.java
- copied, changed from r1603296,
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11FaultImpl.java
(with props)
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12BodyImpl.java
- copied, changed from r1603296,
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12FaultImpl.java
(with props)
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapFaultImpl.java
(with props)
Modified:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapEnvelopeImpl.java
Copied:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11BodyImpl.java
(from r1603296,
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java)
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11BodyImpl.java?p2=webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11BodyImpl.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java&r1=1603296&r2=1604850&rev=1604850&view=diff
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
(original)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11BodyImpl.java
Mon Jun 23 16:22:55 2014
@@ -20,63 +20,46 @@ package org.apache.axiom.spring.ws.soap;
import java.util.Locale;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
+import javax.xml.namespace.QName;
import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.spring.ws.SourceExtractionStrategy;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.ws.soap.SoapBody;
-import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapFaultException;
+import org.springframework.ws.soap.soap11.Soap11Body;
+import org.springframework.ws.soap.soap11.Soap11Fault;
-final class SoapBodyImpl extends SoapElementImpl<SOAPBody> implements SoapBody
{
- private static final Log log = LogFactory.getLog(SoapBodyImpl.class);
-
- SoapBodyImpl(SoapMessageImpl message, SOAPBody axiomNode) {
+final class Soap11BodyImpl extends SoapBodyImpl implements Soap11Body {
+ Soap11BodyImpl(SoapMessageImpl message, SOAPBody axiomNode) {
super(message, axiomNode);
}
- public Source getPayloadSource() {
- SourceExtractionStrategy strategy = getSourceExtractionStrategy();
- if (log.isDebugEnabled()) {
- log.debug("Returning payload using strategy " + strategy);
- }
- return strategy.getSource(axiomNode.getFirstElement());
- }
-
- public Result getPayloadResult() {
- // TODO: clear content first?
- return axiomNode.getSAXResult();
- }
-
- public SoapFault addMustUnderstandFault(String faultStringOrReason, Locale
locale) throws SoapFaultException {
+ public Soap11Fault getFault() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public SoapFault addClientOrSenderFault(String faultStringOrReason, Locale
locale) throws SoapFaultException {
+ public Soap11Fault addMustUnderstandFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public SoapFault addServerOrReceiverFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
+ public Soap11Fault addClientOrSenderFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public SoapFault addVersionMismatchFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
+ public Soap11Fault addServerOrReceiverFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public boolean hasFault() {
- return axiomNode.hasFault();
+ public Soap11Fault addVersionMismatchFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
}
- public SoapFault getFault() {
- // TODO Auto-generated method stub
+ @Override
+ public Soap11Fault addFault(QName faultCode, String faultString, Locale
faultStringLocale) throws SoapFaultException {
+ // TODO
throw new UnsupportedOperationException();
}
}
Added:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11FaultImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11FaultImpl.java?rev=1604850&view=auto
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11FaultImpl.java
(added)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11FaultImpl.java
Mon Jun 23 16:22:55 2014
@@ -0,0 +1,36 @@
+/*
+ * 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.axiom.spring.ws.soap;
+
+import java.util.Locale;
+
+import org.apache.axiom.soap.SOAPFault;
+import org.springframework.ws.soap.soap11.Soap11Fault;
+
+final class Soap11FaultImpl extends SoapFaultImpl implements Soap11Fault {
+ Soap11FaultImpl(SoapMessageImpl message, SOAPFault axiomNode) {
+ super(message, axiomNode);
+ }
+
+ @Override
+ public Locale getFaultStringLocale() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+}
Propchange:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap11FaultImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12BodyImpl.java
(from r1603296,
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java)
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12BodyImpl.java?p2=webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12BodyImpl.java&p1=webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java&r1=1603296&r2=1604850&rev=1604850&view=diff
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
(original)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12BodyImpl.java
Mon Jun 23 16:22:55 2014
@@ -20,63 +20,46 @@ package org.apache.axiom.spring.ws.soap;
import java.util.Locale;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
+import javax.xml.namespace.QName;
import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.spring.ws.SourceExtractionStrategy;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.ws.soap.SoapBody;
-import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapFaultException;
+import org.springframework.ws.soap.soap12.Soap12Body;
+import org.springframework.ws.soap.soap12.Soap12Fault;
-final class SoapBodyImpl extends SoapElementImpl<SOAPBody> implements SoapBody
{
- private static final Log log = LogFactory.getLog(SoapBodyImpl.class);
-
- SoapBodyImpl(SoapMessageImpl message, SOAPBody axiomNode) {
+final class Soap12BodyImpl extends SoapBodyImpl implements Soap12Body {
+ Soap12BodyImpl(SoapMessageImpl message, SOAPBody axiomNode) {
super(message, axiomNode);
}
- public Source getPayloadSource() {
- SourceExtractionStrategy strategy = getSourceExtractionStrategy();
- if (log.isDebugEnabled()) {
- log.debug("Returning payload using strategy " + strategy);
- }
- return strategy.getSource(axiomNode.getFirstElement());
- }
-
- public Result getPayloadResult() {
- // TODO: clear content first?
- return axiomNode.getSAXResult();
- }
-
- public SoapFault addMustUnderstandFault(String faultStringOrReason, Locale
locale) throws SoapFaultException {
+ public Soap12Fault getFault() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public SoapFault addClientOrSenderFault(String faultStringOrReason, Locale
locale) throws SoapFaultException {
+ public Soap12Fault addMustUnderstandFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public SoapFault addServerOrReceiverFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
+ public Soap12Fault addClientOrSenderFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public SoapFault addVersionMismatchFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
+ public Soap12Fault addServerOrReceiverFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
- public boolean hasFault() {
- return axiomNode.hasFault();
+ public Soap12Fault addVersionMismatchFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
}
- public SoapFault getFault() {
- // TODO Auto-generated method stub
+ @Override
+ public Soap12Fault addDataEncodingUnknownFault(QName[] subcodes, String
reason, Locale locale) throws SoapFaultException {
+ // TODO
throw new UnsupportedOperationException();
}
}
Added:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12FaultImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12FaultImpl.java?rev=1604850&view=auto
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12FaultImpl.java
(added)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12FaultImpl.java
Mon Jun 23 16:22:55 2014
@@ -0,0 +1,69 @@
+/*
+ * 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.axiom.spring.ws.soap;
+
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.soap.SOAPFault;
+import org.springframework.ws.soap.soap12.Soap12Fault;
+
+public class Soap12FaultImpl extends SoapFaultImpl implements Soap12Fault {
+ Soap12FaultImpl(SoapMessageImpl message, SOAPFault axiomNode) {
+ super(message, axiomNode);
+ }
+
+ @Override
+ public Iterator<QName> getFaultSubcodes() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void addFaultSubcode(QName subcode) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getFaultNode() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setFaultNode(String uri) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setFaultReasonText(Locale locale, String text) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getFaultReasonText(Locale locale) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+}
Propchange:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/Soap12FaultImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java?rev=1604850&r1=1604849&r2=1604850&view=diff
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
(original)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapBodyImpl.java
Mon Jun 23 16:22:55 2014
@@ -18,8 +18,6 @@
*/
package org.apache.axiom.spring.ws.soap;
-import java.util.Locale;
-
import javax.xml.transform.Result;
import javax.xml.transform.Source;
@@ -28,17 +26,15 @@ import org.apache.axiom.spring.ws.Source
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.ws.soap.SoapBody;
-import org.springframework.ws.soap.SoapFault;
-import org.springframework.ws.soap.SoapFaultException;
-final class SoapBodyImpl extends SoapElementImpl<SOAPBody> implements SoapBody
{
+abstract class SoapBodyImpl extends SoapElementImpl<SOAPBody> implements
SoapBody {
private static final Log log = LogFactory.getLog(SoapBodyImpl.class);
SoapBodyImpl(SoapMessageImpl message, SOAPBody axiomNode) {
super(message, axiomNode);
}
- public Source getPayloadSource() {
+ public final Source getPayloadSource() {
SourceExtractionStrategy strategy = getSourceExtractionStrategy();
if (log.isDebugEnabled()) {
log.debug("Returning payload using strategy " + strategy);
@@ -46,37 +42,12 @@ final class SoapBodyImpl extends SoapEle
return strategy.getSource(axiomNode.getFirstElement());
}
- public Result getPayloadResult() {
+ public final Result getPayloadResult() {
// TODO: clear content first?
return axiomNode.getSAXResult();
}
- public SoapFault addMustUnderstandFault(String faultStringOrReason, Locale
locale) throws SoapFaultException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException();
- }
-
- public SoapFault addClientOrSenderFault(String faultStringOrReason, Locale
locale) throws SoapFaultException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException();
- }
-
- public SoapFault addServerOrReceiverFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException();
- }
-
- public SoapFault addVersionMismatchFault(String faultStringOrReason,
Locale locale) throws SoapFaultException {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException();
- }
-
- public boolean hasFault() {
+ public final boolean hasFault() {
return axiomNode.hasFault();
}
-
- public SoapFault getFault() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException();
- }
}
Modified:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapEnvelopeImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapEnvelopeImpl.java?rev=1604850&r1=1604849&r2=1604850&view=diff
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapEnvelopeImpl.java
(original)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapEnvelopeImpl.java
Mon Jun 23 16:22:55 2014
@@ -64,7 +64,14 @@ final class SoapEnvelopeImpl extends Soa
public SoapBody getBody() throws SoapBodyException {
SOAPBody axiomBody = axiomNode.getBody();
if (body == null || body.axiomNode != axiomBody) {
- body = new SoapBodyImpl(getMessage(), axiomBody);
+ SOAPVersion soapVersion =
((SOAPFactory)axiomBody.getOMFactory()).getSOAPVersion();
+ if (soapVersion == SOAP11Version.getSingleton()) {
+ body = new Soap11BodyImpl(getMessage(), axiomBody);
+ } else if (soapVersion == SOAP12Version.getSingleton()) {
+ body = new Soap12BodyImpl(getMessage(), axiomBody);
+ } else {
+ throw new SoapEnvelopeException("Unrecognized SOAP version");
+ }
}
return body;
}
Added:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapFaultImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapFaultImpl.java?rev=1604850&view=auto
==============================================================================
---
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapFaultImpl.java
(added)
+++
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapFaultImpl.java
Mon Jun 23 16:22:55 2014
@@ -0,0 +1,67 @@
+/*
+ * 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.axiom.spring.ws.soap;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.soap.SOAPFault;
+import org.springframework.ws.soap.SoapFault;
+import org.springframework.ws.soap.SoapFaultDetail;
+
+abstract class SoapFaultImpl extends SoapElementImpl<SOAPFault> implements
SoapFault {
+ SoapFaultImpl(SoapMessageImpl message, SOAPFault axiomNode) {
+ super(message, axiomNode);
+ }
+
+ @Override
+ public QName getFaultCode() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getFaultStringOrReason() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getFaultActorOrRole() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setFaultActorOrRole(String faultActor) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SoapFaultDetail getFaultDetail() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public SoapFaultDetail addFaultDetail() {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+}
Propchange:
webservices/axiom/trunk/axiom-spring-ws/src/main/java/org/apache/axiom/spring/ws/soap/SoapFaultImpl.java
------------------------------------------------------------------------------
svn:eol-style = native