You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by br...@apache.org on 2006/10/19 14:31:56 UTC
svn commit: r465642 [2/5] - in /incubator/yoko/branches/cxf_port: ./ api/
bindings/ bindings/src/main/java/org/apache/yoko/bindings/corba2/
bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/ tools/
tools/src/main/java/org/apache/yoko/...
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java Thu Oct 19 07:31:44 2006
@@ -0,0 +1,44 @@
+/**
+ * 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.yoko.bindings.corba2.interceptors;
+
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+import org.apache.schemas.yoko.bindings.corba.OperationType;
+
+public class CorbaOutInterceptor extends AbstractPhaseInterceptor<Message> {
+
+ public CorbaOutInterceptor() {
+ super();
+ setPhase(Phase.MARSHAL);
+ }
+
+ public void handleMessage(Message message) {
+ System.out.println("handleMessage() in CorbaOutInterceptor...");
+ Exchange exchange = message.getExchange();
+ BindingOperationInfo boi = exchange.get(BindingOperationInfo.class);
+ OperationType opType = boi.getExtensor(OperationType.class);
+ System.out.println("Operation: " + opType.getName());
+ }
+}
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/yoko/branches/cxf_port/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/pom.xml?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/pom.xml (original)
+++ incubator/yoko/branches/cxf_port/pom.xml Thu Oct 19 07:31:44 2006
@@ -381,6 +381,14 @@
<url>https://maven-repository.dev.java.net/nonav/repository/</url>
<layout>legacy</layout>
</repository>
+ <repository>
+ <id>apache-snapshots</id>
+ <name>Apache Maven snapshot repository</name>
+ <url>http://people.apache.org/maven-snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
</repositories>
<pluginRepositories>
Modified: incubator/yoko/branches/cxf_port/tools/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/pom.xml?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/pom.xml (original)
+++ incubator/yoko/branches/cxf_port/tools/pom.xml Thu Oct 19 07:31:44 2006
@@ -1,3 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ * 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.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.yoko</groupId>
@@ -13,6 +32,7 @@
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
+
</properties>
<dependencies>
@@ -24,7 +44,10 @@
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-api</artifactId>
- <version>${cxf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-tools-common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.yoko</groupId>
@@ -42,6 +65,11 @@
<groupId>woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<version>2.9</version>
+ </dependency>
+ <dependency>
+ <groupId>wsdl4j</groupId>
+ <artifactId>wsdl4j</artifactId>
+ <version>1.5.2</version>
</dependency>
</dependencies>
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/CorbaPrimitiveMap.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/CorbaPrimitiveMap.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/CorbaPrimitiveMap.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/CorbaPrimitiveMap.java Thu Oct 19 07:31:44 2006
@@ -23,6 +23,7 @@
import javax.xml.namespace.QName;
+import org.apache.yoko.wsdl.CorbaConstants;
import org.apache.yoko.wsdl.CorbaTypeImpl;
public class CorbaPrimitiveMap extends PrimitiveMapBase {
@@ -34,42 +35,42 @@
private void initialiseMap() {
- corbaPrimitiveMap.put("string", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("boolean", CORBAConstants.NT_CORBA_BOOLEAN);
- corbaPrimitiveMap.put("float", CORBAConstants.NT_CORBA_FLOAT);
- corbaPrimitiveMap.put("double", CORBAConstants.NT_CORBA_DOUBLE);
- corbaPrimitiveMap.put("dateTime", CORBAConstants.NT_CORBA_DATETIME);
- corbaPrimitiveMap.put("date", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("time", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("gYearMonth", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("gYear", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("gMonthDay", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("gMonth", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("gDay", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("duration", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("anyURI", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("QName", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("normalizedString", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("token", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("language", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("NMTOKEN", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("Name", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("NCName", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("ID", CORBAConstants.NT_CORBA_STRING);
- corbaPrimitiveMap.put("integer", CORBAConstants.NT_CORBA_LONGLONG);
- corbaPrimitiveMap.put("short", CORBAConstants.NT_CORBA_SHORT);
- corbaPrimitiveMap.put("byte", CORBAConstants.NT_CORBA_CHAR);
- corbaPrimitiveMap.put("int", CORBAConstants.NT_CORBA_LONG);
- corbaPrimitiveMap.put("long", CORBAConstants.NT_CORBA_LONGLONG);
- corbaPrimitiveMap.put("nonPositiveInteger", CORBAConstants.NT_CORBA_LONGLONG);
- corbaPrimitiveMap.put("negativeInteger", CORBAConstants.NT_CORBA_LONGLONG);
- corbaPrimitiveMap.put("nonNegativeInteger", CORBAConstants.NT_CORBA_ULONGLONG);
- corbaPrimitiveMap.put("positiveInteger", CORBAConstants.NT_CORBA_ULONGLONG);
- corbaPrimitiveMap.put("unsignedInt", CORBAConstants.NT_CORBA_ULONG);
- corbaPrimitiveMap.put("unsignedLong", CORBAConstants.NT_CORBA_ULONGLONG);
- corbaPrimitiveMap.put("unsignedShort", CORBAConstants.NT_CORBA_USHORT);
- corbaPrimitiveMap.put("unsignedByte", CORBAConstants.NT_CORBA_OCTET);
- corbaPrimitiveMap.put("anyType", CORBAConstants.NT_CORBA_ANY);
+ corbaPrimitiveMap.put("string", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("boolean", CorbaConstants.NT_CORBA_BOOLEAN);
+ corbaPrimitiveMap.put("float", CorbaConstants.NT_CORBA_FLOAT);
+ corbaPrimitiveMap.put("double", CorbaConstants.NT_CORBA_DOUBLE);
+ corbaPrimitiveMap.put("dateTime", CorbaConstants.NT_CORBA_DATETIME);
+ corbaPrimitiveMap.put("date", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("time", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("gYearMonth", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("gYear", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("gMonthDay", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("gMonth", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("gDay", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("duration", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("anyURI", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("QName", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("normalizedString", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("token", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("language", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("NMTOKEN", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("Name", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("NCName", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("ID", CorbaConstants.NT_CORBA_STRING);
+ corbaPrimitiveMap.put("integer", CorbaConstants.NT_CORBA_LONGLONG);
+ corbaPrimitiveMap.put("short", CorbaConstants.NT_CORBA_SHORT);
+ corbaPrimitiveMap.put("byte", CorbaConstants.NT_CORBA_CHAR);
+ corbaPrimitiveMap.put("int", CorbaConstants.NT_CORBA_LONG);
+ corbaPrimitiveMap.put("long", CorbaConstants.NT_CORBA_LONGLONG);
+ corbaPrimitiveMap.put("nonPositiveInteger", CorbaConstants.NT_CORBA_LONGLONG);
+ corbaPrimitiveMap.put("negativeInteger", CorbaConstants.NT_CORBA_LONGLONG);
+ corbaPrimitiveMap.put("nonNegativeInteger", CorbaConstants.NT_CORBA_ULONGLONG);
+ corbaPrimitiveMap.put("positiveInteger", CorbaConstants.NT_CORBA_ULONGLONG);
+ corbaPrimitiveMap.put("unsignedInt", CorbaConstants.NT_CORBA_ULONG);
+ corbaPrimitiveMap.put("unsignedLong", CorbaConstants.NT_CORBA_ULONGLONG);
+ corbaPrimitiveMap.put("unsignedShort", CorbaConstants.NT_CORBA_USHORT);
+ corbaPrimitiveMap.put("unsignedByte", CorbaConstants.NT_CORBA_OCTET);
+ corbaPrimitiveMap.put("anyType", CorbaConstants.NT_CORBA_ANY);
}
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/XmlSchemaPrimitiveMap.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/XmlSchemaPrimitiveMap.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/XmlSchemaPrimitiveMap.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/XmlSchemaPrimitiveMap.java Thu Oct 19 07:31:44 2006
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
import org.apache.ws.commons.schema.constants.Constants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class XmlSchemaPrimitiveMap {
private Map<QName, QName> xmlSchemaPrimitiveMap;
@@ -37,32 +38,32 @@
private void initializeMap() {
//<base_type_spec>
// <floating_pt_type> - OMG Syntax and semantics - CORBA v3.0
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_FLOAT, Constants.XSD_FLOAT);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_DOUBLE, Constants.XSD_DOUBLE);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_LONGDOUBLE, Constants.XSD_DOUBLE);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_FLOAT, Constants.XSD_FLOAT);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_DOUBLE, Constants.XSD_DOUBLE);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_LONGDOUBLE, Constants.XSD_DOUBLE);
// <integer_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_SHORT, Constants.XSD_SHORT);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_LONG, Constants.XSD_INT);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_LONGLONG, Constants.XSD_LONG);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_USHORT, Constants.XSD_UNSIGNEDSHORT);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_ULONG, Constants.XSD_UNSIGNEDINT);
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_ULONGLONG, Constants.XSD_UNSIGNEDLONG);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_SHORT, Constants.XSD_SHORT);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_LONG, Constants.XSD_INT);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_LONGLONG, Constants.XSD_LONG);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_USHORT, Constants.XSD_UNSIGNEDSHORT);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_ULONG, Constants.XSD_UNSIGNEDINT);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_ULONGLONG, Constants.XSD_UNSIGNEDLONG);
// <char_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_CHAR, Constants.XSD_BYTE);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_CHAR, Constants.XSD_BYTE);
// <wide_char_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_WCHAR, Constants.XSD_STRING);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_WCHAR, Constants.XSD_STRING);
// <boolean_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_BOOLEAN, Constants.XSD_BOOLEAN);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_BOOLEAN, Constants.XSD_BOOLEAN);
// <octet_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_OCTET, Constants.XSD_UNSIGNEDBYTE);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_OCTET, Constants.XSD_UNSIGNEDBYTE);
// <any_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_ANY, Constants.XSD_ANY);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_ANY, Constants.XSD_ANY);
// <object_type>
@@ -70,9 +71,9 @@
//<template_type_spec>
// <string_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_STRING, Constants.XSD_STRING);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_STRING, Constants.XSD_STRING);
// <wide_string_type>
- xmlSchemaPrimitiveMap.put(CORBAConstants.NT_CORBA_WSTRING, Constants.XSD_STRING);
+ xmlSchemaPrimitiveMap.put(CorbaConstants.NT_CORBA_WSTRING, Constants.XSD_STRING);
}
public QName get(QName key) {
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java Thu Oct 19 07:31:44 2006
@@ -50,4 +50,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java Thu Oct 19 07:31:44 2006
@@ -33,7 +33,7 @@
import org.apache.ws.commons.schema.XmlSchemaSequence;
import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class ArrayVisitor extends TypesVisitorBase {
@@ -82,9 +82,9 @@
corbaSeq.setQName(new QName(typeMap.getTargetNamespace(), name));
corbaSeq.setType(ct.getQName());
corbaSeq.setElemtype(TypesUtils.findCorbaType(getCorbaTypeMap(), stype.getQName()).getQName());
- corbaSeq.setRepositoryID(CORBAConstants.REPO_STRING
+ corbaSeq.setRepositoryID(CorbaConstants.REPO_STRING
+ name
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
getCorbaTypeMap().getStructOrExceptionOrUnion().add(corbaSeq);
setSchemaType(ct);
setCorbaType(corbaSeq);
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java Thu Oct 19 07:31:44 2006
@@ -35,7 +35,7 @@
import org.apache.ws.commons.schema.constants.Constants;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class EnumVisitor extends TypesVisitorBase {
@@ -62,9 +62,9 @@
// corba:enum
Enum corbaEnum = new Enum();
corbaEnum.setQName(new QName(typeMap.getTargetNamespace(), enumNameNode.toString()));
- corbaEnum.setRepositoryID(CORBAConstants.REPO_STRING
+ corbaEnum.setRepositoryID(CorbaConstants.REPO_STRING
+ enumNameNode.toString()
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
corbaEnum.setType(enumSchemaSimpleType.getQName());
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java Thu Oct 19 07:31:44 2006
@@ -34,7 +34,7 @@
import org.apache.ws.commons.schema.XmlSchemaSequence;
import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class ExceptionVisitor extends TypesVisitorBase {
@@ -67,9 +67,9 @@
Exception exception = new Exception();
exception.setQName(new QName(typeMap.getTargetNamespace(), exceptionName));
exception.setType(complexType.getQName());
- exception.setRepositoryID(CORBAConstants.REPO_STRING
+ exception.setRepositoryID(CorbaConstants.REPO_STRING
+ exceptionName
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
// exception members
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java Thu Oct 19 07:31:44 2006
@@ -34,7 +34,7 @@
import org.apache.ws.commons.schema.XmlSchemaTotalDigitsFacet;
import org.apache.ws.commons.schema.constants.Constants;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class FixedVisitor extends TypesVisitorBase {
@@ -110,9 +110,9 @@
corbaFixed.setQName(new QName(typeMap.getTargetNamespace(), identifierNode.toString()));
corbaFixed.setDigits(digits);
corbaFixed.setScale(scale);
- corbaFixed.setRepositoryID(CORBAConstants.REPO_STRING
+ corbaFixed.setRepositoryID(CorbaConstants.REPO_STRING
+ identifierNode.toString()
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
//corbaFixed.setType(Constants.XSD_DECIMAL);
corbaFixed.setType(fixedSimpleType.getQName());
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java Thu Oct 19 07:31:44 2006
@@ -39,9 +39,8 @@
import org.apache.cxf.tools.util.FileWriterUtil;
import org.apache.schemas.yoko.bindings.corba.AddressType;
-
-import org.apache.yoko.tools.common.CORBAConstants;
import org.apache.yoko.tools.common.ToolCorbaConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class IDLToWSDLProcessor implements Processor {
@@ -76,7 +75,7 @@
String tns = (String) env.get(ToolCorbaConstants.CFG_TNS);
if (tns == null) {
- tns = CORBAConstants.WSDL_NS_URI + idl;
+ tns = CorbaConstants.WSDL_NS_URI + idl;
}
try {
@@ -95,8 +94,8 @@
}
}
- public void setEnvironment(ToolContext ctx) {
- env = ctx;
+ public void setEnvironment(ToolContext penv) {
+ env = penv;
}
public ToolContext getEnvironment() {
@@ -127,7 +126,7 @@
port.setName(portTypeName + "CORBAPort");
AddressType address =
(AddressType) def.getExtensionRegistry().createExtension(Port.class,
- CORBAConstants.NE_CORBA_ADDRESS);
+ CorbaConstants.NE_CORBA_ADDRESS);
String addr = (String) env.get(ToolCorbaConstants.CFG_ADDRESS);
if (addr == null) {
addr = "IOR:";
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java Thu Oct 19 07:31:44 2006
@@ -32,7 +32,7 @@
import org.apache.schemas.yoko.bindings.corba.OperationType;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class OperationVisitor implements ASTVisitor {
@@ -72,7 +72,6 @@
msgVisitor.createOutputMessage();
}
msgVisitor.visit(node);
- node = node.getNextSibling();
}
private BindingOperation createBindingOperation(Binding wsdlBinding, Operation op) {
@@ -80,7 +79,7 @@
OperationType operationType = null;
try {
operationType = (OperationType)extReg.createExtension(BindingOperation.class,
- CORBAConstants.NE_CORBA_OPERATION);
+ CorbaConstants.NE_CORBA_OPERATION);
} catch (WSDLException ex) {
throw new RuntimeException(ex);
}
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java Thu Oct 19 07:31:44 2006
@@ -35,7 +35,7 @@
import org.apache.schemas.yoko.bindings.corba.BindingType;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class PortTypeVisitor implements ASTVisitor {
@@ -83,6 +83,12 @@
case IDLTokenTypes.LITERAL_typedef:
typesVisitor.visit(node2);
break;
+ case IDLTokenTypes.LITERAL_attribute:
+ AttributeVisitor attributeVisitor = new AttributeVisitor(wsdlASTVisitor,
+ portType,
+ binding);
+ attributeVisitor.visit(node2);
+ break;
default:
OperationVisitor operationVisitor = new OperationVisitor(wsdlASTVisitor,
portType,
@@ -109,10 +115,10 @@
try {
BindingType bindingType = (BindingType)
- extReg.createExtension(Binding.class, CORBAConstants.NE_CORBA_BINDING);
- bindingType.setRepositoryID(CORBAConstants.REPO_STRING
+ extReg.createExtension(Binding.class, CorbaConstants.NE_CORBA_BINDING);
+ bindingType.setRepositoryID(CorbaConstants.REPO_STRING
+ portType.getQName().getLocalPart().replace('.', '/')
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
binding.addExtensibilityElement(bindingType);
} catch (WSDLException ex) {
throw new RuntimeException(ex);
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java Thu Oct 19 07:31:44 2006
@@ -34,7 +34,7 @@
import org.apache.ws.commons.schema.XmlSchemaSequence;
import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class StructVisitor extends TypesVisitorBase {
@@ -59,9 +59,9 @@
Struct struct = new Struct();
struct.setQName(new QName(typeMap.getTargetNamespace(), structName));
struct.setType(complexType.getQName());
- struct.setRepositoryID(CORBAConstants.REPO_STRING
+ struct.setRepositoryID(CorbaConstants.REPO_STRING
+ structName
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
// struct members
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesUtils.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesUtils.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesUtils.java Thu Oct 19 07:31:44 2006
@@ -30,9 +30,9 @@
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.yoko.tools.common.CORBAConstants;
import org.apache.yoko.tools.common.CorbaPrimitiveMap;
import org.apache.yoko.tools.common.XmlSchemaPrimitiveMap;
+import org.apache.yoko.wsdl.CorbaConstants;
import org.apache.yoko.wsdl.CorbaTypeImpl;
public final class TypesUtils {
@@ -49,13 +49,19 @@
QName corbaType = getPrimitiveType(node);
if (corbaType != null) {
QName schemaType = xmlSchemaPrimitiveMap.get(corbaType);
- result = schemas.getTypeByQName(schemaType);
+ if (schemaType != null) {
+ result = schemas.getTypeByQName(schemaType);
+ }
}
if (result == null) {
//REVISIT, properly reference the node name, need to look at the siblings.
QName qname = new QName(schema.getTargetNamespace(), node.toString());
result = schema.getTypeByName(qname);
}
+ if (result == null) {
+ // template_type_spec
+ System.out.println("Invalid IDL! Error parsing: " + node.toStringTree());
+ }
return result;
}
@@ -95,7 +101,7 @@
}
return currentNode.getNextSibling();
}
-
+
private static QName getPrimitiveType(AST node) {
QName result = null;
switch (node.getType()) {
@@ -103,64 +109,64 @@
if ((node.getNextSibling() != null)
&& (node.getNextSibling().getType() == IDLTokenTypes.LITERAL_long)) {
// long long
- result = CORBAConstants.NT_CORBA_LONGLONG;
+ result = CorbaConstants.NT_CORBA_LONGLONG;
} else if ((node.getFirstChild() != null)
&& (node.getFirstChild().getType() == IDLTokenTypes.LITERAL_double)) {
// "double" node is a child of "long" node - instead of being a sibling
// long double
- result = CORBAConstants.NT_CORBA_LONGDOUBLE;
+ result = CorbaConstants.NT_CORBA_LONGDOUBLE;
} else {
// long
- result = CORBAConstants.NT_CORBA_LONG;
+ result = CorbaConstants.NT_CORBA_LONG;
}
break;
case IDLTokenTypes.LITERAL_unsigned:
AST node2 = node.getNextSibling();
if (node2 != null && node2.getType() == IDLTokenTypes.LITERAL_short) {
// unsigned short
- result = CORBAConstants.NT_CORBA_USHORT;
+ result = CorbaConstants.NT_CORBA_USHORT;
} else if (node2 != null && node2.getType() == IDLTokenTypes.LITERAL_long) {
AST node3 = node2.getNextSibling();
if (node3 != null && node3.getType() == IDLTokenTypes.LITERAL_long) {
// unsigned long long
- result = CORBAConstants.NT_CORBA_ULONGLONG;
+ result = CorbaConstants.NT_CORBA_ULONGLONG;
} else {
// unsigned long
- result = CORBAConstants.NT_CORBA_ULONG;
+ result = CorbaConstants.NT_CORBA_ULONG;
}
} else {
// TBD: we should never get here
}
break;
case IDLTokenTypes.LITERAL_short:
- result = CORBAConstants.NT_CORBA_SHORT;
+ result = CorbaConstants.NT_CORBA_SHORT;
break;
case IDLTokenTypes.LITERAL_float:
- result = CORBAConstants.NT_CORBA_FLOAT;
+ result = CorbaConstants.NT_CORBA_FLOAT;
break;
case IDLTokenTypes.LITERAL_double:
- result = CORBAConstants.NT_CORBA_DOUBLE;
+ result = CorbaConstants.NT_CORBA_DOUBLE;
break;
case IDLTokenTypes.LITERAL_char:
- result = CORBAConstants.NT_CORBA_CHAR;
+ result = CorbaConstants.NT_CORBA_CHAR;
break;
case IDLTokenTypes.LITERAL_wchar:
- result = CORBAConstants.NT_CORBA_WCHAR;
+ result = CorbaConstants.NT_CORBA_WCHAR;
break;
case IDLTokenTypes.LITERAL_string:
- result = CORBAConstants.NT_CORBA_STRING;
+ result = CorbaConstants.NT_CORBA_STRING;
break;
case IDLTokenTypes.LITERAL_wstring:
- result = CORBAConstants.NT_CORBA_WSTRING;
+ result = CorbaConstants.NT_CORBA_WSTRING;
break;
case IDLTokenTypes.LITERAL_boolean:
- result = CORBAConstants.NT_CORBA_BOOLEAN;
+ result = CorbaConstants.NT_CORBA_BOOLEAN;
break;
case IDLTokenTypes.LITERAL_octet:
- result = CORBAConstants.NT_CORBA_OCTET;
+ result = CorbaConstants.NT_CORBA_OCTET;
break;
case IDLTokenTypes.LITERAL_any:
- result = CORBAConstants.NT_CORBA_ANY;
+ result = CorbaConstants.NT_CORBA_ANY;
break;
default:
// TBD
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java Thu Oct 19 07:31:44 2006
@@ -45,16 +45,13 @@
import org.apache.ws.commons.schema.XmlSchemaSerializer;
import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.yoko.tools.common.CORBAConstants;
-
+import org.apache.yoko.wsdl.CorbaConstants;
import org.apache.yoko.wsdl.CorbaTypeImpl;
public class TypesVisitor implements ASTVisitor {
static final List<Integer> PRIMITIVE_TYPES = new ArrayList<Integer>();
static final int PRIMITIVE = 0;
- static final int ARRAY = -1;
- static final int FIXED = -2;
TypeMappingType typeMap;
@@ -80,6 +77,18 @@
createCorbaTypeMap();
}
+ // REVISIT: remove this method
+ // schema should not be a member of TypesVisitor
+ public XmlSchema getSchema() {
+ return schema;
+ }
+
+ // REVISIT: remove this method
+ // schemas should not be a member of TypesVisitor
+ public XmlSchemaCollection getSchemas() {
+ return schemas;
+ }
+
public TypeMappingType getCorbaTypeMapping() {
return typeMap;
}
@@ -151,13 +160,8 @@
}
break;
}
- case ARRAY: {
- visitor = new ArrayVisitor(schemas, schema, typeMap);
- visitor.visit(node);
- break;
- }
- case FIXED: {
- visitor = new FixedVisitor(schemas, schema, typeMap);
+ case IDLTokenTypes.LITERAL_typedef: {
+ visitor = new TypedefVisitor(schemas, schema, typeMap);
visitor.visit(node);
break;
}
@@ -203,10 +207,6 @@
private int getType(AST node) {
if (isPrimitive(node.getType())) {
return PRIMITIVE;
- } else if (isArray(node)) {
- return ARRAY;
- } else if (isFixed(node)) {
- return FIXED;
} else {
return node.getType();
}
@@ -216,35 +216,13 @@
return PRIMITIVE_TYPES.contains(nodeType);
}
- private boolean isArray(AST node) {
- boolean result = false;
- if (node.getType() == IDLTokenTypes.LITERAL_typedef) {
- AST node2 = node.getFirstChild();
- if (node2.getType() == IDLTokenTypes.LITERAL_sequence) {
- result = true;
- }
- }
- return result;
- }
-
- private boolean isFixed(AST node) {
- boolean result = false;
- if (node.getType() == IDLTokenTypes.LITERAL_typedef) {
- AST node2 = node.getFirstChild();
- if (node2.getType() == IDLTokenTypes.LITERAL_fixed) {
- result = true;
- }
- }
- return result;
- }
-
private void createCorbaTypeMap() throws WSDLException {
typeMap = (TypeMappingType)
definition.getExtensionRegistry().createExtension(Definition.class,
- CORBAConstants.NE_CORBA_TYPEMAPPING);
+ CorbaConstants.NE_CORBA_TYPEMAPPING);
typeMap.setTargetNamespace(definition.getTargetNamespace()
+ "/"
- + CORBAConstants.NS_CORBA_TYPEMAP);
+ + CorbaConstants.NS_CORBA_TYPEMAP);
definition.addExtensibilityElement(typeMap);
}
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java Thu Oct 19 07:31:44 2006
@@ -36,7 +36,7 @@
import org.apache.ws.commons.schema.XmlSchemaSequence;
import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.yoko.tools.common.CORBAConstants;
+import org.apache.yoko.wsdl.CorbaConstants;
public class UnionVisitor extends TypesVisitorBase {
@@ -76,9 +76,9 @@
// corba:union
Union corbaUnion = new Union();
corbaUnion.setQName(new QName(typeMap.getTargetNamespace(), identifierNode.toString()));
- corbaUnion.setRepositoryID(CORBAConstants.REPO_STRING
+ corbaUnion.setRepositoryID(CorbaConstants.REPO_STRING
+ identifierNode.toString()
- + CORBAConstants.IDL_VERSION);
+ + CorbaConstants.IDL_VERSION);
corbaUnion.setType(unionSchemaComplexType.getQName());
corbaUnion.setDiscriminator(TypesUtils.findCorbaType(typeMap, type.getQName()).getQName());
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java Thu Oct 19 07:31:44 2006
@@ -47,8 +47,8 @@
import org.apache.schemas.yoko.bindings.corba.OperationType;
import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-import org.apache.yoko.tools.common.CORBAConstants;
import org.apache.yoko.tools.common.WSDLUtils;
+import org.apache.yoko.wsdl.CorbaConstants;
public class WSDLASTVisitor implements ASTVisitor {
@@ -66,7 +66,7 @@
definition.addNamespace(WSDLConstants.XSD_PREFIX, WSDLConstants.XSD_NAMESPACE);
definition.addNamespace(WSDLConstants.SOAP_PREFIX, WSDLConstants.SOAP11_NAMESPACE);
definition.addNamespace(WSDLConstants.TNS_PREFIX, tns);
- definition.addNamespace(CORBAConstants.NP_WSDL_CORBA, CORBAConstants.NU_WSDL_CORBA);
+ definition.addNamespace(CorbaConstants.NP_WSDL_CORBA, CorbaConstants.NU_WSDL_CORBA);
addCorbaExtensions(definition.getExtensionRegistry());
initVisitors();
}
@@ -117,7 +117,7 @@
List extElements = binding.getExtensibilityElements();
for (int i = 0; i < extElements.size(); i++) {
ExtensibilityElement el = (ExtensibilityElement) extElements.get(i);
- if (el.getElementType().equals(CORBAConstants.NE_CORBA_BINDING)) {
+ if (el.getElementType().equals(CorbaConstants.NE_CORBA_BINDING)) {
result.add(binding);
break;
}
@@ -143,12 +143,12 @@
JAXBExtensionHelper.addExtensions(extReg, Definition.class, TypeMappingType.class);
JAXBExtensionHelper.addExtensions(extReg, Port.class, AddressType.class);
- extReg.mapExtensionTypes(Binding.class, CORBAConstants.NE_CORBA_BINDING, BindingType.class);
- extReg.mapExtensionTypes(BindingOperation.class, CORBAConstants.NE_CORBA_OPERATION,
+ extReg.mapExtensionTypes(Binding.class, CorbaConstants.NE_CORBA_BINDING, BindingType.class);
+ extReg.mapExtensionTypes(BindingOperation.class, CorbaConstants.NE_CORBA_OPERATION,
org.apache.schemas.yoko.bindings.corba.OperationType.class);
- extReg.mapExtensionTypes(Definition.class, CORBAConstants.NE_CORBA_TYPEMAPPING,
+ extReg.mapExtensionTypes(Definition.class, CorbaConstants.NE_CORBA_TYPEMAPPING,
TypeMappingType.class);
- extReg.mapExtensionTypes(Port.class, CORBAConstants.NE_CORBA_ADDRESS,
+ extReg.mapExtensionTypes(Port.class, CorbaConstants.NE_CORBA_ADDRESS,
org.apache.schemas.yoko.bindings.corba.AddressType.class);
} catch (javax.xml.bind.JAXBException ex) {
throw new JAXBException(ex.getMessage());
Modified: incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java (original)
+++ incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java Thu Oct 19 07:31:44 2006
@@ -48,12 +48,14 @@
import org.apache.yoko.wsdl.CorbaTypeImpl;
public final class WSDLParameter {
+
+ static Definition definition;
public void processParameters(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation, Definition def,
List<XmlSchema> xmlSchemaList, List<ParamType> params,
List<ArgType> returns, boolean simpleOrdering) throws Exception {
-
+ definition = def;
List<ParamType> inputs = new ArrayList<ParamType>();
List<ParamType> outputs = new ArrayList<ParamType>();
List<ArgType> returnOutputs = new ArrayList<ArgType>();
@@ -78,7 +80,6 @@
private void processWrappedInputParams(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation,
List<XmlSchema> xmlSchemaList, List<ParamType> inputs)
throws Exception {
-
Input input = operation.getInput();
if (input != null) {
@@ -87,57 +88,45 @@
while (i.hasNext()) {
Part part = (Part)i.next();
XmlSchemaType schemaType = null;
- schemaType = lookUpType(part, xmlSchemaList);
- ParamType paramtype = null;
+ schemaType = lookUpType(part, xmlSchemaList);
if (part.getElementName() != null) {
- XmlSchemaComplexType cpt = null;
-
- if (schemaType instanceof XmlSchemaComplexType) {
- cpt = (XmlSchemaComplexType)schemaType;
- }
- if (cpt != null && schemaType.getName() == null) {
+ // its an anonymous type
+ if (schemaType instanceof XmlSchemaComplexType
+ && schemaType.getName() == null) {
Iterator it = getSchemaIterator(schemaType);
Iterator iter = getSchemaIterator(schemaType);
while (it.hasNext()) {
if (it.next() instanceof XmlSchemaElement) {
XmlSchemaElement el = (XmlSchemaElement)iter.next();
- paramtype = createParam(wsdlToCorbaBinding, "in", el.getSchemaType(),
- el.getQName().getLocalPart(),
- el.getSchemaTypeName());
- }
- if (paramtype != null) {
- inputs.add(paramtype);
- }
+ addParam(wsdlToCorbaBinding, el.getSchemaType(),
+ el.getQName().getLocalPart(),
+ el.getSchemaTypeName(), el.isNillable(), inputs);
+ }
}
} else {
- QName typeName = null;
+ XmlSchemaElement el = getElement(part, xmlSchemaList);
if (schemaType == null) {
- typeName = getElementsTypeName(part, xmlSchemaList);
+ addParam(wsdlToCorbaBinding, schemaType, part.getName(),
+ el.getSchemaTypeName(), el.isNillable(), inputs);
} else {
- typeName = part.getElementName();
- }
- paramtype = createParam(wsdlToCorbaBinding, "in", schemaType, part.getName(),
- typeName);
- if (paramtype != null) {
- inputs.add(paramtype);
- }
+ addParam(wsdlToCorbaBinding, schemaType, part.getName(),
+ part.getElementName(), el.isNillable(), inputs);
+ }
}
} else {
if (part.getTypeName() != null) {
- paramtype = createParam(wsdlToCorbaBinding, "in", schemaType, part.getName(), part
- .getTypeName());
- if (paramtype != null) {
- inputs.add(paramtype);
- }
+ addParam(wsdlToCorbaBinding, schemaType, part.getName(),
+ part.getTypeName(), false, inputs);
}
}
}
}
}
-
+
private void processInputParams(WSDLToCorbaBinding wsdlToCorbaBinding,
Operation operation, List<XmlSchema> xmlSchemaList,
- List<ParamType> inputs) throws Exception {
+ List<ParamType> inputs)
+ throws Exception {
Input input = operation.getInput();
@@ -147,27 +136,33 @@
while (i.hasNext()) {
Part part = (Part)i.next();
XmlSchemaType schemaType = null;
- schemaType = lookUpType(part, xmlSchemaList);
- ParamType paramtype = null;
+ schemaType = lookUpType(part, xmlSchemaList);
if (part.getElementName() != null) {
- paramtype = createParam(wsdlToCorbaBinding, "in", schemaType,
- part.getName(), part.getElementName());
- } else {
- if (part.getTypeName() != null) {
- paramtype = createParam(wsdlToCorbaBinding, "in", schemaType,
- part.getName(), part.getTypeName());
- }
- }
- if (paramtype != null) {
- inputs.add(paramtype);
- }
+ XmlSchemaElement el = getElement(part, xmlSchemaList);
+ addParam(wsdlToCorbaBinding, schemaType, part.getName(),
+ part.getElementName(), el.isNillable(), inputs);
+ } else if (part.getTypeName() != null) {
+ addParam(wsdlToCorbaBinding, schemaType, part.getName(),
+ part.getTypeName(), false, inputs);
+ }
}
}
}
+ private void addParam(WSDLToCorbaBinding wsdlToCorbaBinding, XmlSchemaType schemaType,
+ String name, QName typeName, boolean nillable,
+ List<ParamType> inputs) throws Exception {
+ ParamType paramtype = createParam(wsdlToCorbaBinding, "in", schemaType,
+ name, typeName, nillable);
+ if (paramtype != null) {
+ inputs.add(paramtype);
+ }
+ }
+
private void processWrappedOutputParams(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation,
List<XmlSchema> xmlSchemaList, List<ParamType> inputs,
- List<ParamType> outputs) throws Exception {
+ List<ParamType> outputs)
+ throws Exception {
Output output = operation.getOutput();
@@ -180,112 +175,42 @@
schemaType = lookUpType(part, xmlSchemaList);
// check if in input list
- if (part.getElementName() != null) {
- XmlSchemaComplexType cpt = null;
- if (schemaType instanceof XmlSchemaComplexType) {
- cpt = (XmlSchemaComplexType)schemaType;
- }
- if (cpt != null && schemaType.getName() == null) {
+ if (part.getElementName() != null) {
+ if (schemaType instanceof XmlSchemaComplexType
+ && schemaType.getName() == null) {
Iterator it = getSchemaIterator(schemaType);
Iterator iter = getSchemaIterator(schemaType);
while (it.hasNext()) {
if (it.next() instanceof XmlSchemaElement) {
XmlSchemaElement el = (XmlSchemaElement)iter.next();
- updateList(wsdlToCorbaBinding, el.getSchemaType(),
- el.getQName().getLocalPart(),
+ updateList(wsdlToCorbaBinding, el.getSchemaType(),
el.getQName().getLocalPart(),
- el.getSchemaTypeName(), inputs, outputs);
+ el.getSchemaTypeName(), inputs, outputs,
+ el.isNillable());
}
}
} else {
- QName typeName = null;
+ XmlSchemaElement el = getElement(part, xmlSchemaList);
if (schemaType == null) {
- typeName = getElementsTypeName(part, xmlSchemaList);
+ updateList(wsdlToCorbaBinding, schemaType,
+ part.getName(), el.getSchemaTypeName(),
+ inputs, outputs, el.isNillable());
} else {
- typeName = part.getElementName();
- }
- updateList(wsdlToCorbaBinding, schemaType, part.getName(),
- part.getName(), typeName, inputs, outputs);
+ updateList(wsdlToCorbaBinding, schemaType,
+ part.getName(), part.getElementName(),
+ inputs, outputs, el.isNillable());
+ }
}
} else {
if (part.getTypeName() != null) {
- updateList(wsdlToCorbaBinding, schemaType, part.getName(), part.getName(),
- part.getTypeName(), inputs, outputs);
+ updateList(wsdlToCorbaBinding, schemaType, part.getName(),
+ part.getTypeName(), inputs, outputs, false);
}
}
}
}
- }
-
-
- private Iterator getSchemaIterator(XmlSchemaType schemaType) {
-
-
- if (schemaType instanceof XmlSchemaComplexType) {
- XmlSchemaComplexType cpt = (XmlSchemaComplexType)schemaType;
- XmlSchemaParticle particle = null;
- if (cpt.getParticle() != null) {
- particle = (XmlSchemaParticle)cpt.getParticle();
-
- if (particle instanceof XmlSchemaSequence) {
- XmlSchemaSequence seq = (XmlSchemaSequence)particle;
- return seq.getItems().getIterator();
- } else if (particle instanceof XmlSchemaChoice) {
- XmlSchemaChoice choice = (XmlSchemaChoice)particle;
- return choice.getItems().getIterator();
- }
- }
- if (cpt.getContentModel() != null) {
- XmlSchemaContentModel xscm = (XmlSchemaContentModel)cpt.getContentModel();
- if (xscm instanceof XmlSchemaComplexContent) {
- XmlSchemaComplexContent xscc = (XmlSchemaComplexContent)xscm;
-
- XmlSchemaComplexContentExtension ext = null;
- if (xscc.getContent() instanceof XmlSchemaComplexContentExtension) {
- ext = (XmlSchemaComplexContentExtension)xscc.getContent();
- }
- if (ext.getParticle() instanceof XmlSchemaSequence) {
- XmlSchemaSequence seq = (XmlSchemaSequence)ext.getParticle();
- return seq.getItems().getIterator();
- } else if (ext.getParticle() instanceof XmlSchemaChoice) {
- XmlSchemaChoice choice = (XmlSchemaChoice)ext.getParticle();
- return choice.getItems().getIterator();
- }
- }
- }
- }
- return null;
- }
-
- private void updateList(WSDLToCorbaBinding wsdlToCorbaBinding, XmlSchemaType schemaType,
- String componentName, String name, QName typeName,
- List<ParamType> inputs, List<ParamType> outputs) throws Exception {
-
- ParamType paramtype = null;
+ }
- for (int x = 0; x < inputs.size(); x++) {
- paramtype = null;
- ParamType d2 = (ParamType)inputs.get(x);
-
- if (d2.getName().equals(componentName)) {
- inputs.remove(x);
- paramtype = createParam(wsdlToCorbaBinding, "inout", schemaType,
- name, typeName);
- if (paramtype != null) {
- inputs.add(paramtype);
- }
- }
- }
- if (paramtype == null) {
- paramtype = createParam(wsdlToCorbaBinding, "out", schemaType,
- name, typeName);
- if (paramtype != null) {
- outputs.add(paramtype);
- }
- }
-
- }
-
private void processOutputParams(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation,
List<XmlSchema> xmlSchemaList, List<ParamType> inputs,
List<ParamType> outputs) throws Exception {
@@ -311,22 +236,24 @@
&& d2.getName().equals(part.getName())) {
inputs.remove(x);
if (part.getElementName() != null) {
+ XmlSchemaElement el = getElement(part, xmlSchemaList);
paramtype = createParam(wsdlToCorbaBinding, "inout", schemaType,
- part.getName(), part.getElementName());
+ part.getName(), part.getElementName(), el.isNillable());
} else {
paramtype = createParam(wsdlToCorbaBinding, "inout", schemaType,
- part.getName(), part.getTypeName());
+ part.getName(), part.getTypeName(), false);
}
inputs.add(paramtype);
}
}
if (paramtype == null) {
if (part.getElementName() != null) {
+ XmlSchemaElement el = getElement(part, xmlSchemaList);
paramtype = createParam(wsdlToCorbaBinding, mode, schemaType,
- part.getName(), part.getElementName());
+ part.getName(), part.getElementName(), el.isNillable());
} else {
paramtype = createParam(wsdlToCorbaBinding, mode, schemaType,
- part.getName(), part.getTypeName());
+ part.getName(), part.getTypeName(), false);
}
if (paramtype != null) {
outputs.add(paramtype);
@@ -386,15 +313,91 @@
}
}
- private static XmlSchemaType lookUpType(Part part, List<XmlSchema> xmlSchemaList) throws Exception {
+ private void updateList(WSDLToCorbaBinding wsdlToCorbaBinding, XmlSchemaType schemaType,
+ String name, QName typeName,
+ List<ParamType> inputs, List<ParamType> outputs,
+ boolean nillable) throws Exception {
+
+ ParamType paramtype = null;
+
+ for (int x = 0; x < inputs.size(); x++) {
+ paramtype = null;
+ ParamType d2 = (ParamType)inputs.get(x);
+
+ if (d2.getName().equals(name)) {
+ inputs.remove(x);
+ paramtype = createParam(wsdlToCorbaBinding, "inout", schemaType,
+ name, typeName, nillable);
+ if (paramtype != null) {
+ inputs.add(paramtype);
+ }
+ }
+ }
+ if (paramtype == null) {
+ paramtype = createParam(wsdlToCorbaBinding, "out", schemaType,
+ name, typeName, nillable);
+ if (paramtype != null) {
+ outputs.add(paramtype);
+ }
+ }
+
+ }
+
+ private Iterator getSchemaIterator(XmlSchemaType schemaType) {
+
+ if (schemaType instanceof XmlSchemaComplexType) {
+ XmlSchemaComplexType cpt = (XmlSchemaComplexType)schemaType;
+ XmlSchemaParticle particle = null;
+ if (cpt.getParticle() != null) {
+ particle = (XmlSchemaParticle)cpt.getParticle();
+
+ if (particle instanceof XmlSchemaSequence) {
+ XmlSchemaSequence seq = (XmlSchemaSequence)particle;
+ return seq.getItems().getIterator();
+ } else if (particle instanceof XmlSchemaChoice) {
+ XmlSchemaChoice choice = (XmlSchemaChoice)particle;
+ return choice.getItems().getIterator();
+ }
+ }
+ if (cpt.getContentModel() != null) {
+ XmlSchemaContentModel xscm = (XmlSchemaContentModel)cpt.getContentModel();
+ if (xscm instanceof XmlSchemaComplexContent) {
+ XmlSchemaComplexContent xscc = (XmlSchemaComplexContent)xscm;
+
+ XmlSchemaComplexContentExtension ext = null;
+ if (xscc.getContent() instanceof XmlSchemaComplexContentExtension) {
+ ext = (XmlSchemaComplexContentExtension)xscc.getContent();
+ }
+ if (ext.getParticle() instanceof XmlSchemaSequence) {
+ XmlSchemaSequence seq = (XmlSchemaSequence)ext.getParticle();
+ return seq.getItems().getIterator();
+ } else if (ext.getParticle() instanceof XmlSchemaChoice) {
+ XmlSchemaChoice choice = (XmlSchemaChoice)ext.getParticle();
+ return choice.getItems().getIterator();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static XmlSchemaType lookUpType(Part part, List<XmlSchema> xmlSchemaList)
+ throws Exception {
XmlSchemaType schemaType = null;
Iterator i = xmlSchemaList.iterator();
while (i.hasNext()) {
- XmlSchema xmlSchemaType = (XmlSchema)i.next();
+ XmlSchema xmlSchemaType = (XmlSchema)i.next();
if (part.getElementName() != null) {
XmlSchemaElement schemaElement = xmlSchemaType.getElementByName(part.getElementName());
+ if (schemaElement == null) {
+ QName elName = part.getElementName();
+ String prefix = definition.getPrefix(elName.getNamespaceURI());
+ QName name = new QName(elName.getNamespaceURI(),
+ prefix + ":" + elName.getLocalPart(), prefix);
+ schemaElement = xmlSchemaType.getElementByName(name);
+ }
if (schemaElement != null) {
if (schemaElement.getSchemaType() != null) {
schemaType = schemaElement.getSchemaType();
@@ -412,28 +415,34 @@
return schemaType;
}
- private static QName getElementsTypeName(Part part, List<XmlSchema> xmlSchemaList) throws Exception {
- QName schemaTypeName = null;
+ private static XmlSchemaElement getElement(Part part, List<XmlSchema> xmlSchemaList)
+ throws Exception {
+ XmlSchemaElement schemaElement = null;
Iterator i = xmlSchemaList.iterator();
while (i.hasNext()) {
- XmlSchema xmlSchemaType = (XmlSchema)i.next();
-
+ XmlSchema xmlSchemaType = (XmlSchema)i.next();
if (part.getElementName() != null) {
- XmlSchemaElement schemaElement = xmlSchemaType.getElementByName(part.getElementName());
+ schemaElement = xmlSchemaType.getElementByName(part.getElementName());
+ if (schemaElement == null) {
+ QName elName = part.getElementName();
+ String prefix = definition.getPrefix(elName.getNamespaceURI());
+ QName name = new QName(elName.getNamespaceURI(),
+ prefix + ":" + elName.getLocalPart(), prefix);
+ schemaElement = xmlSchemaType.getElementByName(name);
+ }
if (schemaElement != null) {
- if (schemaElement.getSchemaTypeName() != null) {
- return schemaElement.getSchemaTypeName();
- }
+ return schemaElement;
}
}
}
- return schemaTypeName;
+ return schemaElement;
}
-
+
private static ParamType createParam(WSDLToCorbaBinding wsdlToCorbaBinding,
String mode, XmlSchemaType schemaType,
- String name, QName typeName) throws Exception {
+ String name, QName typeName,
+ boolean nill) throws Exception {
CorbaTypeImpl corbaTypeImpl = null;
ParamType paramtype = new ParamType();
@@ -443,15 +452,29 @@
paramtype.setMode(modeType);
if (schemaType == null) {
- corbaTypeImpl = (CorbaTypeImpl)wsdlToCorbaBinding.CORBAPRIMITIVEMAP.get(typeName);
- paramtype.setIdltype(corbaTypeImpl.getQName());
+ corbaTypeImpl = (CorbaTypeImpl)wsdlToCorbaBinding.CORBAPRIMITIVEMAP.get(typeName);
+ if (nill) {
+ QName qname = corbaTypeImpl.getQName();
+ qname = wsdlToCorbaBinding.createQNameCorbaNamespace(qname.getLocalPart()
+ + "_nil");
+ paramtype.setIdltype(qname);
+ } else {
+ paramtype.setIdltype(corbaTypeImpl.getQName());
+ }
} else {
corbaTypeImpl = wsdlToCorbaBinding.convertSchemaToCorbaType(schemaType,
- typeName, null, false);
- if (corbaTypeImpl == null) {
+ typeName, null, null, false);
+ if (corbaTypeImpl == null) {
return null;
} else {
- paramtype.setIdltype(corbaTypeImpl.getQName());
+ if (nill) {
+ QName qname = corbaTypeImpl.getQName();
+ qname = wsdlToCorbaBinding.createQNameCorbaNamespace(qname.getLocalPart()
+ + "_nil");
+ paramtype.setIdltype(qname);
+ } else {
+ paramtype.setIdltype(corbaTypeImpl.getQName());
+ }
}
return paramtype;
}
@@ -500,7 +523,8 @@
private static boolean outputPartsHaveNoDocWrapper(String opName, Operation operation,
- List<XmlSchema> xmlSchemaList) throws Exception {
+ List<XmlSchema> xmlSchemaList)
+ throws Exception {
XmlSchemaType schemaType = null;
Iterator i = null;
@@ -538,7 +562,7 @@
}
private static boolean checkComplex(XmlSchemaComplexType cpt) throws Exception {
-
+
XmlSchemaParticle particle = (XmlSchemaParticle)cpt.getParticle();
if (particle == null) {
return true;
@@ -563,5 +587,6 @@
}
return false;
- }
+ }
+
}