You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/12/23 15:56:42 UTC
[1/3] cxf git commit: [CXF-7195] Removing rt-databindings-xmlbeans
Repository: cxf
Updated Branches:
refs/heads/master 969a10c9f -> 40380d8e5
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XmlBeansTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XmlBeansTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XmlBeansTest.java
deleted file mode 100644
index d516058..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XmlBeansTest.java
+++ /dev/null
@@ -1,94 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.test.AbstractCXFTest;
-import org.apache.cxf.testutil.common.TestUtil;
-import org.apache.cxf.xmlbeans.wsdltest.GreeterMine;
-import org.apache.cxf.xmlbeans.wsdltest.SOAPMineService;
-import org.apache.cxf.xmlbeans.wsdltest.SayHi2MessageDocument;
-import org.apache.cxf.xmlbeans.wsdltest.StringListType;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class XmlBeansTest extends AbstractCXFTest {
- private static final String PORT = TestUtil.getPortNumber(XmlBeansTest.class);
- private static final String CONFIG1 = "org/apache/cxf/xmlbeans/cxf.xml";
- private static final String CONFIG2 = "org/apache/cxf/xmlbeans/cxf2.xml";
-
- private SpringBusFactory bf;
-
- @Before
- public void setUp() throws Exception {
- bf = new SpringBusFactory();
-
- }
-
- @After
- public void tearDown() throws Exception {
- if (bus != null) {
- bus.shutdown(false);
- bus = null;
- }
- BusFactory.setDefaultBus(null);
- }
-
-
- @Test
- public void testBusCreationFails() throws Exception {
- bf = new SpringBusFactory();
- bus = bf.createBus(CONFIG1);
- BusFactory.setDefaultBus(bus);
- }
-
- @Test
- public void testBasicFails() throws Exception {
-
- bf = new SpringBusFactory();
- bus = bf.createBus(CONFIG2);
- BusFactory.setDefaultBus(bus);
- URL wsdlURL = XmlBeansTest.class.getResource("/wsdl/xmlbeanstest.wsdl");
- SOAPMineService ss =
- new SOAPMineService(wsdlURL,
- new QName("http://cxf.apache.org/xmlbeans/wsdltest", "SOAPMineService"));
- GreeterMine port = ss.getSoapPort();
- ((BindingProvider)port).getRequestContext()
- .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- "http://localhost:" + PORT + "/SoapContext/SoapPort");
-
-
- SayHi2MessageDocument document = SayHi2MessageDocument.Factory.newInstance();
- StringListType stringListType = document.addNewSayHi2Message();
- stringListType.setMyname("sean");
- stringListType.setMyaddress("home");
- port.sayHi2(document);
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/BasicTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/BasicTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/BasicTest.java
deleted file mode 100644
index d25f71d..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/BasicTest.java
+++ /dev/null
@@ -1,61 +0,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.
- */
-
-package org.apache.cxf.xmlbeans.basic;
-
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.xmlbeans.AbstractXmlBeansTest;
-import org.junit.Before;
-import org.junit.Test;
-
-public class BasicTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- createService(TestService.class, null, "TestService", null);
- }
-
- @Test
- public void testBasicInvoke() throws Exception {
- Node response = invoke("TestService", "bean11.xml");
- addNamespace("ns1", "http://basic.xmlbeans.cxf.apache.org/");
- assertValid("/s:Envelope/s:Body/ns1:echoAddressResponse", response);
- assertValid("//ns1:echoAddressResponse/ns1:return", response);
- assertValid("//ns1:echoAddressResponse/ns1:return/country", response);
- assertValid("//ns1:echoAddressResponse/ns1:return/country[text()='Mars']",
- response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node doc = getWSDLDocument("TestService");
- assertValid("/wsdl:definitions/wsdl:types/xsd:schema"
- + "[@targetNamespace='http://cxf.apache.org/databinding/xmlbeans/test']",
- doc);
-
- assertValid("/wsdl:definitions/wsdl:types/xsd:schema"
- + "[@targetNamespace='http://cxf.apache.org/databinding/xmlbeans/test']"
- + "/xsd:complexType[@name='Address']",
- doc);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/TestService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/TestService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/TestService.java
deleted file mode 100644
index 4ee4546..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/TestService.java
+++ /dev/null
@@ -1,47 +0,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.
- */
-
-package org.apache.cxf.xmlbeans.basic;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-
-import org.apache.cxf.databinding.xmlbeans.test.Address;
-
-
-/**
- *
- */
-public class TestService {
- @WebMethod
- @WebResult(name = "return")
- public Address echoAddress(@WebParam(name = "ad")Address ad) {
-
- Address ret = Address.Factory.newInstance();
- ret.setAddressLine1(ad.getAddressLine1());
- ret.setAddressLine2(ad.getAddressLine2());
- ret.setCity(ad.getCity());
- ret.setCountry(ad.getCountry());
- ret.setZIPPostalCode(ad.getZIPPostalCode());
- ret.setStateProvinceRegion(ad.getStateProvinceRegion());
- return ret;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/bean11.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/bean11.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/bean11.xml
deleted file mode 100644
index c22e315..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/basic/bean11.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body>
- <ns1:echoAddress xmlns:ns1="http://basic.xmlbeans.cxf.apache.org/">
- <ns1:ad>
- <addressLine1>30 Foo Drive</addressLine1>
- <addressLine2/>
- <city>Bar</city>
- <stateProvinceRegion>SN</stateProvinceRegion>
- <ZIPPostalCode>12345</ZIPPostalCode>
- <country>Mars</country>
- </ns1:ad>
- </ns1:echoAddress>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf.xml
deleted file mode 100644
index 23bf8aa..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
- <bean id="GreeterImpl" class="org.apache.cxf.xmlbeans.GreeterMineImpl" scope="prototype"/>
- <!--bean id="xmlBeansBean"
- class="org.apache.cxf.jaxb.JAXBDataBinding"
- scope="prototype" /-->
- <bean id="xmlBeansBean" class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" scope="prototype"/>
- <bean id="testServiceFactory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="singleton">
- <property name="dataBinding" ref="xmlBeansBean"/>
- </bean>
- <jaxws:endpoint xmlns:ns="http://cxf.apache.org/xmlbeans" id="greeterMineEndpoint" address="local://SoapContext/SoapPort" implementor="org.apache.cxf.xmlbeans.GreeterMineImpl" serviceName="ns:SOAPMineService">
- <jaxws:serviceFactory>
- <ref bean="testServiceFactory"/>
- </jaxws:serviceFactory>
- </jaxws:endpoint>
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf2.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf2.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf2.xml
deleted file mode 100644
index dcfabee..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/cxf2.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
- <bean id="GreeterImpl" class="org.apache.cxf.xmlbeans.GreeterMineImpl" scope="prototype"/>
- <!--bean id="xmlBeansBean"
- class="org.apache.cxf.jaxb.JAXBDataBinding"
- scope="prototype" /-->
- <bean id="xmlBeansBean" class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" scope="prototype"/>
- <bean id="testServiceFactory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="singleton">
- <property name="dataBinding" ref="xmlBeansBean"/>
- <property name="wrapped" value="false"/>
- </bean>
- <jaxws:endpoint id="greeterMineEndpoint" address="http://localhost:${testutil.ports.XmlBeansTest}/SoapContext/SoapPort" implementor="org.apache.cxf.xmlbeans.GreeterMineImpl">
- <jaxws:serviceFactory>
- <ref bean="testServiceFactory"/>
- </jaxws:serviceFactory>
- </jaxws:endpoint>
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/GetWeatherData.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/GetWeatherData.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/GetWeatherData.xml
deleted file mode 100644
index f105dca..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/GetWeatherData.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Body xmlns:x="http://www.webservicex.net">
- <x:getWeatherData/>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/SetWeatherData.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/SetWeatherData.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/SetWeatherData.xml
deleted file mode 100644
index 6b863ff..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/SetWeatherData.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Body xmlns:x="http://www.webservicex.net">
- <x:setWeatherData>
- <data>
- <x:MinTemperatureF>1</x:MinTemperatureF>
- </data>
- </x:setWeatherData>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/WeatherServiceRPCLitTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/WeatherServiceRPCLitTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/WeatherServiceRPCLitTest.java
deleted file mode 100644
index 610aa7b..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/rpc/WeatherServiceRPCLitTest.java
+++ /dev/null
@@ -1,90 +0,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.
- */
-package org.apache.cxf.xmlbeans.rpc;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Node;
-
-import net.webservicex.WeatherData;
-
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.cxf.xmlbeans.AbstractXmlBeansTest;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class WeatherServiceRPCLitTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- //xsf.setStyle(SoapConstants.STYLE_RPC);
- createService(RPCWeatherService.class, new RPCWeatherService(),
- "WeatherService", new QName("http://www.webservicex.net", "WeatherService"));
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("WeatherService", "SetWeatherData.xml");
-
- addNamespace("w", "http://www.webservicex.net");
- assertValid("//w:setWeatherDataResponse", response);
-
- response = invoke("WeatherService", "GetWeatherData.xml");
- assertValid("//w:getWeatherDataResponse/return", response);
- assertValid("//w:getWeatherDataResponse/return/w:MaxTemperatureC[text()='1']", response);
- assertValid("//w:getWeatherDataResponse/return/w:MaxTemperatureF[text()='1']", response);
-
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("WeatherService");
-
- addNamespace("w", WSDLConstants.NS_WSDL11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
- assertValid("//w:message[@name='getWeatherDataResponse']/w:part[@type='tns:WeatherData']", wsdl);
- }
-
- @SOAPBinding(style = SOAPBinding.Style.RPC)
- @WebService(targetNamespace = "http://www.webservicex.net")
- public static class RPCWeatherService {
- @WebMethod
- public WeatherData getWeatherData() {
- WeatherData data = WeatherData.Factory.newInstance();
- data.setMaxTemperatureC("1");
- data.setMaxTemperatureF("1");
-
- return data;
- }
-
- @WebMethod
- public void setWeatherData(@WebParam(name = "data") WeatherData data) {
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/sampleRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/sampleRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/sampleRequest.xml
deleted file mode 100644
index 1b11bc4..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/sampleRequest.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<s12:Envelope xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:ew="http://www.example.com/warnings">
- <s12:Header>
- <wsa:Action>
- http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
- </wsa:Action>
- <wsa:MessageID>
- uuid:d7c5726b-de29-4313-b4d4-b3425b200839
- </wsa:MessageID>
- <wsa:ReplyTo>
- <wsa:Address>http://www.example.com/MyEventSink</wsa:Address>
- </wsa:ReplyTo>
- <wsa:To>http://www.example.org/oceanwatch/EventSource</wsa:To>
- </s12:Header>
- <s12:Body>
- <wse:Subscribe>
- <wse:Delivery>
- <wse:NotifyTo>
- <wsa:Address>
- http://www.example.com/MyEventSink/OnStormWarning
- </wsa:Address>
- <wsa:ReferenceProperties>
- <ew:MySubscription>2597</ew:MySubscription>
- </wsa:ReferenceProperties>
- </wse:NotifyTo>
- </wse:Delivery>
- </wse:Subscribe>
- </s12:Body>
-</s12:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/soap11fault.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/soap11fault.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/soap11fault.xml
deleted file mode 100644
index b75987b..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/soap11fault.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <faultcode>SOAP-ENV:Server</faultcode>
- <faultstring>Server Error</faultstring>
- <detail>
- <e:myfaultdetails xmlns:e="urn:detailsns">
- <message> My application didn't work </message>
- <errorcode> 1001 </errorcode>
- </e:myfaultdetails>
- </detail>
-</SOAP-ENV:Fault>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/undeclaredns.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/undeclaredns.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/undeclaredns.xml
deleted file mode 100644
index eb36abe..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/undeclaredns.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<foo xmlns="urn:bleh" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <bar xsi:type="xsd:string"/>
-</foo>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/xmlbeanstest.wsdl
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/xmlbeanstest.wsdl b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/xmlbeanstest.wsdl
deleted file mode 100644
index dc290ae..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/xmlbeanstest.wsdl
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/xmlbeans" xmlns:x1="http://cxf.apache.org/xmlbeans" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloWorld" targetNamespace="http://cxf.apache.org/xmlbeans">
- <wsdl:types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://cxf.apache.org/xmlbeans" targetNamespace="http://cxf.apache.org/xmlbeans" elementFormDefault="qualified">
- <complexType name="StringListType">
- <all>
- <element minOccurs="1" maxOccurs="1" name="myname" type="string"/>
- <element minOccurs="1" maxOccurs="1" name="myaddress" type="string"/>
- </all>
- </complexType>
- <element name="sayHi2Message" type="x1:StringListType"/>
- </schema>
- </wsdl:types>
- <wsdl:message name="sayHiRequest2">
- <wsdl:part element="x1:sayHi2Message" name="in"/>
- </wsdl:message>
- <wsdl:portType name="GreeterMine">
- <wsdl:operation name="sayHi2">
- <wsdl:input message="tns:sayHiRequest2" name="sayHiRequest2"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="Greeter_SOAPBinding" type="tns:GreeterMine">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="sayHi2">
- <soap:operation soapAction="sayHi2" style="document"/>
- <wsdl:input name="sayHiRequest2">
- <soap:body use="literal"/>
- </wsdl:input>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="SOAPMineService">
- <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
- <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/resources/wsdl/xmlbeanstest.wsdl
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/resources/wsdl/xmlbeanstest.wsdl b/rt/databinding/xmlbeans/src/test/resources/wsdl/xmlbeanstest.wsdl
deleted file mode 100644
index d57e8ae..0000000
--- a/rt/databinding/xmlbeans/src/test/resources/wsdl/xmlbeanstest.wsdl
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/xmlbeans/wsdltest" xmlns:x1="http://cxf.apache.org/xmlbeans/wsdltest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloWorld" targetNamespace="http://cxf.apache.org/xmlbeans/wsdltest">
- <wsdl:types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://cxf.apache.org/xmlbeans/wsdltest" targetNamespace="http://cxf.apache.org/xmlbeans/wsdltest" elementFormDefault="qualified">
- <complexType name="StringListType">
- <all>
- <element minOccurs="1" maxOccurs="1" name="myname" type="string"/>
- <element minOccurs="1" maxOccurs="1" name="myaddress" type="string"/>
- </all>
- </complexType>
- <element name="sayHi2Message" type="x1:StringListType"/>
- </schema>
- </wsdl:types>
- <wsdl:message name="sayHiRequest2">
- <wsdl:part element="x1:sayHi2Message" name="in"/>
- </wsdl:message>
- <wsdl:portType name="GreeterMine">
- <wsdl:operation name="sayHi2">
- <wsdl:input message="tns:sayHiRequest2" name="sayHiRequest2"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="Greeter_SOAPBinding" type="tns:GreeterMine">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="sayHi2">
- <soap:operation soapAction="sayHi2" style="document"/>
- <wsdl:input name="sayHiRequest2">
- <soap:body use="literal"/>
- </wsdl:input>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="SOAPMineService">
- <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
- <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/Base.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/Base.xsd b/rt/databinding/xmlbeans/src/test/xsd/Base.xsd
deleted file mode 100644
index 89204b8..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/Base.xsd
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<xs:schema targetNamespace="urn:xfire:xmlbeans:nstest"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xf="urn:xfire:xmlbeans:nstest"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
- <xs:complexType name="Request">
- <xs:attribute name="id" type="xs:long" use="required"/>
- </xs:complexType>
- <xs:complexType name="Response">
- <xs:attribute name="id" type="xs:long" use="required"/>
- </xs:complexType>
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/Request.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/Request.xsd b/rt/databinding/xmlbeans/src/test/xsd/Request.xsd
deleted file mode 100644
index 0affc73..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/Request.xsd
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<xs:schema targetNamespace="urn:xfire:xmlbeans:nstest"
- xmlns:xf="urn:xfire:xmlbeans:nstest"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:import namespace="urn:xfire:xmlbeans:nstest" schemaLocation="Base.xsd" />
- <xs:element name="RequestText">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xf:Request">
- <xs:attribute name="query" type="xs:string" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:attribute name="foo" type="xs:string" />
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/Response.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/Response.xsd b/rt/databinding/xmlbeans/src/test/xsd/Response.xsd
deleted file mode 100644
index 3936012..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/Response.xsd
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<xs:schema targetNamespace="urn:xfire:xmlbeans:nstest"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xf="urn:xfire:xmlbeans:nstest"
- elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:import namespace="urn:xfire:xmlbeans:nstest"
- schemaLocation="Base.xsd" />
- <xs:element name="ResponseText">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xf:Response">
- <xs:attribute name="text" type="xs:string" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/WeatherForecast.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/WeatherForecast.xsd b/rt/databinding/xmlbeans/src/test/xsd/WeatherForecast.xsd
deleted file mode 100644
index ec3082d..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/WeatherForecast.xsd
+++ /dev/null
@@ -1,72 +0,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.
--->
-<s:schema elementFormDefault="qualified" targetNamespace="http://www.webservicex.net" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.webservicex.net">
- <s:element name="GetWeatherByZipCode">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="GetWeatherByZipCodeResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="1" maxOccurs="1" name="GetWeatherByZipCodeResult"
- type="tns:WeatherForecasts" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:complexType name="WeatherForecasts">
- <s:sequence>
- <s:element minOccurs="1" maxOccurs="1" name="Latitude" type="s:float" />
- <s:element minOccurs="1" maxOccurs="1" name="Longitude" type="s:float" />
- <s:element minOccurs="1" maxOccurs="1" name="AllocationFactor" type="s:float" />
- <s:element minOccurs="0" maxOccurs="1" name="FipsCode" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="PlaceName" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="StateCode" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="Status" type="s:string" />
- </s:sequence>
- </s:complexType>
- <s:complexType name="WeatherData">
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="Day" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="WeatherImage" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="MaxTemperatureF" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="MinTemperatureF" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="MaxTemperatureC" type="s:string" />
- <s:element minOccurs="0" maxOccurs="1" name="MinTemperatureC" type="s:string" />
- </s:sequence>
- </s:complexType>
- <s:element name="GetWeatherByPlaceName">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="PlaceName" type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="GetWeatherByPlaceNameResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="1" maxOccurs="1" name="GetWeatherByPlaceNameResult"
- type="tns:WeatherForecasts" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="WeatherForecasts" type="tns:WeatherForecasts" />
-</s:schema>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/XmlBeanTest.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/XmlBeanTest.xsd b/rt/databinding/xmlbeans/src/test/xsd/XmlBeanTest.xsd
deleted file mode 100644
index 2dc41a3..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/XmlBeanTest.xsd
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<!--XSD file template-->
-<schema targetNamespace="http://cxf.apache.org/databinding/xmlbeans/test"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://cxf.apache.org/databinding/xmlbeans/test">
- <complexType name="Address">
- <sequence>
- <element name="addressLine1" type="string"/>
- <element name="addressLine2" nillable="true" type="string"/>
- <element name="city" type="string"/>
- <element name="stateProvinceRegion" type="string"/>
- <element name="ZIPPostalCode" nillable="true" type="string"/>
- <element name="country" type="string"/>
- </sequence>
- </complexType>
- <complexType name="Person">
- <sequence>
- <element name="firstName" type="string"/>
- <element name="lastName" type="string"/>
- <element name="email" nillable="true" type="string"/>
- <element name="contactPhoneNumber" nillable="true" type="string"/>
- <element name="address" nillable="true" type="tns:Address"/>
- </sequence>
- </complexType>
- <complexType name="Customer">
- <complexContent>
- <extension base="tns:Person">
- <sequence>
- <element name="customerNumber" type="string"/>
- <element name="supportLevel" type="tns:SupportLevel"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- <simpleType name="SupportLevel">
- <restriction base="string">
- <enumeration value="Silver"/>
- <enumeration value="Bronze"/>
- <enumeration value="Gold"/>
- </restriction>
- </simpleType>
-</schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/anyschema.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/anyschema.xsd b/rt/databinding/xmlbeans/src/test/xsd/anyschema.xsd
deleted file mode 100644
index 5ee8718..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/anyschema.xsd
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- attributeFormDefault="qualified" elementFormDefault="qualified"
- targetNamespace="http://cxf.apache.org/xmlbeans">
-
- <!--
- Yes, this is a very obtuse type, the point is to have inner types
- without names - this caused NPE's on WSDL generation at one point
- -->
- <xsd:element name="trouble">
- <xsd:complexType>
- <xsd:all>
- <xsd:element name="inner">
- <xsd:complexType>
- <xsd:all>
- <xsd:element name="wombat">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="joe"/>
- <xsd:enumeration value="bob"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="request">
- <xsd:complexType>
- <xsd:all>
- <xsd:element maxOccurs="1" minOccurs="1"
- name="sessionId" type="xsd:string" />
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="response">
- <xsd:complexType>
- <xsd:all>
- <xsd:element maxOccurs="1" minOccurs="1" name="form"
- type="xsd:anyType" />
- </xsd:all>
- </xsd:complexType>
- </xsd:element>
-</xsd:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/idref.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/idref.xsd b/rt/databinding/xmlbeans/src/test/xsd/idref.xsd
deleted file mode 100644
index 1fe638a..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/idref.xsd
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by Brian Blitzer (NA) -->
-<xs:schema xmlns="http://www.alservices.com/xsd/sample" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.alservices.com/xsd/sample" elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:element name="SampleElement">
- <xs:annotation>
- <xs:documentation>Comment describing your root element</xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="SampleUserInformation">
-
- <xs:complexType>
- <xs:sequence>
- <xs:element name="SampleFirstName" type="xs:string"/>
- <xs:element name="SampleLastName" type="xs:string"/>
- <xs:element name="SampleAnID" type="xs:IDREFS"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
-
- </xs:complexType>
- </xs:element>
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/included.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/included.xsd b/rt/databinding/xmlbeans/src/test/xsd/included.xsd
deleted file mode 100644
index 577c30b..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/included.xsd
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://sample.com/procure" targetNamespace="http://sample.com/procure" elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:complexType name="customer">
- <xs:sequence>
- <xs:element name="name" type="xs:string"/>
- <xs:element name="address" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="shipper">
- <xs:sequence>
- <xs:element name="name" type="xs:string"/>
- <xs:element name="per-ounce-rate" type="xs:decimal"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/xsd/sample.xsd
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/xsd/sample.xsd b/rt/databinding/xmlbeans/src/test/xsd/sample.xsd
deleted file mode 100644
index dc9cd76..0000000
--- a/rt/databinding/xmlbeans/src/test/xsd/sample.xsd
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://sample.com/procure"
- xmlns:po="http://sample.com/procure"
- elementFormDefault="qualified">
- <xs:include schemaLocation="included.xsd"/>
- <xs:element name="purchase-order">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="customer" type="po:customer"/>
- <xs:element name="shipper" type="po:shipper" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/rs/extensions/providers/pom.xml
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/pom.xml b/rt/rs/extensions/providers/pom.xml
index b379e7c..a698681 100644
--- a/rt/rs/extensions/providers/pom.xml
+++ b/rt/rs/extensions/providers/pom.xml
@@ -138,12 +138,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-databinding-xmlbeans</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/pom.xml
----------------------------------------------------------------------
diff --git a/systests/databinding/pom.xml b/systests/databinding/pom.xml
index 9c93f65..092be1e 100644
--- a/systests/databinding/pom.xml
+++ b/systests/databinding/pom.xml
@@ -83,16 +83,6 @@
</defaultOptions>
<wsdlOptions>
<wsdlOption>
- <wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/xmlbeans/hello_world.wsdl</wsdl>
- <frontEnd>cxf</frontEnd>
- <dataBinding>xmlbeans</dataBinding>
- </wsdlOption>
- <wsdlOption>
- <wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/xmlbeans/doc_lit_bare.wsdl</wsdl>
- <frontEnd>cxf</frontEnd>
- <dataBinding>xmlbeans</dataBinding>
- </wsdlOption>
- <wsdlOption>
<wsdl>${basedir}/src/test/resources/wsdl_systest_databinding/source/hello_world.wsdl</wsdl>
<frontEnd>cxf</frontEnd>
<dataBinding>domsource</dataBinding>
@@ -266,11 +256,6 @@
<artifactId>FastInfoset</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-databinding-xmlbeans</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java
deleted file mode 100644
index 358ecbb..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ClientServerXmlBeansTest.java
+++ /dev/null
@@ -1,272 +0,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.
- */
-
-package org.apache.cxf.systest.xmlbeans;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Holder;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.headers.Header;
-import org.apache.cxf.interceptor.LoggingInInterceptor;
-import org.apache.cxf.interceptor.LoggingOutInterceptor;
-import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-import org.apache.cxf.testutil.common.TestUtil;
-import org.apache.cxf.xmlbeans.docLitBare.types.InDecimalDocument;
-import org.apache.cxf.xmlbeans.docLitBare.types.InDocument;
-import org.apache.cxf.xmlbeans.docLitBare.types.InoutDocument;
-import org.apache.cxf.xmlbeans.docLitBare.types.OutStringDocument;
-import org.apache.cxf.xmlbeans.docLitBare.types.StringRespTypeDocument;
-import org.apache.cxf.xmlbeans.docLitBare.types.TradePriceData;
-import org.apache.cxf.xmlbeans.doc_lit_bare.PutLastTradedPricePortType;
-import org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.FaultDetailDocument;
-import org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.FaultDetailDocument.FaultDetail;
-import org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.TestEnum;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.GreetMeFault;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.Greeter;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.PingMeFault;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.SOAPService;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class ClientServerXmlBeansTest extends AbstractBusClientServerTestBase {
- static final String WSDL_PORT = TestUtil.getPortNumber(Server.class);
- static final String NOWSDL_PORT = TestUtil.getPortNumber(ServerNoWsdl.class);
-
- private static final QName SERVICE_NAME
- = new QName("http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans", "SOAPService");
-
- private static final QName DOC_LIT_BARE_SERVICE =
- new QName("http://cxf.apache.org/xmlbeans/doc_lit_bare", "SOAPService");
-
- @BeforeClass
- public static void startServers() throws Exception {
- assertTrue("server did not launch correctly", launchServer(Server.class, true));
- assertTrue("server did not launch correctly", launchServer(ServerNoWsdl.class, true));
- }
-
- @Test
- public void testCallFromDocLitBareClient() throws Exception {
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf.xml");
- BusFactory.setDefaultBus(bus);
- URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/xmlbeans/doc_lit_bare.wsdl");
- assertNotNull("We should have found the WSDL here. ", wsdl);
-
- org.apache.cxf.xmlbeans.doc_lit_bare.SOAPService ss =
- new org.apache.cxf.xmlbeans.doc_lit_bare.SOAPService(wsdl, DOC_LIT_BARE_SERVICE);
- PutLastTradedPricePortType port = ss.getSoapPort();
- updateAddressPort(port, WSDL_PORT);
-
-
- ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
- ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
- StringRespTypeDocument resp = port.bareNoParam();
- assertEquals("Get a wrong response", "Get the request!", resp.getStringRespType());
-
- InDecimalDocument xd = InDecimalDocument.Factory.newInstance();
- xd.setInDecimal(new BigDecimal(123));
- OutStringDocument response = port.nillableParameter(xd);
- assertEquals("Get a wrong response", "Get the request 123", response.getOutString());
-
- InDocument document = InDocument.Factory.newInstance();
- TradePriceData data = document.addNewIn();
- data.setTickerPrice(12.33F);
- data.setTickerSymbol("CXF");
- port.putLastTradedPrice(document);
-
- InoutDocument inOut = InoutDocument.Factory.newInstance();
- data = inOut.addNewInout();
- data.setTickerPrice(12.33F);
- data.setTickerSymbol("CXF");
- Holder<InoutDocument> holder = new Holder<InoutDocument>(inOut);
- port.sayHi(holder);
- assertEquals("Get a wrong response", "BAK", holder.value.getInout().getTickerSymbol());
- }
-
- @Test
- public void testCallFromClient() throws Exception {
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf.xml");
- BusFactory.setDefaultBus(bus);
- URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/xmlbeans/hello_world.wsdl");
- assertNotNull("We should have found the WSDL here. ", wsdl);
-
- SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
- Greeter port = ss.getSoapPort();
- updateAddressPort(port, WSDL_PORT);
-
- String resp;
- ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
- ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
-
- TestEnum.Enum response = port.sayHiEnum(TestEnum.ONE);
- assertEquals(TestEnum.ONE, response);
-
-
- resp = port.sayHi();
- assertEquals("We should get the right response", "Bonjour", resp);
-
- resp = port.greetMe("Willem");
- assertEquals("We should get the right response", "Hello Willem", resp);
-
- String aresp[] = port.sayHiArray(new String[] {"Dan"});
- assertEquals("Hello", aresp[0]);
- assertEquals("Dan", aresp[1]);
-
- try {
- port.greetMe("fault");
- fail("Should have been a fault");
- } catch (GreetMeFault ex) {
- assertEquals("Some fault detail", ex.getFaultInfo().getGreetMeFaultDetail());
- }
-
- try {
- resp = port.greetMe("Invoking greetMe with invalid length string, expecting exception...");
- fail("We expect exception here");
- } catch (WebServiceException ex) {
- assertTrue("Get a wrong exception",
- ex.getMessage().
- indexOf("string length (67) is greater than maxLength facet (30)") >= 0);
- }
-
- try {
- port.pingMe();
- fail("We expect exception here");
- } catch (PingMeFault ex) {
- FaultDetailDocument detailDocument = ex.getFaultInfo();
- FaultDetail detail = detailDocument.getFaultDetail();
- assertEquals("Wrong faultDetail major", detail.getMajor(), 2);
- assertEquals("Wrong faultDetail minor", detail.getMinor(), 1);
- }
- }
-
- @Test
- public void testCallFromClientNoWsdlServer() throws Exception {
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml");
- BusFactory.setDefaultBus(bus);
- URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/xmlbeans/hello_world.wsdl");
- assertNotNull("We should have found the WSDL here. ", wsdl);
-
- SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
- QName soapPort = new QName("http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans", "SoapPort");
- ss.addPort(soapPort, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:"
- + NOWSDL_PORT + "/SoapContext/SoapPort");
- Greeter port = ss.getPort(soapPort, Greeter.class);
- String resp;
- ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
- ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor());
- resp = port.sayHi();
- assertEquals("We should get the right response", resp, "Bonjour");
-
- resp = port.greetMe("Willem");
- assertEquals("We should get the right response", resp, "Hello Willem");
-
- try {
- resp = port.greetMe("Invoking greetMe with invalid length string, expecting exception...");
- fail("We expect exception here");
- } catch (WebServiceException ex) {
- assertTrue("Get a wrong exception",
- ex.getMessage().
- indexOf("string length (67) is greater than maxLength facet (30)") >= 0);
- }
-
- try {
- port.pingMe();
- fail("We expect exception here");
- } catch (PingMeFault ex) {
- FaultDetailDocument detailDocument = ex.getFaultInfo();
- FaultDetail detail = detailDocument.getFaultDetail();
- assertEquals("Wrong faultDetail major", detail.getMajor(), 2);
- assertEquals("Wrong faultDetail minor", detail.getMinor(), 1);
- }
- try {
- port.greetMe("fault");
- fail("Should have been a fault");
- } catch (GreetMeFault ex) {
- assertEquals("Some fault detail", ex.getFaultInfo().getGreetMeFaultDetail());
- }
-
- }
- @Test
- public void testXmlBeansHeader() throws Exception {
- //CXF-2955
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml");
- BusFactory.setDefaultBus(bus);
- URL wsdl = this.getClass().getResource("/wsdl_systest_databinding/xmlbeans/hello_world.wsdl");
- assertNotNull("We should have found the WSDL here. ", wsdl);
-
- SOAPService ss = new SOAPService(wsdl, SERVICE_NAME);
- QName soapPort = new QName("http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans", "SoapPort");
- ss.addPort(soapPort, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:"
- + NOWSDL_PORT + "/SoapContext/SoapPort");
- Greeter port = ss.getPort(soapPort, Greeter.class);
-
- Client client = ClientProxy.getClient(port);
-
- List<Header> headers = new ArrayList<Header>();
- org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeDocument doc
- = org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeDocument.Factory.newInstance();
- doc.addNewGreetMe().setRequestType("doc format header");
- Header head = new Header(new QName("", "doc"), doc,
- client.getEndpoint().getService().getDataBinding());
- headers.add(head);
- org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeDocument.GreetMe gm
- = org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types
- .GreetMeDocument.GreetMe.Factory.newInstance();
- gm.setRequestType("non-doc format header");
- head = new Header(new QName("http://somenamespace.com", "nondocheader"), gm,
- client.getEndpoint().getService().getDataBinding());
- headers.add(head);
- ((BindingProvider)port).getRequestContext().put(Header.HEADER_LIST, headers);
-
- String resp;
- ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
-
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- ClientProxy.getClient(port).getOutInterceptors().add(new LoggingOutInterceptor(pw));
- resp = port.sayHi();
- assertEquals("We should get the right response", resp, "Bonjour");
- assertTrue(sw.toString().contains("doc format header"));
- assertTrue(sw.toString().contains("non-doc format header"));
- assertTrue(sw.toString().contains("nondocheader"));
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/GreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/GreeterImpl.java b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/GreeterImpl.java
deleted file mode 100644
index 0d5e4c9..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/GreeterImpl.java
+++ /dev/null
@@ -1,91 +0,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.
- */
-
-package org.apache.cxf.systest.xmlbeans;
-
-import java.util.logging.Logger;
-
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.FaultDetailDocument;
-import org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.FaultDetailDocument.FaultDetail;
-import org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.TestEnum;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.GreetMeFault;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.Greeter;
-import org.apache.hello_world_soap_http_xmlbeans.xmlbeans.PingMeFault;
-
-@javax.jws.WebService(portName = "SoapPort", serviceName = "SOAPService",
- targetNamespace = "http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans",
- endpointInterface = "org.apache.hello_world_soap_http_xmlbeans.xmlbeans.Greeter")
-public class GreeterImpl implements Greeter {
-
- private static final Logger LOG = LogUtils.getL7dLogger(GreeterImpl.class);
-
- /* (non-Javadoc)
- * @see org.apache.hello_world_soap_http.Greeter#greetMe(java.lang.String)
- */
- public String greetMe(String me) throws GreetMeFault {
- if ("fault".equals(me)) {
- org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeFaultDetailDocument detail
- = org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.GreetMeFaultDetailDocument.Factory
- .newInstance();
- detail.setGreetMeFaultDetail("Some fault detail");
- throw new GreetMeFault("Fault String", detail);
- }
- LOG.info("Executing operation greetMe");
- return "Hello " + me;
- }
-
- /* (non-Javadoc)
- * @see org.apache.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)
- */
- public void greetMeOneWay(String me) {
- LOG.info("Executing operation greetMeOneWay");
- }
-
- /* (non-Javadoc)
- * @see org.apache.hello_world_soap_http.Greeter#sayHi()
- */
- public String sayHi() {
- LOG.info("Executing operation sayHi");
- return "Bonjour";
- }
-
- public void pingMe() throws PingMeFault {
- // here we need to put the FaultDetail into the FaultDetailDocument
- FaultDetailDocument faultDocument =
- org.apache.helloWorldSoapHttpXmlbeans.xmlbeans.types.FaultDetailDocument
- .Factory.newInstance();
- FaultDetail faultDetail = faultDocument.addNewFaultDetail();
- faultDetail.setMajor((short)2);
- faultDetail.setMinor((short)1);
- LOG.info("Executing operation pingMe, throwing PingMeFault exception");
- throw new PingMeFault("PingMeFault raised by server", faultDocument);
- }
-
- public String[] sayHiArray(String requests[]) {
- String ret[] = new String[requests.length + 1];
- ret[0] = "Hello";
- System.arraycopy(requests, 0, ret, 1, requests.length);
- return ret;
- }
-
- public TestEnum.Enum sayHiEnum(TestEnum.Enum request) {
- return request;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/PutLastTradePriceImpl.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/PutLastTradePriceImpl.java b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/PutLastTradePriceImpl.java
deleted file mode 100644
index 6a90827..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/PutLastTradePriceImpl.java
+++ /dev/null
@@ -1,62 +0,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.
- */
-
-package org.apache.cxf.systest.xmlbeans;
-
-import javax.jws.WebService;
-
-import org.apache.cxf.xmlbeans.docLitBare.types.StringRespTypeDocument;
-import org.apache.cxf.xmlbeans.doc_lit_bare.PutLastTradedPricePortType;
-
-/**
- *
- */
-@WebService(targetNamespace = "http://cxf.apache.org/xmlbeans/doc_lit_bare",
- portName = "SoapPort", serviceName = "SOAPService",
- endpointInterface = "org.apache.cxf.xmlbeans.doc_lit_bare.PutLastTradedPricePortType"
-)
-public class PutLastTradePriceImpl implements PutLastTradedPricePortType {
-
- public StringRespTypeDocument bareNoParam() {
- StringRespTypeDocument st = StringRespTypeDocument.Factory.newInstance();
- st.setStringRespType("Get the request!");
- return st;
- }
-
- public org.apache.cxf.xmlbeans.docLitBare.types.OutStringDocument nillableParameter(
- org.apache.cxf.xmlbeans.docLitBare.types.InDecimalDocument theRequest) {
- org.apache.cxf.xmlbeans.docLitBare.types.OutStringDocument st
- = org.apache.cxf.xmlbeans.docLitBare.types.OutStringDocument.Factory.newInstance();
- st.setOutString("Get the request " + theRequest.getInDecimal().toString());
- return st;
- }
-
- public void sayHi(javax.xml.ws.Holder<org.apache.cxf.xmlbeans.docLitBare.types.InoutDocument> body) {
- body.value.getInout().setTickerSymbol("BAK");
- }
-
-
- public void putLastTradedPrice(org.apache.cxf.xmlbeans.docLitBare.types.InDocument body) {
- /*System.out.println("Get the last trade price "
- + body.getIn().getTickerPrice() + ", " + body.getIn().getTickerSymbol());*/
-
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/Server.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/Server.java b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/Server.java
deleted file mode 100644
index aa2201a..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/Server.java
+++ /dev/null
@@ -1,58 +0,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.
- */
-
-package org.apache.cxf.systest.xmlbeans;
-
-import javax.xml.ws.Endpoint;
-
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.apache.cxf.testutil.common.TestUtil;
-
-public class Server extends AbstractBusTestServerBase {
- static final String PORT = TestUtil.getPortNumber(Server.class);
-
- protected void run() {
- // set the configuration file
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf.xml");
- BusFactory.setDefaultBus(bus);
- setBus(bus);
- Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
- new GreeterImpl());
-
- Endpoint.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort",
- new PutLastTradePriceImpl());
- }
-
- public static void main(String args[]) {
- try {
- Server s = new Server();
- s.start();
- } catch (Exception ex) {
- ex.printStackTrace();
- System.exit(-1);
- } finally {
- System.out.println("done!");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ServerNoWsdl.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ServerNoWsdl.java b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ServerNoWsdl.java
deleted file mode 100644
index 4e1a6ce..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/ServerNoWsdl.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-
-package org.apache.cxf.systest.xmlbeans;
-
-import javax.xml.ws.Endpoint;
-
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.apache.cxf.testutil.common.TestUtil;
-
-public class ServerNoWsdl extends AbstractBusTestServerBase {
- static final String PORT = TestUtil.getPortNumber(ServerNoWsdl.class);
-
- protected void run() {
- // set the configuration file
- SpringBusFactory factory = new SpringBusFactory();
- Bus bus = factory.createBus("org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml");
- BusFactory.setDefaultBus(bus);
- setBus(bus);
- Object implementor = new GreeterImpl();
- String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
- Endpoint.publish(address, implementor);
-
- implementor = new PutLastTradePriceImpl();
- Endpoint.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort", implementor);
- }
-
- public static void main(String args[]) {
- try {
- ServerNoWsdl s = new ServerNoWsdl();
- s.start();
- } catch (Exception ex) {
- ex.printStackTrace();
- System.exit(-1);
- } finally {
- System.out.println("done!");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml
deleted file mode 100644
index a8979c1..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
- <jaxws:client name="{http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans}SoapPort" createdFromAPI="true">
- <!-- jaxws:properties>
- <entry key="schema-validation-enabled" value="true" />
- </jaxws:properties-->
- </jaxws:client>
- <jaxws:endpoint name="{http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans}SoapPort" wsdlLocation="classpath:wsdl_systest_databinding/xmlbeans/hello_world.wsdl" createdFromAPI="true">
- <jaxws:properties>
- <entry key="schema-validation-enabled" value="true"/>
- </jaxws:properties>
- </jaxws:endpoint>
- <jaxws:endpoint name="{http://cxf.apache.org/xmlbeans/doc_lit_bare}SoapPort" wsdlLocation="classpath:wsdl_systest_databinding/xmlbeans/doc_lit_bare.wsdl" createdFromAPI="true"/>
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml b/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
deleted file mode 100644
index d63c150..0000000
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
- <!-- comment this bean to disable schema validation in the client -->
- <jaxws:client name="{http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans}SoapPort" createdFromAPI="true">
- <!-- jaxws:properties>
- <entry key="schema-validation-enabled" value="true" />
- </jaxws:properties-->
- </jaxws:client>
- <jaxws:endpoint name="{http://apache.org/hello_world_soap_http_xmlbeans/xmlbeans}SoapPort" createdFromAPI="true">
- <jaxws:properties>
- <entry key="schema-validation-enabled" value="true"/>
- </jaxws:properties>
- </jaxws:endpoint>
- <jaxws:endpoint name="{http://cxf.apache.org/xmlbeans/doc_lit_bare}SoapPort" wsdlLocation="wsdl_systest_databinding/xmlbeans/doc_lit_bare.wsdl" createdFromAPI="true"/>
-</beans>
[3/3] cxf git commit: [CXF-7195] Removing rt-databindings-xmlbeans
Posted by se...@apache.org.
[CXF-7195] Removing rt-databindings-xmlbeans
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/40380d8e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/40380d8e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/40380d8e
Branch: refs/heads/master
Commit: 40380d8e57cdea0d909f3a9ee207628831c202fa
Parents: 969a10c
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Dec 23 15:55:56 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Dec 23 15:55:56 2016 +0000
----------------------------------------------------------------------
.../features/src/main/resources/features.xml | 5 -
rt/databinding/pom.xml | 1 -
rt/databinding/xmlbeans/pom.xml | 205 -------
.../org/apache/cxf/xmlbeans/DataReaderImpl.java | 167 ------
.../org/apache/cxf/xmlbeans/DataWriterImpl.java | 227 --------
.../org/apache/cxf/xmlbeans/Message.properties | 22 -
.../apache/cxf/xmlbeans/NodeDataWriterImpl.java | 61 ---
.../cxf/xmlbeans/XmlBeansDataBinding.java | 176 ------
.../cxf/xmlbeans/XmlBeansSchemaInitializer.java | 328 -----------
.../cxf/xmlbeans/XmlBeansWrapperHelper.java | 103 ----
.../xmlbeans/tools/XMLBeansSchemaTypeUtils.java | 123 -----
.../tools/XMLBeansToolingDataBinding.java | 545 -------------------
.../resources/META-INF/cxf/java2wsbeans.xml | 22 -
.../main/resources/META-INF/tools-plugin.xml | 22 -
.../cxf/xmlbeans/AbstractXmlBeansTest.java | 218 --------
.../apache/cxf/xmlbeans/CustomFault.aegis.xml | 6 -
.../org/apache/cxf/xmlbeans/CustomFault.java | 39 --
.../cxf/xmlbeans/DocumentStyleRequest.xml | 12 -
.../apache/cxf/xmlbeans/DocumentStyleTest.java | 78 ---
.../org/apache/cxf/xmlbeans/FaultRequest.xml | 7 -
.../org/apache/cxf/xmlbeans/GetForecasts.xml | 4 -
.../org/apache/cxf/xmlbeans/GetWeatherByZip.xml | 9 -
.../apache/cxf/xmlbeans/GreeterMineImpl.java | 48 --
.../org/apache/cxf/xmlbeans/IDRefRequest.xml | 9 -
.../org/apache/cxf/xmlbeans/IDRefService.java | 33 --
.../apache/cxf/xmlbeans/IDRefServiceTest.java | 50 --
.../cxf/xmlbeans/MultipleSchemaInNSTest.java | 80 ---
.../cxf/xmlbeans/MultipleSchemaService.java | 33 --
.../apache/cxf/xmlbeans/PrimitiveTypesTest.java | 71 ---
.../org/apache/cxf/xmlbeans/TestService.java | 66 ---
.../org/apache/cxf/xmlbeans/TypesService.java | 77 ---
.../org/apache/cxf/xmlbeans/WeatherService.java | 47 --
.../apache/cxf/xmlbeans/WeatherService2.java | 59 --
.../cxf/xmlbeans/WeatherService2Test.java | 66 ---
.../org/apache/cxf/xmlbeans/WrappedRequest.xml | 12 -
.../apache/cxf/xmlbeans/WrappedStyleTest.java | 104 ----
.../cxf/xmlbeans/XMLBeansServiceTest.java | 107 ----
.../org/apache/cxf/xmlbeans/XmlBeansTest.java | 94 ----
.../apache/cxf/xmlbeans/basic/BasicTest.java | 61 ---
.../apache/cxf/xmlbeans/basic/TestService.java | 47 --
.../org/apache/cxf/xmlbeans/basic/bean11.xml | 16 -
.../test/java/org/apache/cxf/xmlbeans/cxf.xml | 34 --
.../test/java/org/apache/cxf/xmlbeans/cxf2.xml | 36 --
.../apache/cxf/xmlbeans/rpc/GetWeatherData.xml | 6 -
.../apache/cxf/xmlbeans/rpc/SetWeatherData.xml | 10 -
.../xmlbeans/rpc/WeatherServiceRPCLitTest.java | 90 ---
.../org/apache/cxf/xmlbeans/sampleRequest.xml | 29 -
.../org/apache/cxf/xmlbeans/soap11fault.xml | 11 -
.../org/apache/cxf/xmlbeans/undeclaredns.xml | 4 -
.../org/apache/cxf/xmlbeans/xmlbeanstest.wsdl | 54 --
.../src/test/resources/wsdl/xmlbeanstest.wsdl | 54 --
rt/databinding/xmlbeans/src/test/xsd/Base.xsd | 31 --
.../xmlbeans/src/test/xsd/Request.xsd | 35 --
.../xmlbeans/src/test/xsd/Response.xsd | 35 --
.../xmlbeans/src/test/xsd/WeatherForecast.xsd | 72 ---
.../xmlbeans/src/test/xsd/XmlBeanTest.xsd | 60 --
.../xmlbeans/src/test/xsd/anyschema.xsd | 66 ---
rt/databinding/xmlbeans/src/test/xsd/idref.xsd | 24 -
.../xmlbeans/src/test/xsd/included.xsd | 33 --
rt/databinding/xmlbeans/src/test/xsd/sample.xsd | 16 -
rt/rs/extensions/providers/pom.xml | 6 -
systests/databinding/pom.xml | 15 -
.../xmlbeans/ClientServerXmlBeansTest.java | 272 ---------
.../cxf/systest/xmlbeans/GreeterImpl.java | 91 ----
.../systest/xmlbeans/PutLastTradePriceImpl.java | 62 ---
.../org/apache/cxf/systest/xmlbeans/Server.java | 58 --
.../cxf/systest/xmlbeans/ServerNoWsdl.java | 59 --
.../org/apache/cxf/systest/xmlbeans/cxf.xml | 32 --
.../apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml | 33 --
69 files changed, 4788 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/osgi/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/osgi/karaf/features/src/main/resources/features.xml b/osgi/karaf/features/src/main/resources/features.xml
index 90ce5e5..b73b921 100644
--- a/osgi/karaf/features/src/main/resources/features.xml
+++ b/osgi/karaf/features/src/main/resources/features.xml
@@ -298,11 +298,6 @@
<feature version="${project.version}">cxf-wsdl</feature>
<bundle start-level="40">mvn:org.apache.cxf/cxf-rt-databinding-jaxb/${project.version}</bundle>
</feature>
- <feature name="cxf-databinding-xmlbeans" version="${project.version}">
- <feature version="${project.version}">cxf-core</feature>
- <bundle start-level="30" dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlbeans/${cxf.xmlbeans.bundle.version}</bundle>
- <bundle start-level="40">mvn:org.apache.cxf/cxf-rt-databinding-xmlbeans/${project.version}</bundle>
- </feature>
<feature name="cxf-features-clustering" version="${project.version}">
<feature version="${project.version}">cxf-core</feature>
<bundle start-level="40">mvn:org.apache.cxf/cxf-rt-features-clustering/${project.version}</bundle>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/pom.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/pom.xml b/rt/databinding/pom.xml
index 6f8e30a..e48ebac 100644
--- a/rt/databinding/pom.xml
+++ b/rt/databinding/pom.xml
@@ -31,7 +31,6 @@
</parent>
<modules>
<module>jaxb</module>
- <module>xmlbeans</module>
<module>aegis</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/pom.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/pom.xml b/rt/databinding/xmlbeans/pom.xml
deleted file mode 100644
index 0615480..0000000
--- a/rt/databinding/xmlbeans/pom.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-<?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>
- <artifactId>cxf-rt-databinding-xmlbeans</artifactId>
- <packaging>bundle</packaging>
- <name>Apache CXF Runtime XmlBeans DataBinding</name>
- <description>Apache CXF Runtime XmlBeans DataBinding</description>
- <url>http://cxf.apache.org</url>
- <parent>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-parent</artifactId>
- <version>3.2.0-SNAPSHOT</version>
- <relativePath>../../../parent/pom.xml</relativePath>
- </parent>
- <properties>
- <cxf.spi-dir>spi-2.1</cxf.spi-dir>
- <cxf.osgi.import>
- !repackage
- </cxf.osgi.import>
- </properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-tools-common</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-tools-wsdlto-core</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-testutils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-local</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http-jetty</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xmlbeans-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>xmlbeans-test</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <schemaDirectory>src/test/xsd</schemaDirectory>
- <sourceGenerationDirectory>${project.build.directory}/generated/src/test/java</sourceGenerationDirectory>
- <classGenerationDirectory>${project.build.directory}/generated/src/test/resources</classGenerationDirectory>
- <!--noJavac>true</noJavac-->
- <javaSource>1.7</javaSource>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-codegen-plugin</artifactId>
- <version>${project.version}</version>
- <executions>
- <execution>
- <id>generate-test-sources</id>
- <phase>generate-test-sources</phase>
- <configuration>
- <fork>${cxf.codegenplugin.forkmode}</fork>
- <testSourceRoot>target/generated/src/test/java</testSourceRoot>
- <testWsdlRoot>src/test/resources/wsdl</testWsdlRoot>
- <wsdlOptions>
- <wsdlOption>
- <wsdl>src/test/resources/wsdl/xmlbeanstest.wsdl</wsdl>
- <dataBinding>xmlbeans</dataBinding>
- <extraargs>
- <arg>-classdir</arg>
- <arg>${basedir}/target/generated/src/test/resources</arg>
- </extraargs>
- </wsdlOption>
- </wsdlOptions>
- </configuration>
- <goals>
- <goal>wsdl2java</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>setup.eclipse</id>
- <build>
- <defaultGoal>process-test-sources</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>setup.eclipse.project.sdo</id>
- <phase>process-test-sources</phase>
- <configuration>
- <target>
- <!-- XmlBeans generated code uses raw List types -->
- <propertyfile file="${basedir}/.settings/org.eclipse.jdt.core.prefs">
- <entry key="org.eclipse.jdt.core.compiler.problem.rawTypeReference" value="ignore" />
- </propertyfile>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
deleted file mode 100755
index f1b6ab2..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
+++ /dev/null
@@ -1,167 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collection;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.validation.Schema;
-
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.databinding.DataReader;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.message.Attachment;
-import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.XmlAnySimpleType;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-
-
-public class DataReaderImpl implements DataReader<XMLStreamReader> {
- private static final Logger LOG = LogUtils.getLogger(XmlBeansDataBinding.class);
- private boolean validate;
-
- public DataReaderImpl() {
- }
-
- public Object read(XMLStreamReader input) {
- return read(null, input);
- }
-
- public Object read(MessagePartInfo part, XMLStreamReader reader) {
- Class<?> typeClass = part.getTypeClass();
- boolean unwrap = false;
- if (!XmlObject.class.isAssignableFrom(typeClass)) {
- typeClass = (Class<?>)part.getProperty(XmlAnySimpleType.class.getName());
- unwrap = true;
- }
- return doRead(reader,
- part.getTypeClass(),
- typeClass,
- (SchemaType)part.getProperty(SchemaType.class.getName()),
- unwrap);
- }
-
- public Object read(QName name, XMLStreamReader reader, Class<?> typeClass) {
- SchemaType st = null;
- try {
- Field f = typeClass.getField("type");
- if (Modifier.isStatic(f.getModifiers())) {
- st = (SchemaType)f.get(null);
- }
- } catch (Exception es) {
- es.printStackTrace();
- return null;
- }
-
- return doRead(reader,
- typeClass,
- typeClass,
- st,
- false);
- }
-
- private Object doRead(XMLStreamReader reader, Class<?> partTypeClass,
- Class<?> typeClass, SchemaType st, boolean unwrap) {
- boolean isOutClass = false;
- Class<?> encClass = typeClass.getEnclosingClass();
- if (encClass != null) {
- typeClass = encClass;
- isOutClass = true;
- }
- Class<?> cls[] = typeClass.getDeclaredClasses();
- Object obj = null;
- for (Class<?> c : cls) {
- if ("Factory".equals(c.getSimpleName())) {
- try {
- XmlOptions options = new XmlOptions();
- if (validate) {
- options.setValidateOnSet();
- }
- if (st != null && !st.isDocumentType() && !isOutClass) {
- options.setLoadReplaceDocumentElement(null);
- }
- Method meth = c.getMethod("parse", XMLStreamReader.class, XmlOptions.class);
- obj = meth.invoke(null, reader, options);
- break;
- } catch (Exception e) {
- throw new Fault(new Message("UNMARSHAL_ERROR", LOG, partTypeClass, e));
- }
- }
- }
- if (unwrap && obj != null) {
- try {
- Class<?> tc = partTypeClass;
- String methName;
- if (tc.equals(Integer.TYPE) || tc.equals(Integer.class)) {
- methName = "getIntValue";
- } else if (tc.equals(byte[].class)) {
- methName = "byteArrayValue";
- } else {
- String tp = tc.getSimpleName();
- tp = Character.toUpperCase(tp.charAt(0)) + tp.substring(1);
- methName = "get" + tp + "Value";
- }
- Method m = obj.getClass().getMethod(methName);
- obj = m.invoke(obj);
- } catch (Exception e) {
- e.printStackTrace();
- }
- } else if (isOutClass) {
- for (Method m : encClass.getDeclaredMethods()) {
- if (m.getName().startsWith("get")
- && m.getParameterTypes().length == 0
- && m.getReturnType().equals(partTypeClass)) {
- try {
- obj = m.invoke(obj);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }
- if (reader.getEventType() == XMLStreamReader.END_ELEMENT) {
- try {
- reader.next();
- } catch (XMLStreamException e) {
- throw new RuntimeException(e);
- }
- }
- return obj;
- }
-
- public void setAttachments(Collection<Attachment> attachments) {
- }
-
- public void setProperty(String prop, Object value) {
- }
-
- public void setSchema(Schema s) {
- validate = s != null;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataWriterImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataWriterImpl.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataWriterImpl.java
deleted file mode 100755
index fdf2ed4..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataWriterImpl.java
+++ /dev/null
@@ -1,227 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collection;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.validation.Schema;
-
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.databinding.DataWriter;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.message.Attachment;
-import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageUtils;
-import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.XmlAnySimpleType;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.XmlTokenSource;
-import org.apache.xmlbeans.impl.values.XmlObjectBase;
-
-public class DataWriterImpl implements DataWriter<XMLStreamWriter> {
- private static final Logger LOG = LogUtils.getLogger(XmlBeansDataBinding.class);
- private Schema schema;
- private Message message;
-
- public DataWriterImpl() {
- }
-
- public void write(Object obj, XMLStreamWriter output) {
- write(obj, null, output);
- }
-
- public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
- try {
- Class<?> typeClass = part != null ? part.getTypeClass() : null;
- if (typeClass == null) {
- typeClass = obj.getClass();
- }
- if (!XmlObject.class.isAssignableFrom(typeClass) && part != null) {
- typeClass = (Class<?>)part.getProperty(XmlAnySimpleType.class.getName());
-
- Class<?> cls[] = typeClass.getDeclaredClasses();
- for (Class<?> c : cls) {
- if ("Factory".equals(c.getSimpleName())) {
- try {
- SchemaType st = (SchemaType)part.getProperty(SchemaType.class.getName());
- XmlOptions options = new XmlOptions();
- if (schema != null) {
- options.setValidateOnSet();
- }
- if (!st.isDocumentType()) {
- options.setLoadReplaceDocumentElement(null);
- }
- Method meth = c.getMethod("newValue", Object.class);
- obj = meth.invoke(null, obj);
- break;
- } catch (Exception e) {
- throw new Fault("UNMARSHAL_ERROR", LOG, e, part.getTypeClass());
- }
- }
- }
- }
-
-
- if (obj != null) {
- XmlOptions options = new XmlOptions();
- if (schema != null) {
- options.setValidateOnSet();
- }
- if (message != null
- && MessageUtils.getContextualBoolean(message,
- XmlBeansDataBinding.XMLBEANS_NAMESPACE_HACK,
- false)) {
- Object dom;
- if (obj instanceof XmlObjectBase) {
- XmlObjectBase source = (XmlObjectBase)obj;
- dom = source.newDomNode(options);
- } else {
- XmlTokenSource source = (XmlTokenSource)obj;
- dom = source.newDomNode(options);
- }
-
- if (dom instanceof Document) {
- org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
- StaxUtils.copy(e, output);
- } else if (dom instanceof DocumentFragment) {
- DocumentFragment frag = (DocumentFragment) dom;
- Node node = frag.getFirstChild();
- while (node != null) {
- if (node instanceof Element) {
- StaxUtils.copy((Element)node, output);
- } else if (node instanceof Comment) {
- output.writeComment(((Comment)node).getData());
- } else if (node instanceof Text) {
- output.writeCharacters(((Text)node).getData());
- }
- node = node.getNextSibling();
- }
- } else {
- throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
- }
- return;
- }
-
- XMLStreamReader reader;
- if (obj instanceof XmlObjectBase) {
- XmlObjectBase source = (XmlObjectBase)obj;
- reader = source.newCursorForce().newXMLStreamReader(options);
- } else {
- XmlTokenSource source = (XmlTokenSource)obj;
- reader = source.newCursor().newXMLStreamReader(options);
- }
- SchemaType st = part == null ? null
- : (SchemaType)part.getProperty(SchemaType.class.getName());
- if (st == null) {
- try {
- Field f = typeClass.getField("type");
- if (Modifier.isStatic(f.getModifiers())) {
- st = (SchemaType)f.get(null);
- if (part != null) {
- part.setProperty(SchemaType.class.getName(), st);
- }
- }
- } catch (Exception es) {
- //ignore
- es.printStackTrace();
- }
- }
- if (reader.getEventType() == XMLStreamReader.START_DOCUMENT) {
- reader.next();
- }
-
- if (st != null && !st.isDocumentType()
- || reader.getEventType() == XMLStreamReader.CHARACTERS) {
-
- QName elementName = part != null ? part.getConcreteName() : st.getName();
-
- if (StringUtils.isEmpty(elementName.getNamespaceURI())) {
- output.writeStartElement(elementName.getLocalPart());
-
- } else {
- String pfx = output.getPrefix(elementName.getNamespaceURI());
- if (StringUtils.isEmpty(pfx)) {
- output.writeStartElement("tns",
- elementName.getLocalPart(),
- elementName.getNamespaceURI());
- output.writeNamespace("tns", elementName.getNamespaceURI());
- } else {
- output.writeStartElement(pfx,
- elementName.getLocalPart(),
- elementName.getNamespaceURI());
- }
- }
- StaxUtils.copy(reader, output, false);
- output.writeEndElement();
- } else {
- StaxUtils.copy(reader, output, false);
- }
- } else if (needToRender(part)) {
- output.writeStartElement(part.getConcreteName().getNamespaceURI(),
- part.getConcreteName().getLocalPart());
- output.writeEndElement();
- }
- } catch (XMLStreamException e) {
- throw new Fault("MARSHAL_ERROR", LOG, e, obj);
- }
- }
-
- private boolean needToRender(MessagePartInfo part) {
- if (part != null && part.getXmlSchema() instanceof XmlSchemaElement) {
- XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema();
- return element.isNillable() && element.getMinOccurs() > 0;
- }
- return false;
- }
-
- public void setAttachments(Collection<Attachment> attachments) {
- }
-
- public void setProperty(String key, Object value) {
- if (Message.class.getName().equals(key)) {
- message = (Message)value;
- }
- }
-
- public void setSchema(Schema schema) {
- this.schema = schema;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/Message.properties
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/Message.properties b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/Message.properties
deleted file mode 100644
index 8ec7015..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/Message.properties
+++ /dev/null
@@ -1,22 +0,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.
-#
-#
-MARSHAL_ERROR = Marshalling Error: {0}
-UNMARSHAL_ERROR = Unmarshalling Error: {0}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/NodeDataWriterImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/NodeDataWriterImpl.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/NodeDataWriterImpl.java
deleted file mode 100644
index b31973c..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/NodeDataWriterImpl.java
+++ /dev/null
@@ -1,61 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-
-import java.util.Collection;
-import javax.xml.validation.Schema;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import org.apache.cxf.databinding.DataWriter;
-import org.apache.cxf.message.Attachment;
-import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.staxutils.W3CDOMStreamWriter;
-
-public class NodeDataWriterImpl implements DataWriter<Node> {
- DataWriterImpl writer;
-
- public NodeDataWriterImpl() {
- writer = new DataWriterImpl();
- }
-
- public void write(Object obj, Node output) {
- write(obj, null, output);
- }
-
- public void write(Object obj, MessagePartInfo part, Node output) {
- W3CDOMStreamWriter domWriter = new W3CDOMStreamWriter((Element)output);
- writer.write(obj, part, domWriter);
- }
-
- public void setAttachments(Collection<Attachment> attachments) {
- writer.setAttachments(attachments);
- }
-
- public void setProperty(String key, Object value) {
- writer.setProperty(key, value);
- }
-
- public void setSchema(Schema s) {
- writer.setSchema(s);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java
deleted file mode 100644
index f2f7767..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java
+++ /dev/null
@@ -1,176 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.common.jaxb.JAXBUtils;
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.xmlschema.SchemaCollection;
-import org.apache.cxf.databinding.AbstractDataBinding;
-import org.apache.cxf.databinding.AbstractWrapperHelper;
-import org.apache.cxf.databinding.DataReader;
-import org.apache.cxf.databinding.DataWriter;
-import org.apache.cxf.databinding.WrapperCapableDatabinding;
-import org.apache.cxf.databinding.WrapperHelper;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.service.model.ServiceInfo;
-
-
-
-
-/**
- *
- */
-public class XmlBeansDataBinding extends AbstractDataBinding implements WrapperCapableDatabinding {
- public static final String XMLBEANS_NAMESPACE_HACK
- = XmlBeansDataBinding.class.getName() + ".NamespaceHack";
-
-
- private static final Logger LOG = LogUtils.getLogger(XmlBeansDataBinding.class);
-
- private static final Class<?> SUPPORTED_READER_FORMATS[] = new Class<?>[] {XMLStreamReader.class};
- private static final Class<?> SUPPORTED_WRITER_FORMATS[]
- = new Class<?>[] {XMLStreamWriter.class, Node.class};
-
-
- @SuppressWarnings("unchecked")
- public <T> DataWriter<T> createWriter(Class<T> c) {
- if (c == XMLStreamWriter.class) {
- return (DataWriter<T>)new DataWriterImpl();
- } else if (c == Node.class) {
- return (DataWriter<T>)new NodeDataWriterImpl();
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public <T> DataReader<T> createReader(Class<T> c) {
- DataReader<T> dr = null;
- if (c == XMLStreamReader.class) {
- dr = (DataReader<T>)new DataReaderImpl();
- }
- return dr;
- }
-
-
- /**
- * XmlBeans has no declared namespace prefixes.
- * {@inheritDoc}
- */
- public Map<String, String> getDeclaredNamespaceMappings() {
- return null;
- }
-
- public Class<?>[] getSupportedReaderFormats() {
- return SUPPORTED_READER_FORMATS;
- }
-
- public Class<?>[] getSupportedWriterFormats() {
- return SUPPORTED_WRITER_FORMATS;
- }
-
- public void initialize(Service service) {
- if (LOG.isLoggable(Level.FINER)) {
- LOG.log(Level.FINER, "Creating XmlBeansDatabinding for " + service.getName());
- }
- for (ServiceInfo serviceInfo : service.getServiceInfos()) {
- SchemaCollection col = serviceInfo.getXmlSchemaCollection();
-
- if (col.getXmlSchemas().length > 1) {
- // someone has already filled in the types
- continue;
- }
-
- XmlBeansSchemaInitializer schemaInit
- = new XmlBeansSchemaInitializer(serviceInfo, col, this);
- schemaInit.walk();
- }
- }
-
- public WrapperHelper createWrapperHelper(Class<?> wrapperType, QName wrapperName, List<String> partNames,
- List<String> elTypeNames, List<Class<?>> partClasses) {
-
- List<Method> getMethods = new ArrayList<Method>(partNames.size());
- List<Method> setMethods = new ArrayList<Method>(partNames.size());
- List<Field> fields = new ArrayList<Field>(partNames.size());
-
- for (int x = 0; x < partNames.size(); x++) {
- String partName = partNames.get(x);
- if (partName == null) {
- getMethods.add(null);
- setMethods.add(null);
- fields.add(null);
- continue;
- }
-
- String getAccessor = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.GETTER);
- String setAccessor = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.SETTER);
- Method getMethod = null;
- Method setMethod = null;
- Class<?> valueClass = XmlBeansWrapperHelper.getXMLBeansValueType(wrapperType);
- Method[] allMethods = valueClass.getMethods();
-
- try {
- getMethod = valueClass.getMethod(getAccessor, AbstractWrapperHelper.NO_CLASSES);
- } catch (NoSuchMethodException ex) {
- try {
- getMethod = valueClass.getMethod(getAccessor + "Array", AbstractWrapperHelper.NO_CLASSES);
- getAccessor += "Array";
- setAccessor += "Array";
- } catch (NoSuchMethodException ex2) {
- //ignore for now
- }
- }
-
- for (Method method : allMethods) {
- if (method.getParameterTypes() != null && method.getParameterTypes().length == 1
- && (setAccessor.equals(method.getName()))) {
- setMethod = method;
- break;
- }
- }
-
- getMethods.add(getMethod);
- setMethods.add(setMethod);
- // There is no filed in the XMLBeans type class
- fields.add(null);
-
- }
-
- return new XmlBeansWrapperHelper(wrapperType,
- setMethods.toArray(new Method[setMethods.size()]),
- getMethods.toArray(new Method[getMethods.size()]),
- fields.toArray(new Field[fields.size()]));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
deleted file mode 100755
index 1b28cec..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
+++ /dev/null
@@ -1,328 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-
-import java.io.InputStream;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import org.xml.sax.InputSource;
-
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.common.xmlschema.SchemaCollection;
-import org.apache.cxf.helpers.DOMUtils;
-import org.apache.cxf.helpers.XPathUtils;
-import org.apache.cxf.service.ServiceModelVisitor;
-import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaException;
-import org.apache.ws.commons.schema.XmlSchemaType;
-import org.apache.ws.commons.schema.resolver.URIResolver;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.SchemaTypeSystem;
-import org.apache.xmlbeans.XmlAnySimpleType;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem;
-import org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl;
-
-/**
- * Walks the service model and sets up the element/type names.
- */
-class XmlBeansSchemaInitializer extends ServiceModelVisitor {
-
- public static final String XML_BEANS_SCHEMA_PREFIX = "schema"
- + SchemaTypeSystemImpl.METADATA_PACKAGE_GEN + "/src/";
- private static final Logger LOG = LogUtils.getLogger(XmlBeansSchemaInitializer.class);
- private static final Map<Class<?>, Class<? extends XmlAnySimpleType>> CLASS_MAP
- = new HashMap<Class<?>, Class<? extends XmlAnySimpleType>>();
- private SchemaCollection schemas;
- private XmlBeansDataBinding dataBinding;
- private Map<String, XmlSchema> schemaMap
- = new HashMap<String, XmlSchema>();
- private URIResolver schemaResolver;
-
- static {
- CLASS_MAP.put(String.class, org.apache.xmlbeans.XmlString.class);
- CLASS_MAP.put(Integer.class, org.apache.xmlbeans.XmlInt.class);
- CLASS_MAP.put(Integer.TYPE, org.apache.xmlbeans.XmlInt.class);
- CLASS_MAP.put(Short.class, org.apache.xmlbeans.XmlShort.class);
- CLASS_MAP.put(Short.TYPE, org.apache.xmlbeans.XmlShort.class);
- CLASS_MAP.put(Byte.class, org.apache.xmlbeans.XmlByte.class);
- CLASS_MAP.put(Byte.TYPE, org.apache.xmlbeans.XmlByte.class);
- CLASS_MAP.put(Float.class, org.apache.xmlbeans.XmlFloat.class);
- CLASS_MAP.put(Float.TYPE, org.apache.xmlbeans.XmlFloat.class);
- CLASS_MAP.put(Double.class, org.apache.xmlbeans.XmlDouble.class);
- CLASS_MAP.put(Double.TYPE, org.apache.xmlbeans.XmlDouble.class);
- CLASS_MAP.put(Long.class, org.apache.xmlbeans.XmlLong.class);
- CLASS_MAP.put(Long.TYPE, org.apache.xmlbeans.XmlLong.class);
- CLASS_MAP.put(Boolean.class, org.apache.xmlbeans.XmlBoolean.class);
- CLASS_MAP.put(Boolean.TYPE, org.apache.xmlbeans.XmlBoolean.class);
- CLASS_MAP.put(BigDecimal.class, org.apache.xmlbeans.XmlDecimal.class);
- CLASS_MAP.put(BigInteger.class, org.apache.xmlbeans.XmlInteger.class);
- CLASS_MAP.put(Date.class, org.apache.xmlbeans.XmlDate.class);
- CLASS_MAP.put(Calendar.class, org.apache.xmlbeans.XmlDate.class);
- CLASS_MAP.put(byte[].class, org.apache.xmlbeans.XmlBase64Binary.class);
- }
-
- XmlBeansSchemaInitializer(ServiceInfo serviceInfo,
- SchemaCollection col,
- XmlBeansDataBinding db) {
- super(serviceInfo);
- schemas = col;
- dataBinding = db;
- schemaResolver = serviceInfo.getXmlSchemaCollection().getXmlSchemaCollection().getSchemaResolver();
- }
-
- public class XMLSchemaResolver implements URIResolver {
- final SchemaTypeSystem sts;
- XMLSchemaResolver(SchemaTypeSystem sts) {
- this.sts = sts;
- }
-
- public InputSource resolveEntity(String targetNamespace, String schemaLocation, String baseUri) {
- InputStream ins = sts.getSourceAsStream(schemaLocation);
- if (ins != null) {
- return new InputSource(ins);
- }
- return null;
- }
- }
-
- XmlSchema addSchemaElement(SchemaTypeSystem sts, Document doc,
- Element elem, String file) throws URISyntaxException {
- doc.appendChild(elem);
-
- elem = DOMUtils.getFirstElement(elem);
- while (elem != null) {
- if (elem.getLocalName().equals("import")) {
- URI uri = new URI(file);
- String loc = elem.getAttribute("schemaLocation");
- if (!StringUtils.isEmpty(loc)) {
- URI locUri = uri.resolve(loc);
- String newLoc = locUri.toString();
- getSchema(sts, newLoc);
- }
- }
- elem = DOMUtils.getNextElement(elem);
- }
- XmlSchema schema = dataBinding.addSchemaDocument(serviceInfo,
- schemas,
- doc,
- file);
- doc.removeChild(doc.getDocumentElement());
- schemaMap.put(file, schema);
-
- return schema;
- }
- protected XmlSchema getSchema(SchemaTypeSystem sts, String file) {
- if (schemaMap.containsKey(file)) {
- return schemaMap.get(file);
- }
-
- try {
- InputSource fileSource = schemaResolver.resolveEntity(null,
- file,
- null);
- String systemId = removePrefix(fileSource.getSystemId(),
- XML_BEANS_SCHEMA_PREFIX);
-
- return getSchemaInternal(sts, systemId);
- } catch (XmlSchemaException e) {
- if (LOG.isLoggable(Level.FINEST)) {
- LOG.log(Level.FINEST,
- "The XML catalog is not configured to map the file [" + file + "] ", e);
- }
- }
- return getSchemaInternal(sts, file);
- }
-
- protected XmlSchema getSchemaInternal(SchemaTypeSystem sts, String file) {
- InputStream ins = sts.getSourceAsStream(file);
- if (ins == null) {
- return null;
- }
- try {
- //temporary marker to make sure recursive imports don't blow up
- schemaMap.put(file, null);
-
- Document doc = StaxUtils.read(ins);
- Element elem = doc.getDocumentElement();
- doc.removeChild(elem);
-
- if ("schema".equals(elem.getLocalName())
- && "http://www.w3.org/2001/XMLSchema".equals(elem.getNamespaceURI())) {
- return addSchemaElement(sts, doc, elem, file);
- }
- Map<String, String> ns = new HashMap<String, String>();
- ns.put("wsdl", WSDLConstants.NS_WSDL11);
- ns.put("xsd", WSDLConstants.NS_SCHEMA_XSD);
- XPathUtils xpath = new XPathUtils(ns);
- NodeList list = xpath.getValueList("/wsdl:definitions/wsdl:types/xsd:schema", elem);
- for (int x = 0; x < list.getLength(); x++) {
- addSchemaElement(sts, doc, (Element)list.item(x), file + "#1");
- }
- return null;
- } catch (Exception e) {
- throw new RuntimeException("Failed to find schema for: " + file, e);
- }
- }
- /**
- * Removes the prefix ending with the given suffix. For instance, the value
- * XYZ where the prefix is Y, the result will be Z. The removed string is XY.
- *
- * @param value the value from where the returned string is extracted
- * @param prefixSuffix the prefix
- * @return the rest of the string
- */
- protected String removePrefix(String value, String prefixSuffix) {
- return value.substring(value.indexOf(prefixSuffix) + prefixSuffix.length());
- }
-
- @Override
- public void begin(MessagePartInfo part) {
- LOG.finest(part.getName().toString());
- // Check to see if the WSDL information has been filled in for us.
- if (part.getTypeQName() != null || part.getElementQName() != null) {
- checkForExistence(part);
- return;
- }
-
- Class<?> clazz = part.getTypeClass();
- if (clazz == null) {
- return;
- }
-
- boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped();
- if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) {
- clazz = clazz.getComponentType();
- }
- mapClass(part, clazz);
- }
- private void mapClass(MessagePartInfo part, Class<?> clazz) {
-
- if (!XmlObject.class.isAssignableFrom(clazz)) {
-
- Class<? extends XmlAnySimpleType> type = CLASS_MAP.get(clazz);
- if (type == null) {
- LOG.log(Level.SEVERE, clazz.getName() + " was not found in class map");
- return;
- }
- SchemaTypeSystem sts = BuiltinSchemaTypeSystem.get();
- SchemaType st2 = sts.typeForClassname(type.getName());
-
- part.setProperty(SchemaType.class.getName(), st2);
- part.setProperty(XmlAnySimpleType.class.getName(), type);
- part.setTypeQName(st2.getName());
- XmlSchemaType xmlSchema = schemas.getTypeByQName(st2.getName());
- part.setXmlSchema(xmlSchema);
- return;
- }
-
- try {
- Field field = clazz.getField("type");
- SchemaType st = (SchemaType)field.get(null);
- part.setProperty(SchemaType.class.getName(), st);
-
- SchemaTypeSystem sts = st.getTypeSystem();
- schemas.getXmlSchemaCollection().setSchemaResolver(new XMLSchemaResolver(sts));
- String sourceName = st.getSourceName();
- XmlSchema schema = getSchema(sts, sourceName);
- if (schema != null) {
- if (st.isDocumentType()) {
- XmlSchemaElement sct = schema.getElementByName(st.getDocumentElementName());
- part.setXmlSchema(sct);
- part.setElement(true);
- part.setElementQName(st.getDocumentElementName());
- part.setConcreteName(st.getDocumentElementName());
- } else if (st.getComponentType() == SchemaType.ELEMENT) {
- XmlSchemaElement sct = schema.getElementByName(st.getName());
- part.setXmlSchema(sct);
- part.setElement(true);
- } else {
- XmlSchemaType sct = schema.getTypeByName(st.getName());
- part.setTypeQName(st.getName());
- part.setXmlSchema(sct);
- part.setElement(false);
- }
- } else {
- if (st.isDocumentType()) {
- part.setElement(true);
- part.setElementQName(st.getDocumentElementName());
- part.setConcreteName(st.getDocumentElementName());
- part.setXmlSchema(schemas.getElementByQName(st.getDocumentElementName()));
- } else if (st.getComponentType() == SchemaType.ELEMENT) {
- part.setElement(true);
- part.setElementQName(st.getName());
- part.setConcreteName(st.getName());
- part.setXmlSchema(schemas.getElementByQName(st.getName()));
- } else {
- part.setTypeQName(st.getName());
- part.setElement(false);
- part.setXmlSchema(schemas.getTypeByQName(st.getName()));
- }
- }
- } catch (RuntimeException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- public void checkForExistence(MessagePartInfo part) {
- QName qn = part.getElementQName();
- if (qn != null) {
- XmlSchemaElement el = schemas.getElementByQName(qn);
- if (el == null) {
- Class<?> clazz = part.getTypeClass();
- if (clazz == null) {
- return;
- }
-
- boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped();
- if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) {
- clazz = clazz.getComponentType();
- }
- mapClass(part, clazz);
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
deleted file mode 100644
index c98de9b..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
+++ /dev/null
@@ -1,103 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.apache.cxf.databinding.AbstractWrapperHelper;
-import org.apache.xmlbeans.XmlOptions;
-
-
-public class XmlBeansWrapperHelper extends AbstractWrapperHelper {
-
- public XmlBeansWrapperHelper(Class<?> wt, Method[] sets, Method[] gets, Field[] f) {
- super(wt, sets, gets, f);
-
- }
-
- @Override
- protected Object createWrapperObject(Class<?> typeClass) throws Exception {
- Class<?> cls[] = typeClass.getDeclaredClasses();
- Method newType = null;
- for (Method method : typeClass.getMethods()) {
- if (method.getName().startsWith("addNew")) {
- newType = method;
- break;
- }
- }
- Object obj = null;
- for (Class<?> c : cls) {
- if ("Factory".equals(c.getSimpleName())) {
- if (validate) {
- // set the validation option here
- Method method = c.getMethod("newInstance", XmlOptions.class);
- XmlOptions options = new XmlOptions();
- options.setValidateOnSet();
- obj = method.invoke(null, options);
- } else {
- Method method = c.getMethod("newInstance", NO_CLASSES);
- obj = method.invoke(null, NO_PARAMS);
- }
- if (newType != null) {
- // create the value object
- obj = newType.invoke(obj, NO_PARAMS);
- }
- break;
- }
- }
-
- return obj;
- }
-
- @Override
- protected Object getWrapperObject(Object object) throws Exception {
- Method m = getXMLBeansValueMethod(wrapperType);
- Method method = null;
- if (m == null) {
- Class<?> valueClass = getXMLBeansValueType(wrapperType);
- // we need get the real Object first
- method = wrapperType.getMethod("get" + valueClass.getSimpleName(), NO_CLASSES);
- } else {
- method = wrapperType.getMethod("get" + m.getName().substring(6), NO_CLASSES);
- }
- return method.invoke(object, NO_PARAMS);
- }
- public static Method getXMLBeansValueMethod(Class<?> wrapperType) {
- for (Method method : wrapperType.getMethods()) {
- if (method.getName().startsWith("addNew")) {
- return method;
- }
- }
- return null;
- }
-
- public static Class<?> getXMLBeansValueType(Class<?> wrapperType) {
- Class<?> result = wrapperType;
- for (Method method : wrapperType.getMethods()) {
- if (method.getName().startsWith("addNew")) {
- result = method.getReturnType();
- break;
- }
- }
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
deleted file mode 100644
index 9c326a9..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
+++ /dev/null
@@ -1,123 +0,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.
- */
-
-package org.apache.cxf.xmlbeans.tools;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.xmlbeans.SchemaType;
-
-/**
- * This class will help us to map the
- * <a href="http://xmlbeans.apache.org/docs/2.0.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html">
- * XMLBeans Builtin Type</a> into Natural Java Type
- *
- *
- */
-public final class XMLBeansSchemaTypeUtils {
- private static final Map<String, String> BUILTIN_TYPES_MAP;
- static {
- BUILTIN_TYPES_MAP = new HashMap<String, String>();
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlObject", "org.apache.xmlbeans.XmlObject");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlAnySimpleType", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlAnyURI", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlBase64Binary", "byte[]");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlBoolean", "boolean");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlByte", "byte");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlDate", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlDateTime", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlDecimal", "java.math.BigDecimal");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlDouble", "double");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlDuration", "org.apache.xmlbeans.GDuration");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlENTITIES", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlENTITY", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlFloat", "float");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlGDay", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlGMonth", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlGMonthDay", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlGYear", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlGYearMonth", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlHexBinary", "byte[]");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlID", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlIDREF", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlIDREFS", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlInt", "int");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlInteger", "java.math.BigInteger");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlLanguage", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlLong", "long");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlName", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNCNAME", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNegativeInteger", "java.math.BigInteger");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNMTOKEN", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNMTOKENS", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNonNegativeInteger", "java.math.BigInteger");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNonPositiveInteger", "java.math.BigInteger");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNormalizedString", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlNOTATION", "org.apache.xmlbeans.XmlNOTATION");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlPositiveInteger", "java.math.BigInteger");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlQName", "javax.xml.namespace.QName");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlShort", "short");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlString", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlTime", "java.util.Calendar");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlToken", "String");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlUnsignedByte", "short");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlUnsignedInt", "long");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlUnsignedLong", "java.math.BigInteger");
- BUILTIN_TYPES_MAP.put("org.apache.xmlbeans.XmlUnsignedShort", "int");
- }
-
- private XMLBeansSchemaTypeUtils() {
- // helper class
- }
-
- public static String getNaturalJavaClassName(SchemaType st) {
- SchemaType schemaType = st;
- String result = null;
- if (st.getBaseEnumType() != null && !hasBase(st)) {
- return st.getFullJavaName().replace('$', '.') + ".Enum";
- } else if (st.isSimpleType() && !st.isBuiltinType()) {
- schemaType = st.getBaseType();
- while (schemaType != null && !schemaType.isBuiltinType()) {
- schemaType = schemaType.getBaseType();
- }
- }
- if (schemaType != null && schemaType.isBuiltinType()) {
- result = BUILTIN_TYPES_MAP.get(schemaType.getFullJavaName());
- } else if (schemaType != null) {
- result = schemaType.getFullJavaName().replace('$', '.');
- }
- return result;
-
- }
- private static boolean hasBase(SchemaType sType) {
- boolean hasBase;
- SchemaType baseEnumType = sType.getBaseEnumType();
- if (baseEnumType.isAnonymousType() && baseEnumType.isSkippedAnonymousType()) {
- if (sType.getContentBasedOnType() != null) {
- hasBase = sType.getContentBasedOnType().getBaseType() != baseEnumType;
- } else {
- hasBase = sType.getBaseType() != baseEnumType;
- }
- } else {
- hasBase = baseEnumType != sType;
- }
- return hasBase;
- }
-}
[2/3] cxf git commit: [CXF-7195] Removing rt-databindings-xmlbeans
Posted by se...@apache.org.
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
deleted file mode 100644
index 3bbedcf..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
+++ /dev/null
@@ -1,545 +0,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.
- */
-
-package org.apache.cxf.xmlbeans.tools;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-import org.apache.cxf.common.jaxb.JAXBUtils;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.cxf.tools.common.ToolConstants;
-import org.apache.cxf.tools.common.ToolContext;
-import org.apache.cxf.tools.common.ToolException;
-import org.apache.cxf.tools.common.model.DefaultValueWriter;
-import org.apache.cxf.tools.util.ClassCollector;
-import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
-import org.apache.ws.commons.schema.constants.Constants;
-import org.apache.xmlbeans.SchemaGlobalElement;
-import org.apache.xmlbeans.SchemaProperty;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.SchemaTypeLoader;
-import org.apache.xmlbeans.SchemaTypeSystem;
-import org.apache.xmlbeans.SimpleValue;
-import org.apache.xmlbeans.XmlBeans;
-import org.apache.xmlbeans.XmlError;
-import org.apache.xmlbeans.XmlErrorCodes;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.impl.common.ResolverUtil;
-import org.apache.xmlbeans.impl.common.XmlErrorWatcher;
-import org.apache.xmlbeans.impl.config.BindingConfigImpl;
-import org.apache.xmlbeans.impl.schema.PathResourceLoader;
-import org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl;
-import org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler;
-import org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl;
-import org.apache.xmlbeans.impl.schema.StscState;
-import org.apache.xmlbeans.impl.tool.CodeGenUtil;
-import org.apache.xmlbeans.impl.util.FilerImpl;
-import org.apache.xmlbeans.impl.xb.substwsdl.TImport;
-import org.apache.xmlbeans.impl.xb.xmlconfig.ConfigDocument;
-import org.apache.xmlbeans.impl.xb.xmlconfig.Extensionconfig;
-import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
-import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument.Schema;
-
-/**
- *
- */
-public class XMLBeansToolingDataBinding implements DataBindingProfile {
- private static final String CONFIG_URI = "http://xml.apache.org/xmlbeans/2004/02/xbean/config";
- private static final String COMPATIBILITY_CONFIG_URI = "http://www.bea.com/2002/09/xbean/config";
- private static final Map<String, String> MAP_COMPATIBILITY_CONFIG_URIS;
- static {
- MAP_COMPATIBILITY_CONFIG_URIS = new HashMap<String, String>();
- MAP_COMPATIBILITY_CONFIG_URIS.put(COMPATIBILITY_CONFIG_URI, CONFIG_URI);
- }
-
- SchemaTypeSystem typeSystem;
- SchemaTypeLoader typeLoader;
- Map<String, String> sourcesToCopyMap = new HashMap<String, String>();
- List<XmlError> errors = new LinkedList<XmlError>();
- XmlErrorWatcher errorListener = new XmlErrorWatcher(errors);
- PathResourceLoader cpResourceLoader = new PathResourceLoader(CodeGenUtil.systemClasspath());
- StscState state;
-
-
- public void initialize(ToolContext context) throws ToolException {
- context.put(ToolConstants.RUNTIME_DATABINDING_CLASS,
- "org.apache.cxf.xmlbeans.XmlBeansDataBinding.class");
-
- String wsdl = (String)context.get(ToolConstants.CFG_WSDLURL);
- String catalog = (String)context.get(ToolConstants.CFG_CATALOG);
-
- Object o = context.get(ToolConstants.CFG_BINDING);
- String bindingFiles[];
- if (o instanceof String) {
- bindingFiles = new String[] {o.toString()};
- } else {
- bindingFiles = (String[])o;
- }
-
- // build the in-memory type system
- state = StscState.start();
- // construct the state (have to initialize early in case of errors)
- state.setErrorListener(errorListener);
-
- EntityResolver cmdLineEntRes = ResolverUtil.resolverForCatalog(catalog);
- typeSystem = loadTypeSystem(wsdl,
- bindingFiles,
- null,
- null,
- null,
- cmdLineEntRes);
- StscState.end();
- }
-
- public DefaultValueWriter createDefaultValueWriter(QName qn, boolean element) {
- return null;
- }
-
- public DefaultValueWriter createDefaultValueWriterForWrappedElement(QName wrapperElement, QName qn) {
- return null;
- }
-
- public String getType(QName qn, boolean element) {
- String ret;
- if (element) {
- SchemaType type = typeSystem.findDocumentType(qn);
- if (type == null) {
- type = typeLoader.findDocumentType(qn);
- }
- if (type == null) {
- return null;
- }
-
- ret = type.getFullJavaName();
- if (ret.contains("$")) {
- ret = ret.substring(0, ret.indexOf('$'));
- }
- return ret;
- }
-
- SchemaType type = typeSystem.findType(qn);
- if (type == null) {
- type = typeLoader.findType(qn);
- }
-
- if (type == null
- && Constants.URI_2001_SCHEMA_XSD.equals(qn.getNamespaceURI())) {
- return JAXBUtils.builtInTypeToJavaType(qn.getLocalPart());
- }
- if (type == null) {
- return null;
- }
- ret = type.getFullJavaName();
- return ret.replace('$', '.');
- }
-
- public String getWrappedElementType(QName wrapperElement, QName item) {
- SchemaGlobalElement elem = typeSystem.findElement(wrapperElement);
-
- if (elem == null) {
- elem = typeLoader.findElement(wrapperElement);
- }
-
- SchemaType st = elem.getType();
- SchemaProperty prop = st.getElementProperty(item);
- SchemaType partType = prop.getType();
- String s = XMLBeansSchemaTypeUtils.getNaturalJavaClassName(partType);
- if (prop.extendsJavaArray()) {
- s += "[]";
- }
- return s;
- }
-
- public void generate(ToolContext context) throws ToolException {
- String srcd = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
- String classesd = (String)context.get(ToolConstants.CFG_CLASSDIR);
- boolean verbose = context.optionSet(ToolConstants.CFG_VERBOSE);
-
- boolean result = true;
- if (errorListener.hasError()) {
- result = false;
- }
-
- File srcDir;
- File classesDir;
- if (srcd == null) {
- String wsdl = (String)context.get(ToolConstants.CFG_WSDLLOCATION);
- try {
- srcd = new File(new URI(wsdl)).getAbsolutePath();
- } catch (URISyntaxException e) {
- srcd = new File(".").getAbsolutePath();
- }
- }
- srcDir = new File(srcd);
- srcDir.mkdirs();
-
- if (classesd == null) {
- classesDir = srcDir;
- } else {
- classesDir = new File(classesd);
- classesDir.mkdirs();
- }
-
- // now code generate and compile the JAR
- if (result) {
- // filer implementation writes binary .xsd and generated source to disk
- final ClassCollector classCollector = context.get(ClassCollector.class);
-
- FilerImpl filer = new FilerImpl(classesDir, srcDir,
- null, verbose, false) {
-
- public Writer createSourceFile(String typename) throws IOException {
- String tn = typename;
- if (tn.contains("$")) {
- tn = tn.substring(0, tn.indexOf('$'));
- }
- String pkg = tn.substring(0, tn.lastIndexOf('.'));
- tn = tn.substring(tn.lastIndexOf('.') + 1);
- classCollector.addTypesClassName(pkg, tn, pkg + "." + tn);
- return super.createSourceFile(typename);
- }
- };
-
- // currently just for schemaCodePrinter
- XmlOptions options = new XmlOptions();
- /*
- if (codePrinter != null) {
- options.setSchemaCodePrinter(codePrinter);
- }
- */
- options.setGenerateJavaVersion("1.5");
- options.setCharacterEncoding((String)context.get(ToolConstants.CFG_ENCODING));
-
- // save .xsb files
- typeSystem.save(filer);
-
- // gen source files
- result &= SchemaTypeSystemCompiler.generateTypes(typeSystem, filer, options);
- /*
- for (String s : classCollector.getGeneratedFileInfo()) {
- System.out.println(s);
- }
- */
- for (Map.Entry<String, String> ent : sourcesToCopyMap.entrySet()) {
- try {
- OutputStream out = filer.createBinaryFile("schema"
- + SchemaTypeSystemImpl.METADATA_PACKAGE_GEN
- + "/src/" + ent.getValue());
- URL url = new URL(ent.getKey());
- InputStream in = url.openStream();
- IOUtils.copy(in, out);
- out.close();
- in.close();
- } catch (Exception e) {
- //probably not an issue
- }
- }
- }
-
- if (!result) {
- if (verbose) {
- System.out.println("BUILD FAILED");
- }
- StringBuilder sb = new StringBuilder("Error generating XMLBeans types\n");
- for (XmlError err : errors) {
- if (err.getSeverity() != XmlError.SEVERITY_INFO) {
- sb.append(err.toString());
- if (err.getLine() != -1) {
- sb.append(": ").append(err.getSourceName());
- sb.append('[').append(Integer.toString(err.getLine()))
- .append(',').append(Integer.toString(err.getColumn()))
- .append(']');
- }
- sb.append('\n');
- }
- }
- throw new ToolException(sb.toString());
- }
-
- if (cpResourceLoader != null) {
- cpResourceLoader.close();
- }
- }
-
-
- private SchemaTypeSystem loadTypeSystem(String wsdlFile,
- String[] configFiles,
- Set<?> mdefNamespaces,
- File baseDir,
- File schemasDir,
- EntityResolver entResolver) {
-
-
- SchemaTypeLoader loader = XmlBeans.typeLoaderForClassLoader(SchemaDocument.class.getClassLoader());
-
- // parse all the XSD files.
- List<SchemaDocument.Schema> scontentlist = new ArrayList<SchemaDocument.Schema>();
- try {
- URL url = new URL(wsdlFile);
- XmlOptions options = new XmlOptions();
- options.setLoadLineNumbers();
- options.setLoadSubstituteNamespaces(Collections
- .singletonMap("http://schemas.xmlsoap.org/wsdl/",
- "http://www.apache.org/internal/xmlbeans/wsdlsubst"));
- options.setEntityResolver(entResolver);
- options.setGenerateJavaVersion(XmlOptions.GENERATE_JAVA_15);
-
- state.addSourceUri(wsdlFile, null);
- loadWSDLDoc(loader, url, options, scontentlist, errorListener);
-
-
- } catch (XmlException e) {
- errorListener.add(e.getError());
- } catch (Exception e) {
- StscState.addError(errorListener, XmlErrorCodes.CANNOT_LOAD_FILE, new Object[] {
- "url", wsdlFile, e.getMessage()
- }, (URL)null);
- }
-
- SchemaDocument.Schema[] sdocs = (SchemaDocument.Schema[])scontentlist
- .toArray(new SchemaDocument.Schema[scontentlist.size()]);
-
- // now the config files.
- List<ConfigDocument.Config> cdoclist = new ArrayList<ConfigDocument.Config>();
- List<File> javaFiles = new ArrayList<File>();
- if (configFiles != null) {
- for (int i = 0; i < configFiles.length; i++) {
- if (configFiles[i].endsWith(".java")) {
- javaFiles.add(new File(configFiles[i]));
- continue;
- }
- if (!configFiles[i].endsWith(".xsdconfig")) {
- //jaxws/jaxb customization file or something else
- continue;
- }
- try {
- XmlOptions options = new XmlOptions();
- options.put(XmlOptions.LOAD_LINE_NUMBERS);
- options.setEntityResolver(entResolver);
- options.setLoadSubstituteNamespaces(MAP_COMPATIBILITY_CONFIG_URIS);
-
- URI uri = new URI(configFiles[i]);
- XmlObject configdoc = null;
- if ("file".equals(uri.getRawSchemeSpecificPart())) {
- configdoc = loader.parse(new File(uri), null, options);
- } else {
- InputSource source = new InputSource(configFiles[i]);
- Document doc = StaxUtils.read(source);
- configdoc = loader.parse(doc, null, options);
- }
-
- if (!(configdoc instanceof ConfigDocument)) {
- StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[] {
- configFiles[i], "xsd config"
- }, configdoc);
- } else {
- StscState.addInfo(errorListener, "Loading config file " + configFiles[i]);
- if (configdoc.validate(new XmlOptions().setErrorListener(errorListener))) {
- ConfigDocument.Config config = ((ConfigDocument)configdoc).getConfig();
- cdoclist.add(config);
- config.setExtensionArray(new Extensionconfig[] {});
- }
- }
- } catch (XmlException e) {
- errorListener.add(e.getError());
- } catch (Exception e) {
- StscState.addError(errorListener, XmlErrorCodes.CANNOT_LOAD_FILE, new Object[] {
- "xsd config", configFiles[i], e.getMessage()
- }, new File(configFiles[i]));
- }
- }
- }
- ConfigDocument.Config[] cdocs = (ConfigDocument.Config[])cdoclist
- .toArray(new ConfigDocument.Config[cdoclist.size()]);
-
-
- SchemaTypeLoader linkTo = SchemaTypeLoaderImpl.build(null, cpResourceLoader, null);
-
- URI baseURI = null;
- if (baseDir != null) {
- baseURI = baseDir.toURI();
- }
-
- XmlOptions opts = new XmlOptions();
- opts.setCompileDownloadUrls();
-
-
- if (mdefNamespaces != null) {
- opts.setCompileMdefNamespaces(mdefNamespaces);
- }
- opts.setCompileNoValidation(); // already validated here
- opts.setEntityResolver(entResolver);
- opts.setGenerateJavaVersion("1.5");
-
- // now pass it to the main compile function
- SchemaTypeSystemCompiler.Parameters params = new SchemaTypeSystemCompiler.Parameters();
- params.setSchemas(sdocs);
- params.setConfig(BindingConfigImpl.forConfigDocuments(cdocs,
- javaFiles.toArray(new File[javaFiles.size()]),
- CodeGenUtil.systemClasspath()));
-
- typeLoader = loader;
-
- params.setLinkTo(linkTo);
- params.setOptions(opts);
- params.setErrorListener(errorListener);
- params.setJavaize(true);
- params.setBaseURI(baseURI);
- params.setSourcesToCopyMap(sourcesToCopyMap);
- //params.setSchemasDir(schemasDir);
- return SchemaTypeSystemCompiler.compile(params);
- }
-
-
- private static void loadWSDLDoc(SchemaTypeLoader loader, URL url,
- XmlOptions options,
- List<Schema> scontentlist,
- XmlErrorWatcher errorListener)
- throws XmlException, IOException {
- XmlObject urldoc = loader.parse(url, null, options);
-
- if (urldoc instanceof org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument) {
- org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc =
- (org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)urldoc;
-
- addWsdlSchemas(url.toString(),
- wsdldoc,
- errorListener,
- scontentlist);
-
- for (TImport imp : wsdldoc.getDefinitions().getImportArray()) {
- URL url1 = new URL(url, imp.getLocation());
- if (imp.getLocation().toLowerCase().endsWith(".xsd")) {
- XmlObject urldoc2 = loader.parse(url1, null, options);
- addSchema(url1.toString(), (SchemaDocument)urldoc2,
- errorListener, false,
- scontentlist);
- } else {
- loadWSDLDoc(loader, url1, options, scontentlist, errorListener);
- }
- }
-
- } else if (urldoc instanceof SchemaDocument) {
- addSchema(url.toString(), (SchemaDocument)urldoc, errorListener, false,
- scontentlist);
- } else {
- StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[] {
- url, "wsdl or schema"
- }, urldoc);
- }
- }
-
-
- private static void addSchema(String name, SchemaDocument schemadoc, XmlErrorWatcher errorListener,
- boolean noVDoc, List<SchemaDocument.Schema> scontentlist) {
- StscState.addInfo(errorListener, "Loading schema file " + name);
- XmlOptions opts = new XmlOptions().setErrorListener(errorListener);
- if (noVDoc) {
- opts.setValidateTreatLaxAsSkip();
- }
- if (schemadoc.validate(opts)) {
- scontentlist.add(schemadoc.getSchema());
- }
- }
-
- private static void addWsdlSchemas(String name,
- org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc,
- XmlErrorWatcher errorListener,
- List<SchemaDocument.Schema> scontentlist) {
- if (wsdlContainsEncoded(wsdldoc)) {
- StscState
- .addWarning(
- errorListener,
- "The WSDL "
- + name
- + " uses SOAP encoding. SOAP encoding "
- + "is not compatible with literal XML Schema.",
- XmlErrorCodes.GENERIC_ERROR, wsdldoc);
- }
- StscState.addInfo(errorListener, "Loading wsdl file " + name);
- XmlOptions opts = new XmlOptions().setErrorListener(errorListener);
- XmlObject[] types = wsdldoc.getDefinitions().getTypesArray();
-
- int count = 0;
- for (int j = 0; j < types.length; j++) {
- XmlObject[] schemas = types[j]
- .selectPath("declare namespace xs=\"http://www.w3.org/2001/XMLSchema\" xs:schema");
- if (schemas.length == 0) {
- StscState
- .addWarning(
- errorListener,
- "The WSDL "
- + name
- + " did not have any schema documents in "
- + "namespace 'http://www.w3.org/2001/XMLSchema'",
- XmlErrorCodes.GENERIC_ERROR, wsdldoc);
- continue;
- }
-
- for (int k = 0; k < schemas.length; k++) {
- if (schemas[k] instanceof SchemaDocument.Schema && schemas[k].validate(opts)) {
- count++;
- scontentlist.add((SchemaDocument.Schema)schemas[k]);
- }
- }
- }
- StscState.addInfo(errorListener, "Processing " + count + " schema(s) in " + name);
- }
-
-
-
- private static boolean wsdlContainsEncoded(XmlObject wsdldoc) {
- // search for any <soap:body use="encoded"/> etc.
- XmlObject[] useAttrs = wsdldoc
- .selectPath("declare namespace soap='http://schemas.xmlsoap.org/wsdl/soap/' "
- + ".//soap:body/@use|.//soap:header/@use|.//soap:fault/@use");
- for (int i = 0; i < useAttrs.length; i++) {
- if ("encoded".equals(((SimpleValue)useAttrs[i]).getStringValue())) {
- return true;
- }
- }
- return false;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml b/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
deleted file mode 100644
index f5f8103..0000000
--- a/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">
- <bean id="XmlbeansDatabindingBean" class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" scope="prototype"/>
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml b/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml
deleted file mode 100644
index 029dd06..0000000
--- a/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<plugin xmlns="http://cxf.apache.org/tools/plugin" name="xmlbeans" version="" provider="cxf.apache.org">
- <databinding name="xmlbeans" package="org.apache.cxf.xmlbeans.tools" profile="XMLBeansToolingDataBinding"/>
-</plugin>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
deleted file mode 100644
index 60b15a9..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
+++ /dev/null
@@ -1,218 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusException;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.binding.BindingFactoryManager;
-import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.bus.extension.ExtensionManagerBus;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
-import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.test.AbstractCXFTest;
-import org.apache.cxf.tools.wsdlto.core.WSDLDefinitionBuilder;
-import org.apache.cxf.transport.ConduitInitiatorManager;
-import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.transport.local.LocalTransportFactory;
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.cxf.wsdl.WSDLManager;
-import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
-import org.apache.cxf.wsdl11.WSDLManagerImpl;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-
-public abstract class AbstractXmlBeansTest extends AbstractCXFTest {
- protected LocalTransportFactory localTransport;
-
-
- @Before
- public void setUp() throws Exception {
- super.setUpBus();
-
- SoapBindingFactory bindingFactory = new SoapBindingFactory();
- bindingFactory.setBus(bus);
-
- bus.getExtension(BindingFactoryManager.class)
- .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
-
- DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-
- SoapTransportFactory soapDF = new SoapTransportFactory();
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
- dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
-
- localTransport = new LocalTransportFactory();
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
- dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);
- dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", localTransport);
-
- ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
- extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, localTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/", localTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/", localTransport);
-
- bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
-
-
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", WSDLConstants.NS_SCHEMA_XSD);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
-
- }
-
- @Override
- protected Bus createBus() throws BusException {
- ExtensionManagerBus bus = new ExtensionManagerBus();
- BusFactory.setDefaultBus(bus);
- return bus;
- }
-
- protected Node invoke(String service, String message) throws Exception {
- return invoke("local://" + service, LocalTransportFactory.TRANSPORT_ID, message);
- }
- protected Node invoke(String service, byte[] message) throws Exception {
- return invoke("local://" + service, LocalTransportFactory.TRANSPORT_ID, message);
- }
-
- public Server createService(Class<?> serviceClass, QName name) {
- return createService(serviceClass, null, name);
- }
-
- public Server createService(Class<?> serviceClass, Object serviceBean, QName name) {
- return createService(serviceClass, serviceBean, serviceClass.getSimpleName(), name);
- }
-
- protected Server createService(Class<?> serviceClass, QName name, XmlBeansDataBinding binding) {
- return createService(serviceClass, serviceClass.getSimpleName(), name, binding);
- }
-
- protected Server createService(Class<?> serviceClass,
- String address, QName name,
- XmlBeansDataBinding binding) {
- ServerFactoryBean sf = createServiceFactory(serviceClass, null, address, name, binding);
- return sf.create();
- }
-
- public Server createService(Class<?> serviceClass,
- Object serviceBean,
- String address,
- QName name) {
- ServerFactoryBean sf = createServiceFactory(serviceClass, serviceBean, address, name, null);
- return sf.create();
- }
-
- protected ServerFactoryBean createServiceFactory(Class<?> serviceClass,
- Object serviceBean,
- String address,
- QName name,
- XmlBeansDataBinding binding) {
- JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
- sf.setServiceClass(serviceClass);
- if (serviceBean != null) {
- sf.setServiceBean(serviceBean);
- }
- sf.getServiceFactory().setServiceName(name);
- sf.setAddress("local://" + address);
- sf.getServiceFactory().setQualifyWrapperSchema(true);
- setupXmlBeans(sf, binding);
- return sf;
- }
- protected void setupXmlBeans(AbstractWSDLBasedEndpointFactory sf) {
- setupXmlBeans(sf, null);
- }
- protected void setupXmlBeans(AbstractWSDLBasedEndpointFactory sf, XmlBeansDataBinding binding) {
- if (binding == null) {
- binding = new XmlBeansDataBinding();
- }
- sf.getServiceFactory().setDataBinding(binding);
- }
-
- protected Collection<Document> getWSDLDocuments(String string) throws WSDLException {
- WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
-
- Collection<Document> docs = new ArrayList<Document>();
- Definition definition = getWSDLDefinition(string);
- if (definition == null) {
- return null;
- }
- docs.add(writer.getDocument(definition));
-
- for (Import wsdlImport : WSDLDefinitionBuilder.getImports(definition)) {
- docs.add(writer.getDocument(wsdlImport.getDefinition()));
- }
- return docs;
- }
-
- protected Definition getWSDLDefinition(String string) throws WSDLException {
- ServerRegistry svrMan = getBus().getExtension(ServerRegistry.class);
- for (Server s : svrMan.getServers()) {
- Service svc = s.getEndpoint().getService();
- if (svc.getName().getLocalPart().equals(string)) {
- ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
- return builder.build();
- }
- }
- String localString = "local://" + string;
- for (Server s : svrMan.getServers()) {
- String s2 = s.getDestination().getAddress().getAddress().getValue();
- if (localString.equals(s2)) {
- Service svc = s.getEndpoint().getService();
- ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
- return builder.build();
- }
- }
- return null;
-
- }
-
- protected Document getWSDLDocument(String string) throws WSDLException {
- Definition definition = getWSDLDefinition(string);
- if (definition == null) {
- return null;
- }
- WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
- return writer.getDocument(definition);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml
deleted file mode 100644
index 3ddc1fb..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<mappings xmlns:ex="http://cxf.apache.org/xmlbeans/exception">
- <mapping name="ex:CustomFault">
- <property name="extraInfo" style="attribute"/>
- </mapping>
-</mappings>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java
deleted file mode 100644
index 6a0d802..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java
+++ /dev/null
@@ -1,39 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.ws.WebFault;
-
-@WebFault
-public class CustomFault extends Exception {
- private static final long serialVersionUID = 7752898855112831690L;
- private String extraInfo;
-
- public CustomFault() {
- super("custom fault");
- }
-
- public String getFaultInfo() {
- return extraInfo;
- }
-
- public void setFaultInfo(String e) {
- this.extraInfo = e;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml
deleted file mode 100644
index 89f60a8..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:TestService">
- <mixedRequest>
- <string>foo</string>
- <request xmlns="http://cxf.apache.org/xmlbeans">
- <sessionId>foo</sessionId>
- </request>
- </mixedRequest>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java
deleted file mode 100644
index 5464854..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java
+++ /dev/null
@@ -1,78 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.apache.cxf.endpoint.Server;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class DocumentStyleTest extends AbstractXmlBeansTest {
- String ns = "urn:TestService";
- Server server;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- server = createService(TestService.class, new TestService(),
- "TestService",
- new QName(ns, "TestService"));
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("x", "http://cxf.apache.org/xmlbeans");
- addNamespace("y", "urn:TestService");
- assertValid("//s:Body/y:mixedRequestResponse/x:response/x:form", response);
- }
-
- @Test
- public void testInvokeWithHack() throws Exception {
- server.getEndpoint().put(XmlBeansDataBinding.XMLBEANS_NAMESPACE_HACK, Boolean.TRUE);
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("x", "http://cxf.apache.org/xmlbeans");
- addNamespace("y", "urn:TestService");
- assertValid("//s:Body/y:mixedRequestResponse/x:response/x:form", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Document wsdl = getWSDLDocument("TestService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:complexType[@name='mixedRequest']"
- + "/xsd:sequence/xsd:element[@name='string'][@type='xsd:string']",
- wsdl);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml
deleted file mode 100644
index 8b36df3..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:TestService">
- <ThrowFault/>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml
deleted file mode 100644
index 639a3ba..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Body xmlns="http://www.webservicex.net"/>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml
deleted file mode 100644
index 9337933..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="http://www.webservicex.net">
- <GetWeatherByZipCode>
- <ZipCode>49506</ZipCode>
- </GetWeatherByZipCode>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java
deleted file mode 100644
index cc67eb0..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java
+++ /dev/null
@@ -1,48 +0,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.
- */
-
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebService;
-import javax.xml.ws.BindingType;
-
-import org.apache.cxf.xmlbeans.wsdltest.GreeterMine;
-import org.apache.cxf.xmlbeans.wsdltest.SayHi2MessageDocument;
-
-@WebService(endpointInterface = "org.apache.cxf.xmlbeans.wsdltest.GreeterMine",
- targetNamespace = "http://cxf.apache.org/xmlbeans/wsdltest",
- portName = "SoapPort",
- serviceName = "SOAPMineService",
- name = "GreeterMine")
-@BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
-public class GreeterMineImpl implements GreeterMine {
-
-/*
- public String sayHi() {
- System.out.println("****** Executing the operation sayHi *****");
- return "Bonjour";
- }
-*/
- public void sayHi2(SayHi2MessageDocument in) {
- /*System.out.println("****** Executing the operation sayHi2 *****");*/
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml
deleted file mode 100644
index 64a564d..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:xfire:idref">
- <getSampleElement>
-
- </getSampleElement>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java
deleted file mode 100644
index 9ac69db..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java
+++ /dev/null
@@ -1,33 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import com.alservices.xsd.sample.SampleElementDocument;
-
-public class IDRefService {
-
- /**
- * This method "gets" a sample Document.
- *
- * @param inSampleElementDocument
- */
- public void getSampleMethod(SampleElementDocument inSampleElementDocument) {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java
deleted file mode 100644
index a6d2d48..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java
+++ /dev/null
@@ -1,50 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import org.w3c.dom.Node;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class IDRefServiceTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- createService(IDRefService.class, new IDRefService(), "IDRefService", null);
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = getWSDLDocument("IDRefService");
- assertNotNull(response);
-
- /*
- *
- * SampleElementDocument doc =
- * SampleElementDocument.Factory.newInstance(); SampleElement
- * sampleElement = doc.addNewSampleElement(); SampleUserInformation
- * information = sampleElement.addNewSampleUserInformation();
- * addNamespace("t", "urn:TestService"); addNamespace("x",
- * "http://cxf.apache.org/xmlbeans");
- * assertValid("//t:mixedRequestResponse/x:response/x:form", response);
- */
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java
deleted file mode 100644
index f0895c4..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java
+++ /dev/null
@@ -1,80 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests that we can handle multiple schemas within the same namespace.
- */
-public class MultipleSchemaInNSTest extends AbstractXmlBeansTest {
- String ns = "urn:xfire:xmlbeans:nstest";
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(MultipleSchemaService.class,
- new MultipleSchemaService(),
- "MultipleSchemaService",
- new QName("http://xmlbeans.cxf.apache.org/", "MultipleSchemaService"));
- }
-
- @Test
- public void testWSDL() throws Exception {
- Document wsdl = getWSDLDocument("MultipleSchemaService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- NodeList list = assertValid("//xsd:schema[@targetNamespace='" + ns + "']", wsdl);
- assertEquals(StaxUtils.toString(wsdl), 3, list.getLength());
- assertValid("//xsd:import[@namespace='" + ns + "']",
- list.item(0));
- assertValid("//xsd:import[@namespace='" + ns + "']", list.item(0));
-
- assertValid("//xsd:import[@namespace='" + ns + "']",
- list.item(1));
- assertValid("//xsd:import[@namespace='" + ns + "']",
- list.item(2));
- assertInvalid("//xsd:import[@namespace='" + ns + "']/@schemaLocation",
- list.item(1));
- assertInvalid("//xsd:import[@namespace='" + ns + "']/@schemaLocation",
- list.item(2));
- /*
- endpoint.setProperty(AbstractWSDL.REMOVE_ALL_IMPORTS, "True");
-
- wsdl = getWSDLDocument("MultipleSchemaService");
-
- assertValid("//xsd:schema[@targetNamespace='" + ns + "'][1]", wsdl);
- assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][1]" + "/xsd:import[@namespace='" + ns
- + "']", wsdl);
- assertValid("//xsd:schema[@targetNamespace='" + ns + "'][3]", wsdl);
- assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][3]" + "/xsd:import[@namespace='" + ns
- + "']", wsdl);
- */
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java
deleted file mode 100644
index 62a5041..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java
+++ /dev/null
@@ -1,33 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.soap.SOAPBinding;
-
-import xfireXmlbeansNstest.RequestTextDocument;
-import xfireXmlbeansNstest.ResponseTextDocument;
-
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public class MultipleSchemaService {
- @WebMethod
- public ResponseTextDocument testOne(RequestTextDocument requestTextDocument) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java
deleted file mode 100644
index a43cabb..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java
+++ /dev/null
@@ -1,71 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.common.util.Base64Utility;
-import org.junit.Before;
-import org.junit.Test;
-
-public class PrimitiveTypesTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(TypesService.class, new TypesService(),
- "TypesService", new QName("urn:TypesService", "TypesService"));
-
- }
-
- @Test
- public void testPrimitives() throws Exception {
- doTestType("testInt", "24", "In:24");
- doTestType("testInteger", "24", "In:24");
-
- doTestType("testFloat", "3.14", "In:3.14");
- doTestType("testFloatPrim", "3.14", "In:3.14");
-
- doTestType("testBoolean", "false", "In:false");
- doTestType("testBooleanPrim", "true", "In:true");
-
- doTestType("testBase64Binary", Base64Utility.encode("HelloWorld".getBytes()), "In:HelloWorld");
- }
-
-
- public void doTestType(String operation, String data, String expected) throws Exception {
- String req = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
- + "<env:Header/>"
- + "<env:Body xmlns='urn:TypesService' xmlns:x='http://example.com'>"
- + " <" + operation + ">"
- + " <arg0>" + data + "</arg0>"
- + " </" + operation + ">"
- + "</env:Body>"
- + "</env:Envelope>";
- Node nd = invoke("TypesService", req.getBytes());
-
- addNamespace("t", "urn:TypesService");
- assertValid("//t:return[text()='" + expected + "']", nd);
- assertValid("//t:return1[text()='" + data + "']", nd);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java
deleted file mode 100644
index b62bfd2..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java
+++ /dev/null
@@ -1,66 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-
-import com.sample.procure.PurchaseOrderDocument;
-import org.junit.Assert;
-
-
-@WebService(targetNamespace = "urn:TestService",
- serviceName = "TestService")
-public class TestService {
- @WebMethod(operationName = "GetWeatherByZipCode")
- public ResponseDocument getWeatherByZipCode(RequestDocument body) {
- return ResponseDocument.Factory.newInstance();
- }
-
- @WebMethod(operationName = "GetTrouble")
- public TroubleDocument getTrouble(TroubleDocument trouble) {
- return trouble;
- }
-
- @WebMethod(operationName = "ThrowFault")
- public TroubleDocument throwFault() throws CustomFault {
- CustomFault fault = new CustomFault();
- fault.setFaultInfo("extra");
- throw fault;
- }
-
- @WebMethod
- public ResponseDocument mixedRequest(
- @WebParam(name = "string") String string,
- @WebParam(name = "request") RequestDocument req) {
- Assert.assertEquals("foo", string);
- Assert.assertEquals("foo", req.getRequest().getSessionId());
-
- ResponseDocument response = ResponseDocument.Factory.newInstance();
- response.addNewResponse().addNewForm();
- return response;
- }
-
- @WebMethod
- public void submitPO(PurchaseOrderDocument doc) {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java
deleted file mode 100644
index 90bc984..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java
+++ /dev/null
@@ -1,77 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.xml.ws.Holder;
-
-import org.apache.cxf.helpers.IOUtils;
-
-@WebService(targetNamespace = "urn:TypesService")
-public class TypesService {
-
- @WebMethod
- public String testInt(int i, @WebParam(mode = WebParam.Mode.OUT) Holder<Integer> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testInteger(Integer i, @WebParam(mode = WebParam.Mode.OUT) Holder<Integer> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testFloatPrim(float i, @WebParam(mode = WebParam.Mode.OUT) Holder<Float> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testFloat(Float i, @WebParam(mode = WebParam.Mode.OUT) Holder<Float> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testBooleanPrim(boolean i, @WebParam(mode = WebParam.Mode.OUT) Holder<Boolean> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testBoolean(Boolean i, @WebParam(mode = WebParam.Mode.OUT) Holder<Boolean> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testLongPrim(long i, @WebParam(mode = WebParam.Mode.OUT) Holder<Long> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testLong(Long i, @WebParam(mode = WebParam.Mode.OUT) Holder<Long> i2) {
- i2.value = i;
- return "In:" + i;
- }
-
- @WebMethod
- public String testBase64Binary(byte i[], @WebParam(mode = WebParam.Mode.OUT) Holder<byte[]> i2) {
- i2.value = i;
- return "In:" + IOUtils.newStringFromBytes(i);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java
deleted file mode 100644
index a842aaa..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java
+++ /dev/null
@@ -1,47 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-import net.webservicex.GetWeatherByZipCodeDocument;
-import net.webservicex.GetWeatherByZipCodeResponseDocument;
-import net.webservicex.WeatherForecasts;
-
-@WebService(targetNamespace = "http://www.webservicex.net")
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public class WeatherService {
- @WebMethod(operationName = "GetWeatherByZipCode")
- public GetWeatherByZipCodeResponseDocument getWeatherByZipCode(
- @WebParam(name = "GetWeatherByZipCode") GetWeatherByZipCodeDocument body) {
-
- GetWeatherByZipCodeResponseDocument res = GetWeatherByZipCodeResponseDocument.Factory.newInstance();
-
- WeatherForecasts weather = res.addNewGetWeatherByZipCodeResponse().addNewGetWeatherByZipCodeResult();
-
- weather.setLatitude(1);
- weather.setLongitude(1);
- weather.setPlaceName("Grand Rapids, MI");
-
- return res;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java
deleted file mode 100644
index 2faae25..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-import net.webservicex.GetWeatherByZipCodeDocument;
-import net.webservicex.GetWeatherByZipCodeResponseDocument;
-import net.webservicex.WeatherForecasts;
-
-@WebService(targetNamespace = "http://www.webservicex.net")
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public class WeatherService2 {
-
- @WebMethod(operationName = "GetWeatherByZipCode")
- public GetWeatherByZipCodeResponseDocument.GetWeatherByZipCodeResponse
- getWeatherByZipCode(GetWeatherByZipCodeDocument.GetWeatherByZipCode body) {
-
- GetWeatherByZipCodeResponseDocument.GetWeatherByZipCodeResponse res
- = GetWeatherByZipCodeResponseDocument.GetWeatherByZipCodeResponse.Factory
- .newInstance();
-
- WeatherForecasts weather = res.addNewGetWeatherByZipCodeResult();
-
- weather.setLatitude(1);
- weather.setLongitude(1);
- weather.setPlaceName("Grand Rapids, MI");
-
- return res;
- }
- @WebMethod(operationName = "GetForecasts")
- public WeatherForecasts getForecasts() {
- WeatherForecasts weather = WeatherForecasts.Factory.newInstance();
-
- weather.setLatitude(1);
- weather.setLongitude(1);
- weather.setPlaceName("Grand Rapids, MI");
-
- return weather;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java
deleted file mode 100644
index 769999b..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java
+++ /dev/null
@@ -1,66 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class WeatherService2Test extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(WeatherService2.class,
- new WeatherService2(),
- "WeatherService", null);
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("WeatherService", "GetWeatherByZip.xml");
-
- addNamespace("w", "http://www.webservicex.net");
- assertValid("//w:GetWeatherByZipCodeResponse", response);
-
- response = invoke("WeatherService", "GetForecasts.xml");
-
- addNamespace("u", "http://www.webservicex.net");
- assertValid("//u:GetForecastsResponse", response);
- assertValid("//u:GetForecastsResponse/w:Latitude", response);
- assertValid("//u:GetForecastsResponse/w:Longitude", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("WeatherService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- addNamespace("w", WSDLConstants.NS_WSDL11);
-
- assertValid("//w:message[@name='GetForecastsResponse']/w:part[@element='tns:GetForecastsResponse']",
- wsdl);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml
deleted file mode 100644
index 89f60a8..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:TestService">
- <mixedRequest>
- <string>foo</string>
- <request xmlns="http://cxf.apache.org/xmlbeans">
- <sessionId>foo</sessionId>
- </request>
- </mixedRequest>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java
deleted file mode 100644
index 4852c1a..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java
+++ /dev/null
@@ -1,104 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.OperationInfo;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class WrappedStyleTest extends AbstractXmlBeansTest {
- private Server endpoint;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- endpoint = createService(TestService.class, new TestService(),
- "TestService", new QName("urn:TestService", "TestService"));
-
- }
-
- @Test
- public void testParams() throws Exception {
- String ns = "urn:TestService";
-
- OperationInfo op = endpoint.getEndpoint().getService()
- .getServiceInfos().get(0).getInterface().getOperation(new QName(ns, "GetWeatherByZipCode"));
-
- assertNotNull(op);
- MessagePartInfo info = op.getUnwrappedOperation().getInput().getMessagePart(0);
-
- assertEquals(new QName("http://cxf.apache.org/xmlbeans", "request"), info.getElementQName());
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/WrappedRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("t", "urn:TestService");
- addNamespace("x", "http://cxf.apache.org/xmlbeans");
- assertValid("//t:mixedRequestResponse/x:response/x:form", response);
- }
-
- @Test
- public void testFault() throws Exception {
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/FaultRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("t", "urn:TestService");
- addNamespace("x", "http://cxf.apache.org/xmlbeans/exception");
- assertValid("//detail/t:CustomFault[text()='extra']", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("TestService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- addNamespace("ns0", "http://cxf.apache.org/xmlbeans");
- assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:complexType[@name='mixedRequest']"
- + "//xsd:element[@name='string'][@type='xsd:string']", wsdl);
-
- NodeList list = assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:complexType[@name='mixedRequest']"
- + "//xsd:element[@ref]", wsdl);
- for (int x = 0; x < list.getLength(); x++) {
- Element el = (Element)list.item(x);
- assertTrue(el.getAttribute("ref"), el.getAttribute("ref").contains("request"));
- }
-
- assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:element[@name='CustomFault'][@type='xsd:string']", wsdl);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java
deleted file mode 100644
index 74e7189..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java
+++ /dev/null
@@ -1,107 +0,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.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class XMLBeansServiceTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(WeatherService.class, new WeatherService(),
- "WeatherService", new QName("http://www.webservicex.net", "WeatherService"));
- createService(TestService.class, new TestService(), "TestService",
- new QName("urn:TestService", "TestService"));
- }
-
- @Test
- public void testAnyService() throws Exception {
- try {
- getWSDLDocument("TestService");
- assertTrue("Generating WSDL above should not throw an NPE", true);
- } catch (NullPointerException e) {
- fail("Shouldn't be throwing an NPE here");
- }
- }
-
- @Test
- public void testService() throws Exception {
- Node response = invoke("WeatherService", "GetWeatherByZip.xml");
-
- addNamespace("w", "http://www.webservicex.net");
- assertValid("//w:GetWeatherByZipCodeResponse", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("WeatherService");
- // printNode(wsdl);
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
- assertValid("//wsdl:types/xsd:schema[@targetNamespace='http://www.webservicex.net']", wsdl);
- assertValid("//xsd:schema[@targetNamespace='http://www.webservicex.net']"
- + "/xsd:element[@name='WeatherForecasts']", wsdl);
- assertValidBoolean("count(//xsd:schema[@targetNamespace='http://www.webservicex.net']"
- + "/xsd:element[@name='WeatherForecasts'])=1", wsdl);
- assertValid("//xsd:schema[@targetNamespace='http://www.webservicex.net']"
- + "/xsd:complexType[@name='WeatherForecasts']", wsdl);
- }
-
- @Test
- public void testAnyWSDL() throws Exception {
-
- Node wsdl = getWSDLDocument("TestService");
-
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
- assertValid("//wsdl:types/xsd:schema[@targetNamespace='http://cxf.apache.org/xmlbeans']"
- + "/xsd:element[@name='request']", wsdl);
- }
-
- @Test
- public void testAnyWSDLNoDupRootRefElements() throws Exception {
- Node wsdl = getWSDLDocument("TestService");
-
- String xpathString = "/wsdl:definitions/wsdl:types//xsd:schema/xsd:element[@name='trouble']";
-
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- addNamespace("s", Constants.URI_2001_SCHEMA_XSD);
-
- assertEquals(1, assertValid(xpathString, wsdl).getLength());
- }
-
-
-
-}