You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/04/01 19:23:08 UTC

svn commit: r643479 - in /incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src: main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/ test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/

Author: rfeng
Date: Tue Apr  1 10:23:02 2008
New Revision: 643479

URL: http://svn.apache.org/viewvc?rev=643479&view=rev
Log:
Add seed code to support the generation of WSDL from Interface/Operation model

Added:
    incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/
    incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java   (with props)
    incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java   (with props)
    incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/
    incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java   (with props)
    incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java   (with props)

Added: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java?rev=643479&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java (added)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java Tue Apr  1 10:23:02 2008
@@ -0,0 +1,216 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.interface2wsdl;
+
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.OperationType;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.PortType;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaForm;
+import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaType;
+import org.w3c.dom.Element;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Interface2WSDLGenerator {
+    private WSDLFactory factory;
+    private WSDLDefinitionGenerator definitionGenerator = new WSDLDefinitionGenerator();
+
+    public Interface2WSDLGenerator() throws WSDLException {
+        super();
+        this.factory = WSDLFactory.newInstance();
+    }
+
+    public Interface2WSDLGenerator(WSDLFactory factory) {
+        super();
+        this.factory = factory;
+    }
+
+    public Definition generate(Interface interfaze) throws WSDLException {
+        if (interfaze == null) {
+            return null;
+        }
+        if (!interfaze.isRemotable()) {
+            throw new IllegalArgumentException("Interface is not remotable");
+        }
+        if (interfaze instanceof WSDLInterface) {
+            return ((WSDLInterface)interfaze).getWsdlDefinition().getDefinition();
+        }
+        QName name = getQName(interfaze);
+        Definition definition = factory.newDefinition();
+        definition.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
+        definition.addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
+
+        definition.setTargetNamespace(name.getNamespaceURI());
+        definition.setQName(name);
+        definition.addNamespace(name.getPrefix(), name.getNamespaceURI());
+
+        PortType portType = definition.createPortType();
+        portType.setQName(name);
+        for (Operation op : interfaze.getOperations()) {
+            javax.wsdl.Operation operation = generate(definition, op);
+            portType.addOperation(operation);
+        }
+        portType.setUndefined(false);
+        definition.addPortType(portType);
+        definitionGenerator.createBinding(definition, portType);
+        return definition;
+    }
+
+    protected QName getQName(Interface i) {
+        // FIXME: We need to add the name information into the Interface model 
+        Class<?> javaClass = ((JavaInterface)i).getJavaClass();
+        return new QName(JavaInterfaceUtil.getNamespace(javaClass), javaClass.getSimpleName());
+    }
+
+    public javax.wsdl.Operation generate(Definition definition, Operation op) {
+        javax.wsdl.Operation operation = definition.createOperation();
+        operation.setName(op.getName());
+        Input input = definition.createInput();
+        input.setName("input");
+        Message inputMsg = definition.createMessage();
+        QName inputMsgName = new QName(definition.getQName().getNamespaceURI(), "inputMessage");
+        inputMsg.setQName(inputMsgName);
+
+        inputMsg.addPart(generate(definition, op.getInputType(), "parameters"));
+        input.setMessage(inputMsg);
+        operation.setInput(input);
+
+        if (!op.isNonBlocking()) {
+            Output output = definition.createOutput();
+            output.setName("output");
+            Message outputMsg = definition.createMessage();
+            QName outputMsgName = new QName(definition.getQName().getNamespaceURI(), "outputMessage");
+            outputMsg.setQName(outputMsgName);
+
+            outputMsg.addPart(generate(definition, op.getOutputType(), "return"));
+            output.setMessage(outputMsg);
+
+            operation.setOutput(output);
+            operation.setStyle(OperationType.REQUEST_RESPONSE);
+        } else {
+            operation.setStyle(OperationType.ONE_WAY);
+        }
+
+        operation.setUndefined(false);
+        return operation;
+    }
+
+    public Part generate(Definition definition, DataType arg, String partName) {
+        Part part = definition.createPart();
+        part.setName(partName);
+        if (arg != null && arg.getLogical() instanceof XMLType) {
+            XMLType xmlType = (XMLType)arg.getLogical();
+            part.setElementName(xmlType.getElementName());
+            if (xmlType.getElementName() == null) {
+                part.setTypeName(xmlType.getTypeName());
+            }
+        }
+        return part;
+    }
+
+    public XmlSchemaType getXmlSchemaType(DataType type) {
+        return null;
+    }
+
+    // FIXME: WE need to add databinding-specific Java2XSD generation
+    public Element generateXSD() {
+        return null;
+    }
+
+    public void generateWrapperElements(Operation op) {
+        XmlSchemaCollection collection = new XmlSchemaCollection();
+        String ns = getQName(op.getInterface()).getNamespaceURI();
+        XmlSchema schema = new XmlSchema(ns, collection);
+        schema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
+        schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
+
+        XmlSchemaElement inputElement = new XmlSchemaElement();
+        inputElement.setQName(new QName(ns, op.getName()));
+        XmlSchemaComplexType inputType = new XmlSchemaComplexType(schema);
+        inputType.setName("");
+        XmlSchemaSequence inputSeq = new XmlSchemaSequence();
+        inputType.setParticle(inputSeq);
+        List<DataType> argTypes = op.getInputType().getLogical();
+        for (DataType argType : argTypes) {
+            XmlSchemaElement child = new XmlSchemaElement();
+            Object logical = argType.getLogical();
+            if (logical instanceof XMLType) {
+                child.setName(((XMLType)logical).getElementName().getLocalPart());
+                XmlSchemaType type = getXmlSchemaType(argType);
+                child.setType(type);
+            }
+            inputSeq.getItems().add(child);
+        }
+        inputElement.setType(inputType);
+
+        XmlSchemaElement outputElement = new XmlSchemaElement();
+        outputElement.setQName(new QName(ns, op.getName() + "Response"));
+        XmlSchemaComplexType outputType = new XmlSchemaComplexType(schema);
+        outputType.setName("");
+        XmlSchemaSequence outputSeq = new XmlSchemaSequence();
+        outputType.setParticle(outputSeq);
+        DataType returnType = op.getOutputType();
+        XmlSchemaElement child = new XmlSchemaElement();
+        Object logical = returnType.getLogical();
+        if (logical instanceof XMLType) {
+            child.setName(((XMLType)logical).getElementName().getLocalPart());
+            XmlSchemaType type = getXmlSchemaType(returnType);
+            child.setType(type);
+        }
+        outputSeq.getItems().add(child);
+        outputElement.setType(outputType);
+
+        schema.getElements().add(inputElement.getQName(), inputElement);
+        schema.getElements().add(outputElement.getQName(), outputElement);
+
+    }
+
+    public WSDLFactory getFactory() {
+        return factory;
+    }
+
+    public void setFactory(WSDLFactory factory) {
+        this.factory = factory;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Interface2WSDLGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java?rev=643479&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java (added)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java Tue Apr  1 10:23:02 2008
@@ -0,0 +1,201 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.interface2wsdl;
+
+import java.util.Iterator;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Input;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.soap.SOAPBinding;
+import javax.wsdl.extensions.soap.SOAPBody;
+import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+/**
+ * 
+ * @version $Rev$ $Date$
+ */
+public class WSDLDefinitionGenerator {
+    private static final String SOAP_NS = "http://schemas.xmlsoap.org/wsdl/soap/";
+    private static final QName SOAP_ADDRESS = new QName(SOAP_NS, "address");
+    private static final QName SOAP_BINDING = new QName(SOAP_NS, "binding");
+    private static final QName SOAP_BODY = new QName(SOAP_NS, "body");
+    private static final QName SOAP_OPERATION = new QName(SOAP_NS, "operation");
+
+    private static final String BINDING_SUFFIX = "__SOAPBinding";
+    private static final String SERVICE_SUFFIX = "__Service";
+    private static final String PORT_SUFFIX = "__SOAPHTTPPort";
+
+    public Definition cloneDefinition(WSDLFactory factory, Definition definition) throws WSDLException {
+        Element root = definition.getDocumentationElement();
+        root = (Element)root.cloneNode(true);
+        WSDLReader reader = factory.newWSDLReader();
+        return reader.readWSDL(definition.getDocumentBaseURI(), root);
+    }
+
+    public Binding createBinding(Definition definition, PortType portType) throws WSDLException {
+        Binding binding = definition.createBinding();
+        binding.setPortType(portType);
+        configureBinding(binding, portType);
+        SOAPBinding soapBinding =
+            (SOAPBinding)definition.getExtensionRegistry().createExtension(Binding.class, SOAP_BINDING);
+        soapBinding.setStyle("document");
+        soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
+        binding.addExtensibilityElement(soapBinding);
+
+        createBindingOperations(definition, binding, portType);
+        binding.setUndefined(false);
+        definition.addBinding(binding);
+        return binding;
+    }
+
+    protected void configureBinding(Binding binding, PortType portType) throws WSDLException {
+        QName portTypeName = portType.getQName();
+        if (portTypeName != null) {
+            binding.setQName(new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + BINDING_SUFFIX));
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    protected void createBindingOperations(Definition definition, Binding binding, PortType portType)
+        throws WSDLException {
+        for (Iterator oi = portType.getOperations().iterator(); oi.hasNext();) {
+            Operation operation = (Operation)oi.next();
+            BindingOperation bindingOperation = definition.createBindingOperation();
+            bindingOperation.setOperation(operation);
+            configureBindingOperation(bindingOperation, operation);
+            SOAPOperation soapOperation =
+                (SOAPOperation)definition.getExtensionRegistry().createExtension(BindingOperation.class, SOAP_OPERATION);
+            soapOperation.setSoapActionURI("");
+            bindingOperation.addExtensibilityElement(soapOperation);
+            if (operation.getInput() != null) {
+                BindingInput bindingInput = definition.createBindingInput();
+                configureBindingInput(bindingInput, operation.getInput());
+                SOAPBody soapBody =
+                    (SOAPBody)definition.getExtensionRegistry().createExtension(BindingInput.class, SOAP_BODY);
+                soapBody.setUse("literal");
+                bindingInput.addExtensibilityElement(soapBody);
+                bindingOperation.setBindingInput(bindingInput);
+            }
+            if (operation.getOutput() != null) {
+                BindingOutput bindingOutput = definition.createBindingOutput();
+                configureBindingOutput(bindingOutput, operation.getOutput());
+                SOAPBody soapBody =
+                    (SOAPBody)definition.getExtensionRegistry().createExtension(BindingOutput.class, SOAP_BODY);
+                soapBody.setUse("literal");
+                bindingOutput.addExtensibilityElement(soapBody);
+                bindingOperation.setBindingOutput(bindingOutput);
+            }
+            for (Iterator fi = operation.getFaults().values().iterator(); fi.hasNext();) {
+                Fault fault = (Fault)fi.next();
+                BindingFault bindingFault = definition.createBindingFault();
+                configureBindingFault(bindingFault, fault);
+                bindingOperation.addBindingFault(bindingFault);
+            }
+            binding.addBindingOperation(bindingOperation);
+        }
+    }
+
+    protected void configureBindingOperation(BindingOperation bindingOperation, Operation operation)
+        throws WSDLException {
+        bindingOperation.setName(operation.getName());
+    }
+
+    protected void configureBindingInput(BindingInput bindingInput, Input input) throws WSDLException {
+        bindingInput.setName(input.getName());
+    }
+
+    protected void configureBindingOutput(BindingOutput bindingOutput, Output output) throws WSDLException {
+        bindingOutput.setName(output.getName());
+    }
+
+    protected void configureBindingFault(BindingFault bindingFault, Fault fault) throws WSDLException {
+        bindingFault.setName(fault.getName());
+    }
+
+    public Service createService(Definition definition, PortType portType) {
+        try {
+            Service service = definition.createService();
+            configureService(service, portType);
+            Binding binding = createBinding(definition, portType);
+            createPort(definition, binding, service);
+            definition.addService(service);
+            return service;
+        } catch (WSDLException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    public Service createService(Definition definition, Binding binding) {
+        try {
+            Service service = definition.createService();
+            configureService(service, binding.getPortType());
+            createPort(definition, binding, service);
+            definition.addService(service);
+            return service;
+        } catch (WSDLException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    protected void configureService(Service service, PortType portType) throws WSDLException {
+        QName portTypeName = portType.getQName();
+        if (portTypeName != null) {
+            service.setQName(new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + SERVICE_SUFFIX));
+        }
+    }
+
+    protected Port createPort(Definition definition, Binding binding, Service service) throws WSDLException {
+        Port port = definition.createPort();
+        port.setBinding(binding);
+        configurePort(definition, port, binding);
+        /*
+        ExtensibilityElement soapAddress =
+            definition.getExtensionRegistry().createExtension(Port.class, SOAP_ADDRESS);
+        ((SOAPAddress)soapAddress).setLocationURI("");
+        port.addExtensibilityElement(soapAddress);
+        */
+        service.addPort(port);
+        return port;
+    }
+
+    protected void configurePort(Definition definition, Port port, Binding binding) throws WSDLException {
+        if (binding.getPortType() != null && binding.getPortType().getQName() != null) {
+            port.setName(binding.getPortType().getQName().getLocalPart() + PORT_SUFFIX);
+        }
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/WSDLDefinitionGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java?rev=643479&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java Tue Apr  1 10:23:02 2008
@@ -0,0 +1,49 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.interface2wsdl;
+
+import java.io.StringWriter;
+
+import javax.wsdl.Definition;
+import javax.wsdl.xml.WSDLWriter;
+
+import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Java2WSDLGeneratorTestCase {
+
+    @Test
+    public void testGenerate() throws Exception {
+        DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory();
+        org.apache.tuscany.sca.interfacedef.Interface iface = iFactory.createJavaInterface(TestJavaInterface.class);
+        Interface2WSDLGenerator generator = new Interface2WSDLGenerator();
+        Definition definition = generator.generate(iface);
+        // System.out.println(definition);
+        
+        WSDLWriter writer = generator.getFactory().newWSDLWriter();
+        StringWriter sw = new StringWriter();
+        writer.writeWSDL(definition, sw);
+        System.out.println(sw.toString());
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/Java2WSDLGeneratorTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java?rev=643479&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java (added)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java Tue Apr  1 10:23:02 2008
@@ -0,0 +1,37 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.interface2wsdl;
+
+import org.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface TestJavaInterface {
+    String m1(String str);
+
+    @OneWay
+    void m2(int i);
+    
+    String m3();
+    
+    void m4();
+    
+    String m5(String str, int i);
+}

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl/TestJavaInterface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org