diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-12-13 14:12:38 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-12-13 14:12:38 +0000 |
commit | 699653d2ae2df1cec6af2915c90a6a7137a1c077 (patch) | |
tree | 86e5639772629c69a4e9637e682ede48b518b70b /sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org | |
parent | 438fd75ec9cb93740700d9a37c6ea133e1c997ed (diff) |
TUSCANY-3890 - separate the request wrapper model from the response wrapper model as per the change in 1.x under TUSCANY-2931.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1213702 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org')
-rw-r--r-- | sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java | 68 |
1 files changed, 20 insertions, 48 deletions
diff --git a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java index 275049c0fe..830258a8c0 100644 --- a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java +++ b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java @@ -219,10 +219,12 @@ public class WSDLOperationIntrospectorImpl { } operationModel.setOutputType(getOutputType()); - operationModel.setWrapperStyle(isWrapperStyle()); + operationModel.setInputWrapperStyle(isWrapperStyle()); + operationModel.setOutputWrapperStyle(isWrapperStyle()); + if (isWrapperStyle()) { - WrapperInfo wrapperInfo = getWrapper().getWrapperInfo(); - operationModel.setWrapper(wrapperInfo); + operationModel.setInputWrapper(getWrapper().getInputWrapperInfo()); + operationModel.setOutputWrapper(getWrapper().getOutputWrapperInfo()); } } return operationModel; @@ -347,11 +349,8 @@ public class WSDLOperationIntrospectorImpl { private List<XmlSchemaElement> outputElements; - // private DataType<List<DataType<XMLType>>> unwrappedInputType; - // - // private DataType<XMLType> unwrappedOutputType; - - private transient WrapperInfo wrapperInfo; + private transient WrapperInfo inputWrapperInfo; + private transient WrapperInfo outputWrapperInfo; private List<XmlSchemaElement> getChildElements(XmlSchemaElement element) throws InvalidWSDLException { if (element == null) { @@ -519,61 +518,34 @@ public class WSDLOperationIntrospectorImpl { return outputWrapperElement; } - /* - public DataType<List<DataType<XMLType>>> getUnwrappedInputType() throws InvalidWSDLException { - if (unwrappedInputType == null) { - List<DataType<XMLType>> childTypes = new ArrayList<DataType<XMLType>>(); - for (XmlSchemaElement element : getInputChildElements()) { - DataType<XMLType> type = - new DataType<XMLType>(dataBinding, Object.class, new XMLType(getElementInfo(element))); - // type.setMetadata(ElementInfo.class.getName(), getElementInfo(element)); - childTypes.add(type); - } - unwrappedInputType = - new DataType<List<DataType<XMLType>>>("idl:unwrapped.input", Object[].class, childTypes); - } - return unwrappedInputType; - } - - public DataType<XMLType> getUnwrappedOutputType() throws InvalidServiceContractException { - if (unwrappedOutputType == null) { - List<XmlSchemaElement> elements = getOutputChildElements(); - if (elements != null && elements.size() > 0) { - if (elements.size() > 1) { - // We don't support output with multiple parts - throw new NotSupportedWSDLException("Multi-part output is not supported"); - } - XmlSchemaElement element = elements.get(0); - unwrappedOutputType = - new DataType<XMLType>(dataBinding, Object.class, new XMLType(getElementInfo(element))); - // unwrappedOutputType.setMetadata(ElementInfo.class.getName(), getElementInfo(element)); - } - } - return unwrappedOutputType; - } - */ - - public WrapperInfo getWrapperInfo() throws InvalidWSDLException { - if (wrapperInfo == null) { + public WrapperInfo getInputWrapperInfo() throws InvalidWSDLException { + if (inputWrapperInfo == null) { ElementInfo in = getElementInfo(getInputWrapperElement()); - ElementInfo out = getElementInfo(getOutputWrapperElement()); List<ElementInfo> inChildren = new ArrayList<ElementInfo>(); if (in != null) { for (XmlSchemaElement e : getInputChildElements()) { inChildren.add(getElementInfo(e)); } } + inputWrapperInfo = new WrapperInfo(dataBinding, in, inChildren); + } + return inputWrapperInfo; + } + + public WrapperInfo getOutputWrapperInfo() throws InvalidWSDLException { + if (outputWrapperInfo == null) { + ElementInfo out = getElementInfo(getOutputWrapperElement()); List<ElementInfo> outChildren = new ArrayList<ElementInfo>(); if (out != null) { for (XmlSchemaElement e : getOutputChildElements()) { outChildren.add(getElementInfo(e)); } } - wrapperInfo = new WrapperInfo(dataBinding, in, out, inChildren, outChildren); + outputWrapperInfo = new WrapperInfo(dataBinding, out, outChildren); } - return wrapperInfo; + return outputWrapperInfo; } - } + } private static ElementInfo getElementInfo(XmlSchemaElement element) { if (element == null) { |