Author: jim.ma
Date: 2012-02-14 22:30:17 -0500 (Tue, 14 Feb 2012)
New Revision: 15660
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
spi/trunk/src/test/resources/metadata/webservices/test-webservices.xml
Log:
[JBWS-3432]:Skip to parse description, display-name and icon tag in webservices.xml
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2012-02-14
15:47:27 UTC (rev 15659)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2012-02-15
03:30:17 UTC (rev 15660)
@@ -222,7 +222,7 @@
if (match(reader, nsUri, WEBSERVICES))
{
return metadata;
- }
+ }
else
{
throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
@@ -230,8 +230,17 @@
}
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
- metadata.addWebserviceDescription(parseWebserviceDescription(reader,
nsUri, metadata));
+ metadata.addWebserviceDescription(parseWebserviceDescription(reader,
nsUri, metadata));
+ } else if (match(reader, nsUri, "description") || match(reader,
nsUri, "display-name")) {
+ //skip to parse
+ elementAsString(reader);
+ } else if (match(reader, nsUri, "icon")) {
+ //skip icon
+ while (reader.hasNext() && !(reader.nextTag() ==
XMLStreamConstants.END_ELEMENT && match(reader, nsUri, "icon"))) {
+ reader.next();
+ }
}
+
else
{
throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
@@ -299,10 +308,19 @@
throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
}
}
- case XMLStreamConstants.START_ELEMENT : {
+ case XMLStreamConstants.START_ELEMENT : {
if (match(reader, nsUri, PORT_COMPONENT_NAME)) {
pc.setPortComponentName(elementAsString(reader));
}
+ else if (match(reader, nsUri, "description") || match(reader,
nsUri, "display-name")) {
+ //skip to parse
+ elementAsString(reader);
+ } else if (match(reader, nsUri, "icon")) {
+ //skip icon
+ while (reader.hasNext() && !(reader.nextTag() ==
XMLStreamConstants.END_ELEMENT && match(reader, nsUri, "icon"))) {
+ reader.next();
+ }
+ }
else if (match(reader, nsUri, WSDL_SERVICE)) {
pc.setWsdlService(elementAsQName(reader));
}
Modified: spi/trunk/src/test/resources/metadata/webservices/test-webservices.xml
===================================================================
--- spi/trunk/src/test/resources/metadata/webservices/test-webservices.xml 2012-02-14
15:47:27 UTC (rev 15659)
+++ spi/trunk/src/test/resources/metadata/webservices/test-webservices.xml 2012-02-15
03:30:17 UTC (rev 15660)
@@ -4,10 +4,20 @@
xmlns:wsdl="http://Hello.org"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/javaee_web_services_1_3.xsd"
version="1.3">
+ <description>Test Description</description>
+ <display-name>Dispaly Name</display-name>
+ <icon>
+ <small-icon>small icon</small-icon>
+ <large-icon>largeIcon</large-icon>
+ </icon>
<webservice-description>
<webservice-description-name>HelloService</webservice-description-name>
<wsdl-file>META-INF/wsdl/HelloService.wsdl</wsdl-file>
<port-component>
+ <description>Test Description</description>
+ <icon>
+ <large-icon>largeIcon</large-icon>
+ </icon>
<port-component-name>HelloBean</port-component-name>
<wsdl-service>wsdl:HelloService</wsdl-service>
<wsdl-port>wsdl:Hello</wsdl-port>
@@ -50,4 +60,4 @@
</service-impl-bean>
</port-component>
</webservice-description>
-</webservices>
\ No newline at end of file
+</webservices>