You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/10/06 16:53:12 UTC
svn commit: r582501 [7/7] - in
/webservices/axis2/branches/java/jaxws21/modules:
adb-codegen/src/org/apache/axis2/schema/
adb-codegen/src/org/apache/axis2/schema/template/
adb-codegen/src/org/apache/axis2/schema/writer/
adb-codegen/test-resources/tests...
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImplValidationTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImplValidationTests.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImplValidationTests.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImplValidationTests.java Sat Oct 6 07:53:06 2007
@@ -21,6 +21,7 @@
import junit.framework.TestCase;
import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
import javax.xml.ws.WebServiceException;
@@ -38,6 +39,9 @@
MethodDescriptionComposite seiMDC = new MethodDescriptionComposite();
seiMDC.setMethodName("seiMethod");
seiComposite.addMethodDescriptionComposite(seiMDC);
+ WebServiceAnnot seiWebServiceAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
+ seiWebServiceAnnot.setName(null);
+ seiComposite.setWebServiceAnnot(seiWebServiceAnnot);
DescriptionBuilderComposite implComposite = new DescriptionBuilderComposite();
implComposite.setClassName("org.apache.axis2.jaxws.description.impl.MyImpl");
@@ -62,6 +66,75 @@
}
catch (WebServiceException ex) {
// Expected path
+ }
+ catch (Exception ex) {
+ fail("Caught wrong type of exception " + ex.toString());
+ }
+
+
+ }
+
+ public void testValidateOverloadedImplMethodsVsSEI() {
+
+ // Tests that overloaded methods validate correctly. Note that the methods are
+ // intentionally added to the implementation and sei in a different order so that they
+ // don't coincidently pass validation just because they are in the same order in both
+ // collections.
+ // seiMethod()
+ // seiMethod(String)
+
+ // Build up the SEI
+ DescriptionBuilderComposite seiComposite = new DescriptionBuilderComposite();
+ seiComposite.setClassName("org.apache.axis2.jaxws.description.impl.MySEI");
+
+ MethodDescriptionComposite seiMDC = new MethodDescriptionComposite();
+ seiMDC.setMethodName("seiMethod");
+ seiComposite.addMethodDescriptionComposite(seiMDC);
+
+ MethodDescriptionComposite seiMDC2 = new MethodDescriptionComposite();
+ seiMDC2.setMethodName("seiMethod");
+ ParameterDescriptionComposite seiPDC = new ParameterDescriptionComposite();
+ seiPDC.setParameterType("java.lang.String");
+ seiMDC2.addParameterDescriptionComposite(seiPDC);
+ seiComposite.addMethodDescriptionComposite(seiMDC2);
+
+ WebServiceAnnot seiWebServiceAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
+ seiWebServiceAnnot.setName(null);
+ seiComposite.setWebServiceAnnot(seiWebServiceAnnot);
+
+ // Build up the Impl, but put the overloaded MDCs on in a different order than the SEI
+ // so they don't just happen to pass validation
+ DescriptionBuilderComposite implComposite = new DescriptionBuilderComposite();
+ implComposite.setClassName("org.apache.axis2.jaxws.description.impl.MyImpl");
+
+ MethodDescriptionComposite implMDC = new MethodDescriptionComposite();
+ implMDC.setMethodName("seiMethod");
+ ParameterDescriptionComposite implPDC = new ParameterDescriptionComposite();
+ implPDC.setParameterType("java.lang.String");
+ implMDC.addParameterDescriptionComposite(implPDC);
+ implComposite.addMethodDescriptionComposite(implMDC);
+
+ MethodDescriptionComposite implMDC2 = new MethodDescriptionComposite();
+ implMDC2.setMethodName("seiMethod");
+ implComposite.addMethodDescriptionComposite(implMDC2);
+
+ WebServiceAnnot webServiceAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
+ webServiceAnnot.setName(null);
+ webServiceAnnot.setEndpointInterface("org.apache.axis2.jaxws.description.impl.MySEI");
+ implComposite.setWebServiceAnnot(webServiceAnnot);
+ implComposite.setIsInterface(false);
+
+ HashMap<String, DescriptionBuilderComposite> dbcList =
+ new HashMap<String, DescriptionBuilderComposite>();
+ dbcList.put(seiComposite.getClassName(), seiComposite);
+ dbcList.put(implComposite.getClassName(), implComposite);
+
+ try {
+ ServiceDescriptionImpl serviceDescImpl =
+ new ServiceDescriptionImpl(dbcList, implComposite);
+ }
+ catch (WebServiceException ex) {
+ fail("Should NOT have caught exception for validation errors: " + ex);
}
catch (Exception ex) {
fail("Caught wrong type of exception " + ex.toString());
Modified: webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml Sat Oct 6 07:53:06 2007
@@ -333,8 +333,8 @@
<developer>
<name>Davanum Srinivas</name>
<id>dims</id>
- <email>dims AT wso2.com</email>
- <organization>WSO2</organization>
+ <email>davanum AT gmail.com</email>
+ <organization></organization>
</developer>
<developer>
<name>Jayachandra Sekhara Rao Sunkara</name>
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj-api/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj-api/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj-api/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj-api/pom.xml Sat Oct 6 07:53:06 2007
@@ -49,8 +49,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
- <source>1.3</source>
- <target>1.3</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
</plugins>
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml Sat Oct 6 07:53:06 2007
@@ -105,8 +105,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
- <source>1.3</source>
- <target>1.3</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
<plugin>
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java Sat Oct 6 07:53:06 2007
@@ -427,11 +427,16 @@
if (localName == null) { //it is possible that localname isn't set but name is set
localName = domEle.getTagName();
}
+
+ String prefix = domEle.getPrefix();
+ if(prefix == null) {
+ prefix = "";
+ }
if (domEle.getNamespaceURI() != null) {
- ns = new NamespaceImpl(domEle.getNamespaceURI(), domEle.getPrefix());
+ ns = new NamespaceImpl(domEle.getNamespaceURI(), prefix);
} else {
- if (domEle.getPrefix() != null) {
- ns = new NamespaceImpl("", domEle.getPrefix());
+ if (prefix != null) {
+ ns = new NamespaceImpl("", prefix);
} else {
ns = new NamespaceImpl("", "");
Modified: webservices/axis2/branches/java/jaxws21/modules/samples/version/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/samples/version/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/samples/version/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/samples/version/pom.xml Sat Oct 6 07:53:06 2007
@@ -34,8 +34,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.3</source>
- <target>1.3</target>
+ <source>1.4</source>
+ <target>1.4</target>
</configuration>
</plugin>
<plugin>
Modified: webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java Sat Oct 6 07:53:06 2007
@@ -180,6 +180,13 @@
String xsdConfigFile = (String)cgconfig.getProperties().get(XMLBeansExtension.XSDCONFIG_OPTION);
+ //-Ejavaversion switch to XmlOptions to generate 1.5 compliant code
+ XmlOptions xmlOptions = new XmlOptions();
+ xmlOptions.setEntityResolver(er);
+ //test if javaversion property in CodeGenConfig
+ if(null!=cgconfig.getProperty("javaversion")){
+ xmlOptions.put(XmlOptions.GENERATE_JAVA_VERSION,cgconfig.getProperty("javaversion"));
+ }
sts = XmlBeans.compileXmlBeans(
// set the STS name; defaults to null, which makes the generated class
// include a unique (but random) STS name
@@ -190,7 +197,7 @@
xsdConfigFile),
XmlBeans.getContextTypeLoader(),
new Axis2Filer(cgconfig),
- new XmlOptions().setEntityResolver(er));
+ xmlOptions);
// prune the generated schema type system and add the list of base64 types
cgconfig.putProperty(Constants.BASE_64_PROPERTY_KEY,
Modified: webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl Sat Oct 6 07:53:06 2007
@@ -65,7 +65,7 @@
throws org.apache.axis2.AxisFault {
final javax.xml.stream.XMLStreamReader xmlReader = param.newXMLStreamReader();
- while (!xmlReader.isEndElement()) {
+ while (!xmlReader.isStartElement()) {
try {
xmlReader.next();
} catch (javax.xml.stream.XMLStreamException e) {
@@ -78,7 +78,8 @@
public void serialize(java.io.OutputStream outputStream, org.apache.axiom.om.OMOutputFormat omOutputFormat)
throws javax.xml.stream.XMLStreamException {
try {
- param.save(outputStream);
+ org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions();
+ param.save(outputStream,xmlOptions.setSaveNoXmlDecl());
} catch (java.io.IOException e) {
throw new javax.xml.stream.XMLStreamException("Problem with saving document",e);
}
@@ -87,7 +88,8 @@
public void serialize(java.io.Writer writer, org.apache.axiom.om.OMOutputFormat omOutputFormat)
throws javax.xml.stream.XMLStreamException {
try {
- param.save(writer);
+ org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions();
+ param.save(writer,xmlOptions.setSaveNoXmlDecl());
} catch (java.io.IOException e) {
throw new javax.xml.stream.XMLStreamException("Problem with saving document",e);
}
@@ -98,7 +100,8 @@
org.apache.axiom.om.impl.MTOMXMLStreamWriter mtomxmlStreamWriter =
(org.apache.axiom.om.impl.MTOMXMLStreamWriter) xmlStreamWriter;
try {
- param.save(mtomxmlStreamWriter.getOutputStream());
+ org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions();
+ param.save(mtomxmlStreamWriter.getOutputStream(),xmlOptions.setSaveNoXmlDecl());
mtomxmlStreamWriter.getOutputStream().flush();
} catch (java.io.IOException e) {
throw new javax.xml.stream.XMLStreamException("Problem with saving document", e);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org