cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r542728 [2/2] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/tools/ api/src/main/java/org/apache/cxf/tools/validator/ api/src/main/java/org/apache/cxf/wsdl/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/wsdl11/ rt/...
Date Wed, 30 May 2007 02:38:56 GMT
Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
Tue May 29 19:38:51 2007
@@ -23,11 +23,11 @@
 import java.io.Writer;
 import java.util.Iterator;
 import java.util.Map;
-
 import javax.wsdl.Binding;
 import javax.wsdl.Port;
 import javax.wsdl.Service;
 import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.ExtensionRegistry;
 import javax.wsdl.xml.WSDLWriter;
 import javax.xml.namespace.QName;
@@ -36,14 +36,13 @@
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.WSDLConstants;
-import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
-import org.apache.cxf.transport.jms.AddressType;
+import org.apache.cxf.tools.misc.processor.address.Address;
+import org.apache.cxf.tools.misc.processor.address.AddressFactory;
+import org.apache.cxf.wsdl.WSDLExtensibilityPlugin;
 
 public class WSDLToServiceProcessor extends AbstractWSDLToProcessor {
 
     private static final String NEW_FILE_NAME_MODIFIER = "-service";
-    private static final String HTTP_PREFIX = "http://localhost:9000";
 
     private Map services;
     private Service service;
@@ -101,10 +100,6 @@
         return (port == null) ? false : true;
     }
 
-    private boolean isSOAP12() {
-        return env.optionSet(ToolConstants.CFG_SOAP12);
-    }
-
     private boolean isBindingExisted() {
         Map bindings = wsdlDefinition.getBindings();
         if (bindings == null) {
@@ -163,59 +158,16 @@
         if (extReg == null) {
             extReg = wsdlFactory.newPopulatedExtensionRegistry();
         }
-        if ("http".equalsIgnoreCase((String)env.get(ToolConstants.CFG_TRANSPORT))) {
-            SoapAddress soapAddress = null;
-            try {
-                soapAddress = SOAPBindingUtil.createSoapAddress(extReg, isSOAP12());
-            } catch (WSDLException wse) {
-                Message msg = new Message("FAIL_TO_CREATE_SOAPADDRESS", LOG);
-                throw new ToolException(msg, wse);
-            }
-            
-            if (env.get(ToolConstants.CFG_ADDRESS) != null) {
-                soapAddress.setLocationURI((String)env.get(ToolConstants.CFG_ADDRESS));
-            } else {
-                soapAddress.setLocationURI(HTTP_PREFIX + "/" + env.get(ToolConstants.CFG_SERVICE)
+ "/"
-                                           + env.get(ToolConstants.CFG_PORT));
-            }
-            port.addExtensibilityElement(soapAddress);
-        } else if ("jms".equalsIgnoreCase((String)env.get(ToolConstants.CFG_TRANSPORT)))
{
-            AddressType jmsAddress = null;
-            //JMSAddress jmsAddress = null;
-            //JMSAddressSerializer jmsAddressSerializer = new JMSAddressSerializer();
-            try {
-//extReg.registerSerializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
-//extReg.registerDeserializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
-                jmsAddress = (AddressType)extReg.createExtension(Port.class, ToolConstants.JMS_ADDRESS);
-                if (env.optionSet(ToolConstants.JMS_ADDR_DEST_STYLE)) {
-                    //jmsAddress.setDestinationStyle((String)env.get(ToolConstants.JMS_ADDR_DEST_STYLE));
-                }
-                if (env.optionSet(ToolConstants.JMS_ADDR_INIT_CTX)) {
-                    //jmsAddress.setInitialContextFactory((String)env.get(ToolConstants.JMS_ADDR_INIT_CTX));
-                }
-                if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_DEST)) {
-                    jmsAddress.setJndiDestinationName((String)env.get(ToolConstants.JMS_ADDR_JNDI_DEST));
-                }
-                if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_FAC)) {
-                    jmsAddress.setJndiConnectionFactoryName((String)env.get(ToolConstants.JMS_ADDR_JNDI_FAC));
-                }
-                if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_URL)) {
-                    //jmsAddress.setJndiProviderURL((String)env.get(ToolConstants.JMS_ADDR_JNDI_URL));
-                }
-                if (env.optionSet(ToolConstants.JMS_ADDR_MSGID_TO_CORRID)) {
-                    //jmsAddress.setUseMessageIDAsCorrelationID(Boolean.getBoolean((String)env
-                    //.get(ToolConstants.JMS_ADDR_MSGID_TO_CORRID)));
-                }
-                if (env.optionSet(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME)) {
-                    //jmsAddress.setDurableSubscriberName((String)env
-                    //  .get(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME));
-                }
-            } catch (WSDLException wse) {
-                Message msg = new Message("FAIL_TO_CREATE_SOAP_ADDRESS", LOG);
-                throw new ToolException(msg, wse);
-            }
-            port.addExtensibilityElement(jmsAddress);
+        String transport = (String)env.get(ToolConstants.CFG_TRANSPORT);
+        Address address = AddressFactory.getInstance().getAddresser(transport);
+
+        WSDLExtensibilityPlugin plugin = getWSDLPlugin(transport, Port.class);
+        try {
+            ExtensibilityElement extElement = plugin.createExtension(address.buildAddressArguments(env));
+            port.addExtensibilityElement(extElement);
+        } catch (WSDLException wse) {
+            Message msg = new Message("FAIL_TO_CREATE_SOAP_ADDRESS", LOG);
+            throw new ToolException(msg, wse);
         }
     }
-
 }

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
Tue May 29 19:38:51 2007
@@ -21,10 +21,10 @@
 
 import java.io.IOException;
 import java.io.Writer;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-
 import javax.wsdl.Binding;
 import javax.wsdl.BindingInput;
 import javax.wsdl.BindingOperation;
@@ -36,22 +36,22 @@
 import javax.wsdl.PortType;
 import javax.wsdl.Service;
 import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.ExtensionRegistry;
-import javax.wsdl.extensions.http.HTTPAddress;
 import javax.wsdl.xml.WSDLWriter;
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.bindings.xformat.XMLBindingMessageFormat;
-import org.apache.cxf.bindings.xformat.XMLFormatBinding;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.WSDLConstants;
+import org.apache.cxf.tools.misc.processor.address.Address;
+import org.apache.cxf.tools.misc.processor.address.AddressFactory;
+import org.apache.cxf.wsdl.WSDLExtensibilityPlugin;
 
 public class WSDLToXMLProcessor extends AbstractWSDLToProcessor {
 
     private static final String NEW_FILE_NAME_MODIFIER = "-xmlbinding";
-    private static final String HTTP_PREFIX = "http://localhost:9000";
 
     private ExtensionRegistry extReg;
 
@@ -182,15 +182,12 @@
         if (extReg == null) {
             extReg = wsdlFactory.newPopulatedExtensionRegistry();
         }
-        XMLFormatBinding xmlBinding = null;
         try {
-            xmlBinding = (XMLFormatBinding)extReg.createExtension(Binding.class,
-                                                                  ToolConstants.XML_BINDING_FORMAT);
+            binding.addExtensibilityElement(getWSDLPlugin("xml", Binding.class).createExtension(null));
         } catch (WSDLException wse) {
             Message msg = new Message("FAIL_TO_CREATE_XMLBINDING", LOG);
             throw new ToolException(msg);
         }
-        binding.addExtensibilityElement(xmlBinding);
     }
 
     @SuppressWarnings("unchecked")
@@ -232,19 +229,20 @@
         // TODO
     }
 
-    private XMLBindingMessageFormat getXMLBody(Class clz, String operationName) throws ToolException
{
+    private ExtensibilityElement getXMLBody(Class clz, String operationName) throws ToolException
{
         if (extReg == null) {
             extReg = wsdlFactory.newPopulatedExtensionRegistry();
         }
-        XMLBindingMessageFormat xmlFormat = null;
+        Map<String, Object> args = new HashMap<String, Object>();
+        args.put(QName.class.getName(), new QName(wsdlDefinition.getTargetNamespace(), operationName));
+        args.put(Class.class.getName(), clz);
+
         try {
-            xmlFormat = (XMLBindingMessageFormat)extReg.createExtension(clz, ToolConstants.XML_FORMAT);
+            return getWSDLPlugin("xml", clz).createExtension(args);
         } catch (WSDLException wse) {
             Message msg = new Message("FAIL_TO_CREATE_XMLBINDING", LOG);
             throw new ToolException(msg);
         }
-        xmlFormat.setRootNode(new QName(wsdlDefinition.getTargetNamespace(), operationName));
-        return xmlFormat;
     }
 
     private void doAppendService() throws ToolException {
@@ -268,21 +266,17 @@
         if (extReg == null) {
             extReg = wsdlFactory.newPopulatedExtensionRegistry();
         }
-        HTTPAddress xmlHttpAddress = null;
+
+        Address address = AddressFactory.getInstance().getAddresser("xml");
+        WSDLExtensibilityPlugin generator = getWSDLPlugin("xml", Port.class);
         try {
-            xmlHttpAddress = (HTTPAddress)extReg.createExtension(Port.class,
-                                                                 WSDLConstants.NS_XMLHTTP_BINDING_ADDRESS);
+            ExtensibilityElement extElement = generator.createExtension(address.buildAddressArguments(env));
+
+            port.addExtensibilityElement(extElement);
         } catch (WSDLException wse) {
             Message msg = new Message("FAIL_TO_CREATE_SOAPADDRESS", LOG);
             throw new ToolException(msg);
         }
-        if (env.get(ToolConstants.CFG_ADDRESS) != null) {
-            xmlHttpAddress.setLocationURI((String)env.get(ToolConstants.CFG_ADDRESS));
-        } else {
-            xmlHttpAddress.setLocationURI(HTTP_PREFIX + "/" + env.get(ToolConstants.CFG_SERVICE)
+ "/"
-                                          + env.get(ToolConstants.CFG_PORT));
-        }
-        port.addExtensibilityElement(xmlHttpAddress);
     }
 
     private void writeToWSDL() throws ToolException {

Added: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Address.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Address.java?view=auto&rev=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Address.java
(added)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Address.java
Tue May 29 19:38:51 2007
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.misc.processor.address;
+
+import java.util.Map;
+import org.apache.cxf.tools.common.ToolContext;
+
+public interface Address {
+    String HTTP_PREFIX = "http://localhost:9000";
+    
+    Map<String, Object> buildAddressArguments(final ToolContext context);
+}

Added: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/AddressFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/AddressFactory.java?view=auto&rev=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/AddressFactory.java
(added)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/AddressFactory.java
Tue May 29 19:38:51 2007
@@ -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.cxf.tools.misc.processor.address;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.util.NameUtil;
+
+public final class AddressFactory {
+    private static final Logger LOG = LogUtils.getL7dLogger(AddressFactory.class);
+    
+    private static final String PREFIX = "org.apache.cxf.tools.misc.processor.address";
+    private static final AddressFactory INSTANCE = new AddressFactory();
+
+    private final Map<String, Address> addresses = new HashMap<String, Address>();
+    
+    private AddressFactory() {
+    }
+
+    public static AddressFactory getInstance() {
+        return INSTANCE;
+    }
+    
+    public Address getAddresser(final String name) {
+        Address address = addresses.get(name);
+        if (address != null) {
+            return address;
+        }
+
+        StringBuffer sb = new StringBuffer();
+        sb.append(PREFIX);
+        sb.append(".");
+        sb.append(NameUtil.capitalize(name));
+        sb.append("Address");
+        try {
+            address = (Address) Class.forName(sb.toString()).newInstance();
+            addresses.put(name, address);
+            LOG.log(Level.INFO, "FOUND_ADDRESSER", sb);
+            return address;
+        } catch (Exception e) {
+            Message msg = new Message("FOUND_NO_ADDRESSER", LOG, sb);
+            throw new ToolException(msg);
+        } 
+    }
+}

Added: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/JmsAddress.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/JmsAddress.java?view=auto&rev=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/JmsAddress.java
(added)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/JmsAddress.java
Tue May 29 19:38:51 2007
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.misc.processor.address;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+
+public class JmsAddress implements Address {
+    public Map<String, Object> buildAddressArguments(final ToolContext context) {
+        Map<String, Object> args = new HashMap<String, Object>();
+        
+        if (context.optionSet(ToolConstants.JMS_ADDR_DEST_STYLE)) {
+            args.put(ToolConstants.JMS_ADDR_DEST_STYLE,
+                     context.get(ToolConstants.JMS_ADDR_DEST_STYLE));
+        }
+        if (context.optionSet(ToolConstants.JMS_ADDR_INIT_CTX)) {
+            args.put(ToolConstants.JMS_ADDR_INIT_CTX,
+                     context.get(ToolConstants.JMS_ADDR_INIT_CTX));
+        }
+        if (context.optionSet(ToolConstants.JMS_ADDR_JNDI_DEST)) {
+            args.put(ToolConstants.JMS_ADDR_JNDI_DEST,
+                context.get(ToolConstants.JMS_ADDR_JNDI_DEST));
+        }
+        if (context.optionSet(ToolConstants.JMS_ADDR_JNDI_FAC)) {
+            args.put(ToolConstants.JMS_ADDR_JNDI_FAC,
+                     context.get(ToolConstants.JMS_ADDR_JNDI_FAC));
+        }
+        if (context.optionSet(ToolConstants.JMS_ADDR_JNDI_URL)) {
+            args.put(ToolConstants.JMS_ADDR_JNDI_URL,
+                     context.get(ToolConstants.JMS_ADDR_JNDI_URL));
+        }
+        if (context.optionSet(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME)) {
+            args.put(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME,
+                     context.get(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME));
+        }
+        return args;
+    }
+}

Added: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Messages.properties?view=auto&rev=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Messages.properties
(added)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/Messages.properties
Tue May 29 19:38:51 2007
@@ -0,0 +1,2 @@
+FOUND_NO_ADDRESSER = Can not find addresser for {0}
+FOUND_ADDRESSER = Found addresser {0}
\ No newline at end of file

Added: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/SoapAddress.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/SoapAddress.java?view=auto&rev=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/SoapAddress.java
(added)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/SoapAddress.java
Tue May 29 19:38:51 2007
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.misc.processor.address;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+
+public class SoapAddress extends XmlAddress {
+    
+    public Map<String, Object> buildAddressArguments(final ToolContext context) {
+        Map<String, Object> args = new HashMap<String, Object>();
+
+        args.putAll(super.buildAddressArguments(context));
+        
+        if (context.optionSet(ToolConstants.CFG_SOAP12)) {
+            args.put(ToolConstants.CFG_SOAP12,
+                     context.get(ToolConstants.CFG_SOAP12));
+        }
+        return args;
+    }
+}

Added: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/XmlAddress.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/XmlAddress.java?view=auto&rev=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/XmlAddress.java
(added)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/address/XmlAddress.java
Tue May 29 19:38:51 2007
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.misc.processor.address;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+
+public class XmlAddress implements Address {
+    
+    public Map<String, Object> buildAddressArguments(final ToolContext context) {
+        Map<String, Object> args = new HashMap<String, Object>();
+
+        if (context.optionSet(ToolConstants.CFG_ADDRESS)) {
+            args.put(ToolConstants.CFG_ADDRESS,
+                     context.get(ToolConstants.CFG_ADDRESS));
+        } else {
+            args.put(ToolConstants.CFG_ADDRESS,
+                     HTTP_PREFIX + "/"
+                     + context.get(ToolConstants.CFG_SERVICE)
+                     + "/"
+                     + context.get(ToolConstants.CFG_PORT));
+        }
+
+        return args;
+    }
+}

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/wsdl2service.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/wsdl2service.xml?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/wsdl2service.xml
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/wsdl2service.xml
Tue May 29 19:38:51 2007
@@ -40,8 +40,8 @@
 		       </annotation>
 				<switch>transport</switch>
 				<associatedArgument placement="afterSpace">
-				    <annotation>http/jms</annotation>
-				  	<valueenum>http|jms</valueenum>
+				    <annotation>soap/xml/jms</annotation>
+				  	<valueenum>soap|xml|jms</valueenum>
 				</associatedArgument>
 		    </option>
 	

Modified: incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessorTest.java
Tue May 29 19:38:51 2007
@@ -46,7 +46,7 @@
 
     @Test
     public void testNewService() throws Exception {
-        String[] args = new String[] {"-transport", "http", "-e", "serviceins", "-p", "portins",
"-n",
+        String[] args = new String[] {"-transport", "soap", "-e", "serviceins", "-p", "portins",
"-n",
                                       "Greeter_SOAPBinding", "-a",
                                       "http://localhost:9000/newservice/newport", "-d",
                                       output.getCanonicalPath(),
@@ -93,7 +93,7 @@
 
     @Test
     public void testNewServiceSoap12() throws Exception {
-        String[] args = new String[] {"-soap12", "-transport", "http",
+        String[] args = new String[] {"-soap12", "-transport", "soap",
                                       "-e", "SOAPService", "-p", "SoapPort", "-n",
                                       "Greeter_SOAPBinding", "-a",
                                       "http://localhost:9000/SOAPService/SoapPort", "-d",
@@ -138,7 +138,7 @@
     @Test
     public void testDefaultLocation() throws Exception {
 
-        String[] args = new String[] {"-transport", "http", "-e", "serviceins", "-p", "portins",
"-n",
+        String[] args = new String[] {"-transport", "soap", "-e", "serviceins", "-p", "portins",
"-n",
                                       "Greeter_SOAPBinding", "-d", output.getCanonicalPath(),
                                       getLocation("/misctools_wsdl/hello_world.wsdl")};
         WSDLToService.main(args);
@@ -230,7 +230,6 @@
 //                     }
                     if (!(jmsAddress.getJndiDestinationName() != null && jmsAddress.getJndiDestinationName()
                         .equals("dynamicQueues/test.cxf.jmstransport.queue"))) {
-                        System.err.println("jms address break 2");
                         break;
                     }
 //                 if (!(jmsAddress.getJndiProviderURL() != null && jmsAddress.getJndiProviderURL()

Modified: incubator/cxf/trunk/tools/wsdlto/test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/pom.xml?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/pom.xml (original)
+++ incubator/cxf/trunk/tools/wsdlto/test/pom.xml Tue May 29 19:38:51 2007
@@ -76,7 +76,20 @@
 	     <scope>test</scope>
 	</dependency>
 
-        
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-jms</artifactId>
+            <version>${project.version}</version>
+	    <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-bindings-xml</artifactId>
+            <version>${project.version}</version>
+	    <scope>test</scope>
+        </dependency>
+
     </dependencies>
 
     <scm>

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
Tue May 29 19:38:51 2007
@@ -493,9 +493,7 @@
     
     @Test
     public void testCXF677() throws Exception {
-        
-       
-        String[] args = new String[] {"-d", output.getCanonicalPath(), 
+        String[] args = new String[] {"-d", output.getCanonicalPath(),
                                       "-b", 
                                       getLocation("/wsdl2java_wsdl/hello-mime-binding.xml"),
                                       getLocation("/wsdl2java_wsdl/hello-mime.wsdl")};

Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java?view=diff&rev=542728&r1=542727&r2=542728
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
Tue May 29 19:38:51 2007
@@ -34,6 +34,7 @@
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.common.model.JavaPort;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
+import org.apache.cxf.tools.validator.ServiceValidator;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
 import org.apache.cxf.tools.wsdlto.core.PluginLoader;
@@ -183,6 +184,13 @@
         } catch (Exception e) {
             e.printStackTrace();
         }
+    }
+
+    public void testGetServceValidator() throws Exception {
+        JAXWSContainer container = new JAXWSContainer(null);
+        List<ServiceValidator> validators = container.getServiceValidators();
+        assertNotNull(validators);
+        assertTrue(validators.size() > 0);
     }
 
     protected String getLocation(String wsdlFile) throws URISyntaxException {



Mime
View raw message