JBossWS SVN: r1579 - in trunk/docs/online: . tutorial-doc/en
by jbossws-commits@lists.jboss.org
Author: sam.griffith(a)jboss.com
Date: 2006-12-06 10:32:32 -0500 (Wed, 06 Dec 2006)
New Revision: 1579
Added:
trunk/docs/online/Tutorial-Oxygen-Project.xpr
trunk/docs/online/tutorial-doc/en/master.xml
Log:
Added Oxygen Project file.
Added: trunk/docs/online/Tutorial-Oxygen-Project.xpr
===================================================================
--- trunk/docs/online/Tutorial-Oxygen-Project.xpr 2006-12-06 15:30:26 UTC (rev 1578)
+++ trunk/docs/online/Tutorial-Oxygen-Project.xpr 2006-12-06 15:32:32 UTC (rev 1579)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <meta>
+ <filters directoryPatterns="" filePatterns=""
+ positiveFilePatterns=""/>
+ </meta>
+ <projectTree name="Tutorial-Oxygen-Project.xpr"/>
+</project>
Added: trunk/docs/online/tutorial-doc/en/master.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/master.xml 2006-12-06 15:30:26 UTC (rev 1578)
+++ trunk/docs/online/tutorial-doc/en/master.xml 2006-12-06 15:32:32 UTC (rev 1579)
@@ -0,0 +1,53 @@
+<?xml version='1.0' encoding="iso-8859-1"?>
+
+<!-- $Id: master.xml 118 2006-04-06 14:44:24Z thomas.diesler(a)jboss.com $ -->
+
+<!DOCTYPE book PUBLIC
+ "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+ "../../../docbook-support/support/docbook-dtd/docbookx.dtd"
+[
+<!ENTITY ch-introduction SYSTEM "modules/introduction.xml">
+<!ENTITY s-what-is-a-web-service SYSTEM "modules/what-is-a-web-service.xml">
+<!ENTITY ch-installation SYSTEM "modules/installation/installation.xml">
+<!ENTITY s-install-jboss SYSTEM "modules/installation/install-jboss.xml">
+<!ENTITY s-install-on-jboss-5 SYSTEM "modules/installation/install-on-jboss-5.xml">
+<!ENTITY ch-getting-started SYSTEM "modules/getting-started/getting-started.xml">
+<!ENTITY s-rpc-endpoints SYSTEM "modules/getting-started/rpc-endpoints.xml">
+<!ENTITY s-doc-endpoints SYSTEM "modules/getting-started/doc-endpoints.xml">
+<!ENTITY s-message-style SYSTEM "modules/getting-started/message-endpoints.xml">
+]>
+
+
+<book lang="en">
+
+ <bookinfo>
+ <title>JBossWS Tutorials</title>
+ <subtitle>jbossws-2.0.0.CR3.DEV</subtitle>
+ <releaseinfo>06-Dec-2006</releaseinfo>
+ <releaseinfo>
+ <ulink url="http://labs.jboss.com/jbossws/tutorials/en/html/index.html">[Multiple Pages]</ulink>,
+ <ulink url="http://labs.jboss.com/jbossws/tutorials/en/html_single/index.html">[Single Page]</ulink>,
+ <ulink url="http://labs.jboss.com/jbossws/tutorials/en/pdf/jbossws-userguide.pdf">[PDF]</ulink>
+ </releaseinfo>
+ </bookinfo>
+
+ <toc/>
+
+ <preface id="preface" revision="1">
+ <title>Preface</title>
+ <para>
+ Tutorials covering the JAX-WS 2.0 web services stack for the JBoss Application Server.
+ </para>
+ <para> If you have questions regarding JBossWS, please feel to ask the JBossWS team.</para>
+
+ <para>Web Service Lead - Thomas Diesler</para>
+ <para>WS-Security, WSTools - Jason Greene</para>
+ <para>WS-Eventing, Standards - Heiko Braun</para>
+
+ </preface>
+
+ &ch-introduction;
+ &ch-installation;
+ <!-- &ch-getting-started; -->
+
+</book>
19 years, 5 months
JBossWS SVN: r1578 - in trunk/docs/online/tutorial-doc/en/modules: . installation
by jbossws-commits@lists.jboss.org
Author: sam.griffith(a)jboss.com
Date: 2006-12-06 10:30:26 -0500 (Wed, 06 Dec 2006)
New Revision: 1578
Added:
trunk/docs/online/tutorial-doc/en/modules/installation/install-on-jboss-5.xml
trunk/docs/online/tutorial-doc/en/modules/what-is-a-web-service.xml
Removed:
trunk/docs/online/tutorial-doc/en/modules/attachments/
trunk/docs/online/tutorial-doc/en/modules/clients/
trunk/docs/online/tutorial-doc/en/modules/endpoints/
trunk/docs/online/tutorial-doc/en/modules/exceptions/
trunk/docs/online/tutorial-doc/en/modules/headers-handlers/
trunk/docs/online/tutorial-doc/en/modules/holders/
trunk/docs/online/tutorial-doc/en/modules/installation/install-tomcat.xml
trunk/docs/online/tutorial-doc/en/modules/jmstransport/
trunk/docs/online/tutorial-doc/en/modules/mtom-xop/
trunk/docs/online/tutorial-doc/en/modules/oneway/
trunk/docs/online/tutorial-doc/en/modules/secureejb/
trunk/docs/online/tutorial-doc/en/modules/wsaddressing/
trunk/docs/online/tutorial-doc/en/modules/wseventing/
trunk/docs/online/tutorial-doc/en/modules/wssecurity/
trunk/docs/online/tutorial-doc/en/modules/wstransaction/
trunk/docs/online/tutorial-doc/en/modules/xmlregistry/
Log:
Added: trunk/docs/online/tutorial-doc/en/modules/installation/install-on-jboss-5.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/modules/installation/install-on-jboss-5.xml 2006-12-06 15:25:10 UTC (rev 1577)
+++ trunk/docs/online/tutorial-doc/en/modules/installation/install-on-jboss-5.xml 2006-12-06 15:30:26 UTC (rev 1578)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<sect2 id="install-on-jboss-5">
+
+ <title>Installation on JBoss Application Server 5</title>
+
+ <para>
+ If you are using a beta of JBoss Application Server 5, you do not need to install anything as
+ the JBoss Web Service JAX-WS 2.0 stack is included already.
+ </para>
+
+<!--
+ <para>Additionally, please have a look at the <ulink url="http://labs.jboss.com/jbossws/user-guide/en/Install.txt">release specific install instructions</ulink>.</para>
+-->
+
+</sect2>
Deleted: trunk/docs/online/tutorial-doc/en/modules/installation/install-tomcat.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/modules/installation/install-tomcat.xml 2006-12-06 15:25:10 UTC (rev 1577)
+++ trunk/docs/online/tutorial-doc/en/modules/installation/install-tomcat.xml 2006-12-06 15:30:26 UTC (rev 1578)
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: install-tomcat.xml 1495 2006-11-21 20:29:19Z thomas.diesler(a)jboss.com $ -->
-
-<sect1 id="install-tomcat">
-
- <title>Install on Apache Tomcat</title>
-
- <para>If you have an existing application on Tomcat that has a need for web service support, you can still use JBossWS. This
- allows you to develop standard portable J2EE-1.4 web service endpoints in Tomcat that can be moved unmodified to JBossAS when needed.
- New applications should consider JBoss with ebedded Tomcat for a number of good reasons. </para>
-
- <para>For additional information, see <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=TomcatStandalonevsEmbedded">Tomcat Standalone vs Embedded</ulink>.</para>
-
- <para>JBoss Inc. provides subscription support contracts for both Tomcat Standalone and JBoss embedded Tomcat.</para>
-
- <para>To install JBossWS on Tomcat you need to</para>
-
- <itemizedlist>
- <listitem>
- <para>
- Copy serializer.jar, xalan.jar, xercesImpl.jar to ${tomcat.home}/common/endorsed. This overrides the XML parser that comes with
- the JDK with a more recent version that is compatible with JBossWS.
- </para>
- </listitem>
- <listitem>
- <para>
- Copy activation.jar, mailapi.jar, log4j.jar to ${tomcat.home}/common/lib.
- </para>
- </listitem>
- <listitem>
- <para>
- Copy jbossws-core.jar, jbossws-tomcat-integration.jar, jbossws-thirdparty.jar to ${tomcat.home}/common/lib.
- </para>
- </listitem>
- <listitem>
- <para>
- Copy jbossws.war to ${tomcat.home}/webapps.
- </para>
- </listitem>
- </itemizedlist>
-
- <para>There is no jdk1.4 version available for Tomcat.</para>
-
- <para>When the jbossws web application context stats up, it creates a ${tomcat.home}/jbossws-deploy directory next to ${tomcat.home}/webapps.
- This is the hot deployment directory equivalent to ${jboss.home}/server/default/deploy. Web service endpoints that you drop in ${tomcat.home}/jbossws-deploy
- are converted into valid web applications and copied over to ${tomcat.home}/webapps</para>
-
- <para>Only POJO endpoints are supported. EJB endpoints are not supported in Tomcat standalone for obvious resons. Also note, that POJO endpoints
- are currently not pooled, hence you get a new instance for ever invocation. The packaging of a standard portable J2EE-1.4 web service endpoints
- is defined by the JSR109 specification. JBossWS also supports JSR181 endpoints, which are significantly easier to develop and maintain.</para>
-
- <para>To run the samples that come with this JBossWS release against Tomcat, you must enable access to the Tomcat Manager in ${tomcat.home}/conf/tomcat-users.xml
- For details of this see <ulink url="http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#Configuring%20...">Configuring Manager Application Access</ulink>
- in the Tomcat documentation.</para>
-
- <para>Here is a example</para>
-
- <para>
- <programlisting><![CDATA[
- <tomcat-users>
- <role rolename="manager"/>
- <user username="manager" password="manager" roles="manager"/>
- </tomcat-users>
- ]]></programlisting></para>
-
- <para>Additionally, please have a look at the <ulink url="http://labs.jboss.com/jbossws/user-guide/en/Install.txt">release specific install instructions</ulink>.</para>
-
-</sect1>
Added: trunk/docs/online/tutorial-doc/en/modules/what-is-a-web-service.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/modules/what-is-a-web-service.xml 2006-12-06 15:25:10 UTC (rev 1577)
+++ trunk/docs/online/tutorial-doc/en/modules/what-is-a-web-service.xml 2006-12-06 15:30:26 UTC (rev 1578)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<sect1 id="what-is-a-web-service">
+
+ <title>What is a Web Service?</title>
+
+ <para>
+ Several approaches over the years (CORBA, DCOM, DSOM, RPC) aimed at providing distributed
+ processing in a standardized manner have lead us to today's Web
+ Services approach. It is built on XML which is multinational, human readable, platform
+ independent and allows the expression and manipulation of very complicated data structures.
+ Both the SOAP and RESTful web service approaches use XML to do the data transfer between
+ the client and server distibuted processes.
+ </para>
+
+ <para>
+ While there are several different approaches to web services. The most common approach is
+ embodied in the SOAP based web services specs and frameworks (now W3C specs) created jointly
+ between IBM and Microsoft. They are a very rich set of specs, but along with that richness comes a lot
+ of complexity aimed at dealing with many different kinds of scenerios. There is also the
+ RESTful approach as well which tends to be more bare-bones and avoids dealing with many of
+ the issues that the covered in the W3C specs.
+ </para>
+
+ <para>
+ The common reality of each of these approaches is being able to call
+ some distributed (either remotely or on the same machine)
+ process to get it to do some work for you and then return the results.
+ So web services may best defined in this simple way:
+ <quote>
+ Web Services provide ability to call distributed behavior and receive
+ results in a platform independent and well understood format.
+ </quote>
+ </para>
+
+</sect1>
\ No newline at end of file
19 years, 5 months
JBossWS SVN: r1576 - in trunk/docs/online/tutorial-doc/en: . modules modules/installation
by jbossws-commits@lists.jboss.org
Author: sam.griffith(a)jboss.com
Date: 2006-12-06 10:24:38 -0500 (Wed, 06 Dec 2006)
New Revision: 1576
Modified:
trunk/docs/online/tutorial-doc/en/master.template
trunk/docs/online/tutorial-doc/en/modules/installation/install-jboss.xml
trunk/docs/online/tutorial-doc/en/modules/installation/installation.xml
trunk/docs/online/tutorial-doc/en/modules/introduction.xml
Log:
Docbook edit of the tutorial. First checkin of docbook edits... more coming. Wanted to get first edit working with Docbook and checked in.
Modified: trunk/docs/online/tutorial-doc/en/master.template
===================================================================
--- trunk/docs/online/tutorial-doc/en/master.template 2006-12-06 14:17:04 UTC (rev 1575)
+++ trunk/docs/online/tutorial-doc/en/master.template 2006-12-06 15:24:38 UTC (rev 1576)
@@ -1,104 +1,53 @@
-<?xml version='1.0' encoding="iso-8859-1"?>
-
-<!-- $Id: master.xml 118 2006-04-06 14:44:24Z thomas.diesler(a)jboss.com $ -->
-
-<!DOCTYPE book PUBLIC
- "-//OASIS//DTD DocBook XML V4.3CR3//EN"
- "../../../docbook-support/support/docbook-dtd/docbookx.dtd"
-[
-<!ENTITY ch-introduction SYSTEM "modules/introduction.xml">
-<!ENTITY ch-installation SYSTEM "modules/installation/installation.xml">
-<!ENTITY s-install-jboss SYSTEM "modules/installation/install-jboss.xml">
-<!ENTITY s-install-tomcat SYSTEM "modules/installation/install-tomcat.xml">
-<!ENTITY ch-installation SYSTEM "modules/installation/installation.xml">
-<!ENTITY ch-getting-started SYSTEM "modules/getting-started/getting-started.xml">
-<!ENTITY s-rpc-endpoints SYSTEM "modules/getting-started/rpc-endpoints.xml">
-<!ENTITY s-doc-endpoints SYSTEM "modules/getting-started/doc-endpoints.xml">
-<!ENTITY s-message-style SYSTEM "modules/getting-started/message-endpoints.xml">
-<!ENTITY ch-endpoints SYSTEM "modules/endpoints/endpoints.xml">
-<!ENTITY s-jsr109-endpoints SYSTEM "modules/endpoints/jsr109-endpoints.xml">
-<!ENTITY s-jsr109-pojo-endpoint SYSTEM "modules/endpoints/jsr109-pojo-endpoint.xml">
-<!ENTITY s-jsr109-ejb-endpoint SYSTEM "modules/endpoints/jsr109-ejb-endpoint.xml">
-<!ENTITY s-jsr181-endpoints SYSTEM "modules/endpoints/jsr181-endpoints.xml">
-<!ENTITY s-jsr181-pojo-endpoint SYSTEM "modules/endpoints/jsr181-pojo-endpoint.xml">
-<!ENTITY s-jsr181-ejb3-endpoint SYSTEM "modules/endpoints/jsr181-ejb3-endpoint.xml">
-<!ENTITY s-service-lifecycle SYSTEM "modules/endpoints/service-lifecycle.xml">
-<!ENTITY s-templates SYSTEM "modules/endpoints/template-config.xml">
-<!ENTITY ch-clients SYSTEM "modules/clients/clients.xml">
-<!ENTITY s-jsr109-clients SYSTEM "modules/clients/jsr109-clients.xml">
-<!ENTITY s-dii-clients SYSTEM "modules/clients/dii-clients.xml">
-<!ENTITY s-stub-properties SYSTEM "modules/clients/stub-properties.xml">
-<!ENTITY ch-headers-handlers SYSTEM "modules/headers-handlers/headers-handlers.xml">
-<!ENTITY s-headers SYSTEM "modules/headers-handlers/headers.xml">
-<!ENTITY s-handlers SYSTEM "modules/headers-handlers/handlers.xml">
-<!ENTITY s-dynamic-handlers SYSTEM "modules/headers-handlers/dynamic-handlers.xml">
-<!ENTITY ch-holders SYSTEM "modules/holders/inout-parameters.xml">
-<!ENTITY ch-exceptions SYSTEM "modules/exceptions/exceptions.xml">
-<!ENTITY ch-oneway SYSTEM "modules/oneway/oneway.xml">
-<!ENTITY ch-attachments SYSTEM "modules/attachments/attachments.xml">
-<!ENTITY ch-mtom-xop SYSTEM "modules/mtom-xop/mtom-xop.xml">
-<!ENTITY ch-jms-transport SYSTEM "modules/jmstransport/jms-transport.xml">
-<!ENTITY s-jms-endpoint SYSTEM "modules/jmstransport/jms-endpoint.xml">
-<!ENTITY s-jms-client SYSTEM "modules/jmstransport/jms-client.xml">
-<!ENTITY ch-secure-ejb SYSTEM "modules/secureejb/secure-ejb.xml">
-<!ENTITY ch-wssecurity SYSTEM "modules/wssecurity/wssecurity.xml">
-<!ENTITY ch-wsaddressing SYSTEM "modules/wsaddressing/wsaddressing.xml">
-<!ENTITY ch-wseventing SYSTEM "modules/wseventing/wseventing.xml">
-<!ENTITY ch-wstransaction SYSTEM "modules/wstransaction/wstransaction.xml">
-<!ENTITY ch-xmlregistry SYSTEM "modules/xmlregistry/xmlregistry.xml">
-<!ENTITY appendix-a SYSTEM "modules/appendix-a.xml">
-]>
-
-
-<book lang="en">
-
- <bookinfo>
- <title>JBossWS User Guide</title>
- <subtitle>jbossws-(a)version.id@</subtitle>
- <releaseinfo>@build.date@</releaseinfo>
- <releaseinfo>
- <ulink url="http://labs.jboss.com/jbossws/user-guide/en/html/index.html">[Multiple Pages]</ulink>,
- <ulink url="http://labs.jboss.com/jbossws/user-guide/en/html_single/index.html">[Single Page]</ulink>,
- <ulink url="http://labs.jboss.com/jbossws/user-guide/en/pdf/jbossws-userguide.pdf">[PDF]</ulink>
- </releaseinfo>
- </bookinfo>
-
- <toc/>
-
- <preface id="preface" revision="1">
- <title>Preface</title>
- <para> After JBoss J2EE-1.4 certification in Jun/2004 we have decided to develop our
- own JAXRPC SOAP stack that fits better in the overall JBoss architecture and is
- generally more suiteable for the specific J2EE requirements for web services.
- JBossWS is our new implementation of J2EE compatible web services.
- This document describes the JBossWS feature set and its usage.
- </para>
- <para> If you have questions regarding JBossWS, please feel to ask the JBossWS team.</para>
-
- <para>Web Service Lead - Thomas Diesler</para>
- <para>WS-Security, WSTools - Jason Greene</para>
- <para>WS-Eventing, Standards - Heiko Braun</para>
-
- </preface>
-
- &ch-introduction;
- &ch-installation;
- &ch-getting-started;
- &ch-endpoints;
- &ch-clients;
- &ch-headers-handlers;
- &ch-holders;
- &ch-exceptions;
- &ch-oneway;
- &ch-attachments;
- &ch-mtom-xop;
- &ch-jms-transport;
- &ch-secure-ejb;
- &ch-wssecurity;
- &ch-wsaddressing;
- &ch-wseventing;
- &ch-wstransaction;
- &ch-xmlregistry;
- &appendix-a;
-
-</book>
+<?xml version='1.0' encoding="iso-8859-1"?>
+
+<!-- $Id: master.xml 118 2006-04-06 14:44:24Z thomas.diesler(a)jboss.com $ -->
+
+<!DOCTYPE book PUBLIC
+ "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+ "../../../docbook-support/support/docbook-dtd/docbookx.dtd"
+[
+<!ENTITY ch-introduction SYSTEM "modules/introduction.xml">
+<!ENTITY s-what-is-a-web-service SYSTEM "modules/what-is-a-web-service.xml">
+<!ENTITY ch-installation SYSTEM "modules/installation/installation.xml">
+<!ENTITY s-install-jboss SYSTEM "modules/installation/install-jboss.xml">
+<!ENTITY s-install-on-jboss-5 SYSTEM "modules/installation/install-on-jboss-5.xml">
+<!ENTITY ch-getting-started SYSTEM "modules/getting-started/getting-started.xml">
+<!ENTITY s-rpc-endpoints SYSTEM "modules/getting-started/rpc-endpoints.xml">
+<!ENTITY s-doc-endpoints SYSTEM "modules/getting-started/doc-endpoints.xml">
+<!ENTITY s-message-style SYSTEM "modules/getting-started/message-endpoints.xml">
+]>
+
+
+<book lang="en">
+
+ <bookinfo>
+ <title>JBossWS Tutorials</title>
+ <subtitle>jbossws-(a)version.id@</subtitle>
+ <releaseinfo>@build.date@</releaseinfo>
+ <releaseinfo>
+ <ulink url="http://labs.jboss.com/jbossws/tutorials/en/html/index.html">[Multiple Pages]</ulink>,
+ <ulink url="http://labs.jboss.com/jbossws/tutorials/en/html_single/index.html">[Single Page]</ulink>,
+ <ulink url="http://labs.jboss.com/jbossws/tutorials/en/pdf/jbossws-userguide.pdf">[PDF]</ulink>
+ </releaseinfo>
+ </bookinfo>
+
+ <toc/>
+
+ <preface id="preface" revision="1">
+ <title>Preface</title>
+ <para>
+ Tutorials covering the JAX-WS 2.0 web services stack for the JBoss Application Server.
+ </para>
+ <para> If you have questions regarding JBossWS, please feel to ask the JBossWS team.</para>
+
+ <para>Web Service Lead - Thomas Diesler</para>
+ <para>WS-Security, WSTools - Jason Greene</para>
+ <para>WS-Eventing, Standards - Heiko Braun</para>
+
+ </preface>
+
+ &ch-introduction;
+ &ch-installation;
+ <!-- &ch-getting-started; -->
+
+</book>
Modified: trunk/docs/online/tutorial-doc/en/modules/installation/install-jboss.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/modules/installation/install-jboss.xml 2006-12-06 14:17:04 UTC (rev 1575)
+++ trunk/docs/online/tutorial-doc/en/modules/installation/install-jboss.xml 2006-12-06 15:24:38 UTC (rev 1576)
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: install-jboss.xml 1495 2006-11-21 20:29:19Z thomas.diesler(a)jboss.com $ -->
-
<sect1 id="install-jboss">
- <title>Install on JBoss Application Server</title>
+ <title>Web Services on JBoss Application Server</title>
<para>To take advantage of optimum integration it is best to install JBossWS on the appserver with embedded Tomcat.
In this way you get access to the full set of advanced J2EE features (JMS, JAAS, EJB, etc.) advanced class loading,
@@ -13,28 +11,6 @@
<para>For additional information, see <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=TomcatStandalonevsEmbedded">Tomcat Standalone vs Embedded</ulink>.</para>
- <para>Installing JBossWS on JBoss is a matter of two simple steps.</para>
-
- <itemizedlist>
- <listitem>
- <para>
- Deploy jbossws.sar to ${jboss.home}/server/default/deploy.
- Recommended is an expanded deployment for easy access to JBossWS configuration files.
- </para>
- </listitem>
- <listitem>
- <para>
- Copy jbossws-client.jar to ${jboss.home}/client.
- </para>
- </listitem>
- </itemizedlist>
-
- <para>If you are running JBoss on jdk1.4, you need to deploy jbossws14.sar and jbossws14-client.jar respectivly.</para>
-
- <para>The integration layer hooks into the JBoss deployer architecture and allows you to hot-deploy POJO and EJB endpoints. The
- packaging of a standard portable J2EE-1.4 web service endpoints is defined by the JSR109 specification. JBossWS also supports
- JSR181 endpoints, which are significantly easier to develop and maintain.</para>
-
<para>Additionally, please have a look at the <ulink url="http://labs.jboss.com/jbossws/user-guide/en/Install.txt">release specific install instructions</ulink>.</para>
</sect1>
Modified: trunk/docs/online/tutorial-doc/en/modules/installation/installation.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/modules/installation/installation.xml 2006-12-06 14:17:04 UTC (rev 1575)
+++ trunk/docs/online/tutorial-doc/en/modules/installation/installation.xml 2006-12-06 15:24:38 UTC (rev 1576)
@@ -5,13 +5,20 @@
<title>Installation</title>
<para>
- JBossWS is based on the <ulink url="http://labs.jboss.com/portal/jbossmc">JBoss Microcontainer</ulink>, which
- supports direct POJO deployment and standalone use outside the JBoss application server. Currently, we have integration
- layers for the JBoss application server and Apache Tomcat.
- </para>
+ JBossWS 2.0 (JAX-WS 2.0) is based on the
+ <ulink url="http://labs.jboss.com/portal/jbossmc">JBoss Microcontainer</ulink>,
+ which supports direct POJO deployment and standalone use outside the JBoss
+ application server. Currently, we have integration layers for the JBoss application
+ server and Apache Tomcat.
+ </para>
+ <para>
+ For this series of tutorials we are going to focus on using the JBoss Web Services
+ stack on the JBoss Application Server. If you need to know how to work with Tomcat,
+ please see the JBoss Web Services User Guide for more details.
+ </para>
+
&s-install-jboss;
- &s-install-tomcat;
+ &s-install-on-jboss-5;
</chapter>
-
Modified: trunk/docs/online/tutorial-doc/en/modules/introduction.xml
===================================================================
--- trunk/docs/online/tutorial-doc/en/modules/introduction.xml 2006-12-06 14:17:04 UTC (rev 1575)
+++ trunk/docs/online/tutorial-doc/en/modules/introduction.xml 2006-12-06 15:24:38 UTC (rev 1576)
@@ -3,62 +3,21 @@
<chapter id="introduction">
<title>Introduction</title>
- <sect1 id="features">
- <title>Features</title>
- <itemizedlist>
- <listitem>
- <para>RPC style and Document style endpoints (wrapped and bare)</para>
- </listitem>
- <listitem>
- <para>SOAP header values bound/unbound to endpoint parameters</para>
- </listitem>
- <listitem>
- <para>J2EE endpoint development model for EJB and Java (JSR-109)</para>
- </listitem>
- <listitem>
- <para>J2EE client development model (JSR-109)</para>
- </listitem>
- <listitem>
- <para>Dynamic Invocation Interface (DII)</para>
- </listitem>
- <listitem>
- <para>JAX-RPC client/server side handlers</para>
- </listitem>
- <listitem>
- <para>Holders for INOUT/OUT parameters</para>
- </listitem>
- <listitem>
- <para>Message style endpoints</para>
- </listitem>
- <listitem>
- <para>Attachments Profile Version 1.0</para>
- </listitem>
- <listitem>
- <para>Dynamic client/server side handler injection</para>
- </listitem>
- <listitem>
- <para>Web Service Metadata (JSR-181)</para>
- </listitem>
- <listitem>
- <para>EJB3 Stateless Session endpoints</para>
- </listitem>
- <listitem>
- <para>WS-Security1.0 for XML Encryption/Signature of the SOAP message</para>
- </listitem>
- <listitem>
- <para>WS-Addressing (W3C candidate release) and JSR-261</para>
- </listitem>
- <listitem>
- <para>WS-Eventing</para>
- </listitem>
- <listitem>
- <para>WS-Policy</para>
- </listitem>
- <listitem>
- <para>MTOM/XOP</para>
- </listitem>
- </itemizedlist>
- </sect1>
+ <para>
+ Welcome to the JBoss JAX-WS 2.0 series of tutorials. This set of tutorials is intended to help
+ developers in getting started with the new JAX-WS 2.0 web services stack. The initial
+ tutorial covers installation, a simple web service and client programs to use the simple
+ web service from both Eclipse and NetBeans. Over the next few weeks, further tutorials will
+ include adding security, MTOM example, wstools options and others.
+ </para>
+ <para>
+ The tutorials assume your working against JBoss Application Server 5 Beta 1 or after. If you haven't
+ downloaded a version of AS 5 yet, you can get it here:
+ <ulink url="http://labs.jboss.com/portal/jbossas/download/index.html"/>
+ </para>
+
+ &s-what-is-a-web-service;
+
</chapter>
19 years, 5 months
JBossWS SVN: r1575 - in branches/tdiesler/trunk/src: main/java/org/jboss/ws/common main/java/org/jboss/ws/common/umdm main/java/org/jboss/ws/common/wsdl main/java/org/jboss/ws/core/metadata/builder/jaxws main/java/org/jboss/ws/core/server main/java/org/jboss/ws/integration/jboss50 main/java/org/jboss/ws/tools main/java/org/jboss/ws/tools/helpers test/java/org/jboss/test/ws/common/wsdl11 test/java/org/jboss/test/ws/jaxrpc/jbws1068 test/java/org/jboss/test/ws/jaxrpc/jbws1190 test/java/org/jb
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-06 09:17:04 -0500 (Wed, 06 Dec 2006)
New Revision: 1575
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLLocatorImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriterResolver.java
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLLocatorImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
Log:
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -48,8 +48,8 @@
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
/**
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl (from rev 1573, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl)
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11DefinitionFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11DefinitionFactory.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -1,96 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.tools.wsdl;
-
-// $Id$
-
-import java.net.URL;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.xml.sax.EntityResolver;
-
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
-/**
- * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class WSDL11DefinitionFactory
-{
- // provide logging
- private static Logger log = Logger.getLogger(WSDL11DefinitionFactory.class);
-
- // This feature is set by default in wsdl4j, it means the object structore contains the imported arguments
- public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
- // Set this feature for additional debugging output
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
-
- // The WSDLReader that is used by this factory
- private WSDLReader wsdlReader;
-
- // Hide constructor
- private WSDL11DefinitionFactory() throws WSDLException
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- wsdlReader = wsdlFactory.newWSDLReader();
- wsdlReader.setFeature(WSDL11DefinitionFactory.FEATURE_VERBOSE, false);
- }
-
- /** Create a new instance of a wsdl factory */
- public static WSDL11DefinitionFactory newInstance() throws WSDLException
- {
- return new WSDL11DefinitionFactory();
- }
-
- /** Set a feature on the underlying reader */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- wsdlReader.setFeature(name, value);
- }
-
- /**
- * Read the wsdl document from the given URL
- */
- public Definition parse(URL wsdlLocation) throws WSDLException
- {
- if (wsdlLocation == null)
- throw new IllegalArgumentException("URL cannot be null");
-
- log.trace("parse: " + wsdlLocation.toExternalForm());
-
- EntityResolver entityResolver = new JBossWSEntityResolver();
-
- // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
- ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
-
- Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
- return wsdlDefinition;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11DefinitionFactory.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11DefinitionFactory.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,96 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.wsdl;
+
+// $Id$
+
+import java.net.URL;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.xml.sax.EntityResolver;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
+/**
+ * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class WSDL11DefinitionFactory
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WSDL11DefinitionFactory.class);
+
+ // This feature is set by default in wsdl4j, it means the object structore contains the imported arguments
+ public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
+ // Set this feature for additional debugging output
+ public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
+
+ // The WSDLReader that is used by this factory
+ private WSDLReader wsdlReader;
+
+ // Hide constructor
+ private WSDL11DefinitionFactory() throws WSDLException
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ wsdlReader = wsdlFactory.newWSDLReader();
+ wsdlReader.setFeature(WSDL11DefinitionFactory.FEATURE_VERBOSE, false);
+ }
+
+ /** Create a new instance of a wsdl factory */
+ public static WSDL11DefinitionFactory newInstance() throws WSDLException
+ {
+ return new WSDL11DefinitionFactory();
+ }
+
+ /** Set a feature on the underlying reader */
+ public void setFeature(String name, boolean value) throws IllegalArgumentException
+ {
+ wsdlReader.setFeature(name, value);
+ }
+
+ /**
+ * Read the wsdl document from the given URL
+ */
+ public Definition parse(URL wsdlLocation) throws WSDLException
+ {
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("URL cannot be null");
+
+ log.trace("parse: " + wsdlLocation.toExternalForm());
+
+ EntityResolver entityResolver = new JBossWSEntityResolver();
+
+ // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+ ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
+
+ Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
+ return wsdlDefinition;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Reader.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Reader.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -1,1219 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.wsdl;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingInput;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.BindingOutput;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Import;
-import javax.wsdl.Input;
-import javax.wsdl.Message;
-import javax.wsdl.Operation;
-import javax.wsdl.Output;
-import javax.wsdl.Part;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.mime.MIMEContent;
-import javax.wsdl.extensions.mime.MIMEMultipartRelated;
-import javax.wsdl.extensions.mime.MIMEPart;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap.SOAPBody;
-import javax.wsdl.extensions.soap.SOAPHeader;
-import javax.wsdl.extensions.soap.SOAPOperation;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.jaxrpc.Style;
-import org.jboss.ws.common.metadata.wsdl.NCName;
-import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingMessageReference;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.common.metadata.wsdl.WSDLMIMEPart;
-import org.jboss.ws.common.metadata.wsdl.WSDLProperty;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.common.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.common.metadata.wsdl.XSModelTypes;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.tools.JavaToXSD;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @since 10-Oct-2004
- */
-public class WSDL11Reader
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDL11Reader.class);
-
- private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12, "binding");
- private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
- private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12, "operation");
- private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
-
- private WSDLDefinitions destWsdl;
-
- // Maps wsdl message parts to their corresponding element names
- private Map<String, QName> messagePartToElementMap = new HashMap<String, QName>();
-
- // Map of <ns,URL> for schemalocation keyed by namespace
- private Map<String, URL> schemaLocationsMap = new HashMap<String, URL>();
-
- private LinkedHashMap<QName, Binding> allBindings;
- private LinkedHashMap<QName, Binding> portTypeBindings;
-
- // Temporary files used by this reader.
- private List<File> tempFiles = new ArrayList<File>();
-
- /**
- * Takes a WSDL11 Definition element and converts into
- * our object graph that has been developed for WSDL20
- *
- * @param srcWsdl The src WSDL11 definition
- * @param wsdlLoc The source location, if null we cannot process imports or includes
- */
- public WSDLDefinitions processDefinition(Definition srcWsdl, URL wsdlLoc) throws IOException
- {
- log.trace("processDefinition: " + wsdlLoc);
-
- destWsdl = new WSDLDefinitions();
- destWsdl.setWsdlTypes(new XSModelTypes());
- destWsdl.setWsdlOneOneDefinition(srcWsdl);
- destWsdl.setWsdlNamespace(Constants.NS_WSDL11);
-
- processNamespaces(srcWsdl);
- processTypes(srcWsdl, wsdlLoc);
- processServices(srcWsdl);
-
- if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
- processUnreachableBindings(srcWsdl);
-
- cleanupTemporaryFiles();
-
- return destWsdl;
- }
-
- private void cleanupTemporaryFiles()
- {
- for (File current : tempFiles)
- {
- current.delete();
- }
- }
-
- // process all bindings not within service separetly
- private void processUnreachableBindings(Definition srcWsdl)
- {
- log.trace("processUnreachableBindings");
-
- Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
- while (it.hasNext())
- {
- Binding srcBinding = (Binding)it.next();
- QName srcQName = srcBinding.getQName();
-
- WSDLBinding destBinding = destWsdl.getBinding(new NCName(srcQName));
- if (destBinding == null)
- {
- processBinding(srcWsdl, srcBinding);
- }
- }
- }
-
- private void processNamespaces(Definition srcWsdl)
- {
- String targetNS = srcWsdl.getTargetNamespace();
- destWsdl.setTargetNamespace(targetNS);
-
- // Copy wsdl namespaces
- Map nsMap = srcWsdl.getNamespaces();
- Iterator iter = nsMap.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry entry = (Map.Entry)iter.next();
- String prefix = (String)entry.getKey();
- String nsURI = (String)entry.getValue();
- destWsdl.registerNamespaceURI(nsURI, prefix);
- }
- }
-
- private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException
- {
- log.trace("BEGIN processTypes: " + wsdlLoc);
-
- WSDLTypes destTypes = destWsdl.getWsdlTypes();
-
- Types srcTypes = srcWsdl.getTypes();
- if (srcTypes != null && srcTypes.getExtensibilityElements().size() > 0)
- {
- List extElements = srcTypes.getExtensibilityElements();
- int len = extElements.size();
-
- for (int i = 0; i < len; i++)
- {
- ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
-
- Element domElement;
- if (extElement instanceof Schema)
- {
- domElement = ((Schema)extElement).getElement();
- }
- else if (extElement instanceof UnknownExtensibilityElement)
- {
- domElement = ((UnknownExtensibilityElement)extElement).getElement();
- }
- else
- {
- throw new WSException("Unsupported extensibility element: " + extElement);
- }
-
- Element domElementClone = (Element)domElement.cloneNode(true);
- copyParentNamespaceDeclarations(domElementClone, domElement);
-
- String localname = domElementClone.getLocalName();
- try
- {
- if ("import".equals(localname))
- {
- processSchemaImport(destTypes, wsdlLoc, domElementClone);
- }
- else if ("schema".equals(localname))
- {
- processSchemaInclude(destTypes, wsdlLoc, domElementClone);
- }
- else
- {
- throw new IllegalArgumentException("Unsuported schema element: " + localname);
- }
- }
- catch (IOException e)
- {
- throw new WSException("Cannot extract schema definition", e);
- }
- }
-
- if (len > 0)
- {
- JavaToXSD jxsd = new JavaToXSD();
- JBossXSModel xsmodel = jxsd.parseSchema(schemaLocationsMap);
- WSDLUtils.addSchemaModel(destTypes, destWsdl.getTargetNamespace(), xsmodel);
- }
- }
- else
- {
- log.trace("Empty wsdl types element, processing imports");
- Iterator it = srcWsdl.getImports().values().iterator();
- while (it.hasNext())
- {
- List<Import> srcImports = (List<Import>)it.next();
- for (Import srcImport : srcImports)
- {
- Definition impDefinition = srcImport.getDefinition();
- String impLoc = impDefinition.getDocumentBaseURI();
- processTypes(impDefinition, new URL(impLoc));
- }
- }
- }
-
- log.trace("END processTypes: " + wsdlLoc + "\n" + destTypes);
- }
-
- private void copyParentNamespaceDeclarations(Element destElement, Element srcElement)
- {
- Node parent = srcElement.getParentNode();
- while (parent != null)
- {
- if (parent.hasAttributes())
- {
- NamedNodeMap attributes = parent.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++)
- {
- Attr attr = (Attr)attributes.item(i);
- String name = attr.getName();
- String value = attr.getValue();
- if (name.startsWith("xmlns:") && destElement.hasAttribute(name) == false)
- destElement.setAttribute(name, value);
- }
- }
- parent = parent.getParentNode();
- }
- }
-
- private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl) throws IOException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process import, parent location not set");
-
- log.trace("processSchemaImport: " + wsdlLoc);
-
- String location = getOptionalAttribute(importEl, "schemaLocation");
- if (location == null)
- throw new IllegalArgumentException("schemaLocation is null for xsd:import");
-
- URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
- URL newloc = processSchemaInclude(types, locationURL, rootElement);
- if (newloc != null)
- importEl.setAttribute("schemaLocation", newloc.toExternalForm());
- }
-
- private URL processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl) throws IOException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process iclude, parent location not set");
-
- File tmpFile = null;
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process include, parent location not set");
-
- log.trace("processSchemaInclude: " + wsdlLoc);
-
- String schemaPrefix = schemaEl.getPrefix();
-
- String importTag = (schemaPrefix == null) ? "import" : schemaPrefix + ":import";
- Element importElement = schemaEl.getOwnerDocument().createElementNS(Constants.NS_SCHEMA_XSD, importTag);
- importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
- schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
-
- // Handle schema includes
- Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "include"));
- while (it.hasNext())
- {
- Element includeEl = (Element)it.next();
- String location = getOptionalAttribute(includeEl, "schemaLocation");
- if (location == null)
- throw new IllegalArgumentException("schemaLocation is null for xsd:include");
-
- URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
- URL newloc = processSchemaInclude(types, locationURL, rootElement);
- if (newloc != null)
- includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
- }
-
- String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
- if (targetNS != null)
- {
- log.trace("processSchemaInclude: [targetNS=" + targetNS + ",parentURL=" + wsdlLoc + "]");
-
- tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
- tempFiles.add(tmpFile);
-
- FileWriter fwrite = new FileWriter(tmpFile);
- new DOMWriter(fwrite).setPrettyprint(true).print(schemaEl);
- fwrite.close();
-
- schemaLocationsMap.put(targetNS, tmpFile.toURL());
- }
-
- // schema elements that have no target namespace are skipped
- //
- // <xsd:schema>
- // <xsd:import namespace="http://org.jboss.webservice/example/types" schemaLocation="Hello.xsd"/>
- // <xsd:import namespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservic..." schemaLocation="subdir/HelloArr.xsd"/>
- // </xsd:schema>
- if (targetNS == null)
- {
- log.trace("Schema element without target namespace in: " + wsdlLoc);
- }
-
- handleSchemaImports(schemaEl, wsdlLoc);
-
- return tmpFile != null ? tmpFile.toURL() : null;
- }
-
- private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws MalformedURLException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process import, parent location not set");
-
- Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "import"));
- while (it.hasNext())
- {
- Element includeEl = (Element)it.next();
- String schemaLocation = getOptionalAttribute(includeEl, "schemaLocation");
- String namespace = getOptionalAttribute(includeEl, "namespace");
-
- log.trace("handleSchemaImport: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
-
- // Skip, let the entity resolver resolve these
- if (namespace != null && schemaLocation != null)
- {
- URL currLoc = getLocationURL(wsdlLoc, schemaLocation);
- schemaLocationsMap.put(namespace, currLoc);
- }
- else
- {
- log.trace("Skip schema import: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
- }
- }
- }
-
- private URL getLocationURL(URL parentURL, String location) throws MalformedURLException
- {
- log.trace("getLocationURL: [location=" + location + ",parent=" + parentURL + "]");
-
- URL locationURL = null;
- try
- {
- locationURL = new URL(location);
- }
- catch (MalformedURLException e)
- {
- // ignore malformed URL
- }
-
- if (locationURL == null)
- {
- String parentProtocol = parentURL.getProtocol();
- if (parentProtocol.equals("file") && !location.startsWith("/"))
- {
- String path = parentURL.toExternalForm();
- path = path.substring(0, path.lastIndexOf("/"));
- locationURL = new URL(path + "/" + location);
- }
- else if (parentProtocol.startsWith("http") && location.startsWith("/"))
- {
- String path = parentProtocol + "://" + parentURL.getHost() + ":" + parentURL.getPort();
- locationURL = new URL(path + location);
- }
- else if (parentProtocol.equals("jar") && !location.startsWith("/"))
- {
- String path = parentURL.toExternalForm();
- path = path.substring(0, path.lastIndexOf("/"));
- locationURL = new URL(path + "/" + location);
- }
- else
- {
- throw new WSException("Unsupported schemaLocation: " + location);
- }
- }
-
- log.trace("Modified schemaLocation: " + locationURL);
- return locationURL;
- }
-
- private void processPortType(Definition srcWsdl, PortType srcPortType)
- {
- log.trace("processPortType: " + srcPortType.getQName());
-
- QName qname = srcPortType.getQName();
- NCName ncName = new NCName(qname);
- if (destWsdl.getInterface(ncName) == null)
- {
- WSDLInterface destInterface = new WSDLInterface(destWsdl);
- destInterface.setName(ncName);
- destInterface.setQName(qname);
-
- // eventing extensions
- QName eventSourceProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
- if (eventSourceProp != null && eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
- {
- destInterface.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_EVENTSOURCE, eventSourceProp.getLocalPart()));
- }
-
- destWsdl.addInterface(destInterface);
-
- processPortTypeOperations(srcWsdl, destInterface, srcPortType);
- }
- }
-
- private void processPortTypeOperations(Definition srcWsdl, WSDLInterface destInterface, PortType srcPortType)
- {
- Iterator itOperations = srcPortType.getOperations().iterator();
- while (itOperations.hasNext())
- {
- Operation srcOperation = (Operation)itOperations.next();
-
- WSDLInterfaceOperation destOperation = new WSDLInterfaceOperation(destInterface);
- destOperation.setName(new NCName(srcOperation.getName()));
- destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
-
- processOperationInput(srcWsdl, srcOperation, destOperation, srcPortType);
- processOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType);
- processOperationFaults(srcOperation, destOperation, destInterface);
-
- destInterface.addOperation(destOperation);
- }
- }
-
- private void processOperationInput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
- {
- Input srcInput = srcOperation.getInput();
- if (srcInput != null)
- {
- Message srcMessage = srcInput.getMessage();
- log.trace("processOperationInput: " + srcMessage.getQName());
-
- QName wsaAction = (QName)srcInput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
- if (wsaAction != null)
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_IN, wsaAction.getLocalPart()));
-
- List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
- if (paramOrder != null)
- {
- for (String name : paramOrder)
- {
- if (srcMessage.getPart(name) != null)
- destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
- }
- }
-
- WSDLInterfaceOperationInput rpcInput = new WSDLInterfaceOperationInput(destOperation);
- for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(paramOrder))
- {
- if (Constants.URI_STYLE_IRI == destOperation.getStyle())
- {
- WSDLInterfaceOperationInput destInput = new WSDLInterfaceOperationInput(destOperation);
- QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- destInput.setElement(elementName);
-
- //Lets remember the Message name
- destInput.setMessageName(srcMessage.getQName());
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN, srcMessage.getQName().getLocalPart()));
-
- destInput.setPartName(srcPart.getName());
-
- destOperation.addInput(destInput);
- }
- else
- {
- // If we don't have a type then we aren't a valid RPC parameter
- // This could happen on a header element, in which case the
- // binding will pick it up
- QName xmlType = srcPart.getTypeName();
- if (xmlType != null)
- rpcInput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
- else
- messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- }
- }
- if (Constants.URI_STYLE_RPC == destOperation.getStyle())
- {
- // This is really a place holder, but also the actual value used in
- // WSDL 2.0 RPC bindings
- rpcInput.setElement(destOperation.getQName());
- rpcInput.setMessageName(srcMessage.getQName());
- destOperation.addInput(rpcInput);
- }
- }
- }
-
- private void processOperationOutput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
- {
- Output srcOutput = srcOperation.getOutput();
- if (srcOutput == null)
- {
- destOperation.setPattern(Constants.WSDL20_PATTERN_IN_ONLY);
- return;
- }
-
- Message srcMessage = srcOutput.getMessage();
- log.trace("processOperationOutput: " + srcMessage.getQName());
-
- destOperation.setPattern(Constants.WSDL20_PATTERN_IN_OUT);
- QName wsaAction = (QName) srcOutput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
- if (wsaAction != null)
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_OUT, wsaAction.getLocalPart()));
-
- List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
- if (paramOrder != null)
- {
- for (String name : paramOrder)
- {
- if (srcMessage.getPart(name) != null)
- {
- WSDLRPCSignatureItem item = destOperation.getRpcSignatureitem(name);
- if (item != null)
- item.setDirection(Direction.INOUT);
- else
- destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name, Direction.OUT));
- }
- }
- }
-
- WSDLInterfaceOperationOutput rpcOutput = new WSDLInterfaceOperationOutput(destOperation);
- for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(null))
- {
- if (Constants.URI_STYLE_IRI == destOperation.getStyle())
- {
- WSDLInterfaceOperationOutput destOutput = new WSDLInterfaceOperationOutput(destOperation);
-
- QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- destOutput.setElement(elementName);
-
- // Lets remember the Message name
- destOutput.setMessageName(srcMessage.getQName());
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName()
- .getLocalPart()));
-
- // Remember the original part name
- destOutput.setPartName(srcPart.getName());
-
- destOperation.addOutput(destOutput);
- }
- else
- {
- // If we don't have a type then we aren't a valid RPC parameter
- // This could happen on a header element, in which case the
- // binding will pick it up
- QName xmlType = srcPart.getTypeName();
- if (xmlType != null)
- rpcOutput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
- else
- messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- }
- }
-
- if (Constants.URI_STYLE_RPC == destOperation.getStyle())
- {
- // This is really a place holder, but also the actual value used in
- // WSDL 2.0 RPC bindings
- QName name = destOperation.getQName();
- rpcOutput.setElement(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
- rpcOutput.setMessageName(srcMessage.getQName());
- destOperation.addOutput(rpcOutput);
- }
- }
-
- private void processOperationFaults(Operation srcOperation, WSDLInterfaceOperation destOperation, WSDLInterface destInterface)
- {
-
- Map faults = srcOperation.getFaults();
- Iterator itFaults = faults.values().iterator();
- while (itFaults.hasNext())
- {
- Fault srcFault = (Fault)itFaults.next();
- processOperationFault(destOperation, destInterface, srcFault);
- }
- }
-
- private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface destInterface, Fault srcFault)
- {
- String faultName = srcFault.getName();
- log.trace("processOperationFault: " + faultName);
-
- WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface);
- NCName ncName = new NCName(faultName);
- destFault.setName(ncName);
-
- Message message = srcFault.getMessage();
- QName messageName = message.getQName();
-
- Map partsMap = message.getParts();
- if (partsMap.size() != 1)
- throw new WSException("Unsupported number of fault parts in message " + messageName);
-
- Part part = (Part)partsMap.values().iterator().next();
- QName xmlName = part.getElementName();
-
- if (xmlName != null)
- {
- destFault.setElement(xmlName);
- }
- else
- {
- destFault.setElement(messageName);
- log.warn("Unsupported fault message part in message: " + messageName);
- }
-
- WSDLInterfaceFault prevFault = destInterface.getFault(ncName);
- if (prevFault != null && prevFault.getName().equals(ncName) == false)
- throw new WSException("Fault name must be unique: " + faultName);
-
- // Add the fault to the interface
- destInterface.addFault(destFault);
-
- // Add the fault refererence to the operation
- WSDLInterfaceOperationOutfault opOutFault = new WSDLInterfaceOperationOutfault(destOperation);
- opOutFault.setRef(new QName(destWsdl.getTargetNamespace(), faultName));
- destOperation.addOutfault(opOutFault);
- }
-
- /** Translate the message part name into an XML element name.
- */
- private QName messagePartToElementName(Definition srcWsdl, PortType srcPortType, Operation srcOperation, Message srcMessage, Part srcPart)
- {
- // <part name="param" element="tns:SomeType" />
- QName xmlName = srcPart.getElementName();
-
- // <part name="param" type="xsd:string" />
- if (xmlName == null)
- xmlName = new QName(srcPart.getName());
-
- xmlName = destWsdl.registerQName(xmlName);
- String key = srcMessage.getQName() + "->" + srcPart.getName();
- messagePartToElementMap.put(key, xmlName);
-
- return xmlName;
- }
-
- private BindingOperation getBindingOperation(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
- {
- Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
-
- if (srcBinding == null)
- throw new WSException("Cannot find binding for: " + srcPortType.getQName());
-
- String srcOperationName = srcOperation.getName();
- BindingOperation srcBindingOperation = srcBinding.getBindingOperation(srcOperationName, null, null);
- if (srcBindingOperation == null)
- throw new WSException("Cannot find binding operation for: " + srcOperationName);
- return srcBindingOperation;
- }
-
- private String getOperationStyle(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
- {
- Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
- BindingOperation srcBindingOperation = getBindingOperation(srcWsdl, srcPortType, srcOperation);
-
- String operationStyle = null;
- List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPOperation)
- {
- SOAPOperation soapOp = (SOAPOperation)extElement;
- operationStyle = soapOp.getStyle();
- }
- else if (SOAP12_OPERATION.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
- }
- }
-
- if (operationStyle == null)
- {
- for (ExtensibilityElement extElement : (List<ExtensibilityElement>) srcBinding.getExtensibilityElements())
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
- {
- SOAPBinding soapBinding = (SOAPBinding) extElement;
- operationStyle = soapBinding.getStyle();
- }
- else if (SOAP12_BINDING.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement) extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
- }
- }
- }
-
- return ("rpc".equals(operationStyle)) ? Constants.URI_STYLE_RPC : Constants.URI_STYLE_IRI;
- }
-
- private void processBinding(Definition srcWsdl, Binding srcBinding)
- {
- QName srcBindingQName = srcBinding.getQName();
- log.trace("processBinding: " + srcBindingQName);
-
- NCName ncName = new NCName(srcBindingQName);
- if (destWsdl.getBinding(ncName) == null)
- {
- PortType srcPortType = srcBinding.getPortType();
- if (srcPortType == null)
- throw new WSException("Cannot find port type for binding: " + ncName);
-
- processPortType(srcWsdl, srcPortType);
-
- WSDLBinding destBinding = new WSDLBinding(destWsdl);
- destBinding.setQName(srcBindingQName);
- destBinding.setName(ncName);
- destBinding.setInterfaceName(srcPortType.getQName());
-
- String bindingStyle = Style.getDefaultStyle().toString();
- List<ExtensibilityElement> extList = srcBinding.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
- {
- destBinding.setType(Constants.NS_SOAP11);
- SOAPBinding soapBinding = (SOAPBinding)extElement;
- bindingStyle = soapBinding.getStyle();
- }
- else if (SOAP12_BINDING.equals(elementType))
- {
- destBinding.setType(Constants.NS_SOAP12);
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- bindingStyle = getOptionalAttribute(domElement, "style");
- }
- }
- destWsdl.addBinding(destBinding);
- processBindingOperations(destBinding, srcBinding, bindingStyle);
- }
- }
-
- private Map<QName, Binding> getPortTypeBindings(Definition srcWsdl)
- {
- getAllDefinedBindings(srcWsdl);
- return portTypeBindings;
- }
-
- private Map<QName, Binding> getAllDefinedBindings(Definition srcWsdl)
- {
- if (allBindings != null)
- return allBindings;
-
- allBindings = new LinkedHashMap<QName, Binding>();
- portTypeBindings = new LinkedHashMap<QName, Binding>();
- Map srcBindings = srcWsdl.getBindings();
- Iterator itBinding = srcBindings.values().iterator();
- while (itBinding.hasNext())
- {
- Binding srcBinding = (Binding)itBinding.next();
- allBindings.put(srcBinding.getQName(), srcBinding);
- portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
- }
-
- // Bindings not available when pulled in through <wsdl:import>
- // http://sourceforge.net/tracker/index.php?func=detail&aid=1240323&group_id...
- Iterator itService = srcWsdl.getServices().values().iterator();
- while (itService.hasNext())
- {
- Service srcService = (Service)itService.next();
- Iterator itPort = srcService.getPorts().values().iterator();
- while (itPort.hasNext())
- {
- Port srcPort = (Port)itPort.next();
- Binding srcBinding = srcPort.getBinding();
- allBindings.put(srcBinding.getQName(), srcBinding);
- portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
- }
- }
-
- return allBindings;
- }
-
- private void processBindingOperations(WSDLBinding destBinding, Binding srcBinding, String bindingStyle)
- {
- Iterator it = srcBinding.getBindingOperations().iterator();
- while (it.hasNext())
- {
- BindingOperation srcBindingOperation = (BindingOperation)it.next();
- processBindingOperation(destBinding, bindingStyle, srcBindingOperation);
- }
- }
-
- private void processBindingOperation(WSDLBinding destBinding, String bindingStyle, BindingOperation srcBindingOperation)
- {
- String srcBindingName = srcBindingOperation.getName();
- log.trace("processBindingOperation: " + srcBindingName);
-
- WSDLInterface destInterface = destBinding.getInterface();
- String namespaceURI = destInterface.getQName().getNamespaceURI();
-
- WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
- QName refQName = new QName(namespaceURI, srcBindingName);
- destBindingOperation.setRef(refQName);
- destBinding.addOperation(destBindingOperation);
-
- String opName = srcBindingName;
- WSDLInterfaceOperation destIntfOperation = destInterface.getOperation(new NCName(opName));
-
- // Process soap:operation@soapAction, soap:operation@style
- List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPOperation)
- {
- SOAPOperation soapOp = (SOAPOperation)extElement;
- destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
- }
- else if (SOAP12_OPERATION.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- destBindingOperation.setSOAPAction(getOptionalAttribute(domElement, "soapAction"));
- }
- }
-
- BindingInput srcBindingInput = srcBindingOperation.getBindingInput();
- if (srcBindingInput != null)
- {
- processBindingInput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingInput);
- }
-
- BindingOutput srcBindingOutput = srcBindingOperation.getBindingOutput();
- if (srcBindingOutput != null)
- {
- processBindingOutput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingOutput);
- }
- }
-
- interface ReferenceCallback
- {
- void removeReference(QName element);
- void removeRPCPart(String partName);
- QName getXmlType(String partName);
- }
-
- private void processBindingInput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingInput srcBindingInput)
- {
- log.trace("processBindingInput");
-
- QName soap11Body = new QName(Constants.NS_SOAP11, "body");
- List<ExtensibilityElement> extList = srcBindingInput.getExtensibilityElements();
- WSDLBindingOperationInput input = new WSDLBindingOperationInput(destBindingOperation);
- destBindingOperation.addInput(input);
-
- ReferenceCallback cb = new ReferenceCallback()
- {
- public QName getXmlType(String partName)
- {
- return srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
- }
-
- public void removeReference(QName element)
- {
- WSDLInterfaceOperationInput destIntfInput = destIntfOperation.getInput(element);
- if (destIntfInput == null)
- destIntfOperation.removeInput(element);
- }
-
- public void removeRPCPart(String partName)
- {
- WSDLInterfaceOperationInput operationInput = destIntfOperation.getInput(destIntfOperation.getQName());
- operationInput.removeChildPart(partName);
- }
- };
-
- processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, input, cb);
- }
-
- private void processBindingOutput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingOutput srcBindingOutput)
- {
- log.trace("processBindingInput");
-
- QName soap11Body = new QName(Constants.NS_SOAP11, "body");
- List<ExtensibilityElement> extList = srcBindingOutput.getExtensibilityElements();
- WSDLBindingOperationOutput output = new WSDLBindingOperationOutput(destBindingOperation);
- destBindingOperation.addOutput(output);
-
- ReferenceCallback cb = new ReferenceCallback()
- {
- public QName getXmlType(String partName)
- {
- return srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
- }
-
- public void removeReference(QName element)
- {
- WSDLInterfaceOperationOutput destIntfOutput = destIntfOperation.getOutput(element);
- if (destIntfOutput == null)
- destIntfOperation.removeInput(element);
- }
-
- public void removeRPCPart(String partName)
- {
- QName name = destIntfOperation.getQName();
- WSDLInterfaceOperationOutput operationOutput = destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
- operationOutput.removeChildPart(partName);
- }
- };
-
- processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, output, cb);
- }
-
-
- private void processBindingReference(WSDLBindingOperation destBindingOperation, WSDLInterfaceOperation destIntfOperation,
- QName soap11Body, List<ExtensibilityElement> extList, WSDLBindingMessageReference reference, ReferenceCallback callback)
- {
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (soap11Body.equals(elementType) || SOAP12_BODY.equals(elementType))
- {
- processEncodingStyle(extElement, destBindingOperation);
- }
- else if (extElement instanceof SOAPHeader)
- {
- SOAPHeader header = (SOAPHeader)extElement;
- QName messageQName = header.getMessage();
- String partName = header.getPart();
-
- String key = messageQName + "->" + partName;
- QName elementName = (QName)messagePartToElementMap.get(key);
- if (elementName == null)
- throw new WSException("Could not determine element name from header: " + partName);
-
- reference.addSoapHeader(new WSDLSOAPHeader(elementName, partName));
- if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
- {
- callback.removeReference(elementName);
- }
- else
- {
- // Just in case
- callback.removeRPCPart(partName);
- }
- }
- else if (extElement instanceof MIMEMultipartRelated)
- {
- MIMEMultipartRelated related = (MIMEMultipartRelated)extElement;
- Iterator i = related.getMIMEParts().iterator();
- while (i.hasNext())
- {
- MIMEPart part = (MIMEPart)i.next();
- Iterator j = part.getExtensibilityElements().iterator();
- String name = null;
- String types = null;
-
- while (j.hasNext())
- {
- ExtensibilityElement inner = (ExtensibilityElement)j.next();
- if (inner instanceof MIMEContent)
- {
- MIMEContent content = (MIMEContent)inner;
- name = content.getPart();
- if (types == null)
- {
- types = content.getType();
- }
- else
- {
- types += "," + content.getType();
- }
- }
- }
-
- // Found content types in this part
- if (name != null)
- {
- QName xmlType = callback.getXmlType(name);
- reference.addMimePart(new WSDLMIMEPart(name, xmlType, types));
- if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
- {
- // A mime part must be defined as <part type="">
- callback.removeReference(new QName(name));
- }
- else
- {
- callback.removeRPCPart(name);
- }
- }
- }
- }
- }
- }
-
-
- private void processEncodingStyle(ExtensibilityElement extElement, WSDLBindingOperation destBindingOperation)
- {
- log.trace("processEncodingStyle");
-
- String encStyle = null;
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBody)
- {
- SOAPBody body = (SOAPBody)extElement;
- List encStyleList = body.getEncodingStyles();
- if (encStyleList != null)
- {
- if (encStyleList.size() > 1)
- log.warn("Multiple encoding styles not supported: " + encStyleList);
-
- if (encStyleList.size() > 0)
- {
- encStyle = (String)encStyleList.get(0);
- }
- }
- }
- else if (SOAP12_BODY.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- encStyle = getOptionalAttribute(domElement, "encodingStyle");
- }
-
- if (encStyle != null)
- {
- String setStyle = destBindingOperation.getEncodingStyle();
- if (encStyle.equals(setStyle) == false)
- log.warn("Encoding style '" + encStyle + "' not supported for: " + destBindingOperation.getRef());
-
- destBindingOperation.setEncodingStyle(encStyle);
- }
- }
-
- private void processServices(Definition srcWsdl)
- {
- log.trace("BEGIN processServices: " + srcWsdl.getDocumentBaseURI());
-
- // Each definition needs a clear binding cache
- allBindings = null;
-
- if (srcWsdl.getServices().size() > 0)
- {
- Iterator it = srcWsdl.getServices().values().iterator();
- while (it.hasNext())
- {
- Service srcService = (Service)it.next();
- QName qname = srcService.getQName();
- WSDLService destService = new WSDLService(destWsdl);
- destService.setName(new NCName(qname));
- destService.setQName(qname);
- destWsdl.addService(destService);
- processPorts(srcWsdl, destService, srcService);
- }
- }
- else
- {
- log.trace("Empty wsdl services, processing imports");
- Iterator it = srcWsdl.getImports().values().iterator();
- while (it.hasNext())
- {
- List<Import> srcImports = (List<Import>)it.next();
- for (Import srcImport : srcImports)
- {
- Definition importDefinition = srcImport.getDefinition();
- processServices(importDefinition);
- }
- }
-
- // The binding cache must be clear after imports, so that undefined bindings can be located
- allBindings = null;
- }
-
- log.trace("END processServices: " + srcWsdl.getDocumentBaseURI());
- }
-
- private void processPorts(Definition srcWsdl, WSDLService destService, Service srcService)
- {
- Iterator it = srcService.getPorts().values().iterator();
- while (it.hasNext())
- {
- Port srcPort = (Port)it.next();
- processPort(srcWsdl, destService, srcPort);
- }
- }
-
- private void processPort(Definition srcWsdl, WSDLService destService, Port srcPort)
- {
- log.trace("processPort: " + srcPort.getName());
-
- Binding srcBinding = srcPort.getBinding();
-
- WSDLEndpoint destEndpoint = new WSDLEndpoint(destService);
- destEndpoint.setName(new NCName(srcPort.getName()));
- destEndpoint.setBinding(srcBinding.getQName());
- destEndpoint.setQName(new QName(srcWsdl.getTargetNamespace(), srcPort.getName()));
- destEndpoint.setAddress(getSOAPAddress(srcPort));
- destService.addEndpoint(destEndpoint);
-
- processBinding(srcWsdl, srcBinding);
- }
-
- /** Get the endpoint address from the ports extensible element
- */
- private String getSOAPAddress(Port srcPort)
- {
- String soapAddress = "dummy";
-
- Iterator it = srcPort.getExtensibilityElements().iterator();
- while (it.hasNext())
- {
- ExtensibilityElement extElement = (ExtensibilityElement)it.next();
- QName elementType = extElement.getElementType();
-
- if (extElement instanceof SOAPAddress)
- {
- SOAPAddress addr = (SOAPAddress)extElement;
- soapAddress = addr.getLocationURI();
- break;
- }
- else if (SOAP12_ADDRESS.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- soapAddress = getOptionalAttribute(domElement, "location");
- break;
- }
- else if ("address".equals(elementType.getLocalPart()))
- {
- log.warn("Unprocessed extension element: " + elementType);
- }
- }
-
- if (soapAddress == null)
- throw new WSException("Cannot obtain SOAP address");
-
- return soapAddress;
- }
-
- private String getOptionalAttribute(Element domElement, String attrName)
- {
- String attrValue = domElement.getAttribute(attrName);
- return (attrValue.length() > 0 ? attrValue : null);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Reader.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Reader.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,1219 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.wsdl;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Import;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.mime.MIMEContent;
+import javax.wsdl.extensions.mime.MIMEMultipartRelated;
+import javax.wsdl.extensions.mime.MIMEPart;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap.SOAPBinding;
+import javax.wsdl.extensions.soap.SOAPBody;
+import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.jaxrpc.Style;
+import org.jboss.ws.common.metadata.wsdl.NCName;
+import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingMessageReference;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLMIMEPart;
+import org.jboss.ws.common.metadata.wsdl.WSDLProperty;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.common.metadata.wsdl.WSDLSOAPHeader;
+import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.common.metadata.wsdl.XSModelTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.tools.JavaToXSD;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @since 10-Oct-2004
+ */
+public class WSDL11Reader
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDL11Reader.class);
+
+ private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12, "binding");
+ private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
+ private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12, "operation");
+ private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
+
+ private WSDLDefinitions destWsdl;
+
+ // Maps wsdl message parts to their corresponding element names
+ private Map<String, QName> messagePartToElementMap = new HashMap<String, QName>();
+
+ // Map of <ns,URL> for schemalocation keyed by namespace
+ private Map<String, URL> schemaLocationsMap = new HashMap<String, URL>();
+
+ private LinkedHashMap<QName, Binding> allBindings;
+ private LinkedHashMap<QName, Binding> portTypeBindings;
+
+ // Temporary files used by this reader.
+ private List<File> tempFiles = new ArrayList<File>();
+
+ /**
+ * Takes a WSDL11 Definition element and converts into
+ * our object graph that has been developed for WSDL20
+ *
+ * @param srcWsdl The src WSDL11 definition
+ * @param wsdlLoc The source location, if null we cannot process imports or includes
+ */
+ public WSDLDefinitions processDefinition(Definition srcWsdl, URL wsdlLoc) throws IOException
+ {
+ log.trace("processDefinition: " + wsdlLoc);
+
+ destWsdl = new WSDLDefinitions();
+ destWsdl.setWsdlTypes(new XSModelTypes());
+ destWsdl.setWsdlOneOneDefinition(srcWsdl);
+ destWsdl.setWsdlNamespace(Constants.NS_WSDL11);
+
+ processNamespaces(srcWsdl);
+ processTypes(srcWsdl, wsdlLoc);
+ processServices(srcWsdl);
+
+ if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
+ processUnreachableBindings(srcWsdl);
+
+ cleanupTemporaryFiles();
+
+ return destWsdl;
+ }
+
+ private void cleanupTemporaryFiles()
+ {
+ for (File current : tempFiles)
+ {
+ current.delete();
+ }
+ }
+
+ // process all bindings not within service separetly
+ private void processUnreachableBindings(Definition srcWsdl)
+ {
+ log.trace("processUnreachableBindings");
+
+ Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
+ while (it.hasNext())
+ {
+ Binding srcBinding = (Binding)it.next();
+ QName srcQName = srcBinding.getQName();
+
+ WSDLBinding destBinding = destWsdl.getBinding(new NCName(srcQName));
+ if (destBinding == null)
+ {
+ processBinding(srcWsdl, srcBinding);
+ }
+ }
+ }
+
+ private void processNamespaces(Definition srcWsdl)
+ {
+ String targetNS = srcWsdl.getTargetNamespace();
+ destWsdl.setTargetNamespace(targetNS);
+
+ // Copy wsdl namespaces
+ Map nsMap = srcWsdl.getNamespaces();
+ Iterator iter = nsMap.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)iter.next();
+ String prefix = (String)entry.getKey();
+ String nsURI = (String)entry.getValue();
+ destWsdl.registerNamespaceURI(nsURI, prefix);
+ }
+ }
+
+ private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException
+ {
+ log.trace("BEGIN processTypes: " + wsdlLoc);
+
+ WSDLTypes destTypes = destWsdl.getWsdlTypes();
+
+ Types srcTypes = srcWsdl.getTypes();
+ if (srcTypes != null && srcTypes.getExtensibilityElements().size() > 0)
+ {
+ List extElements = srcTypes.getExtensibilityElements();
+ int len = extElements.size();
+
+ for (int i = 0; i < len; i++)
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
+
+ Element domElement;
+ if (extElement instanceof Schema)
+ {
+ domElement = ((Schema)extElement).getElement();
+ }
+ else if (extElement instanceof UnknownExtensibilityElement)
+ {
+ domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ }
+ else
+ {
+ throw new WSException("Unsupported extensibility element: " + extElement);
+ }
+
+ Element domElementClone = (Element)domElement.cloneNode(true);
+ copyParentNamespaceDeclarations(domElementClone, domElement);
+
+ String localname = domElementClone.getLocalName();
+ try
+ {
+ if ("import".equals(localname))
+ {
+ processSchemaImport(destTypes, wsdlLoc, domElementClone);
+ }
+ else if ("schema".equals(localname))
+ {
+ processSchemaInclude(destTypes, wsdlLoc, domElementClone);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsuported schema element: " + localname);
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot extract schema definition", e);
+ }
+ }
+
+ if (len > 0)
+ {
+ JavaToXSD jxsd = new JavaToXSD();
+ JBossXSModel xsmodel = jxsd.parseSchema(schemaLocationsMap);
+ WSDLUtils.addSchemaModel(destTypes, destWsdl.getTargetNamespace(), xsmodel);
+ }
+ }
+ else
+ {
+ log.trace("Empty wsdl types element, processing imports");
+ Iterator it = srcWsdl.getImports().values().iterator();
+ while (it.hasNext())
+ {
+ List<Import> srcImports = (List<Import>)it.next();
+ for (Import srcImport : srcImports)
+ {
+ Definition impDefinition = srcImport.getDefinition();
+ String impLoc = impDefinition.getDocumentBaseURI();
+ processTypes(impDefinition, new URL(impLoc));
+ }
+ }
+ }
+
+ log.trace("END processTypes: " + wsdlLoc + "\n" + destTypes);
+ }
+
+ private void copyParentNamespaceDeclarations(Element destElement, Element srcElement)
+ {
+ Node parent = srcElement.getParentNode();
+ while (parent != null)
+ {
+ if (parent.hasAttributes())
+ {
+ NamedNodeMap attributes = parent.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++)
+ {
+ Attr attr = (Attr)attributes.item(i);
+ String name = attr.getName();
+ String value = attr.getValue();
+ if (name.startsWith("xmlns:") && destElement.hasAttribute(name) == false)
+ destElement.setAttribute(name, value);
+ }
+ }
+ parent = parent.getParentNode();
+ }
+ }
+
+ private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl) throws IOException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process import, parent location not set");
+
+ log.trace("processSchemaImport: " + wsdlLoc);
+
+ String location = getOptionalAttribute(importEl, "schemaLocation");
+ if (location == null)
+ throw new IllegalArgumentException("schemaLocation is null for xsd:import");
+
+ URL locationURL = getLocationURL(wsdlLoc, location);
+ Element rootElement = DOMUtils.parse(locationURL.openStream());
+ URL newloc = processSchemaInclude(types, locationURL, rootElement);
+ if (newloc != null)
+ importEl.setAttribute("schemaLocation", newloc.toExternalForm());
+ }
+
+ private URL processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl) throws IOException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process iclude, parent location not set");
+
+ File tmpFile = null;
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process include, parent location not set");
+
+ log.trace("processSchemaInclude: " + wsdlLoc);
+
+ String schemaPrefix = schemaEl.getPrefix();
+
+ String importTag = (schemaPrefix == null) ? "import" : schemaPrefix + ":import";
+ Element importElement = schemaEl.getOwnerDocument().createElementNS(Constants.NS_SCHEMA_XSD, importTag);
+ importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
+ schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
+
+ // Handle schema includes
+ Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "include"));
+ while (it.hasNext())
+ {
+ Element includeEl = (Element)it.next();
+ String location = getOptionalAttribute(includeEl, "schemaLocation");
+ if (location == null)
+ throw new IllegalArgumentException("schemaLocation is null for xsd:include");
+
+ URL locationURL = getLocationURL(wsdlLoc, location);
+ Element rootElement = DOMUtils.parse(locationURL.openStream());
+ URL newloc = processSchemaInclude(types, locationURL, rootElement);
+ if (newloc != null)
+ includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
+ }
+
+ String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
+ if (targetNS != null)
+ {
+ log.trace("processSchemaInclude: [targetNS=" + targetNS + ",parentURL=" + wsdlLoc + "]");
+
+ tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
+ tempFiles.add(tmpFile);
+
+ FileWriter fwrite = new FileWriter(tmpFile);
+ new DOMWriter(fwrite).setPrettyprint(true).print(schemaEl);
+ fwrite.close();
+
+ schemaLocationsMap.put(targetNS, tmpFile.toURL());
+ }
+
+ // schema elements that have no target namespace are skipped
+ //
+ // <xsd:schema>
+ // <xsd:import namespace="http://org.jboss.webservice/example/types" schemaLocation="Hello.xsd"/>
+ // <xsd:import namespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservic..." schemaLocation="subdir/HelloArr.xsd"/>
+ // </xsd:schema>
+ if (targetNS == null)
+ {
+ log.trace("Schema element without target namespace in: " + wsdlLoc);
+ }
+
+ handleSchemaImports(schemaEl, wsdlLoc);
+
+ return tmpFile != null ? tmpFile.toURL() : null;
+ }
+
+ private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws MalformedURLException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process import, parent location not set");
+
+ Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "import"));
+ while (it.hasNext())
+ {
+ Element includeEl = (Element)it.next();
+ String schemaLocation = getOptionalAttribute(includeEl, "schemaLocation");
+ String namespace = getOptionalAttribute(includeEl, "namespace");
+
+ log.trace("handleSchemaImport: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
+
+ // Skip, let the entity resolver resolve these
+ if (namespace != null && schemaLocation != null)
+ {
+ URL currLoc = getLocationURL(wsdlLoc, schemaLocation);
+ schemaLocationsMap.put(namespace, currLoc);
+ }
+ else
+ {
+ log.trace("Skip schema import: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
+ }
+ }
+ }
+
+ private URL getLocationURL(URL parentURL, String location) throws MalformedURLException
+ {
+ log.trace("getLocationURL: [location=" + location + ",parent=" + parentURL + "]");
+
+ URL locationURL = null;
+ try
+ {
+ locationURL = new URL(location);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore malformed URL
+ }
+
+ if (locationURL == null)
+ {
+ String parentProtocol = parentURL.getProtocol();
+ if (parentProtocol.equals("file") && !location.startsWith("/"))
+ {
+ String path = parentURL.toExternalForm();
+ path = path.substring(0, path.lastIndexOf("/"));
+ locationURL = new URL(path + "/" + location);
+ }
+ else if (parentProtocol.startsWith("http") && location.startsWith("/"))
+ {
+ String path = parentProtocol + "://" + parentURL.getHost() + ":" + parentURL.getPort();
+ locationURL = new URL(path + location);
+ }
+ else if (parentProtocol.equals("jar") && !location.startsWith("/"))
+ {
+ String path = parentURL.toExternalForm();
+ path = path.substring(0, path.lastIndexOf("/"));
+ locationURL = new URL(path + "/" + location);
+ }
+ else
+ {
+ throw new WSException("Unsupported schemaLocation: " + location);
+ }
+ }
+
+ log.trace("Modified schemaLocation: " + locationURL);
+ return locationURL;
+ }
+
+ private void processPortType(Definition srcWsdl, PortType srcPortType)
+ {
+ log.trace("processPortType: " + srcPortType.getQName());
+
+ QName qname = srcPortType.getQName();
+ NCName ncName = new NCName(qname);
+ if (destWsdl.getInterface(ncName) == null)
+ {
+ WSDLInterface destInterface = new WSDLInterface(destWsdl);
+ destInterface.setName(ncName);
+ destInterface.setQName(qname);
+
+ // eventing extensions
+ QName eventSourceProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
+ if (eventSourceProp != null && eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
+ {
+ destInterface.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_EVENTSOURCE, eventSourceProp.getLocalPart()));
+ }
+
+ destWsdl.addInterface(destInterface);
+
+ processPortTypeOperations(srcWsdl, destInterface, srcPortType);
+ }
+ }
+
+ private void processPortTypeOperations(Definition srcWsdl, WSDLInterface destInterface, PortType srcPortType)
+ {
+ Iterator itOperations = srcPortType.getOperations().iterator();
+ while (itOperations.hasNext())
+ {
+ Operation srcOperation = (Operation)itOperations.next();
+
+ WSDLInterfaceOperation destOperation = new WSDLInterfaceOperation(destInterface);
+ destOperation.setName(new NCName(srcOperation.getName()));
+ destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
+
+ processOperationInput(srcWsdl, srcOperation, destOperation, srcPortType);
+ processOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType);
+ processOperationFaults(srcOperation, destOperation, destInterface);
+
+ destInterface.addOperation(destOperation);
+ }
+ }
+
+ private void processOperationInput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
+ {
+ Input srcInput = srcOperation.getInput();
+ if (srcInput != null)
+ {
+ Message srcMessage = srcInput.getMessage();
+ log.trace("processOperationInput: " + srcMessage.getQName());
+
+ QName wsaAction = (QName)srcInput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
+ if (wsaAction != null)
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_IN, wsaAction.getLocalPart()));
+
+ List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
+ if (paramOrder != null)
+ {
+ for (String name : paramOrder)
+ {
+ if (srcMessage.getPart(name) != null)
+ destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
+ }
+ }
+
+ WSDLInterfaceOperationInput rpcInput = new WSDLInterfaceOperationInput(destOperation);
+ for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(paramOrder))
+ {
+ if (Constants.URI_STYLE_IRI == destOperation.getStyle())
+ {
+ WSDLInterfaceOperationInput destInput = new WSDLInterfaceOperationInput(destOperation);
+ QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ destInput.setElement(elementName);
+
+ //Lets remember the Message name
+ destInput.setMessageName(srcMessage.getQName());
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN, srcMessage.getQName().getLocalPart()));
+
+ destInput.setPartName(srcPart.getName());
+
+ destOperation.addInput(destInput);
+ }
+ else
+ {
+ // If we don't have a type then we aren't a valid RPC parameter
+ // This could happen on a header element, in which case the
+ // binding will pick it up
+ QName xmlType = srcPart.getTypeName();
+ if (xmlType != null)
+ rpcInput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
+ else
+ messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ }
+ }
+ if (Constants.URI_STYLE_RPC == destOperation.getStyle())
+ {
+ // This is really a place holder, but also the actual value used in
+ // WSDL 2.0 RPC bindings
+ rpcInput.setElement(destOperation.getQName());
+ rpcInput.setMessageName(srcMessage.getQName());
+ destOperation.addInput(rpcInput);
+ }
+ }
+ }
+
+ private void processOperationOutput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
+ {
+ Output srcOutput = srcOperation.getOutput();
+ if (srcOutput == null)
+ {
+ destOperation.setPattern(Constants.WSDL20_PATTERN_IN_ONLY);
+ return;
+ }
+
+ Message srcMessage = srcOutput.getMessage();
+ log.trace("processOperationOutput: " + srcMessage.getQName());
+
+ destOperation.setPattern(Constants.WSDL20_PATTERN_IN_OUT);
+ QName wsaAction = (QName) srcOutput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
+ if (wsaAction != null)
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_OUT, wsaAction.getLocalPart()));
+
+ List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
+ if (paramOrder != null)
+ {
+ for (String name : paramOrder)
+ {
+ if (srcMessage.getPart(name) != null)
+ {
+ WSDLRPCSignatureItem item = destOperation.getRpcSignatureitem(name);
+ if (item != null)
+ item.setDirection(Direction.INOUT);
+ else
+ destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name, Direction.OUT));
+ }
+ }
+ }
+
+ WSDLInterfaceOperationOutput rpcOutput = new WSDLInterfaceOperationOutput(destOperation);
+ for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(null))
+ {
+ if (Constants.URI_STYLE_IRI == destOperation.getStyle())
+ {
+ WSDLInterfaceOperationOutput destOutput = new WSDLInterfaceOperationOutput(destOperation);
+
+ QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ destOutput.setElement(elementName);
+
+ // Lets remember the Message name
+ destOutput.setMessageName(srcMessage.getQName());
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName()
+ .getLocalPart()));
+
+ // Remember the original part name
+ destOutput.setPartName(srcPart.getName());
+
+ destOperation.addOutput(destOutput);
+ }
+ else
+ {
+ // If we don't have a type then we aren't a valid RPC parameter
+ // This could happen on a header element, in which case the
+ // binding will pick it up
+ QName xmlType = srcPart.getTypeName();
+ if (xmlType != null)
+ rpcOutput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
+ else
+ messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ }
+ }
+
+ if (Constants.URI_STYLE_RPC == destOperation.getStyle())
+ {
+ // This is really a place holder, but also the actual value used in
+ // WSDL 2.0 RPC bindings
+ QName name = destOperation.getQName();
+ rpcOutput.setElement(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
+ rpcOutput.setMessageName(srcMessage.getQName());
+ destOperation.addOutput(rpcOutput);
+ }
+ }
+
+ private void processOperationFaults(Operation srcOperation, WSDLInterfaceOperation destOperation, WSDLInterface destInterface)
+ {
+
+ Map faults = srcOperation.getFaults();
+ Iterator itFaults = faults.values().iterator();
+ while (itFaults.hasNext())
+ {
+ Fault srcFault = (Fault)itFaults.next();
+ processOperationFault(destOperation, destInterface, srcFault);
+ }
+ }
+
+ private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface destInterface, Fault srcFault)
+ {
+ String faultName = srcFault.getName();
+ log.trace("processOperationFault: " + faultName);
+
+ WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface);
+ NCName ncName = new NCName(faultName);
+ destFault.setName(ncName);
+
+ Message message = srcFault.getMessage();
+ QName messageName = message.getQName();
+
+ Map partsMap = message.getParts();
+ if (partsMap.size() != 1)
+ throw new WSException("Unsupported number of fault parts in message " + messageName);
+
+ Part part = (Part)partsMap.values().iterator().next();
+ QName xmlName = part.getElementName();
+
+ if (xmlName != null)
+ {
+ destFault.setElement(xmlName);
+ }
+ else
+ {
+ destFault.setElement(messageName);
+ log.warn("Unsupported fault message part in message: " + messageName);
+ }
+
+ WSDLInterfaceFault prevFault = destInterface.getFault(ncName);
+ if (prevFault != null && prevFault.getName().equals(ncName) == false)
+ throw new WSException("Fault name must be unique: " + faultName);
+
+ // Add the fault to the interface
+ destInterface.addFault(destFault);
+
+ // Add the fault refererence to the operation
+ WSDLInterfaceOperationOutfault opOutFault = new WSDLInterfaceOperationOutfault(destOperation);
+ opOutFault.setRef(new QName(destWsdl.getTargetNamespace(), faultName));
+ destOperation.addOutfault(opOutFault);
+ }
+
+ /** Translate the message part name into an XML element name.
+ */
+ private QName messagePartToElementName(Definition srcWsdl, PortType srcPortType, Operation srcOperation, Message srcMessage, Part srcPart)
+ {
+ // <part name="param" element="tns:SomeType" />
+ QName xmlName = srcPart.getElementName();
+
+ // <part name="param" type="xsd:string" />
+ if (xmlName == null)
+ xmlName = new QName(srcPart.getName());
+
+ xmlName = destWsdl.registerQName(xmlName);
+ String key = srcMessage.getQName() + "->" + srcPart.getName();
+ messagePartToElementMap.put(key, xmlName);
+
+ return xmlName;
+ }
+
+ private BindingOperation getBindingOperation(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
+ {
+ Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
+
+ if (srcBinding == null)
+ throw new WSException("Cannot find binding for: " + srcPortType.getQName());
+
+ String srcOperationName = srcOperation.getName();
+ BindingOperation srcBindingOperation = srcBinding.getBindingOperation(srcOperationName, null, null);
+ if (srcBindingOperation == null)
+ throw new WSException("Cannot find binding operation for: " + srcOperationName);
+ return srcBindingOperation;
+ }
+
+ private String getOperationStyle(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
+ {
+ Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
+ BindingOperation srcBindingOperation = getBindingOperation(srcWsdl, srcPortType, srcOperation);
+
+ String operationStyle = null;
+ List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPOperation)
+ {
+ SOAPOperation soapOp = (SOAPOperation)extElement;
+ operationStyle = soapOp.getStyle();
+ }
+ else if (SOAP12_OPERATION.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ operationStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+
+ if (operationStyle == null)
+ {
+ for (ExtensibilityElement extElement : (List<ExtensibilityElement>) srcBinding.getExtensibilityElements())
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ SOAPBinding soapBinding = (SOAPBinding) extElement;
+ operationStyle = soapBinding.getStyle();
+ }
+ else if (SOAP12_BINDING.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement) extElement).getElement();
+ operationStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+ }
+
+ return ("rpc".equals(operationStyle)) ? Constants.URI_STYLE_RPC : Constants.URI_STYLE_IRI;
+ }
+
+ private void processBinding(Definition srcWsdl, Binding srcBinding)
+ {
+ QName srcBindingQName = srcBinding.getQName();
+ log.trace("processBinding: " + srcBindingQName);
+
+ NCName ncName = new NCName(srcBindingQName);
+ if (destWsdl.getBinding(ncName) == null)
+ {
+ PortType srcPortType = srcBinding.getPortType();
+ if (srcPortType == null)
+ throw new WSException("Cannot find port type for binding: " + ncName);
+
+ processPortType(srcWsdl, srcPortType);
+
+ WSDLBinding destBinding = new WSDLBinding(destWsdl);
+ destBinding.setQName(srcBindingQName);
+ destBinding.setName(ncName);
+ destBinding.setInterfaceName(srcPortType.getQName());
+
+ String bindingStyle = Style.getDefaultStyle().toString();
+ List<ExtensibilityElement> extList = srcBinding.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ destBinding.setType(Constants.NS_SOAP11);
+ SOAPBinding soapBinding = (SOAPBinding)extElement;
+ bindingStyle = soapBinding.getStyle();
+ }
+ else if (SOAP12_BINDING.equals(elementType))
+ {
+ destBinding.setType(Constants.NS_SOAP12);
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ bindingStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+ destWsdl.addBinding(destBinding);
+ processBindingOperations(destBinding, srcBinding, bindingStyle);
+ }
+ }
+
+ private Map<QName, Binding> getPortTypeBindings(Definition srcWsdl)
+ {
+ getAllDefinedBindings(srcWsdl);
+ return portTypeBindings;
+ }
+
+ private Map<QName, Binding> getAllDefinedBindings(Definition srcWsdl)
+ {
+ if (allBindings != null)
+ return allBindings;
+
+ allBindings = new LinkedHashMap<QName, Binding>();
+ portTypeBindings = new LinkedHashMap<QName, Binding>();
+ Map srcBindings = srcWsdl.getBindings();
+ Iterator itBinding = srcBindings.values().iterator();
+ while (itBinding.hasNext())
+ {
+ Binding srcBinding = (Binding)itBinding.next();
+ allBindings.put(srcBinding.getQName(), srcBinding);
+ portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
+ }
+
+ // Bindings not available when pulled in through <wsdl:import>
+ // http://sourceforge.net/tracker/index.php?func=detail&aid=1240323&group_id...
+ Iterator itService = srcWsdl.getServices().values().iterator();
+ while (itService.hasNext())
+ {
+ Service srcService = (Service)itService.next();
+ Iterator itPort = srcService.getPorts().values().iterator();
+ while (itPort.hasNext())
+ {
+ Port srcPort = (Port)itPort.next();
+ Binding srcBinding = srcPort.getBinding();
+ allBindings.put(srcBinding.getQName(), srcBinding);
+ portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
+ }
+ }
+
+ return allBindings;
+ }
+
+ private void processBindingOperations(WSDLBinding destBinding, Binding srcBinding, String bindingStyle)
+ {
+ Iterator it = srcBinding.getBindingOperations().iterator();
+ while (it.hasNext())
+ {
+ BindingOperation srcBindingOperation = (BindingOperation)it.next();
+ processBindingOperation(destBinding, bindingStyle, srcBindingOperation);
+ }
+ }
+
+ private void processBindingOperation(WSDLBinding destBinding, String bindingStyle, BindingOperation srcBindingOperation)
+ {
+ String srcBindingName = srcBindingOperation.getName();
+ log.trace("processBindingOperation: " + srcBindingName);
+
+ WSDLInterface destInterface = destBinding.getInterface();
+ String namespaceURI = destInterface.getQName().getNamespaceURI();
+
+ WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
+ QName refQName = new QName(namespaceURI, srcBindingName);
+ destBindingOperation.setRef(refQName);
+ destBinding.addOperation(destBindingOperation);
+
+ String opName = srcBindingName;
+ WSDLInterfaceOperation destIntfOperation = destInterface.getOperation(new NCName(opName));
+
+ // Process soap:operation@soapAction, soap:operation@style
+ List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPOperation)
+ {
+ SOAPOperation soapOp = (SOAPOperation)extElement;
+ destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
+ }
+ else if (SOAP12_OPERATION.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ destBindingOperation.setSOAPAction(getOptionalAttribute(domElement, "soapAction"));
+ }
+ }
+
+ BindingInput srcBindingInput = srcBindingOperation.getBindingInput();
+ if (srcBindingInput != null)
+ {
+ processBindingInput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingInput);
+ }
+
+ BindingOutput srcBindingOutput = srcBindingOperation.getBindingOutput();
+ if (srcBindingOutput != null)
+ {
+ processBindingOutput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingOutput);
+ }
+ }
+
+ interface ReferenceCallback
+ {
+ void removeReference(QName element);
+ void removeRPCPart(String partName);
+ QName getXmlType(String partName);
+ }
+
+ private void processBindingInput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingInput srcBindingInput)
+ {
+ log.trace("processBindingInput");
+
+ QName soap11Body = new QName(Constants.NS_SOAP11, "body");
+ List<ExtensibilityElement> extList = srcBindingInput.getExtensibilityElements();
+ WSDLBindingOperationInput input = new WSDLBindingOperationInput(destBindingOperation);
+ destBindingOperation.addInput(input);
+
+ ReferenceCallback cb = new ReferenceCallback()
+ {
+ public QName getXmlType(String partName)
+ {
+ return srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
+ }
+
+ public void removeReference(QName element)
+ {
+ WSDLInterfaceOperationInput destIntfInput = destIntfOperation.getInput(element);
+ if (destIntfInput == null)
+ destIntfOperation.removeInput(element);
+ }
+
+ public void removeRPCPart(String partName)
+ {
+ WSDLInterfaceOperationInput operationInput = destIntfOperation.getInput(destIntfOperation.getQName());
+ operationInput.removeChildPart(partName);
+ }
+ };
+
+ processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, input, cb);
+ }
+
+ private void processBindingOutput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingOutput srcBindingOutput)
+ {
+ log.trace("processBindingInput");
+
+ QName soap11Body = new QName(Constants.NS_SOAP11, "body");
+ List<ExtensibilityElement> extList = srcBindingOutput.getExtensibilityElements();
+ WSDLBindingOperationOutput output = new WSDLBindingOperationOutput(destBindingOperation);
+ destBindingOperation.addOutput(output);
+
+ ReferenceCallback cb = new ReferenceCallback()
+ {
+ public QName getXmlType(String partName)
+ {
+ return srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
+ }
+
+ public void removeReference(QName element)
+ {
+ WSDLInterfaceOperationOutput destIntfOutput = destIntfOperation.getOutput(element);
+ if (destIntfOutput == null)
+ destIntfOperation.removeInput(element);
+ }
+
+ public void removeRPCPart(String partName)
+ {
+ QName name = destIntfOperation.getQName();
+ WSDLInterfaceOperationOutput operationOutput = destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
+ operationOutput.removeChildPart(partName);
+ }
+ };
+
+ processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, output, cb);
+ }
+
+
+ private void processBindingReference(WSDLBindingOperation destBindingOperation, WSDLInterfaceOperation destIntfOperation,
+ QName soap11Body, List<ExtensibilityElement> extList, WSDLBindingMessageReference reference, ReferenceCallback callback)
+ {
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (soap11Body.equals(elementType) || SOAP12_BODY.equals(elementType))
+ {
+ processEncodingStyle(extElement, destBindingOperation);
+ }
+ else if (extElement instanceof SOAPHeader)
+ {
+ SOAPHeader header = (SOAPHeader)extElement;
+ QName messageQName = header.getMessage();
+ String partName = header.getPart();
+
+ String key = messageQName + "->" + partName;
+ QName elementName = (QName)messagePartToElementMap.get(key);
+ if (elementName == null)
+ throw new WSException("Could not determine element name from header: " + partName);
+
+ reference.addSoapHeader(new WSDLSOAPHeader(elementName, partName));
+ if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
+ {
+ callback.removeReference(elementName);
+ }
+ else
+ {
+ // Just in case
+ callback.removeRPCPart(partName);
+ }
+ }
+ else if (extElement instanceof MIMEMultipartRelated)
+ {
+ MIMEMultipartRelated related = (MIMEMultipartRelated)extElement;
+ Iterator i = related.getMIMEParts().iterator();
+ while (i.hasNext())
+ {
+ MIMEPart part = (MIMEPart)i.next();
+ Iterator j = part.getExtensibilityElements().iterator();
+ String name = null;
+ String types = null;
+
+ while (j.hasNext())
+ {
+ ExtensibilityElement inner = (ExtensibilityElement)j.next();
+ if (inner instanceof MIMEContent)
+ {
+ MIMEContent content = (MIMEContent)inner;
+ name = content.getPart();
+ if (types == null)
+ {
+ types = content.getType();
+ }
+ else
+ {
+ types += "," + content.getType();
+ }
+ }
+ }
+
+ // Found content types in this part
+ if (name != null)
+ {
+ QName xmlType = callback.getXmlType(name);
+ reference.addMimePart(new WSDLMIMEPart(name, xmlType, types));
+ if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
+ {
+ // A mime part must be defined as <part type="">
+ callback.removeReference(new QName(name));
+ }
+ else
+ {
+ callback.removeRPCPart(name);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ private void processEncodingStyle(ExtensibilityElement extElement, WSDLBindingOperation destBindingOperation)
+ {
+ log.trace("processEncodingStyle");
+
+ String encStyle = null;
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBody)
+ {
+ SOAPBody body = (SOAPBody)extElement;
+ List encStyleList = body.getEncodingStyles();
+ if (encStyleList != null)
+ {
+ if (encStyleList.size() > 1)
+ log.warn("Multiple encoding styles not supported: " + encStyleList);
+
+ if (encStyleList.size() > 0)
+ {
+ encStyle = (String)encStyleList.get(0);
+ }
+ }
+ }
+ else if (SOAP12_BODY.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ encStyle = getOptionalAttribute(domElement, "encodingStyle");
+ }
+
+ if (encStyle != null)
+ {
+ String setStyle = destBindingOperation.getEncodingStyle();
+ if (encStyle.equals(setStyle) == false)
+ log.warn("Encoding style '" + encStyle + "' not supported for: " + destBindingOperation.getRef());
+
+ destBindingOperation.setEncodingStyle(encStyle);
+ }
+ }
+
+ private void processServices(Definition srcWsdl)
+ {
+ log.trace("BEGIN processServices: " + srcWsdl.getDocumentBaseURI());
+
+ // Each definition needs a clear binding cache
+ allBindings = null;
+
+ if (srcWsdl.getServices().size() > 0)
+ {
+ Iterator it = srcWsdl.getServices().values().iterator();
+ while (it.hasNext())
+ {
+ Service srcService = (Service)it.next();
+ QName qname = srcService.getQName();
+ WSDLService destService = new WSDLService(destWsdl);
+ destService.setName(new NCName(qname));
+ destService.setQName(qname);
+ destWsdl.addService(destService);
+ processPorts(srcWsdl, destService, srcService);
+ }
+ }
+ else
+ {
+ log.trace("Empty wsdl services, processing imports");
+ Iterator it = srcWsdl.getImports().values().iterator();
+ while (it.hasNext())
+ {
+ List<Import> srcImports = (List<Import>)it.next();
+ for (Import srcImport : srcImports)
+ {
+ Definition importDefinition = srcImport.getDefinition();
+ processServices(importDefinition);
+ }
+ }
+
+ // The binding cache must be clear after imports, so that undefined bindings can be located
+ allBindings = null;
+ }
+
+ log.trace("END processServices: " + srcWsdl.getDocumentBaseURI());
+ }
+
+ private void processPorts(Definition srcWsdl, WSDLService destService, Service srcService)
+ {
+ Iterator it = srcService.getPorts().values().iterator();
+ while (it.hasNext())
+ {
+ Port srcPort = (Port)it.next();
+ processPort(srcWsdl, destService, srcPort);
+ }
+ }
+
+ private void processPort(Definition srcWsdl, WSDLService destService, Port srcPort)
+ {
+ log.trace("processPort: " + srcPort.getName());
+
+ Binding srcBinding = srcPort.getBinding();
+
+ WSDLEndpoint destEndpoint = new WSDLEndpoint(destService);
+ destEndpoint.setName(new NCName(srcPort.getName()));
+ destEndpoint.setBinding(srcBinding.getQName());
+ destEndpoint.setQName(new QName(srcWsdl.getTargetNamespace(), srcPort.getName()));
+ destEndpoint.setAddress(getSOAPAddress(srcPort));
+ destService.addEndpoint(destEndpoint);
+
+ processBinding(srcWsdl, srcBinding);
+ }
+
+ /** Get the endpoint address from the ports extensible element
+ */
+ private String getSOAPAddress(Port srcPort)
+ {
+ String soapAddress = "dummy";
+
+ Iterator it = srcPort.getExtensibilityElements().iterator();
+ while (it.hasNext())
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)it.next();
+ QName elementType = extElement.getElementType();
+
+ if (extElement instanceof SOAPAddress)
+ {
+ SOAPAddress addr = (SOAPAddress)extElement;
+ soapAddress = addr.getLocationURI();
+ break;
+ }
+ else if (SOAP12_ADDRESS.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ soapAddress = getOptionalAttribute(domElement, "location");
+ break;
+ }
+ else if ("address".equals(elementType.getLocalPart()))
+ {
+ log.warn("Unprocessed extension element: " + elementType);
+ }
+ }
+
+ if (soapAddress == null)
+ throw new WSException("Cannot obtain SOAP address");
+
+ return soapAddress;
+ }
+
+ private String getOptionalAttribute(Element domElement, String attrName)
+ {
+ String attrValue = domElement.getAttribute(attrName);
+ return (attrValue.length() > 0 ? attrValue : null);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Writer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Writer.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -1,538 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.tools.wsdl;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.HashSet;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.wsdl.NCName;
-import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingMessageReference;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.common.metadata.wsdl.WSDLImport;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceMessageReference;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCPart;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem;
-import org.jboss.ws.common.metadata.wsdl.WSDLSOAPHeader;
-import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A WSDL Writer that writes a WSDL 1.1 file. It works off
- * of the WSDL20 Object Graph.
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- */
-public class WSDL11Writer extends WSDLWriter
-{
- //Used Internally
- private String wsdlStyle = Constants.RPC_LITERAL;
-
- // Used to prevent duplicates
- private HashSet<String> writtenFaultMessages = new HashSet<String>();
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- public WSDL11Writer(WSDLDefinitions wsdl)
- {
- super(wsdl);
- }
-
- public void write(Writer writer) throws IOException
- {
- write(writer, null);
- }
-
-
- public void write(Writer writer, String charset) throws IOException
- {
- write(writer, charset, null);
- }
-
- public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws IOException
- {
- // Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
- if (wsdl.getWsdlOneOneDefinition() != null)
- {
- Definition wsdlDefinition = wsdl.getWsdlOneOneDefinition();
- try
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
- wsdlWriter.writeWSDL(wsdlDefinition, writer);
- }
- catch (WSDLException e)
- {
- this.logException(e);
- throw new IOException(e.toString());
- }
- }
- else
- {
- StringBuilder buffer = new StringBuilder();
-
- //Detect the WSDL Style early
- wsdlStyle = utils.getWSDLStyle(wsdl);
-
- StringBuilder importBuffer = new StringBuilder();
- for (WSDLImport wsdlImport : wsdl.getImports())
- {
- if (resolver == null)
- continue;
-
- WSDLWriterResolver resolved = resolver.resolve(wsdlImport.getLocation());
- if (resolved == null)
- continue;
-
- String namespace = wsdlImport.getNamespace();
- importBuffer.append("<import namespace='" + namespace + "' location='" + resolved.actualFile + "'/>");
- if (resolved != null)
- {
- StringBuilder builder = new StringBuilder();
-
- appendDefinitions(builder, namespace);
- appendBody(builder, namespace);
- writeBuilder(builder, resolved.writer, resolved.charset);
- resolved.writer.close();
- }
- }
-
- appendDefinitions(buffer, wsdl.getTargetNamespace());
- if (importBuffer.length() > 0)
- buffer.append(importBuffer);
-
- appendBody(buffer, wsdl.getTargetNamespace());
- writeBuilder(buffer, writer, charset);
- }
- }
-
- private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws IOException
- {
- Element element = DOMUtils.parse(builder.toString());
-
- if (charset != null)
- writer.write("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
- new DOMWriter(writer).setPrettyprint(true).print(element);
- }
-
- protected void appendBody(StringBuilder builder, String namespace)
- {
- writtenFaultMessages.clear();
-
- appendTypes(builder, namespace);
- appendMessages(builder, namespace);
- appendInterfaces(builder, namespace);
- appendBindings(builder, namespace);
- appendServices(builder, namespace);
- builder.append("</definitions>");
- }
-
- protected void appendMessages(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] interfaces = wsdl.getInterfaces();
- int len = interfaces != null ? interfaces.length : 0;
- for (int i = 0; i < len; i++)
- {
- WSDLInterface intf = interfaces[i];
- if (! namespace.equals(intf.getQName().getNamespaceURI()))
- continue;
-
- WSDLInterfaceOperation[] operations = intf.getSortedOperations();
- int lenOps = operations.length;
- for (int j = 0; j < lenOps; j++)
- {
- appendMessage(buffer, operations[j]);
- appendMessagesForExceptions(buffer, operations[j]);
- }
- }
- }
-
- private void appendMessage(StringBuilder buffer, WSDLInterfaceOperation operation)
- {
- String opname = operation.getName().toString();
- //Determine the style of the wsdl
- if (Constants.URI_STYLE_RPC.equals(operation.getStyle()) == false)
- wsdlStyle = Constants.DOCUMENT_LITERAL; //Not RPC/Literal
-
- String interfaceName = operation.getWsdlInterface().getName().toString();
- buffer.append("<message name='" + interfaceName + "_" + opname + "' >");
- for (WSDLInterfaceOperationInput input : operation.getInputs())
- appendMessageParts(buffer, input);
- buffer.append("</message>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
- {
- buffer.append("<message name='" + interfaceName + "_" + opname + "Response' >");
- WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
- for (WSDLInterfaceOperationOutput output : outputs)
- appendMessageParts(buffer, output);
- buffer.append("</message>");
- }
- }
-
- private void appendMessagesForExceptions(StringBuilder buffer, WSDLInterfaceOperation operation)
- {
- //Get the outfaults
- WSDLInterfaceOperationOutfault[] faults = operation.getOutfaults();
- int len = faults != null ? faults.length : 0;
-
- for (int i = 0; i < len; i++)
- {
- WSDLInterfaceOperationOutfault fault = faults[i];
- String exceptionName = fault.getRef().getLocalPart();
- if (writtenFaultMessages.contains(exceptionName))
- continue;
-
- WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(new NCName(exceptionName));
- QName xmlName = interfaceFault.getElement();
-
- buffer.append("<message name='" + exceptionName + "' >");
- String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
- String xmlNameStr = prefix + ":" + xmlName.getLocalPart();
- buffer.append("<part name='" + exceptionName + "' element='" + xmlNameStr + "' />");
- buffer.append("</message>");
-
- writtenFaultMessages.add(exceptionName);
- }
- }
-
- private String getReferenceString(QName name)
- {
- String namespaceURI = name.getNamespaceURI();
- String prefix = wsdl.getPrefix(namespaceURI);
- if (prefix == null)
- throw new WSException("Prefix not bound for namespace: " + namespaceURI);
-
- return prefix + ":" + name.getLocalPart();
- }
-
- private void appendMessageParts(StringBuilder buffer, WSDLInterfaceMessageReference reference)
- {
- if (wsdlStyle.equals(Constants.RPC_LITERAL))
- {
- for (WSDLRPCPart part : reference.getChildParts())
- {
- buffer.append("<part name='" + part.getName()).append('\'');
- buffer.append(" type='" + getReferenceString(part.getType()) + "'/>");
- }
- }
- else
- {
- QName element = reference.getElement();
- // Null represents empty message
- if (element != null)
- {
- buffer.append("<part name='" + reference.getPartName() + '\'');
- buffer.append(" element='" + getReferenceString(element) + "'/>");
- }
- }
-
- WSDLBindingMessageReference bindingReference = getBindingReference(reference);
- if (bindingReference == null)
- return;
-
- for (WSDLSOAPHeader header : bindingReference.getSoapHeaders())
- {
- if (header.isIncludeInSignature());
- {
- QName element = header.getElement();
- buffer.append("<part name='" + header.getPartName() + '\'');
- buffer.append(" element='" + getReferenceString(element) + "'/>");
- }
- }
- }
-
- private WSDLBindingMessageReference getBindingReference(WSDLInterfaceMessageReference reference)
- {
- WSDLInterfaceOperation operation = reference.getWsdlOperation();
- WSDLInterface wsdlInterface = operation.getWsdlInterface();
- WSDLBinding binding = wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation bindingOperation = binding.getOperationByRef(operation.getQName());
- WSDLBindingMessageReference[] bindingReferences;
-
- if (reference instanceof WSDLInterfaceOperationInput)
- bindingReferences = bindingOperation.getInputs();
- else
- bindingReferences = bindingOperation.getOutputs();
-
- if (bindingReferences.length > 1)
- throw new IllegalArgumentException("WSDl 1.1 only supports In-Only, and In-Out MEPS, more than reference input found");
-
- if (bindingReferences.length == 1)
- return bindingReferences[0];
-
- return null;
- }
-
- protected void appendInterfaces(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] intfs = wsdl.getInterfaces();
- for (int i = 0; i < intfs.length; i++)
- {
- WSDLInterface intf = intfs[i];
- if (!namespace.equals(intf.getQName().getNamespaceURI()))
- continue;
-
- buffer.append("<portType name='" + intf.getName() + "'>");
- appendPortOperations(buffer, intf);
- buffer.append("</portType>");
- }
- }
-
- private String getParameterOrder(WSDLInterfaceOperation operation)
- {
- StringBuilder builder = new StringBuilder();
- for (WSDLRPCSignatureItem item : operation.getRpcSignatureItems())
- {
- if (item.getDirection() != Direction.RETURN)
- {
- if (builder.length() > 0)
- builder.append(' ');
- builder.append(item.getName());
- }
- }
-
- return builder.toString();
- }
-
- protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
- {
- String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
- WSDLInterfaceOperation[] operations = intf.getSortedOperations();
- for (int i = 0; i < operations.length; i++)
- {
- WSDLInterfaceOperation operation = operations[i];
- buffer.append("<operation name='" + operation.getName().toString() + "'");
-
- String parameterOrder = getParameterOrder(operation);
- if (parameterOrder.length() > 0)
- buffer.append(" parameterOrder='").append(parameterOrder).append("'");
- buffer.append(">");
-
- String opname = operation.getName().toString();
- String interfaceName = operation.getWsdlInterface().getName().toString();
- String msgEl = prefix + ":" + interfaceName + "_" + opname;
-
- buffer.append("<input message='" + msgEl + "'>").append("</input>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
- {
- buffer.append("<output message='" + msgEl + "Response'>");
- buffer.append("</output>");
- }
-
- //Append the Faults
- for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
- {
- QName element = fault.getRef();
- buffer.append("<fault message='" + utils.getFormattedString(element));
- buffer.append("' name='" + element.getLocalPart() + "'/>");
- }
-
- buffer.append("</operation>");
- }
- }
-
- protected void appendBindings(StringBuilder buffer, String namespace)
- {
- WSDLBinding[] bindings = wsdl.getBindings();
- for (int i = 0; i < bindings.length; i++)
- {
- WSDLBinding binding = bindings[i];
- if (!namespace.equals(binding.getQName().getNamespaceURI()))
- continue;
- buffer.append("<binding name='" + binding.getName() + "' type='" + getQNameRef(binding.getInterfaceName()) + "'>");
- //TODO:Need to derive the WSDLStyle from the Style attribute of InterfaceOperation
- if (wsdlStyle == null)
- throw new IllegalArgumentException("WSDL Style is null (should be rpc or document");
- String style = "rpc";
- if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
- style = "document";
- buffer.append("<" + soapPrefix + ":binding transport='http://schemas.xmlsoap.org/soap/http' style='" + style + "'/>");
- appendBindingOperations(buffer, binding);
- buffer.append("</binding>");
- }
- }
-
- protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
- {
- WSDLBindingOperation[] operations = binding.getOperations();
- Arrays.sort(operations);
-
- for (int i = 0; i < operations.length; i++)
- {
- WSDLBindingOperation operation = operations[i];
- String interfaceName = operation.getWsdlBinding().getInterfaceName().getLocalPart();
-
- WSDLInterface wsdlInterface = wsdl.getInterface(new NCName(interfaceName));
- if (wsdlInterface == null)
- throw new WSException("WSDL Interface should not be null");
- WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
-
- buffer.append("<operation name='" + interfaceOperation.getName() + "'>");
- String soapAction = (operation.getSOAPAction() != null ? operation.getSOAPAction() : "");
- buffer.append("<" + soapPrefix + ":operation soapAction=\"" + soapAction + "\"/>");
-
- WSDLBindingOperationInput[] inputs = operation.getInputs();
- if (inputs.length != 1)
- throw new WSException("WSDl 1.1 only supports In-Only, and In-Out MEPS.");
-
- buffer.append("<input>");
- appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
- buffer.append("</input>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(getBindingOperationPattern(operation)))
- {
- buffer.append("<output>");
- WSDLBindingOperationOutput[] outputs = operation.getOutputs();
- appendSOAPBinding(buffer, wsdlInterface, operation, outputs);
- buffer.append("</output>");
- }
-
- //Append faults
- WSDLInterfaceOperationOutfault[] faults = interfaceOperation.getOutfaults();
- if (faults != null)
- {
- for (WSDLInterfaceOperationOutfault fault : faults)
- {
- String n = "name='" + fault.getRef().getLocalPart() + "'";
- buffer.append("<fault " + n + ">");
- buffer.append("<" + soapPrefix + ":fault " + n + " use='literal' />");
- buffer.append("</fault>");
- }
- buffer.append("</operation>");
- }
- }
- }
-
- private void appendSOAPBinding(StringBuilder buffer, WSDLInterface wsdlInterface, WSDLBindingOperation operation, WSDLBindingMessageReference[] inputs)
- {
- String tns = wsdl.getTargetNamespace();
- WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
- WSDLInterfaceMessageReference reference = (inputs instanceof WSDLBindingOperationInput[]) ? interfaceOperation.getInputs()[0]
- : interfaceOperation.getOutputs()[0];
-
- StringBuilder bodyParts = new StringBuilder();
- if (Constants.DOCUMENT_LITERAL == wsdlStyle)
- {
- bodyParts.append(reference.getPartName());
- }
- else
- {
- for (WSDLRPCPart part : reference.getChildParts())
- {
- if (bodyParts.length() > 0)
- bodyParts.append(" ");
- bodyParts.append(part.getName());
- }
- }
-
- StringBuilder soapHeader = new StringBuilder();
- for (WSDLSOAPHeader header : inputs[0].getSoapHeaders())
- {
- if (header.isIncludeInSignature())
- {
- String messageName = wsdlInterface.getName() + "_" + operation.getRef().getLocalPart();
- if (reference instanceof WSDLInterfaceOperationOutput)
- messageName += "Response";
- soapHeader.append("<").append(soapPrefix).append(":header use='literal' message='tns:").append(messageName);
- soapHeader.append("' part='").append(header.getElement().getLocalPart()).append("'/>");
- }
- }
-
- buffer.append("<" + soapPrefix + ":body use='literal'");
- if (wsdlStyle != Constants.DOCUMENT_LITERAL)
- buffer.append(" namespace='" + tns + "'");
- if (soapHeader.length() > 0)
- {
- buffer.append(" parts='").append(bodyParts).append("'/>");
- buffer.append(soapHeader);
- }
- else
- {
- buffer.append("/>");
- }
- }
-
- private String getBindingOperationPattern(WSDLBindingOperation operation)
- {
- WSDLBinding binding = operation.getWsdlBinding();
- String pattern = binding.getInterface().getOperation(new NCName(operation.getRef().getLocalPart())).getPattern();
-
- return pattern;
- }
-
- protected void appendServices(StringBuilder buffer, String namespace)
- {
- WSDLService[] services = wsdl.getServices();
- int len = services.length;
- for (int i = 0; i < len; i++)
- {
-
- WSDLService service = services[i];
- if (!namespace.equals(service.getQName().getNamespaceURI()))
- continue;
- buffer.append("<service name='" + service.getName() + "'>");
- WSDLEndpoint[] endpoints = service.getEndpoints();
- int lenend = endpoints.length;
- for (int j = 0; j < lenend; j++)
- {
- WSDLEndpoint endpoint = endpoints[j];
- appendServicePort(buffer, endpoint);
- }
-
- buffer.append("</service>");
- }
- }
-
- protected void appendServicePort(StringBuilder buffer, WSDLEndpoint endpoint)
- {
- String name = endpoint.getName().toString();
- QName endpointBinding = endpoint.getBinding();
- String prefix = endpointBinding.getPrefix();
- prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
- String ebname = prefix + ":" + endpointBinding.getLocalPart();
- buffer.append("<port name='" + name + "' binding='" + ebname + "'>");
- buffer.append("<" + soapPrefix + ":address location='" + endpoint.getAddress() + "'/>");
- buffer.append("</port>");
- }
-}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Writer.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDL11Writer.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,538 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.wsdl;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.HashSet;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.wsdl.NCName;
+import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingMessageReference;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.common.metadata.wsdl.WSDLImport;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceMessageReference;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.common.metadata.wsdl.WSDLSOAPHeader;
+import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.w3c.dom.Element;
+
+/**
+ * A WSDL Writer that writes a WSDL 1.1 file. It works off
+ * of the WSDL20 Object Graph.
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ */
+public class WSDL11Writer extends WSDLWriter
+{
+ //Used Internally
+ private String wsdlStyle = Constants.RPC_LITERAL;
+
+ // Used to prevent duplicates
+ private HashSet<String> writtenFaultMessages = new HashSet<String>();
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ public WSDL11Writer(WSDLDefinitions wsdl)
+ {
+ super(wsdl);
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ write(writer, null);
+ }
+
+
+ public void write(Writer writer, String charset) throws IOException
+ {
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws IOException
+ {
+ // Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
+ if (wsdl.getWsdlOneOneDefinition() != null)
+ {
+ Definition wsdlDefinition = wsdl.getWsdlOneOneDefinition();
+ try
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
+ wsdlWriter.writeWSDL(wsdlDefinition, writer);
+ }
+ catch (WSDLException e)
+ {
+ this.logException(e);
+ throw new IOException(e.toString());
+ }
+ }
+ else
+ {
+ StringBuilder buffer = new StringBuilder();
+
+ //Detect the WSDL Style early
+ wsdlStyle = utils.getWSDLStyle(wsdl);
+
+ StringBuilder importBuffer = new StringBuilder();
+ for (WSDLImport wsdlImport : wsdl.getImports())
+ {
+ if (resolver == null)
+ continue;
+
+ WSDLWriterResolver resolved = resolver.resolve(wsdlImport.getLocation());
+ if (resolved == null)
+ continue;
+
+ String namespace = wsdlImport.getNamespace();
+ importBuffer.append("<import namespace='" + namespace + "' location='" + resolved.actualFile + "'/>");
+ if (resolved != null)
+ {
+ StringBuilder builder = new StringBuilder();
+
+ appendDefinitions(builder, namespace);
+ appendBody(builder, namespace);
+ writeBuilder(builder, resolved.writer, resolved.charset);
+ resolved.writer.close();
+ }
+ }
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ if (importBuffer.length() > 0)
+ buffer.append(importBuffer);
+
+ appendBody(buffer, wsdl.getTargetNamespace());
+ writeBuilder(buffer, writer, charset);
+ }
+ }
+
+ private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws IOException
+ {
+ Element element = DOMUtils.parse(builder.toString());
+
+ if (charset != null)
+ writer.write("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendBody(StringBuilder builder, String namespace)
+ {
+ writtenFaultMessages.clear();
+
+ appendTypes(builder, namespace);
+ appendMessages(builder, namespace);
+ appendInterfaces(builder, namespace);
+ appendBindings(builder, namespace);
+ appendServices(builder, namespace);
+ builder.append("</definitions>");
+ }
+
+ protected void appendMessages(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] interfaces = wsdl.getInterfaces();
+ int len = interfaces != null ? interfaces.length : 0;
+ for (int i = 0; i < len; i++)
+ {
+ WSDLInterface intf = interfaces[i];
+ if (! namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ WSDLInterfaceOperation[] operations = intf.getSortedOperations();
+ int lenOps = operations.length;
+ for (int j = 0; j < lenOps; j++)
+ {
+ appendMessage(buffer, operations[j]);
+ appendMessagesForExceptions(buffer, operations[j]);
+ }
+ }
+ }
+
+ private void appendMessage(StringBuilder buffer, WSDLInterfaceOperation operation)
+ {
+ String opname = operation.getName().toString();
+ //Determine the style of the wsdl
+ if (Constants.URI_STYLE_RPC.equals(operation.getStyle()) == false)
+ wsdlStyle = Constants.DOCUMENT_LITERAL; //Not RPC/Literal
+
+ String interfaceName = operation.getWsdlInterface().getName().toString();
+ buffer.append("<message name='" + interfaceName + "_" + opname + "' >");
+ for (WSDLInterfaceOperationInput input : operation.getInputs())
+ appendMessageParts(buffer, input);
+ buffer.append("</message>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
+ {
+ buffer.append("<message name='" + interfaceName + "_" + opname + "Response' >");
+ WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
+ for (WSDLInterfaceOperationOutput output : outputs)
+ appendMessageParts(buffer, output);
+ buffer.append("</message>");
+ }
+ }
+
+ private void appendMessagesForExceptions(StringBuilder buffer, WSDLInterfaceOperation operation)
+ {
+ //Get the outfaults
+ WSDLInterfaceOperationOutfault[] faults = operation.getOutfaults();
+ int len = faults != null ? faults.length : 0;
+
+ for (int i = 0; i < len; i++)
+ {
+ WSDLInterfaceOperationOutfault fault = faults[i];
+ String exceptionName = fault.getRef().getLocalPart();
+ if (writtenFaultMessages.contains(exceptionName))
+ continue;
+
+ WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(new NCName(exceptionName));
+ QName xmlName = interfaceFault.getElement();
+
+ buffer.append("<message name='" + exceptionName + "' >");
+ String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
+ String xmlNameStr = prefix + ":" + xmlName.getLocalPart();
+ buffer.append("<part name='" + exceptionName + "' element='" + xmlNameStr + "' />");
+ buffer.append("</message>");
+
+ writtenFaultMessages.add(exceptionName);
+ }
+ }
+
+ private String getReferenceString(QName name)
+ {
+ String namespaceURI = name.getNamespaceURI();
+ String prefix = wsdl.getPrefix(namespaceURI);
+ if (prefix == null)
+ throw new WSException("Prefix not bound for namespace: " + namespaceURI);
+
+ return prefix + ":" + name.getLocalPart();
+ }
+
+ private void appendMessageParts(StringBuilder buffer, WSDLInterfaceMessageReference reference)
+ {
+ if (wsdlStyle.equals(Constants.RPC_LITERAL))
+ {
+ for (WSDLRPCPart part : reference.getChildParts())
+ {
+ buffer.append("<part name='" + part.getName()).append('\'');
+ buffer.append(" type='" + getReferenceString(part.getType()) + "'/>");
+ }
+ }
+ else
+ {
+ QName element = reference.getElement();
+ // Null represents empty message
+ if (element != null)
+ {
+ buffer.append("<part name='" + reference.getPartName() + '\'');
+ buffer.append(" element='" + getReferenceString(element) + "'/>");
+ }
+ }
+
+ WSDLBindingMessageReference bindingReference = getBindingReference(reference);
+ if (bindingReference == null)
+ return;
+
+ for (WSDLSOAPHeader header : bindingReference.getSoapHeaders())
+ {
+ if (header.isIncludeInSignature());
+ {
+ QName element = header.getElement();
+ buffer.append("<part name='" + header.getPartName() + '\'');
+ buffer.append(" element='" + getReferenceString(element) + "'/>");
+ }
+ }
+ }
+
+ private WSDLBindingMessageReference getBindingReference(WSDLInterfaceMessageReference reference)
+ {
+ WSDLInterfaceOperation operation = reference.getWsdlOperation();
+ WSDLInterface wsdlInterface = operation.getWsdlInterface();
+ WSDLBinding binding = wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
+ WSDLBindingOperation bindingOperation = binding.getOperationByRef(operation.getQName());
+ WSDLBindingMessageReference[] bindingReferences;
+
+ if (reference instanceof WSDLInterfaceOperationInput)
+ bindingReferences = bindingOperation.getInputs();
+ else
+ bindingReferences = bindingOperation.getOutputs();
+
+ if (bindingReferences.length > 1)
+ throw new IllegalArgumentException("WSDl 1.1 only supports In-Only, and In-Out MEPS, more than reference input found");
+
+ if (bindingReferences.length == 1)
+ return bindingReferences[0];
+
+ return null;
+ }
+
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] intfs = wsdl.getInterfaces();
+ for (int i = 0; i < intfs.length; i++)
+ {
+ WSDLInterface intf = intfs[i];
+ if (!namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ buffer.append("<portType name='" + intf.getName() + "'>");
+ appendPortOperations(buffer, intf);
+ buffer.append("</portType>");
+ }
+ }
+
+ private String getParameterOrder(WSDLInterfaceOperation operation)
+ {
+ StringBuilder builder = new StringBuilder();
+ for (WSDLRPCSignatureItem item : operation.getRpcSignatureItems())
+ {
+ if (item.getDirection() != Direction.RETURN)
+ {
+ if (builder.length() > 0)
+ builder.append(' ');
+ builder.append(item.getName());
+ }
+ }
+
+ return builder.toString();
+ }
+
+ protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
+ {
+ String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
+ WSDLInterfaceOperation[] operations = intf.getSortedOperations();
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLInterfaceOperation operation = operations[i];
+ buffer.append("<operation name='" + operation.getName().toString() + "'");
+
+ String parameterOrder = getParameterOrder(operation);
+ if (parameterOrder.length() > 0)
+ buffer.append(" parameterOrder='").append(parameterOrder).append("'");
+ buffer.append(">");
+
+ String opname = operation.getName().toString();
+ String interfaceName = operation.getWsdlInterface().getName().toString();
+ String msgEl = prefix + ":" + interfaceName + "_" + opname;
+
+ buffer.append("<input message='" + msgEl + "'>").append("</input>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
+ {
+ buffer.append("<output message='" + msgEl + "Response'>");
+ buffer.append("</output>");
+ }
+
+ //Append the Faults
+ for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
+ {
+ QName element = fault.getRef();
+ buffer.append("<fault message='" + utils.getFormattedString(element));
+ buffer.append("' name='" + element.getLocalPart() + "'/>");
+ }
+
+ buffer.append("</operation>");
+ }
+ }
+
+ protected void appendBindings(StringBuilder buffer, String namespace)
+ {
+ WSDLBinding[] bindings = wsdl.getBindings();
+ for (int i = 0; i < bindings.length; i++)
+ {
+ WSDLBinding binding = bindings[i];
+ if (!namespace.equals(binding.getQName().getNamespaceURI()))
+ continue;
+ buffer.append("<binding name='" + binding.getName() + "' type='" + getQNameRef(binding.getInterfaceName()) + "'>");
+ //TODO:Need to derive the WSDLStyle from the Style attribute of InterfaceOperation
+ if (wsdlStyle == null)
+ throw new IllegalArgumentException("WSDL Style is null (should be rpc or document");
+ String style = "rpc";
+ if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
+ style = "document";
+ buffer.append("<" + soapPrefix + ":binding transport='http://schemas.xmlsoap.org/soap/http' style='" + style + "'/>");
+ appendBindingOperations(buffer, binding);
+ buffer.append("</binding>");
+ }
+ }
+
+ protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
+ {
+ WSDLBindingOperation[] operations = binding.getOperations();
+ Arrays.sort(operations);
+
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLBindingOperation operation = operations[i];
+ String interfaceName = operation.getWsdlBinding().getInterfaceName().getLocalPart();
+
+ WSDLInterface wsdlInterface = wsdl.getInterface(new NCName(interfaceName));
+ if (wsdlInterface == null)
+ throw new WSException("WSDL Interface should not be null");
+ WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
+
+ buffer.append("<operation name='" + interfaceOperation.getName() + "'>");
+ String soapAction = (operation.getSOAPAction() != null ? operation.getSOAPAction() : "");
+ buffer.append("<" + soapPrefix + ":operation soapAction=\"" + soapAction + "\"/>");
+
+ WSDLBindingOperationInput[] inputs = operation.getInputs();
+ if (inputs.length != 1)
+ throw new WSException("WSDl 1.1 only supports In-Only, and In-Out MEPS.");
+
+ buffer.append("<input>");
+ appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
+ buffer.append("</input>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(getBindingOperationPattern(operation)))
+ {
+ buffer.append("<output>");
+ WSDLBindingOperationOutput[] outputs = operation.getOutputs();
+ appendSOAPBinding(buffer, wsdlInterface, operation, outputs);
+ buffer.append("</output>");
+ }
+
+ //Append faults
+ WSDLInterfaceOperationOutfault[] faults = interfaceOperation.getOutfaults();
+ if (faults != null)
+ {
+ for (WSDLInterfaceOperationOutfault fault : faults)
+ {
+ String n = "name='" + fault.getRef().getLocalPart() + "'";
+ buffer.append("<fault " + n + ">");
+ buffer.append("<" + soapPrefix + ":fault " + n + " use='literal' />");
+ buffer.append("</fault>");
+ }
+ buffer.append("</operation>");
+ }
+ }
+ }
+
+ private void appendSOAPBinding(StringBuilder buffer, WSDLInterface wsdlInterface, WSDLBindingOperation operation, WSDLBindingMessageReference[] inputs)
+ {
+ String tns = wsdl.getTargetNamespace();
+ WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
+ WSDLInterfaceMessageReference reference = (inputs instanceof WSDLBindingOperationInput[]) ? interfaceOperation.getInputs()[0]
+ : interfaceOperation.getOutputs()[0];
+
+ StringBuilder bodyParts = new StringBuilder();
+ if (Constants.DOCUMENT_LITERAL == wsdlStyle)
+ {
+ bodyParts.append(reference.getPartName());
+ }
+ else
+ {
+ for (WSDLRPCPart part : reference.getChildParts())
+ {
+ if (bodyParts.length() > 0)
+ bodyParts.append(" ");
+ bodyParts.append(part.getName());
+ }
+ }
+
+ StringBuilder soapHeader = new StringBuilder();
+ for (WSDLSOAPHeader header : inputs[0].getSoapHeaders())
+ {
+ if (header.isIncludeInSignature())
+ {
+ String messageName = wsdlInterface.getName() + "_" + operation.getRef().getLocalPart();
+ if (reference instanceof WSDLInterfaceOperationOutput)
+ messageName += "Response";
+ soapHeader.append("<").append(soapPrefix).append(":header use='literal' message='tns:").append(messageName);
+ soapHeader.append("' part='").append(header.getElement().getLocalPart()).append("'/>");
+ }
+ }
+
+ buffer.append("<" + soapPrefix + ":body use='literal'");
+ if (wsdlStyle != Constants.DOCUMENT_LITERAL)
+ buffer.append(" namespace='" + tns + "'");
+ if (soapHeader.length() > 0)
+ {
+ buffer.append(" parts='").append(bodyParts).append("'/>");
+ buffer.append(soapHeader);
+ }
+ else
+ {
+ buffer.append("/>");
+ }
+ }
+
+ private String getBindingOperationPattern(WSDLBindingOperation operation)
+ {
+ WSDLBinding binding = operation.getWsdlBinding();
+ String pattern = binding.getInterface().getOperation(new NCName(operation.getRef().getLocalPart())).getPattern();
+
+ return pattern;
+ }
+
+ protected void appendServices(StringBuilder buffer, String namespace)
+ {
+ WSDLService[] services = wsdl.getServices();
+ int len = services.length;
+ for (int i = 0; i < len; i++)
+ {
+
+ WSDLService service = services[i];
+ if (!namespace.equals(service.getQName().getNamespaceURI()))
+ continue;
+ buffer.append("<service name='" + service.getName() + "'>");
+ WSDLEndpoint[] endpoints = service.getEndpoints();
+ int lenend = endpoints.length;
+ for (int j = 0; j < lenend; j++)
+ {
+ WSDLEndpoint endpoint = endpoints[j];
+ appendServicePort(buffer, endpoint);
+ }
+
+ buffer.append("</service>");
+ }
+ }
+
+ protected void appendServicePort(StringBuilder buffer, WSDLEndpoint endpoint)
+ {
+ String name = endpoint.getName().toString();
+ QName endpointBinding = endpoint.getBinding();
+ String prefix = endpointBinding.getPrefix();
+ prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
+ String ebname = prefix + ":" + endpointBinding.getLocalPart();
+ buffer.append("<port name='" + name + "' binding='" + ebname + "'>");
+ buffer.append("<" + soapPrefix + ":address location='" + endpoint.getAddress() + "'/>");
+ buffer.append("</port>");
+ }
+}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLDefinitionsFactory.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -1,196 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.tools.wsdl;
-
-// $Id$
-
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.ConnectException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.parsers.DocumentBuilder;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLException;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.EntityResolver;
-
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
-/**
- * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
- *
- * This implementations deals with different WSDL versions so that clients of this
- * factory do need to know about WSDL version specifics. The Java object view of the
- * WSDL document (WSDLDefinitions) is modeled on WSDL-2.0
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLDefinitionsFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
-
- // This feature is set by default in wsdl4j, it means the object structure contains the imported arguments
- public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
- // Set this feature for additional debugging output
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
-
- // The WSDL reader features
- private Map features = new HashMap();
-
- // Hide constructor
- private WSDLDefinitionsFactory()
- {
- }
-
- /**
- * Create a new instance of a wsdl factory
- */
- public static WSDLDefinitionsFactory newInstance()
- {
- return new WSDLDefinitionsFactory();
- }
-
- /**
- * Set a feature on the underlying reader
- */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- features.put(name, new Boolean(value));
- }
-
- /**
- * Read the wsdl document from the given URL
- */
- public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
- {
- if (wsdlLocation == null)
- throw new IllegalArgumentException("URL cannot be null");
-
- log.debug("parse: " + wsdlLocation.toExternalForm());
-
- EntityResolver entityResolver = new JBossWSEntityResolver();
- WSDLDefinitions wsdlDefinitions = null;
- try
- {
- Document wsdlDoc = getDocument(wsdlLocation);
- String defaultNamespace = getDefaultNamespace(wsdlDoc);
- if (Constants.NS_WSDL11.equals(defaultNamespace))
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
-
- // Setup reader features
- Iterator it = features.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Boolean flag = (Boolean)entry.getValue();
- wsdlReader.setFeature(key, flag.booleanValue());
- }
-
- // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
- ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
-
- Definition definition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
- wsdlDefinitions = new WSDL11Reader().processDefinition(definition, wsdlLocation);
- wsdlDefinitions.setWsdlDocument(wsdlDoc);
- }
- else
- throw new WSDLException("Invalid default namespace: " + defaultNamespace);
-
- if (log.isTraceEnabled())
- {
- StringWriter stwr = new StringWriter();
- WSDL11Writer wsdlWriter = new WSDL11Writer(wsdlDefinitions);
- wsdlWriter.write(stwr);
- log.trace("\n" + stwr.toString());
- }
- }
- catch (WSDLException e)
- {
- throw e;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSDLException(e);
- }
-
- return wsdlDefinitions;
- }
-
- /** Get the WSDL document.
- */
- private Document getDocument(URL wsdlLocation) throws WSDLException
- {
- try
- {
- InputStream wsdlInputStream = wsdlLocation.openStream();
- try
- {
- DocumentBuilder builder = DOMUtils.getDocumentBuilder();
- return builder.parse(wsdlInputStream);
- }
- finally
- {
- wsdlInputStream.close();
- }
- }
- catch (ConnectException ex)
- {
- throw new WSDLException("Cannot connect to: " + wsdlLocation);
- }
- catch (Exception ex)
- {
- throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation, ex);
- }
- }
-
- /** Get the default namespace for the given WSDL
- */
- private String getDefaultNamespace(Document wsdlDoc) throws WSDLException
- {
- Element root = wsdlDoc.getDocumentElement();
- String defaultNamespace = root.getNamespaceURI();
- return defaultNamespace;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLDefinitionsFactory.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLDefinitionsFactory.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,196 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.wsdl;
+
+// $Id$
+
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.ConnectException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.parsers.DocumentBuilder;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
+/**
+ * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
+ *
+ * This implementations deals with different WSDL versions so that clients of this
+ * factory do need to know about WSDL version specifics. The Java object view of the
+ * WSDL document (WSDLDefinitions) is modeled on WSDL-2.0
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLDefinitionsFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
+
+ // This feature is set by default in wsdl4j, it means the object structure contains the imported arguments
+ public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
+ // Set this feature for additional debugging output
+ public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
+
+ // The WSDL reader features
+ private Map features = new HashMap();
+
+ // Hide constructor
+ private WSDLDefinitionsFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a wsdl factory
+ */
+ public static WSDLDefinitionsFactory newInstance()
+ {
+ return new WSDLDefinitionsFactory();
+ }
+
+ /**
+ * Set a feature on the underlying reader
+ */
+ public void setFeature(String name, boolean value) throws IllegalArgumentException
+ {
+ features.put(name, new Boolean(value));
+ }
+
+ /**
+ * Read the wsdl document from the given URL
+ */
+ public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
+ {
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("URL cannot be null");
+
+ log.debug("parse: " + wsdlLocation.toExternalForm());
+
+ EntityResolver entityResolver = new JBossWSEntityResolver();
+ WSDLDefinitions wsdlDefinitions = null;
+ try
+ {
+ Document wsdlDoc = getDocument(wsdlLocation);
+ String defaultNamespace = getDefaultNamespace(wsdlDoc);
+ if (Constants.NS_WSDL11.equals(defaultNamespace))
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+
+ // Setup reader features
+ Iterator it = features.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Boolean flag = (Boolean)entry.getValue();
+ wsdlReader.setFeature(key, flag.booleanValue());
+ }
+
+ // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+ ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
+
+ Definition definition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
+ wsdlDefinitions = new WSDL11Reader().processDefinition(definition, wsdlLocation);
+ wsdlDefinitions.setWsdlDocument(wsdlDoc);
+ }
+ else
+ throw new WSDLException("Invalid default namespace: " + defaultNamespace);
+
+ if (log.isTraceEnabled())
+ {
+ StringWriter stwr = new StringWriter();
+ WSDL11Writer wsdlWriter = new WSDL11Writer(wsdlDefinitions);
+ wsdlWriter.write(stwr);
+ log.trace("\n" + stwr.toString());
+ }
+ }
+ catch (WSDLException e)
+ {
+ throw e;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSDLException(e);
+ }
+
+ return wsdlDefinitions;
+ }
+
+ /** Get the WSDL document.
+ */
+ private Document getDocument(URL wsdlLocation) throws WSDLException
+ {
+ try
+ {
+ InputStream wsdlInputStream = wsdlLocation.openStream();
+ try
+ {
+ DocumentBuilder builder = DOMUtils.getDocumentBuilder();
+ return builder.parse(wsdlInputStream);
+ }
+ finally
+ {
+ wsdlInputStream.close();
+ }
+ }
+ catch (ConnectException ex)
+ {
+ throw new WSDLException("Cannot connect to: " + wsdlLocation);
+ }
+ catch (Exception ex)
+ {
+ throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation, ex);
+ }
+ }
+
+ /** Get the default namespace for the given WSDL
+ */
+ private String getDefaultNamespace(Document wsdlDoc) throws WSDLException
+ {
+ Element root = wsdlDoc.getDocumentElement();
+ String defaultNamespace = root.getNamespaceURI();
+ return defaultNamespace;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLLocatorImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLLocatorImpl.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -1,159 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.wsdl.xml.WSDLLocator;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-/* A WSDLLocator that can handle wsdl imports
- */
-class WSDLLocatorImpl implements WSDLLocator
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
-
- private EntityResolver entityResolver;
- private URL wsdlURL;
- private String latestImportURI;
-
- public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
- {
- if (wsdlFile == null)
- throw new IllegalArgumentException("WSDL file argument cannot be null");
-
- this.entityResolver = entityResolver;
- this.wsdlURL = wsdlFile;
- }
-
- public InputSource getBaseInputSource()
- {
- log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
- try
- {
- InputStream is = wsdlURL.openStream();
- if (is == null)
- throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
-
- return new InputSource(is);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
- }
- }
-
- public String getBaseURI()
- {
- return wsdlURL.toExternalForm();
- }
-
- public InputSource getImportInputSource(String parent, String resource)
- {
- log.trace("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
-
- URL parentURL = null;
- try
- {
- parentURL = new URL(parent);
- }
- catch (MalformedURLException e)
- {
- log.error("Not a valid URL: " + parent);
- return null;
- }
-
- String wsdlImport = null;
- String external = parentURL.toExternalForm();
-
- // An external URL
- if (resource.startsWith("http://") || resource.startsWith("https://"))
- {
- wsdlImport = resource;
- }
-
- // Absolute path
- else if (resource.startsWith("/"))
- {
- String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
- wsdlImport = beforePath + resource;
- }
-
- // A relative path
- else
- {
- String parentDir = external.substring(0, external.lastIndexOf("/"));
-
- // remove references to current dir
- while (resource.startsWith("./"))
- resource = resource.substring(2);
-
- // remove references to parentdir
- while (resource.startsWith("../"))
- {
- parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
- resource = resource.substring(3);
- }
-
- wsdlImport = parentDir + "/" + resource;
- }
-
- try
- {
- log.trace("Trying to resolve: " + wsdlImport);
- InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
- if (inputSource != null)
- {
- latestImportURI = wsdlImport;
- }
- else
- {
- throw new IllegalArgumentException("Cannot resolve imported resource: " + wsdlImport);
- }
-
- return inputSource;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
- }
- }
-
- public String getLatestImportURI()
- {
- return latestImportURI;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLLocatorImpl.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLLocatorImpl.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.wsdl.xml.WSDLLocator;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+/* A WSDLLocator that can handle wsdl imports
+ */
+class WSDLLocatorImpl implements WSDLLocator
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
+
+ private EntityResolver entityResolver;
+ private URL wsdlURL;
+ private String latestImportURI;
+
+ public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
+ {
+ if (wsdlFile == null)
+ throw new IllegalArgumentException("WSDL file argument cannot be null");
+
+ this.entityResolver = entityResolver;
+ this.wsdlURL = wsdlFile;
+ }
+
+ public InputSource getBaseInputSource()
+ {
+ log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+ try
+ {
+ InputStream is = wsdlURL.openStream();
+ if (is == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
+
+ return new InputSource(is);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
+ }
+ }
+
+ public String getBaseURI()
+ {
+ return wsdlURL.toExternalForm();
+ }
+
+ public InputSource getImportInputSource(String parent, String resource)
+ {
+ log.trace("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
+
+ URL parentURL = null;
+ try
+ {
+ parentURL = new URL(parent);
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Not a valid URL: " + parent);
+ return null;
+ }
+
+ String wsdlImport = null;
+ String external = parentURL.toExternalForm();
+
+ // An external URL
+ if (resource.startsWith("http://") || resource.startsWith("https://"))
+ {
+ wsdlImport = resource;
+ }
+
+ // Absolute path
+ else if (resource.startsWith("/"))
+ {
+ String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
+ wsdlImport = beforePath + resource;
+ }
+
+ // A relative path
+ else
+ {
+ String parentDir = external.substring(0, external.lastIndexOf("/"));
+
+ // remove references to current dir
+ while (resource.startsWith("./"))
+ resource = resource.substring(2);
+
+ // remove references to parentdir
+ while (resource.startsWith("../"))
+ {
+ parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
+ resource = resource.substring(3);
+ }
+
+ wsdlImport = parentDir + "/" + resource;
+ }
+
+ try
+ {
+ log.trace("Trying to resolve: " + wsdlImport);
+ InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
+ if (inputSource != null)
+ {
+ latestImportURI = wsdlImport;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot resolve imported resource: " + wsdlImport);
+ }
+
+ return inputSource;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
+ }
+ }
+
+ public String getLatestImportURI()
+ {
+ return latestImportURI;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriter.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriter.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -1,228 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.tools.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.wsdl.DOMTypes;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
-import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.common.metadata.wsdl.XSModelTypes;
-import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A helper that writes out a WSDL definition
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLWriter
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(WSDLWriter.class);
-
- protected WSDLDefinitions wsdl;
- protected WSDLUtils utils = WSDLUtils.getInstance();
-
- // The soap prefix
- protected String soapPrefix = "soap";
-
- /**
- * Include or import WSDL Types
- */
- protected boolean includeSchemaInWSDL = true;
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- public WSDLWriter(WSDLDefinitions wsdl)
- {
- if (wsdl == null)
- throw new IllegalArgumentException("WSDL definitions is NULL");
-
- this.wsdl = wsdl;
- }
-
- /** Write the wsdl definition to the given writer, clients should not care about the wsdl version. */
- public void write(Writer writer, String charset) throws IOException
- {
- write(writer, charset, null);
- }
-
- public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws IOException
- {
- String wsdlNamespace = wsdl.getWsdlNamespace();
- if (Constants.NS_WSDL11.equals(wsdlNamespace))
- {
- WSDL11Writer wsdl11Writer = new WSDL11Writer(wsdl);
- wsdl11Writer.write(writer, charset, resolver);
- }
- else
- {
- throw new WSException("Unsupported wsdl version: " + wsdlNamespace);
- }
- }
-
- public void write(Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(Constants.XML_HEADER);
-
- appendDefinitions(buffer, wsdl.getTargetNamespace());
- appendTypes(buffer, wsdl.getTargetNamespace());
- appendInterfaces(buffer, wsdl.getTargetNamespace());
- appendBindings(buffer, wsdl.getTargetNamespace());
- appendServices(buffer, wsdl.getTargetNamespace());
-
- buffer.append("</definitions>");
-
- Element element = DOMUtils.parse(buffer.toString());
- new DOMWriter(writer).setPrettyprint(true).print(element);
- }
-
- protected void appendDefinitions(StringBuilder buffer, String namespace)
- {
- buffer.append("<definitions");
- //Append service name as done by wscompile, if there is just one
- WSDLService[] services = wsdl.getServices();
- if (services != null && services.length == 1)
- {
- WSDLService ser = services[0];
- buffer.append(" name='" + ser.getName() + "'");
- }
- buffer.append(" targetNamespace='" + namespace + "'");
- buffer.append(" xmlns='" + wsdl.getWsdlNamespace() + "'");
-
- Iterator it = wsdl.getRegisteredNamespaceURIs();
- while (it.hasNext())
- {
- String namespaceURI = (String)it.next();
- String prefix = wsdl.getPrefix(namespaceURI);
- if (prefix.length() > 0)
- {
- buffer.append(" xmlns:" + prefix + "='" + namespaceURI + "'");
- if (Constants.PREFIX_SOAP11.equals(prefix) || Constants.PREFIX_SOAP12.equals(prefix))
- soapPrefix = prefix;
- }
- }
- buffer.append(">");
- }
-
- protected void appendTypes(StringBuilder buffer, String namespace)
- {
- WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
- // If the type section is bound to a particular namespace, verify it mataches, otherwise skip
- if (wsdlTypes.getNamespace() != null && !wsdlTypes.getNamespace().equals(namespace))
- return;
-
- if (wsdlTypes instanceof XSModelTypes)
- {
- buffer.append("<types>");
- JBossXSModel xsM = WSDLUtils.getSchemaModel(wsdlTypes);
- String schema = xsM.serialize();
- buffer.append(schema);
- buffer.append("</types>");
- }
- else if (wsdlTypes instanceof DOMTypes)
- {
- synchronized (wsdlTypes)
- {
- buffer.append(DOMWriter.printNode(((DOMTypes)wsdlTypes).getElement(), true));
- }
- }
- }
-
- protected void appendInterfaces(StringBuilder buffer, String namespace)
- {
- }
-
- protected void appendBindings(StringBuilder buffer, String namespace)
- {
- }
-
- protected void appendServices(StringBuilder buffer, String namespace)
- {
- }
-
- /** Get a prefixed name of form prefix:localPart */
- protected String getQNameRef(QName qname)
- {
- String retStr = qname.getLocalPart();
-
- String prefix = qname.getPrefix();
- String nsURI = qname.getNamespaceURI();
- if (prefix.length() == 0 && nsURI.length() > 0)
- {
- qname = wsdl.registerQName(qname);
- prefix = qname.getPrefix();
- }
-
- if (prefix.length() > 0)
- retStr = prefix + ":" + retStr;
-
- return retStr;
- }
-
- public WSDLDefinitions getWsdl()
- {
- return wsdl;
- }
-
- public void setWsdl(WSDLDefinitions wsdl)
- {
- this.wsdl = wsdl;
- }
-
- public boolean isIncludeTypesInWSDL()
- {
- return includeSchemaInWSDL;
- }
-
- public void logException(Exception e)
- {
- if (log.isTraceEnabled())
- {
- log.trace(e);
- }
- }
-
- public void logMessage(String msg)
- {
- if (log.isTraceEnabled())
- {
- log.trace(msg);
- }
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriter.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriter.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,228 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.wsdl.DOMTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.common.metadata.wsdl.XSModelTypes;
+import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.w3c.dom.Element;
+
+/**
+ * A helper that writes out a WSDL definition
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLWriter
+{
+ // provide logging
+ protected static final Logger log = Logger.getLogger(WSDLWriter.class);
+
+ protected WSDLDefinitions wsdl;
+ protected WSDLUtils utils = WSDLUtils.getInstance();
+
+ // The soap prefix
+ protected String soapPrefix = "soap";
+
+ /**
+ * Include or import WSDL Types
+ */
+ protected boolean includeSchemaInWSDL = true;
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ public WSDLWriter(WSDLDefinitions wsdl)
+ {
+ if (wsdl == null)
+ throw new IllegalArgumentException("WSDL definitions is NULL");
+
+ this.wsdl = wsdl;
+ }
+
+ /** Write the wsdl definition to the given writer, clients should not care about the wsdl version. */
+ public void write(Writer writer, String charset) throws IOException
+ {
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws IOException
+ {
+ String wsdlNamespace = wsdl.getWsdlNamespace();
+ if (Constants.NS_WSDL11.equals(wsdlNamespace))
+ {
+ WSDL11Writer wsdl11Writer = new WSDL11Writer(wsdl);
+ wsdl11Writer.write(writer, charset, resolver);
+ }
+ else
+ {
+ throw new WSException("Unsupported wsdl version: " + wsdlNamespace);
+ }
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(Constants.XML_HEADER);
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ appendTypes(buffer, wsdl.getTargetNamespace());
+ appendInterfaces(buffer, wsdl.getTargetNamespace());
+ appendBindings(buffer, wsdl.getTargetNamespace());
+ appendServices(buffer, wsdl.getTargetNamespace());
+
+ buffer.append("</definitions>");
+
+ Element element = DOMUtils.parse(buffer.toString());
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendDefinitions(StringBuilder buffer, String namespace)
+ {
+ buffer.append("<definitions");
+ //Append service name as done by wscompile, if there is just one
+ WSDLService[] services = wsdl.getServices();
+ if (services != null && services.length == 1)
+ {
+ WSDLService ser = services[0];
+ buffer.append(" name='" + ser.getName() + "'");
+ }
+ buffer.append(" targetNamespace='" + namespace + "'");
+ buffer.append(" xmlns='" + wsdl.getWsdlNamespace() + "'");
+
+ Iterator it = wsdl.getRegisteredNamespaceURIs();
+ while (it.hasNext())
+ {
+ String namespaceURI = (String)it.next();
+ String prefix = wsdl.getPrefix(namespaceURI);
+ if (prefix.length() > 0)
+ {
+ buffer.append(" xmlns:" + prefix + "='" + namespaceURI + "'");
+ if (Constants.PREFIX_SOAP11.equals(prefix) || Constants.PREFIX_SOAP12.equals(prefix))
+ soapPrefix = prefix;
+ }
+ }
+ buffer.append(">");
+ }
+
+ protected void appendTypes(StringBuilder buffer, String namespace)
+ {
+ WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
+ // If the type section is bound to a particular namespace, verify it mataches, otherwise skip
+ if (wsdlTypes.getNamespace() != null && !wsdlTypes.getNamespace().equals(namespace))
+ return;
+
+ if (wsdlTypes instanceof XSModelTypes)
+ {
+ buffer.append("<types>");
+ JBossXSModel xsM = WSDLUtils.getSchemaModel(wsdlTypes);
+ String schema = xsM.serialize();
+ buffer.append(schema);
+ buffer.append("</types>");
+ }
+ else if (wsdlTypes instanceof DOMTypes)
+ {
+ synchronized (wsdlTypes)
+ {
+ buffer.append(DOMWriter.printNode(((DOMTypes)wsdlTypes).getElement(), true));
+ }
+ }
+ }
+
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
+ {
+ }
+
+ protected void appendBindings(StringBuilder buffer, String namespace)
+ {
+ }
+
+ protected void appendServices(StringBuilder buffer, String namespace)
+ {
+ }
+
+ /** Get a prefixed name of form prefix:localPart */
+ protected String getQNameRef(QName qname)
+ {
+ String retStr = qname.getLocalPart();
+
+ String prefix = qname.getPrefix();
+ String nsURI = qname.getNamespaceURI();
+ if (prefix.length() == 0 && nsURI.length() > 0)
+ {
+ qname = wsdl.registerQName(qname);
+ prefix = qname.getPrefix();
+ }
+
+ if (prefix.length() > 0)
+ retStr = prefix + ":" + retStr;
+
+ return retStr;
+ }
+
+ public WSDLDefinitions getWsdl()
+ {
+ return wsdl;
+ }
+
+ public void setWsdl(WSDLDefinitions wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public boolean isIncludeTypesInWSDL()
+ {
+ return includeSchemaInWSDL;
+ }
+
+ public void logException(Exception e)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace(e);
+ }
+ }
+
+ public void logMessage(String msg)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace(msg);
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriterResolver.java (from rev 1574, branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/wsdl/WSDLWriterResolver.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * A helper that writes out a WSDL definition
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class WSDLWriterResolver
+{
+ public String actualFile;
+ public String charset;
+ public Writer writer;
+
+ public abstract WSDLWriterResolver resolve(String suggestedFile) throws IOException;
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -86,6 +86,8 @@
import org.jboss.ws.common.utils.IOUtils;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.common.wsdl.WSDLWriter;
+import org.jboss.ws.common.wsdl.WSDLWriterResolver;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.core.jaxws.WrapperGenerator;
import org.jboss.ws.core.metadata.acessor.JAXBAccessor;
@@ -96,8 +98,6 @@
import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.jaxws.WSDLGenerator;
-import org.jboss.ws.tools.wsdl.WSDLWriter;
-import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -49,7 +49,7 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.tools.wsdl.WSDLWriter;
+import org.jboss.ws.common.wsdl.WSDLWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -41,10 +41,10 @@
import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
+import org.jboss.ws.common.wsdl.WSDL11DefinitionFactory;
import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCClientDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
/**
* Binds a JAXRPC Service object in the client's ENC for every service-ref element in the
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -40,9 +40,9 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.common.wsdl.WSDLWriter;
import org.jboss.ws.tools.Configuration.OperationConfig;
import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
-import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -58,8 +58,8 @@
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -55,6 +55,7 @@
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.common.utils.IOUtils;
import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.common.wsdl.WSDLWriter;
import org.jboss.ws.tools.Configuration;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.JavaWriter;
@@ -68,7 +69,6 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.tools.wsdl.WSDLWriter;
/**
* Helper class used by the command line tool "jbossws"
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -27,7 +27,7 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Tests WSDL11Reader ability to parse WSDL Files
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -27,7 +27,7 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test the XSModel, and how it handles multiple schemas
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -31,7 +31,7 @@
import org.jboss.net.protocol.URLStreamHandlerFactory;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
+import org.jboss.ws.common.wsdl.WSDL11DefinitionFactory;
/**
* Test a wsdl import functionality.
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -38,8 +38,8 @@
import org.jboss.ws.common.metadata.wsdl.WSDLService;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.extras.eventing.EventingConstants;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -28,7 +28,7 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* The WSDL may contain or import XSD schema definitions.
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Cannot handle xsd:import of xml schema
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -30,7 +30,7 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
*
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -26,7 +26,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* XML entity usage in wsdl contained schema
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -35,8 +35,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -35,8 +35,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -44,6 +44,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceExt;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.core.jaxrpc.StubExt;
@@ -58,7 +59,6 @@
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -36,6 +36,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.extras.addressing.AddressingClientUtil;
import org.jboss.ws.extras.eventing.EventSourceEndpoint;
@@ -46,7 +47,6 @@
import org.jboss.ws.extras.eventing.element.FilterType;
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Eventing test case support.
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS WebServiceContext
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -43,7 +43,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS Endpoint deployment
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -32,7 +32,7 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
*
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Investigate "Is Not A Servlet" error with multiple servlets in the web.xml
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* EJB3 jmx name is incorrectly derrived
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -30,7 +30,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
// $Id$
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -48,7 +48,7 @@
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareRequest;
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareResponse;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import javax.xml.namespace.QName;
import java.net.MalformedURLException;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -33,9 +33,9 @@
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDL20Writer;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.tools.wsdl.WSDL20Writer;
/**
* Test jbossws WSDL11 -> Java
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -33,10 +33,10 @@
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDL20Writer;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.tools.wsdl.WSDL20Writer;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test jbossws WSDL11 -> Java -> WSDL20
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -47,13 +47,13 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -35,12 +35,12 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.JavaToWSDL;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-06 14:12:50 UTC (rev 1574)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-06 14:17:04 UTC (rev 1575)
@@ -26,8 +26,8 @@
import junit.framework.TestCase;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Testcase to test the WSDL Validator
19 years, 5 months
JBossWS SVN: r1574 - branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-06 09:12:50 -0500 (Wed, 06 Dec 2006)
New Revision: 1574
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java
Log:
partial commit
Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java 2006-12-06 14:11:26 UTC (rev 1573)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java 2006-12-06 14:12:50 UTC (rev 1574)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * A helper that writes out a WSDL definition
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public abstract class WSDLWriterResolver
+{
+ public String actualFile;
+ public String charset;
+ public Writer writer;
+
+ public abstract WSDLWriterResolver resolve(String suggestedFile) throws IOException;
+}
Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriterResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years, 5 months
JBossWS SVN: r1573 - in branches/tdiesler/trunk/src: main/java/org/jboss/ws/common/metadata/wsdl main/java/org/jboss/ws/common/umdm main/java/org/jboss/ws/core main/java/org/jboss/ws/core/jaxrpc main/java/org/jboss/ws/core/jaxws/core main/java/org/jboss/ws/core/metadata/builder/jaxws main/java/org/jboss/ws/core/server main/java/org/jboss/ws/core/soap main/java/org/jboss/ws/extras/xop main/java/org/jboss/ws/integration/jboss50 main/java/org/jboss/ws/tools main/java/org/jboss/ws/tools/helper
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-06 09:11:26 -0500 (Wed, 06 Dec 2006)
New Revision: 1573
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/SOAPMessageMarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/SOAPMessageUnMarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLLocatorImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitions.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/HTTPBindingJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/MessageBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/PayloadBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
Log:
partial commit
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,96 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import java.net.URL;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.xml.sax.EntityResolver;
-
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
-/**
- * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-April-2004
- */
-public class WSDL11DefinitionFactory
-{
- // provide logging
- private static Logger log = Logger.getLogger(WSDL11DefinitionFactory.class);
-
- // This feature is set by default in wsdl4j, it means the object structore contains the imported arguments
- public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
- // Set this feature for additional debugging output
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
-
- // The WSDLReader that is used by this factory
- private WSDLReader wsdlReader;
-
- // Hide constructor
- private WSDL11DefinitionFactory() throws WSDLException
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- wsdlReader = wsdlFactory.newWSDLReader();
- wsdlReader.setFeature(WSDL11DefinitionFactory.FEATURE_VERBOSE, false);
- }
-
- /** Create a new instance of a wsdl factory */
- public static WSDL11DefinitionFactory newInstance() throws WSDLException
- {
- return new WSDL11DefinitionFactory();
- }
-
- /** Set a feature on the underlying reader */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- wsdlReader.setFeature(name, value);
- }
-
- /**
- * Read the wsdl document from the given URL
- */
- public Definition parse(URL wsdlLocation) throws WSDLException
- {
- if (wsdlLocation == null)
- throw new IllegalArgumentException("URL cannot be null");
-
- log.trace("parse: " + wsdlLocation.toExternalForm());
-
- EntityResolver entityResolver = new JBossWSEntityResolver();
-
- // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
- ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
-
- Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
- return wsdlDefinition;
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,1196 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.Binding;
-import javax.wsdl.BindingInput;
-import javax.wsdl.BindingOperation;
-import javax.wsdl.BindingOutput;
-import javax.wsdl.Definition;
-import javax.wsdl.Fault;
-import javax.wsdl.Import;
-import javax.wsdl.Input;
-import javax.wsdl.Message;
-import javax.wsdl.Operation;
-import javax.wsdl.Output;
-import javax.wsdl.Part;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.mime.MIMEContent;
-import javax.wsdl.extensions.mime.MIMEMultipartRelated;
-import javax.wsdl.extensions.mime.MIMEPart;
-import javax.wsdl.extensions.schema.Schema;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap.SOAPBody;
-import javax.wsdl.extensions.soap.SOAPHeader;
-import javax.wsdl.extensions.soap.SOAPOperation;
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.jaxrpc.Style;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.tools.JavaToXSD;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @since 10-Oct-2004
- */
-public class WSDL11Reader
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDL11Reader.class);
-
- private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12, "binding");
- private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
- private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12, "operation");
- private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
-
- private WSDLDefinitions destWsdl;
-
- // Maps wsdl message parts to their corresponding element names
- private Map<String, QName> messagePartToElementMap = new HashMap<String, QName>();
-
- // Map of <ns,URL> for schemalocation keyed by namespace
- private Map<String, URL> schemaLocationsMap = new HashMap<String, URL>();
-
- private LinkedHashMap<QName, Binding> allBindings;
- private LinkedHashMap<QName, Binding> portTypeBindings;
-
- // Temporary files used by this reader.
- private List<File> tempFiles = new ArrayList<File>();
-
- /**
- * Takes a WSDL11 Definition element and converts into
- * our object graph that has been developed for WSDL20
- *
- * @param srcWsdl The src WSDL11 definition
- * @param wsdlLoc The source location, if null we cannot process imports or includes
- */
- public WSDLDefinitions processDefinition(Definition srcWsdl, URL wsdlLoc) throws IOException
- {
- log.trace("processDefinition: " + wsdlLoc);
-
- destWsdl = new WSDLDefinitions();
- destWsdl.setWsdlTypes(new XSModelTypes());
- destWsdl.setWsdlOneOneDefinition(srcWsdl);
- destWsdl.setWsdlNamespace(Constants.NS_WSDL11);
-
- processNamespaces(srcWsdl);
- processTypes(srcWsdl, wsdlLoc);
- processServices(srcWsdl);
-
- if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
- processUnreachableBindings(srcWsdl);
-
- cleanupTemporaryFiles();
-
- return destWsdl;
- }
-
- private void cleanupTemporaryFiles()
- {
- for (File current : tempFiles)
- {
- current.delete();
- }
- }
-
- // process all bindings not within service separetly
- private void processUnreachableBindings(Definition srcWsdl)
- {
- log.trace("processUnreachableBindings");
-
- Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
- while (it.hasNext())
- {
- Binding srcBinding = (Binding)it.next();
- QName srcQName = srcBinding.getQName();
-
- WSDLBinding destBinding = destWsdl.getBinding(new NCName(srcQName));
- if (destBinding == null)
- {
- processBinding(srcWsdl, srcBinding);
- }
- }
- }
-
- private void processNamespaces(Definition srcWsdl)
- {
- String targetNS = srcWsdl.getTargetNamespace();
- destWsdl.setTargetNamespace(targetNS);
-
- // Copy wsdl namespaces
- Map nsMap = srcWsdl.getNamespaces();
- Iterator iter = nsMap.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry entry = (Map.Entry)iter.next();
- String prefix = (String)entry.getKey();
- String nsURI = (String)entry.getValue();
- destWsdl.registerNamespaceURI(nsURI, prefix);
- }
- }
-
- private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException
- {
- log.trace("BEGIN processTypes: " + wsdlLoc);
-
- WSDLTypes destTypes = destWsdl.getWsdlTypes();
-
- Types srcTypes = srcWsdl.getTypes();
- if (srcTypes != null && srcTypes.getExtensibilityElements().size() > 0)
- {
- List extElements = srcTypes.getExtensibilityElements();
- int len = extElements.size();
-
- for (int i = 0; i < len; i++)
- {
- ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
-
- Element domElement;
- if (extElement instanceof Schema)
- {
- domElement = ((Schema)extElement).getElement();
- }
- else if (extElement instanceof UnknownExtensibilityElement)
- {
- domElement = ((UnknownExtensibilityElement)extElement).getElement();
- }
- else
- {
- throw new WSException("Unsupported extensibility element: " + extElement);
- }
-
- Element domElementClone = (Element)domElement.cloneNode(true);
- copyParentNamespaceDeclarations(domElementClone, domElement);
-
- String localname = domElementClone.getLocalName();
- try
- {
- if ("import".equals(localname))
- {
- processSchemaImport(destTypes, wsdlLoc, domElementClone);
- }
- else if ("schema".equals(localname))
- {
- processSchemaInclude(destTypes, wsdlLoc, domElementClone);
- }
- else
- {
- throw new IllegalArgumentException("Unsuported schema element: " + localname);
- }
- }
- catch (IOException e)
- {
- throw new WSException("Cannot extract schema definition", e);
- }
- }
-
- if (len > 0)
- {
- JavaToXSD jxsd = new JavaToXSD();
- JBossXSModel xsmodel = jxsd.parseSchema(schemaLocationsMap);
- WSDLUtils.addSchemaModel(destTypes, destWsdl.getTargetNamespace(), xsmodel);
- }
- }
- else
- {
- log.trace("Empty wsdl types element, processing imports");
- Iterator it = srcWsdl.getImports().values().iterator();
- while (it.hasNext())
- {
- List<Import> srcImports = (List<Import>)it.next();
- for (Import srcImport : srcImports)
- {
- Definition impDefinition = srcImport.getDefinition();
- String impLoc = impDefinition.getDocumentBaseURI();
- processTypes(impDefinition, new URL(impLoc));
- }
- }
- }
-
- log.trace("END processTypes: " + wsdlLoc + "\n" + destTypes);
- }
-
- private void copyParentNamespaceDeclarations(Element destElement, Element srcElement)
- {
- Node parent = srcElement.getParentNode();
- while (parent != null)
- {
- if (parent.hasAttributes())
- {
- NamedNodeMap attributes = parent.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++)
- {
- Attr attr = (Attr)attributes.item(i);
- String name = attr.getName();
- String value = attr.getValue();
- if (name.startsWith("xmlns:") && destElement.hasAttribute(name) == false)
- destElement.setAttribute(name, value);
- }
- }
- parent = parent.getParentNode();
- }
- }
-
- private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl) throws IOException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process import, parent location not set");
-
- log.trace("processSchemaImport: " + wsdlLoc);
-
- String location = getOptionalAttribute(importEl, "schemaLocation");
- if (location == null)
- throw new IllegalArgumentException("schemaLocation is null for xsd:import");
-
- URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
- URL newloc = processSchemaInclude(types, locationURL, rootElement);
- if (newloc != null)
- importEl.setAttribute("schemaLocation", newloc.toExternalForm());
- }
-
- private URL processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl) throws IOException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process iclude, parent location not set");
-
- File tmpFile = null;
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process include, parent location not set");
-
- log.trace("processSchemaInclude: " + wsdlLoc);
-
- String schemaPrefix = schemaEl.getPrefix();
-
- String importTag = (schemaPrefix == null) ? "import" : schemaPrefix + ":import";
- Element importElement = schemaEl.getOwnerDocument().createElementNS(Constants.NS_SCHEMA_XSD, importTag);
- importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
- schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
-
- // Handle schema includes
- Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "include"));
- while (it.hasNext())
- {
- Element includeEl = (Element)it.next();
- String location = getOptionalAttribute(includeEl, "schemaLocation");
- if (location == null)
- throw new IllegalArgumentException("schemaLocation is null for xsd:include");
-
- URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
- URL newloc = processSchemaInclude(types, locationURL, rootElement);
- if (newloc != null)
- includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
- }
-
- String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
- if (targetNS != null)
- {
- log.trace("processSchemaInclude: [targetNS=" + targetNS + ",parentURL=" + wsdlLoc + "]");
-
- tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
- tempFiles.add(tmpFile);
-
- FileWriter fwrite = new FileWriter(tmpFile);
- new DOMWriter(fwrite).setPrettyprint(true).print(schemaEl);
- fwrite.close();
-
- schemaLocationsMap.put(targetNS, tmpFile.toURL());
- }
-
- // schema elements that have no target namespace are skipped
- //
- // <xsd:schema>
- // <xsd:import namespace="http://org.jboss.webservice/example/types" schemaLocation="Hello.xsd"/>
- // <xsd:import namespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservic..." schemaLocation="subdir/HelloArr.xsd"/>
- // </xsd:schema>
- if (targetNS == null)
- {
- log.trace("Schema element without target namespace in: " + wsdlLoc);
- }
-
- handleSchemaImports(schemaEl, wsdlLoc);
-
- return tmpFile != null ? tmpFile.toURL() : null;
- }
-
- private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws MalformedURLException
- {
- if (wsdlLoc == null)
- throw new IllegalArgumentException("Cannot process import, parent location not set");
-
- Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "import"));
- while (it.hasNext())
- {
- Element includeEl = (Element)it.next();
- String schemaLocation = getOptionalAttribute(includeEl, "schemaLocation");
- String namespace = getOptionalAttribute(includeEl, "namespace");
-
- log.trace("handleSchemaImport: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
-
- // Skip, let the entity resolver resolve these
- if (namespace != null && schemaLocation != null)
- {
- URL currLoc = getLocationURL(wsdlLoc, schemaLocation);
- schemaLocationsMap.put(namespace, currLoc);
- }
- else
- {
- log.trace("Skip schema import: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
- }
- }
- }
-
- private URL getLocationURL(URL parentURL, String location) throws MalformedURLException
- {
- log.trace("getLocationURL: [location=" + location + ",parent=" + parentURL + "]");
-
- URL locationURL = null;
- try
- {
- locationURL = new URL(location);
- }
- catch (MalformedURLException e)
- {
- // ignore malformed URL
- }
-
- if (locationURL == null)
- {
- String parentProtocol = parentURL.getProtocol();
- if (parentProtocol.equals("file") && !location.startsWith("/"))
- {
- String path = parentURL.toExternalForm();
- path = path.substring(0, path.lastIndexOf("/"));
- locationURL = new URL(path + "/" + location);
- }
- else if (parentProtocol.startsWith("http") && location.startsWith("/"))
- {
- String path = parentProtocol + "://" + parentURL.getHost() + ":" + parentURL.getPort();
- locationURL = new URL(path + location);
- }
- else if (parentProtocol.equals("jar") && !location.startsWith("/"))
- {
- String path = parentURL.toExternalForm();
- path = path.substring(0, path.lastIndexOf("/"));
- locationURL = new URL(path + "/" + location);
- }
- else
- {
- throw new WSException("Unsupported schemaLocation: " + location);
- }
- }
-
- log.trace("Modified schemaLocation: " + locationURL);
- return locationURL;
- }
-
- private void processPortType(Definition srcWsdl, PortType srcPortType)
- {
- log.trace("processPortType: " + srcPortType.getQName());
-
- QName qname = srcPortType.getQName();
- NCName ncName = new NCName(qname);
- if (destWsdl.getInterface(ncName) == null)
- {
- WSDLInterface destInterface = new WSDLInterface(destWsdl);
- destInterface.setName(ncName);
- destInterface.setQName(qname);
-
- // eventing extensions
- QName eventSourceProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
- if (eventSourceProp != null && eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
- {
- destInterface.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_EVENTSOURCE, eventSourceProp.getLocalPart()));
- }
-
- destWsdl.addInterface(destInterface);
-
- processPortTypeOperations(srcWsdl, destInterface, srcPortType);
- }
- }
-
- private void processPortTypeOperations(Definition srcWsdl, WSDLInterface destInterface, PortType srcPortType)
- {
- Iterator itOperations = srcPortType.getOperations().iterator();
- while (itOperations.hasNext())
- {
- Operation srcOperation = (Operation)itOperations.next();
-
- WSDLInterfaceOperation destOperation = new WSDLInterfaceOperation(destInterface);
- destOperation.setName(new NCName(srcOperation.getName()));
- destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
-
- processOperationInput(srcWsdl, srcOperation, destOperation, srcPortType);
- processOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType);
- processOperationFaults(srcOperation, destOperation, destInterface);
-
- destInterface.addOperation(destOperation);
- }
- }
-
- private void processOperationInput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
- {
- Input srcInput = srcOperation.getInput();
- if (srcInput != null)
- {
- Message srcMessage = srcInput.getMessage();
- log.trace("processOperationInput: " + srcMessage.getQName());
-
- QName wsaAction = (QName)srcInput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
- if (wsaAction != null)
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_IN, wsaAction.getLocalPart()));
-
- List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
- if (paramOrder != null)
- {
- for (String name : paramOrder)
- {
- if (srcMessage.getPart(name) != null)
- destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
- }
- }
-
- WSDLInterfaceOperationInput rpcInput = new WSDLInterfaceOperationInput(destOperation);
- for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(paramOrder))
- {
- if (Constants.URI_STYLE_IRI == destOperation.getStyle())
- {
- WSDLInterfaceOperationInput destInput = new WSDLInterfaceOperationInput(destOperation);
- QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- destInput.setElement(elementName);
-
- //Lets remember the Message name
- destInput.setMessageName(srcMessage.getQName());
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN, srcMessage.getQName().getLocalPart()));
-
- destInput.setPartName(srcPart.getName());
-
- destOperation.addInput(destInput);
- }
- else
- {
- // If we don't have a type then we aren't a valid RPC parameter
- // This could happen on a header element, in which case the
- // binding will pick it up
- QName xmlType = srcPart.getTypeName();
- if (xmlType != null)
- rpcInput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
- else
- messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- }
- }
- if (Constants.URI_STYLE_RPC == destOperation.getStyle())
- {
- // This is really a place holder, but also the actual value used in
- // WSDL 2.0 RPC bindings
- rpcInput.setElement(destOperation.getQName());
- rpcInput.setMessageName(srcMessage.getQName());
- destOperation.addInput(rpcInput);
- }
- }
- }
-
- private void processOperationOutput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
- {
- Output srcOutput = srcOperation.getOutput();
- if (srcOutput == null)
- {
- destOperation.setPattern(Constants.WSDL20_PATTERN_IN_ONLY);
- return;
- }
-
- Message srcMessage = srcOutput.getMessage();
- log.trace("processOperationOutput: " + srcMessage.getQName());
-
- destOperation.setPattern(Constants.WSDL20_PATTERN_IN_OUT);
- QName wsaAction = (QName) srcOutput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
- if (wsaAction != null)
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_OUT, wsaAction.getLocalPart()));
-
- List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
- if (paramOrder != null)
- {
- for (String name : paramOrder)
- {
- if (srcMessage.getPart(name) != null)
- {
- WSDLRPCSignatureItem item = destOperation.getRpcSignatureitem(name);
- if (item != null)
- item.setDirection(Direction.INOUT);
- else
- destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name, Direction.OUT));
- }
- }
- }
-
- WSDLInterfaceOperationOutput rpcOutput = new WSDLInterfaceOperationOutput(destOperation);
- for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(null))
- {
- if (Constants.URI_STYLE_IRI == destOperation.getStyle())
- {
- WSDLInterfaceOperationOutput destOutput = new WSDLInterfaceOperationOutput(destOperation);
-
- QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- destOutput.setElement(elementName);
-
- // Lets remember the Message name
- destOutput.setMessageName(srcMessage.getQName());
- destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName()
- .getLocalPart()));
-
- // Remember the original part name
- destOutput.setPartName(srcPart.getName());
-
- destOperation.addOutput(destOutput);
- }
- else
- {
- // If we don't have a type then we aren't a valid RPC parameter
- // This could happen on a header element, in which case the
- // binding will pick it up
- QName xmlType = srcPart.getTypeName();
- if (xmlType != null)
- rpcOutput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
- else
- messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
- }
- }
-
- if (Constants.URI_STYLE_RPC == destOperation.getStyle())
- {
- // This is really a place holder, but also the actual value used in
- // WSDL 2.0 RPC bindings
- QName name = destOperation.getQName();
- rpcOutput.setElement(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
- rpcOutput.setMessageName(srcMessage.getQName());
- destOperation.addOutput(rpcOutput);
- }
- }
-
- private void processOperationFaults(Operation srcOperation, WSDLInterfaceOperation destOperation, WSDLInterface destInterface)
- {
-
- Map faults = srcOperation.getFaults();
- Iterator itFaults = faults.values().iterator();
- while (itFaults.hasNext())
- {
- Fault srcFault = (Fault)itFaults.next();
- processOperationFault(destOperation, destInterface, srcFault);
- }
- }
-
- private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface destInterface, Fault srcFault)
- {
- String faultName = srcFault.getName();
- log.trace("processOperationFault: " + faultName);
-
- WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface);
- NCName ncName = new NCName(faultName);
- destFault.setName(ncName);
-
- Message message = srcFault.getMessage();
- QName messageName = message.getQName();
-
- Map partsMap = message.getParts();
- if (partsMap.size() != 1)
- throw new WSException("Unsupported number of fault parts in message " + messageName);
-
- Part part = (Part)partsMap.values().iterator().next();
- QName xmlName = part.getElementName();
-
- if (xmlName != null)
- {
- destFault.setElement(xmlName);
- }
- else
- {
- destFault.setElement(messageName);
- log.warn("Unsupported fault message part in message: " + messageName);
- }
-
- WSDLInterfaceFault prevFault = destInterface.getFault(ncName);
- if (prevFault != null && prevFault.getName().equals(ncName) == false)
- throw new WSException("Fault name must be unique: " + faultName);
-
- // Add the fault to the interface
- destInterface.addFault(destFault);
-
- // Add the fault refererence to the operation
- WSDLInterfaceOperationOutfault opOutFault = new WSDLInterfaceOperationOutfault(destOperation);
- opOutFault.setRef(new QName(destWsdl.getTargetNamespace(), faultName));
- destOperation.addOutfault(opOutFault);
- }
-
- /** Translate the message part name into an XML element name.
- */
- private QName messagePartToElementName(Definition srcWsdl, PortType srcPortType, Operation srcOperation, Message srcMessage, Part srcPart)
- {
- // <part name="param" element="tns:SomeType" />
- QName xmlName = srcPart.getElementName();
-
- // <part name="param" type="xsd:string" />
- if (xmlName == null)
- xmlName = new QName(srcPart.getName());
-
- xmlName = destWsdl.registerQName(xmlName);
- String key = srcMessage.getQName() + "->" + srcPart.getName();
- messagePartToElementMap.put(key, xmlName);
-
- return xmlName;
- }
-
- private BindingOperation getBindingOperation(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
- {
- Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
-
- if (srcBinding == null)
- throw new WSException("Cannot find binding for: " + srcPortType.getQName());
-
- String srcOperationName = srcOperation.getName();
- BindingOperation srcBindingOperation = srcBinding.getBindingOperation(srcOperationName, null, null);
- if (srcBindingOperation == null)
- throw new WSException("Cannot find binding operation for: " + srcOperationName);
- return srcBindingOperation;
- }
-
- private String getOperationStyle(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
- {
- Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
- BindingOperation srcBindingOperation = getBindingOperation(srcWsdl, srcPortType, srcOperation);
-
- String operationStyle = null;
- List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPOperation)
- {
- SOAPOperation soapOp = (SOAPOperation)extElement;
- operationStyle = soapOp.getStyle();
- }
- else if (SOAP12_OPERATION.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
- }
- }
-
- if (operationStyle == null)
- {
- for (ExtensibilityElement extElement : (List<ExtensibilityElement>) srcBinding.getExtensibilityElements())
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
- {
- SOAPBinding soapBinding = (SOAPBinding) extElement;
- operationStyle = soapBinding.getStyle();
- }
- else if (SOAP12_BINDING.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement) extElement).getElement();
- operationStyle = getOptionalAttribute(domElement, "style");
- }
- }
- }
-
- return ("rpc".equals(operationStyle)) ? Constants.URI_STYLE_RPC : Constants.URI_STYLE_IRI;
- }
-
- private void processBinding(Definition srcWsdl, Binding srcBinding)
- {
- QName srcBindingQName = srcBinding.getQName();
- log.trace("processBinding: " + srcBindingQName);
-
- NCName ncName = new NCName(srcBindingQName);
- if (destWsdl.getBinding(ncName) == null)
- {
- PortType srcPortType = srcBinding.getPortType();
- if (srcPortType == null)
- throw new WSException("Cannot find port type for binding: " + ncName);
-
- processPortType(srcWsdl, srcPortType);
-
- WSDLBinding destBinding = new WSDLBinding(destWsdl);
- destBinding.setQName(srcBindingQName);
- destBinding.setName(ncName);
- destBinding.setInterfaceName(srcPortType.getQName());
-
- String bindingStyle = Style.getDefaultStyle().toString();
- List<ExtensibilityElement> extList = srcBinding.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBinding)
- {
- destBinding.setType(Constants.NS_SOAP11);
- SOAPBinding soapBinding = (SOAPBinding)extElement;
- bindingStyle = soapBinding.getStyle();
- }
- else if (SOAP12_BINDING.equals(elementType))
- {
- destBinding.setType(Constants.NS_SOAP12);
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- bindingStyle = getOptionalAttribute(domElement, "style");
- }
- }
- destWsdl.addBinding(destBinding);
- processBindingOperations(destBinding, srcBinding, bindingStyle);
- }
- }
-
- private Map<QName, Binding> getPortTypeBindings(Definition srcWsdl)
- {
- getAllDefinedBindings(srcWsdl);
- return portTypeBindings;
- }
-
- private Map<QName, Binding> getAllDefinedBindings(Definition srcWsdl)
- {
- if (allBindings != null)
- return allBindings;
-
- allBindings = new LinkedHashMap<QName, Binding>();
- portTypeBindings = new LinkedHashMap<QName, Binding>();
- Map srcBindings = srcWsdl.getBindings();
- Iterator itBinding = srcBindings.values().iterator();
- while (itBinding.hasNext())
- {
- Binding srcBinding = (Binding)itBinding.next();
- allBindings.put(srcBinding.getQName(), srcBinding);
- portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
- }
-
- // Bindings not available when pulled in through <wsdl:import>
- // http://sourceforge.net/tracker/index.php?func=detail&aid=1240323&group_id...
- Iterator itService = srcWsdl.getServices().values().iterator();
- while (itService.hasNext())
- {
- Service srcService = (Service)itService.next();
- Iterator itPort = srcService.getPorts().values().iterator();
- while (itPort.hasNext())
- {
- Port srcPort = (Port)itPort.next();
- Binding srcBinding = srcPort.getBinding();
- allBindings.put(srcBinding.getQName(), srcBinding);
- portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
- }
- }
-
- return allBindings;
- }
-
- private void processBindingOperations(WSDLBinding destBinding, Binding srcBinding, String bindingStyle)
- {
- Iterator it = srcBinding.getBindingOperations().iterator();
- while (it.hasNext())
- {
- BindingOperation srcBindingOperation = (BindingOperation)it.next();
- processBindingOperation(destBinding, bindingStyle, srcBindingOperation);
- }
- }
-
- private void processBindingOperation(WSDLBinding destBinding, String bindingStyle, BindingOperation srcBindingOperation)
- {
- String srcBindingName = srcBindingOperation.getName();
- log.trace("processBindingOperation: " + srcBindingName);
-
- WSDLInterface destInterface = destBinding.getInterface();
- String namespaceURI = destInterface.getQName().getNamespaceURI();
-
- WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
- QName refQName = new QName(namespaceURI, srcBindingName);
- destBindingOperation.setRef(refQName);
- destBinding.addOperation(destBindingOperation);
-
- String opName = srcBindingName;
- WSDLInterfaceOperation destIntfOperation = destInterface.getOperation(new NCName(opName));
-
- // Process soap:operation@soapAction, soap:operation@style
- List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPOperation)
- {
- SOAPOperation soapOp = (SOAPOperation)extElement;
- destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
- }
- else if (SOAP12_OPERATION.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- destBindingOperation.setSOAPAction(getOptionalAttribute(domElement, "soapAction"));
- }
- }
-
- BindingInput srcBindingInput = srcBindingOperation.getBindingInput();
- if (srcBindingInput != null)
- {
- processBindingInput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingInput);
- }
-
- BindingOutput srcBindingOutput = srcBindingOperation.getBindingOutput();
- if (srcBindingOutput != null)
- {
- processBindingOutput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingOutput);
- }
- }
-
- interface ReferenceCallback
- {
- void removeReference(QName element);
- void removeRPCPart(String partName);
- QName getXmlType(String partName);
- }
-
- private void processBindingInput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingInput srcBindingInput)
- {
- log.trace("processBindingInput");
-
- QName soap11Body = new QName(Constants.NS_SOAP11, "body");
- List<ExtensibilityElement> extList = srcBindingInput.getExtensibilityElements();
- WSDLBindingOperationInput input = new WSDLBindingOperationInput(destBindingOperation);
- destBindingOperation.addInput(input);
-
- ReferenceCallback cb = new ReferenceCallback()
- {
- public QName getXmlType(String partName)
- {
- return srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
- }
-
- public void removeReference(QName element)
- {
- WSDLInterfaceOperationInput destIntfInput = destIntfOperation.getInput(element);
- if (destIntfInput == null)
- destIntfOperation.removeInput(element);
- }
-
- public void removeRPCPart(String partName)
- {
- WSDLInterfaceOperationInput operationInput = destIntfOperation.getInput(destIntfOperation.getQName());
- operationInput.removeChildPart(partName);
- }
- };
-
- processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, input, cb);
- }
-
- private void processBindingOutput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingOutput srcBindingOutput)
- {
- log.trace("processBindingInput");
-
- QName soap11Body = new QName(Constants.NS_SOAP11, "body");
- List<ExtensibilityElement> extList = srcBindingOutput.getExtensibilityElements();
- WSDLBindingOperationOutput output = new WSDLBindingOperationOutput(destBindingOperation);
- destBindingOperation.addOutput(output);
-
- ReferenceCallback cb = new ReferenceCallback()
- {
- public QName getXmlType(String partName)
- {
- return srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
- }
-
- public void removeReference(QName element)
- {
- WSDLInterfaceOperationOutput destIntfOutput = destIntfOperation.getOutput(element);
- if (destIntfOutput == null)
- destIntfOperation.removeInput(element);
- }
-
- public void removeRPCPart(String partName)
- {
- QName name = destIntfOperation.getQName();
- WSDLInterfaceOperationOutput operationOutput = destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
- operationOutput.removeChildPart(partName);
- }
- };
-
- processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, output, cb);
- }
-
-
- private void processBindingReference(WSDLBindingOperation destBindingOperation, WSDLInterfaceOperation destIntfOperation,
- QName soap11Body, List<ExtensibilityElement> extList, WSDLBindingMessageReference reference, ReferenceCallback callback)
- {
- for (ExtensibilityElement extElement : extList)
- {
- QName elementType = extElement.getElementType();
- if (soap11Body.equals(elementType) || SOAP12_BODY.equals(elementType))
- {
- processEncodingStyle(extElement, destBindingOperation);
- }
- else if (extElement instanceof SOAPHeader)
- {
- SOAPHeader header = (SOAPHeader)extElement;
- QName messageQName = header.getMessage();
- String partName = header.getPart();
-
- String key = messageQName + "->" + partName;
- QName elementName = (QName)messagePartToElementMap.get(key);
- if (elementName == null)
- throw new WSException("Could not determine element name from header: " + partName);
-
- reference.addSoapHeader(new WSDLSOAPHeader(elementName, partName));
- if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
- {
- callback.removeReference(elementName);
- }
- else
- {
- // Just in case
- callback.removeRPCPart(partName);
- }
- }
- else if (extElement instanceof MIMEMultipartRelated)
- {
- MIMEMultipartRelated related = (MIMEMultipartRelated)extElement;
- Iterator i = related.getMIMEParts().iterator();
- while (i.hasNext())
- {
- MIMEPart part = (MIMEPart)i.next();
- Iterator j = part.getExtensibilityElements().iterator();
- String name = null;
- String types = null;
-
- while (j.hasNext())
- {
- ExtensibilityElement inner = (ExtensibilityElement)j.next();
- if (inner instanceof MIMEContent)
- {
- MIMEContent content = (MIMEContent)inner;
- name = content.getPart();
- if (types == null)
- {
- types = content.getType();
- }
- else
- {
- types += "," + content.getType();
- }
- }
- }
-
- // Found content types in this part
- if (name != null)
- {
- QName xmlType = callback.getXmlType(name);
- reference.addMimePart(new WSDLMIMEPart(name, xmlType, types));
- if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
- {
- // A mime part must be defined as <part type="">
- callback.removeReference(new QName(name));
- }
- else
- {
- callback.removeRPCPart(name);
- }
- }
- }
- }
- }
- }
-
-
- private void processEncodingStyle(ExtensibilityElement extElement, WSDLBindingOperation destBindingOperation)
- {
- log.trace("processEncodingStyle");
-
- String encStyle = null;
- QName elementType = extElement.getElementType();
- if (extElement instanceof SOAPBody)
- {
- SOAPBody body = (SOAPBody)extElement;
- List encStyleList = body.getEncodingStyles();
- if (encStyleList != null)
- {
- if (encStyleList.size() > 1)
- log.warn("Multiple encoding styles not supported: " + encStyleList);
-
- if (encStyleList.size() > 0)
- {
- encStyle = (String)encStyleList.get(0);
- }
- }
- }
- else if (SOAP12_BODY.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- encStyle = getOptionalAttribute(domElement, "encodingStyle");
- }
-
- if (encStyle != null)
- {
- String setStyle = destBindingOperation.getEncodingStyle();
- if (encStyle.equals(setStyle) == false)
- log.warn("Encoding style '" + encStyle + "' not supported for: " + destBindingOperation.getRef());
-
- destBindingOperation.setEncodingStyle(encStyle);
- }
- }
-
- private void processServices(Definition srcWsdl)
- {
- log.trace("BEGIN processServices: " + srcWsdl.getDocumentBaseURI());
-
- // Each definition needs a clear binding cache
- allBindings = null;
-
- if (srcWsdl.getServices().size() > 0)
- {
- Iterator it = srcWsdl.getServices().values().iterator();
- while (it.hasNext())
- {
- Service srcService = (Service)it.next();
- QName qname = srcService.getQName();
- WSDLService destService = new WSDLService(destWsdl);
- destService.setName(new NCName(qname));
- destService.setQName(qname);
- destWsdl.addService(destService);
- processPorts(srcWsdl, destService, srcService);
- }
- }
- else
- {
- log.trace("Empty wsdl services, processing imports");
- Iterator it = srcWsdl.getImports().values().iterator();
- while (it.hasNext())
- {
- List<Import> srcImports = (List<Import>)it.next();
- for (Import srcImport : srcImports)
- {
- Definition importDefinition = srcImport.getDefinition();
- processServices(importDefinition);
- }
- }
-
- // The binding cache must be clear after imports, so that undefined bindings can be located
- allBindings = null;
- }
-
- log.trace("END processServices: " + srcWsdl.getDocumentBaseURI());
- }
-
- private void processPorts(Definition srcWsdl, WSDLService destService, Service srcService)
- {
- Iterator it = srcService.getPorts().values().iterator();
- while (it.hasNext())
- {
- Port srcPort = (Port)it.next();
- processPort(srcWsdl, destService, srcPort);
- }
- }
-
- private void processPort(Definition srcWsdl, WSDLService destService, Port srcPort)
- {
- log.trace("processPort: " + srcPort.getName());
-
- Binding srcBinding = srcPort.getBinding();
-
- WSDLEndpoint destEndpoint = new WSDLEndpoint(destService);
- destEndpoint.setName(new NCName(srcPort.getName()));
- destEndpoint.setBinding(srcBinding.getQName());
- destEndpoint.setQName(new QName(srcWsdl.getTargetNamespace(), srcPort.getName()));
- destEndpoint.setAddress(getSOAPAddress(srcPort));
- destService.addEndpoint(destEndpoint);
-
- processBinding(srcWsdl, srcBinding);
- }
-
- /** Get the endpoint address from the ports extensible element
- */
- private String getSOAPAddress(Port srcPort)
- {
- String soapAddress = "dummy";
-
- Iterator it = srcPort.getExtensibilityElements().iterator();
- while (it.hasNext())
- {
- ExtensibilityElement extElement = (ExtensibilityElement)it.next();
- QName elementType = extElement.getElementType();
-
- if (extElement instanceof SOAPAddress)
- {
- SOAPAddress addr = (SOAPAddress)extElement;
- soapAddress = addr.getLocationURI();
- break;
- }
- else if (SOAP12_ADDRESS.equals(elementType))
- {
- Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
- soapAddress = getOptionalAttribute(domElement, "location");
- break;
- }
- else if ("address".equals(elementType.getLocalPart()))
- {
- log.warn("Unprocessed extension element: " + elementType);
- }
- }
-
- if (soapAddress == null)
- throw new WSException("Cannot obtain SOAP address");
-
- return soapAddress;
- }
-
- private String getOptionalAttribute(Element domElement, String attrName)
- {
- String attrValue = domElement.getAttribute(attrName);
- return (attrValue.length() > 0 ? attrValue : null);
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,518 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.common.metadata.wsdl;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.HashSet;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A WSDL Writer that writes a WSDL 1.1 file. It works off
- * of the WSDL20 Object Graph.
- * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
- */
-public class WSDL11Writer extends WSDLWriter
-{
- //Used Internally
- private String wsdlStyle = Constants.RPC_LITERAL;
-
- // Used to prevent duplicates
- private HashSet<String> writtenFaultMessages = new HashSet<String>();
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- public WSDL11Writer(WSDLDefinitions wsdl)
- {
- super(wsdl);
- }
-
- public void write(Writer writer) throws IOException
- {
- write(writer, null);
- }
-
-
- public void write(Writer writer, String charset) throws IOException
- {
- write(writer, charset, null);
- }
-
- public void write(Writer writer, String charset, WriterResolver resolver) throws IOException
- {
- // Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
- if (wsdl.getWsdlOneOneDefinition() != null)
- {
- Definition wsdlDefinition = wsdl.getWsdlOneOneDefinition();
- try
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
- wsdlWriter.writeWSDL(wsdlDefinition, writer);
- }
- catch (WSDLException e)
- {
- this.logException(e);
- throw new IOException(e.toString());
- }
- }
- else
- {
- StringBuilder buffer = new StringBuilder();
-
- //Detect the WSDL Style early
- wsdlStyle = utils.getWSDLStyle(wsdl);
-
- StringBuilder importBuffer = new StringBuilder();
- for (WSDLImport wsdlImport : wsdl.getImports())
- {
- if (resolver == null)
- continue;
-
- ResolvedWriter resolved = resolver.resolve(wsdlImport.getLocation());
- if (resolved == null)
- continue;
-
- String namespace = wsdlImport.getNamespace();
- importBuffer.append("<import namespace='" + namespace + "' location='" + resolved.actualFile + "'/>");
- if (resolved != null)
- {
- StringBuilder builder = new StringBuilder();
-
- appendDefinitions(builder, namespace);
- appendBody(builder, namespace);
- writeBuilder(builder, resolved.writer, resolved.charset);
- resolved.writer.close();
- }
- }
-
- appendDefinitions(buffer, wsdl.getTargetNamespace());
- if (importBuffer.length() > 0)
- buffer.append(importBuffer);
-
- appendBody(buffer, wsdl.getTargetNamespace());
- writeBuilder(buffer, writer, charset);
- }
- }
-
- private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws IOException
- {
- Element element = DOMUtils.parse(builder.toString());
-
- if (charset != null)
- writer.write("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
- new DOMWriter(writer).setPrettyprint(true).print(element);
- }
-
- protected void appendBody(StringBuilder builder, String namespace)
- {
- writtenFaultMessages.clear();
-
- appendTypes(builder, namespace);
- appendMessages(builder, namespace);
- appendInterfaces(builder, namespace);
- appendBindings(builder, namespace);
- appendServices(builder, namespace);
- builder.append("</definitions>");
- }
-
- protected void appendMessages(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] interfaces = wsdl.getInterfaces();
- int len = interfaces != null ? interfaces.length : 0;
- for (int i = 0; i < len; i++)
- {
- WSDLInterface intf = interfaces[i];
- if (! namespace.equals(intf.getQName().getNamespaceURI()))
- continue;
-
- WSDLInterfaceOperation[] operations = intf.getSortedOperations();
- int lenOps = operations.length;
- for (int j = 0; j < lenOps; j++)
- {
- appendMessage(buffer, operations[j]);
- appendMessagesForExceptions(buffer, operations[j]);
- }
- }
- }
-
- private void appendMessage(StringBuilder buffer, WSDLInterfaceOperation operation)
- {
- String opname = operation.getName().toString();
- //Determine the style of the wsdl
- if (Constants.URI_STYLE_RPC.equals(operation.getStyle()) == false)
- wsdlStyle = Constants.DOCUMENT_LITERAL; //Not RPC/Literal
-
- String interfaceName = operation.getWsdlInterface().getName().toString();
- buffer.append("<message name='" + interfaceName + "_" + opname + "' >");
- for (WSDLInterfaceOperationInput input : operation.getInputs())
- appendMessageParts(buffer, input);
- buffer.append("</message>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
- {
- buffer.append("<message name='" + interfaceName + "_" + opname + "Response' >");
- WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
- for (WSDLInterfaceOperationOutput output : outputs)
- appendMessageParts(buffer, output);
- buffer.append("</message>");
- }
- }
-
- private void appendMessagesForExceptions(StringBuilder buffer, WSDLInterfaceOperation operation)
- {
- //Get the outfaults
- WSDLInterfaceOperationOutfault[] faults = operation.getOutfaults();
- int len = faults != null ? faults.length : 0;
-
- for (int i = 0; i < len; i++)
- {
- WSDLInterfaceOperationOutfault fault = faults[i];
- String exceptionName = fault.getRef().getLocalPart();
- if (writtenFaultMessages.contains(exceptionName))
- continue;
-
- WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(new NCName(exceptionName));
- QName xmlName = interfaceFault.getElement();
-
- buffer.append("<message name='" + exceptionName + "' >");
- String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
- String xmlNameStr = prefix + ":" + xmlName.getLocalPart();
- buffer.append("<part name='" + exceptionName + "' element='" + xmlNameStr + "' />");
- buffer.append("</message>");
-
- writtenFaultMessages.add(exceptionName);
- }
- }
-
- private String getReferenceString(QName name)
- {
- String namespaceURI = name.getNamespaceURI();
- String prefix = wsdl.getPrefix(namespaceURI);
- if (prefix == null)
- throw new WSException("Prefix not bound for namespace: " + namespaceURI);
-
- return prefix + ":" + name.getLocalPart();
- }
-
- private void appendMessageParts(StringBuilder buffer, WSDLInterfaceMessageReference reference)
- {
- if (wsdlStyle.equals(Constants.RPC_LITERAL))
- {
- for (WSDLRPCPart part : reference.getChildParts())
- {
- buffer.append("<part name='" + part.getName()).append('\'');
- buffer.append(" type='" + getReferenceString(part.getType()) + "'/>");
- }
- }
- else
- {
- QName element = reference.getElement();
- // Null represents empty message
- if (element != null)
- {
- buffer.append("<part name='" + reference.getPartName() + '\'');
- buffer.append(" element='" + getReferenceString(element) + "'/>");
- }
- }
-
- WSDLBindingMessageReference bindingReference = getBindingReference(reference);
- if (bindingReference == null)
- return;
-
- for (WSDLSOAPHeader header : bindingReference.getSoapHeaders())
- {
- if (header.isIncludeInSignature());
- {
- QName element = header.getElement();
- buffer.append("<part name='" + header.getPartName() + '\'');
- buffer.append(" element='" + getReferenceString(element) + "'/>");
- }
- }
- }
-
- private WSDLBindingMessageReference getBindingReference(WSDLInterfaceMessageReference reference)
- {
- WSDLInterfaceOperation operation = reference.getWsdlOperation();
- WSDLInterface wsdlInterface = operation.getWsdlInterface();
- WSDLBinding binding = wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
- WSDLBindingOperation bindingOperation = binding.getOperationByRef(operation.getQName());
- WSDLBindingMessageReference[] bindingReferences;
-
- if (reference instanceof WSDLInterfaceOperationInput)
- bindingReferences = bindingOperation.getInputs();
- else
- bindingReferences = bindingOperation.getOutputs();
-
- if (bindingReferences.length > 1)
- throw new IllegalArgumentException("WSDl 1.1 only supports In-Only, and In-Out MEPS, more than reference input found");
-
- if (bindingReferences.length == 1)
- return bindingReferences[0];
-
- return null;
- }
-
- protected void appendInterfaces(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] intfs = wsdl.getInterfaces();
- for (int i = 0; i < intfs.length; i++)
- {
- WSDLInterface intf = intfs[i];
- if (!namespace.equals(intf.getQName().getNamespaceURI()))
- continue;
-
- buffer.append("<portType name='" + intf.getName() + "'>");
- appendPortOperations(buffer, intf);
- buffer.append("</portType>");
- }
- }
-
- private String getParameterOrder(WSDLInterfaceOperation operation)
- {
- StringBuilder builder = new StringBuilder();
- for (WSDLRPCSignatureItem item : operation.getRpcSignatureItems())
- {
- if (item.getDirection() != Direction.RETURN)
- {
- if (builder.length() > 0)
- builder.append(' ');
- builder.append(item.getName());
- }
- }
-
- return builder.toString();
- }
-
- protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
- {
- String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
- WSDLInterfaceOperation[] operations = intf.getSortedOperations();
- for (int i = 0; i < operations.length; i++)
- {
- WSDLInterfaceOperation operation = operations[i];
- buffer.append("<operation name='" + operation.getName().toString() + "'");
-
- String parameterOrder = getParameterOrder(operation);
- if (parameterOrder.length() > 0)
- buffer.append(" parameterOrder='").append(parameterOrder).append("'");
- buffer.append(">");
-
- String opname = operation.getName().toString();
- String interfaceName = operation.getWsdlInterface().getName().toString();
- String msgEl = prefix + ":" + interfaceName + "_" + opname;
-
- buffer.append("<input message='" + msgEl + "'>").append("</input>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
- {
- buffer.append("<output message='" + msgEl + "Response'>");
- buffer.append("</output>");
- }
-
- //Append the Faults
- for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
- {
- QName element = fault.getRef();
- buffer.append("<fault message='" + utils.getFormattedString(element));
- buffer.append("' name='" + element.getLocalPart() + "'/>");
- }
-
- buffer.append("</operation>");
- }
- }
-
- protected void appendBindings(StringBuilder buffer, String namespace)
- {
- WSDLBinding[] bindings = wsdl.getBindings();
- for (int i = 0; i < bindings.length; i++)
- {
- WSDLBinding binding = bindings[i];
- if (!namespace.equals(binding.getQName().getNamespaceURI()))
- continue;
- buffer.append("<binding name='" + binding.getName() + "' type='" + getQNameRef(binding.getInterfaceName()) + "'>");
- //TODO:Need to derive the WSDLStyle from the Style attribute of InterfaceOperation
- if (wsdlStyle == null)
- throw new IllegalArgumentException("WSDL Style is null (should be rpc or document");
- String style = "rpc";
- if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
- style = "document";
- buffer.append("<" + soapPrefix + ":binding transport='http://schemas.xmlsoap.org/soap/http' style='" + style + "'/>");
- appendBindingOperations(buffer, binding);
- buffer.append("</binding>");
- }
- }
-
- protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
- {
- WSDLBindingOperation[] operations = binding.getOperations();
- Arrays.sort(operations);
-
- for (int i = 0; i < operations.length; i++)
- {
- WSDLBindingOperation operation = operations[i];
- String interfaceName = operation.getWsdlBinding().getInterfaceName().getLocalPart();
-
- WSDLInterface wsdlInterface = wsdl.getInterface(new NCName(interfaceName));
- if (wsdlInterface == null)
- throw new WSException("WSDL Interface should not be null");
- WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
-
- buffer.append("<operation name='" + interfaceOperation.getName() + "'>");
- String soapAction = (operation.getSOAPAction() != null ? operation.getSOAPAction() : "");
- buffer.append("<" + soapPrefix + ":operation soapAction=\"" + soapAction + "\"/>");
-
- WSDLBindingOperationInput[] inputs = operation.getInputs();
- if (inputs.length != 1)
- throw new WSException("WSDl 1.1 only supports In-Only, and In-Out MEPS.");
-
- buffer.append("<input>");
- appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
- buffer.append("</input>");
-
- if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(getBindingOperationPattern(operation)))
- {
- buffer.append("<output>");
- WSDLBindingOperationOutput[] outputs = operation.getOutputs();
- appendSOAPBinding(buffer, wsdlInterface, operation, outputs);
- buffer.append("</output>");
- }
-
- //Append faults
- WSDLInterfaceOperationOutfault[] faults = interfaceOperation.getOutfaults();
- if (faults != null)
- {
- for (WSDLInterfaceOperationOutfault fault : faults)
- {
- String n = "name='" + fault.getRef().getLocalPart() + "'";
- buffer.append("<fault " + n + ">");
- buffer.append("<" + soapPrefix + ":fault " + n + " use='literal' />");
- buffer.append("</fault>");
- }
- buffer.append("</operation>");
- }
- }
- }
-
- private void appendSOAPBinding(StringBuilder buffer, WSDLInterface wsdlInterface, WSDLBindingOperation operation, WSDLBindingMessageReference[] inputs)
- {
- String tns = wsdl.getTargetNamespace();
- WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
- WSDLInterfaceMessageReference reference = (inputs instanceof WSDLBindingOperationInput[]) ? interfaceOperation.getInputs()[0]
- : interfaceOperation.getOutputs()[0];
-
- StringBuilder bodyParts = new StringBuilder();
- if (Constants.DOCUMENT_LITERAL == wsdlStyle)
- {
- bodyParts.append(reference.getPartName());
- }
- else
- {
- for (WSDLRPCPart part : reference.getChildParts())
- {
- if (bodyParts.length() > 0)
- bodyParts.append(" ");
- bodyParts.append(part.getName());
- }
- }
-
- StringBuilder soapHeader = new StringBuilder();
- for (WSDLSOAPHeader header : inputs[0].getSoapHeaders())
- {
- if (header.isIncludeInSignature())
- {
- String messageName = wsdlInterface.getName() + "_" + operation.getRef().getLocalPart();
- if (reference instanceof WSDLInterfaceOperationOutput)
- messageName += "Response";
- soapHeader.append("<").append(soapPrefix).append(":header use='literal' message='tns:").append(messageName);
- soapHeader.append("' part='").append(header.getElement().getLocalPart()).append("'/>");
- }
- }
-
- buffer.append("<" + soapPrefix + ":body use='literal'");
- if (wsdlStyle != Constants.DOCUMENT_LITERAL)
- buffer.append(" namespace='" + tns + "'");
- if (soapHeader.length() > 0)
- {
- buffer.append(" parts='").append(bodyParts).append("'/>");
- buffer.append(soapHeader);
- }
- else
- {
- buffer.append("/>");
- }
- }
-
- private String getBindingOperationPattern(WSDLBindingOperation operation)
- {
- WSDLBinding binding = operation.getWsdlBinding();
- String pattern = binding.getInterface().getOperation(new NCName(operation.getRef().getLocalPart())).getPattern();
-
- return pattern;
- }
-
- protected void appendServices(StringBuilder buffer, String namespace)
- {
- WSDLService[] services = wsdl.getServices();
- int len = services.length;
- for (int i = 0; i < len; i++)
- {
-
- WSDLService service = services[i];
- if (!namespace.equals(service.getQName().getNamespaceURI()))
- continue;
- buffer.append("<service name='" + service.getName() + "'>");
- WSDLEndpoint[] endpoints = service.getEndpoints();
- int lenend = endpoints.length;
- for (int j = 0; j < lenend; j++)
- {
- WSDLEndpoint endpoint = endpoints[j];
- appendServicePort(buffer, endpoint);
- }
-
- buffer.append("</service>");
- }
- }
-
- protected void appendServicePort(StringBuilder buffer, WSDLEndpoint endpoint)
- {
- String name = endpoint.getName().toString();
- QName endpointBinding = endpoint.getBinding();
- String prefix = endpointBinding.getPrefix();
- prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
- String ebname = prefix + ":" + endpointBinding.getLocalPart();
- buffer.append("<port name='" + name + "' binding='" + ebname + "'>");
- buffer.append("<" + soapPrefix + ":address location='" + endpoint.getAddress() + "'/>");
- buffer.append("</port>");
- }
-}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Reader.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Reader.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Reader.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,557 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.wsdl.xml.WSDLLocator;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-
-/**
- * A factory that creates a WSDL <code>Definition</code> from an URL.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDL20Reader implements ObjectModelFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDL20Reader.class);
-
- private WSDLLocator locator = null;
-
- public WSDLDefinitions readWSDL(WSDLLocator wsdlLocator) throws WSDLException, IOException
- {
- locator = wsdlLocator;
-
- String wsdlURI = wsdlLocator.getBaseURI();
- InputSource inputSource = wsdlLocator.getBaseInputSource();
- if (inputSource == null)
- throw new WSException("Cannot obtain WSDL input source for: " + wsdlURI);
-
- InputStream is = inputSource.getByteStream();
- try
- {
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setValidation(true);
-
- WSDLDefinitions wsdl = new WSDLDefinitions();
- wsdl.setWsdlNamespace(Constants.NS_WSDL20);
-
- unmarshaller.unmarshal(is, this, wsdl);
- return wsdl;
- }
- catch (RuntimeException re)
- {
- throw re;
- }
- catch (Exception e)
- {
- throw new WSDLException("Cannot unmarshal: " + wsdlURI, e);
- }
- finally
- {
- is.close();
- }
- }
-
- public void setFeature(String name, boolean value)
- {
- }
-
- /**
- * This method is called by the object model factory and returns the root of the object graph.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- /**
- * WSDL2.0 Assertions (http://www.w3.org/TR/wsdl20-primer)
- * The value of the WSDL target namespace MUST be an absolute URI.
- */
- WSDLDefinitions wsdl = null;
-
- StringBuilder buf = null;
-
- if (root instanceof WSDLDefinitions)
- {
- wsdl = (WSDLDefinitions)root;
-
- String targetNamespace = attrs.getValue("targetNamespace");
- boolean abs = (targetNamespace.startsWith("http"));
- if (targetNamespace == null || abs == false)
- throw new RuntimeException("WSDL 2.0 Assertion: targetNamespace must be an absolute uri");
-
- wsdl.setWsdlNamespace(Constants.NS_WSDL20);
- wsdl.setTargetNamespace(targetNamespace);
-
- Iterator uris = navigator.getNamespaceURIs();
- while (uris.hasNext())
- {
- String namespace = (String)uris.next();
- String prefix = navigator.getNamespaceContext().getPrefix(namespace);
- if (prefix.length() > 0)
- wsdl.registerNamespaceURI(namespace, prefix);
- }
- return wsdl;
- }
- else if (root instanceof WSDLTypes)
- {
- wsdl = ((WSDLTypes)root).getWsdlDefinitions();
- if ("import".equalsIgnoreCase(localName))
- {
- importTypes(wsdl, attrs);
- return null;
- }
- if ("schema".equalsIgnoreCase(localName))
- {
- //Included Schema - wsdl 2.0
- //We will start writing whatever the parser has obtained
- buf = new StringBuilder("<schema ");
- Iterator uris = navigator.getNamespaceURIs();
- String targetNS = attrs.getValue("targetNamespace");
- buf.append(" targetNamespace='" + targetNS + "'");
- while (uris.hasNext())
- {
- String namespace = (String)uris.next();
- Iterator iter = navigator.getNamespaceContext().getPrefixes(namespace);
- if (namespace.equals(Constants.NS_WSDL20))
- continue;
- if (iter == null)
- buf.append(" xmlns='" + namespace + "'");
- else
- {
- while (iter.hasNext())
- {
- String prefix = (String)iter.next();
- if (prefix.length() == 0)
- buf.append(" xmlns='" + namespace + "'");
- else buf.append(" xmlns:" + prefix + "='" + namespace + "'");
- }
- }
- }
- buf.append(">");
- return buf;
- }
- }
- else if (root instanceof StringBuilder)
- {
- return newChild((StringBuilder)root, navigator, namespaceURI, localName, attrs);
- }
- else
- {
- throw new IllegalArgumentException("Invalid root for namespace: " + namespaceURI);
- }
-
- return null;
- }
-
- /**
- * This method is called by the object model factory and returns the root of the object graph.
- */
- public Object newChild(WSDLTypes types, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- /**
- * WSDL2.0 Assertions (http://www.w3.org/TR/wsdl20-primer)
- * The value of the WSDL target namespace MUST be an absolute URI.
- */
- WSDLDefinitions wsdl = types.getWsdlDefinitions();
-
- StringBuilder buf = null;
- if ("import".equalsIgnoreCase(localName))
- {
- importTypes(wsdl, attrs);
- return null;
- }
- if ("schema".equalsIgnoreCase(localName))
- {
- //Included Schema - wsdl 2.0
- //We will start writing whatever the parser has obtained
- buf = new StringBuilder("<schema ");
- Iterator uris = navigator.getNamespaceURIs();
- String targetNS = attrs.getValue("targetNamespace");
- buf.append(" targetNamespace='" + targetNS + "'");
- while (uris.hasNext())
- {
- String namespace = (String)uris.next();
- Iterator iter = navigator.getNamespaceContext().getPrefixes(namespace);
- if (namespace.equals(Constants.NS_WSDL20))
- continue;
- if (iter == null)
- buf.append(" xmlns='" + namespace + "'");
- else
- {
- while (iter.hasNext())
- {
- String prefix = (String)iter.next();
- if (prefix.length() == 0)
- buf.append(" xmlns='" + namespace + "'");
- else buf.append(" xmlns:" + prefix + "='" + namespace + "'");
- }
- }
- }
- buf.append(">");
- return buf;
- }
-
- return null;
- }
-
- /**
- * The JBossXB has completed the parsing of the WSDL 2.0 document
- * @param root
- * @param ctx
- * @param uri
- * @param name
- * @return
- */
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
- {
- return root;
- }
-
- /**
- * Used in the parsing of the included XML Schema in WSDL 2.0
- * @param buf
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- */
- public Object newChild(StringBuilder buf, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- int len = attrs.getLength();
- buf.append("<" + localName);
- for (int i = 0; i < len; i++)
- {
- String val = attrs.getValue(i);
- String attrname = attrs.getLocalName(i);
- buf.append(" " + attrname + "='" + val + "'");
- }
- buf.append(">");
- return buf;
- }
-
- /**
- * Used in the parsing of the included XML Schema in WSDL 2.0
- * We have reached the end of an xml element.
- * @param buf
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @return
- */
- public Object addChild(StringBuilder buf, StringBuilder buf1, UnmarshallingContext navigator, String namespaceURI, String localName) throws WSDLException
- {
- buf.append("</" + localName + ">");
- return buf;
-
- }
-
- /**
- * Used in the parsing of the included XML Schema in WSDL 2.0
- * We have parsed the schema completely. Write it into a file and update WSDLTypes (schemaLocation)
- * @param types
- * @param buf
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @return
- * @throws WSDLException
- */
- public Object addChild(WSDLTypes types, StringBuilder buf, UnmarshallingContext navigator, String namespaceURI, String localName) throws WSDLException
- {
- buf.append("</schema>");
- String targetNS = types.getWsdlDefinitions().getTargetNamespace();
- try
- {
- File file = SchemaUtils.getSchemaTempFile(targetNS);
- file.deleteOnExit();
- FileWriter fwrite = new FileWriter(file);
- fwrite.write(buf.toString());
- fwrite.flush();
- fwrite.close();
- }
- catch (IOException e)
- {
- String msg = "Cannot extract schema definition for target namespace: " + targetNS;
- log.error(msg, e);
- throw new WSException(msg);
- }
- return types;
- }
-
- /**
- * Parsing the WSDL 2.0 document
- * @param wsdl20
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- * @throws WSDLException
- */
- public Object newChild(WSDLDefinitions wsdl20, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs) throws WSDLException
- {
- /**
- * WSDL 20 Assertions
- * Each interface must be given a name that is unique within the set of interfaces defined in this WSDL target NS
- * Interface names are tokens that must not contain a space or colon (":")
- */
- String defaultNamespace = wsdl20.getWsdlNamespace();
- if (Constants.NS_WSDL20.equals(defaultNamespace))
- {
- if ("types".equals(localName))
- {
- WSDLTypes wsdlTypes = new XSModelTypes();
- wsdl20.setWsdlTypes(wsdlTypes);
- return wsdlTypes;
- }
- else if ("interface".equals(localName))
- {
- WSDLInterface wsdlInterface = new WSDLInterface(wsdl20);
- String name = attrs.getValue("name");
- if (name == null)
- throw new RuntimeException("Interface name should not be null");
- if (name.indexOf(" ") > -1 || name.indexOf(":") > -1)
- throw new RuntimeException("WSDL 2.0 Assertion:Interface names are tokens " + "that must not contain a space or colon");
-
- NCName ncname = new NCName(name);
- if (wsdl20.getInterface(ncname) != null)
- throw new RuntimeException("WSDL 2.0 Assertion:Each interface must be given a name that is "
- + "unique within the set of interfaces defined in this WSDL target namespace");
-
- wsdlInterface.setName(ncname);
- wsdl20.addInterface(wsdlInterface);
-
- return wsdlInterface;
- }
- else if ("binding".equals(localName))
- {
- /**
- * WSDL 2.0 Assertion: Each name must be unique among all bindings in this WSDL target namespace
- */
- String name = attrs.getValue("name");
- NCName ncname = new NCName(name);
- if (wsdl20.getBinding(ncname) != null)
- throw new RuntimeException("WSDL 2.0 Assertion:Each name must be unique among " + "all bindings in this WSDL target namespace");
- WSDLBinding wsdlBinding = new WSDLBinding(wsdl20);
- wsdlBinding.setName(ncname);
- wsdl20.addBinding(wsdlBinding);
-
- return wsdlBinding;
- }
- else if ("service".equals(localName))
- {
- WSDLService wsdlService = new WSDLService(wsdl20);
- wsdlService.setName(new NCName(attrs.getValue("name")));
- wsdl20.addService(wsdlService);
- wsdlService.setInterfaceName(navigator.resolveQName(attrs.getValue("interface")));
- return wsdlService;
- }
- else log.warn("Unrecogized child element: " + localName);
- }
- else throw new WSDLException("Invalid default namespace: " + defaultNamespace);
-
- return null;
- }
-
- /**
- * Parsing the WSDL 2.0 document
- * @param wsdlInterface
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- */
- public Object newChild(WSDLInterface wsdlInterface, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- /**
- * WSDL .0 Assertion: Operation names must also be unique within an interface
- */
- if ("operation".equals(localName))
- {
- String name = attrs.getValue("name");
- if (name == null)
- throw new RuntimeException("Operation name must not be null");
- NCName ncname = new NCName(name);
- if (wsdlInterface.containsInterfaceOperation(ncname))
- throw new RuntimeException("WSDL 2.0 Assertion:Each operation must be given a name that is "
- + "unique within an interface defined in this WSDL target namespace");
- WSDLInterfaceOperation wsdlOperation = new WSDLInterfaceOperation(wsdlInterface);
- wsdlOperation.setName(ncname);
- wsdlInterface.addOperation(wsdlOperation);
- return wsdlOperation;
- }
-
- log.warn("Unrecogized child element: " + localName);
- return null;
- }
-
- /**
- * Parsing the WSDL 2.0 document
- * @param wsdlOperation
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- */
- public Object newChild(WSDLInterfaceOperation wsdlOperation, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("input".equals(localName))
- {
- WSDLInterfaceOperationInput wsdlInterfaceOperationInput = new WSDLInterfaceOperationInput(wsdlOperation);
- wsdlInterfaceOperationInput.setElement(navigator.resolveQName(attrs.getValue("element")));
- wsdlInterfaceOperationInput.setMessageLabel(new NCName(attrs.getValue("messageLabel")));
- wsdlOperation.addInput(wsdlInterfaceOperationInput);
- return wsdlInterfaceOperationInput;
- }
- else if ("output".equals(localName))
- {
- WSDLInterfaceOperationOutput output = new WSDLInterfaceOperationOutput(wsdlOperation);
- output.setElement(navigator.resolveQName(attrs.getValue("element")));
- output.setMessageLabel(new NCName(attrs.getValue("messageLabel")));
- wsdlOperation.addOutput(output);
- return output;
- }
- else if ("outfault".equals(localName))
- {
- WSDLInterfaceOperationOutfault fault = new WSDLInterfaceOperationOutfault(wsdlOperation);
- String messageLabel = attrs.getValue("messageLabel");
- fault.setRef(navigator.resolveQName(attrs.getValue("ref")));
- if (messageLabel != null)
- fault.setMessageLabel(new NCName(messageLabel));
- wsdlOperation.addOutfault(fault);
- return wsdlOperation;
- }
-
- log.warn("Unrecogized child element: " + localName);
- return null;
- }
-
- /**
- * Parsing the WSDL 2.0 document
- * @param wsdlBinding
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- */
- public Object newChild(WSDLBinding wsdlBinding, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("operation".equals(localName))
- {
- WSDLBindingOperation wsdlBindingOperation = new WSDLBindingOperation(wsdlBinding);
- wsdlBindingOperation.setRef(navigator.resolveQName(attrs.getValue("ref")));
- wsdlBinding.addOperation(wsdlBindingOperation);
- return wsdlBindingOperation;
- }
-
- log.warn("Unrecogized child element: " + localName);
- return null;
- }
-
- /**
- * Parsing the WSDL 2.0 document
- * @param wsdlBindingOperation
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- */
- public Object newChild(WSDLBindingOperation wsdlBindingOperation, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("input".equals(localName))
- {
- WSDLBindingOperationInput wsdlBindingOperationInput = new WSDLBindingOperationInput(wsdlBindingOperation);
- wsdlBindingOperationInput.setMessageLabel(new NCName(attrs.getValue("messageLabel")));
- wsdlBindingOperation.addInput(wsdlBindingOperationInput);
- return wsdlBindingOperationInput;
- }
- if ("output".equals(localName))
- {
- WSDLBindingOperationOutput wsdlBindingOperationOutput = new WSDLBindingOperationOutput(wsdlBindingOperation);
- wsdlBindingOperationOutput.setMessageLabel(new NCName(attrs.getValue("messageLabel")));
- wsdlBindingOperation.addOutput(wsdlBindingOperationOutput);
- return wsdlBindingOperationOutput;
- }
-
- log.warn("Unrecogized child element: " + localName);
- return null;
- }
-
- /**
- * Parsing the WSDL 2.0 document
- * @param wsdlService
- * @param navigator
- * @param namespaceURI
- * @param localName
- * @param attrs
- * @return
- */
- public Object newChild(WSDLService wsdlService, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("endpoint".equals(localName))
- {
- WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(wsdlService);
- wsdlEndpoint.setName(new NCName(attrs.getValue("name")));
- wsdlEndpoint.setBinding(navigator.resolveQName(attrs.getValue("binding")));
- wsdlService.addEndpoint(wsdlEndpoint);
- return wsdlEndpoint;
- }
-
- log.warn("Unrecogized child element: " + localName);
- return null;
- }
-
- /**
- * Method that deals with importing schema
- * @param wsdl
- * @param attrs
- */
- private void importTypes(WSDLDefinitions wsdl, Attributes attrs)
- {
- // [TODO]
- }
-}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Writer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Writer.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL20Writer.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,200 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-
-/**
- * A WSDL writer that writes out a WSDL-2.0 compliant wsdl.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDL20Writer extends WSDLWriter
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(WSDL20Writer.class);
-
- protected WSDLUtils utils = WSDLUtils.getInstance();
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- public WSDL20Writer(WSDLDefinitions wsdl)
- {
- super(wsdl);
- }
-
-
- protected void appendInterfaces(StringBuilder buffer, String namespace)
- {
- WSDLInterface[] interfaces = wsdl.getInterfaces();
- for (int i = 0; i < interfaces.length; i++)
- {
- WSDLInterface intf = interfaces[i];
- buffer.append("<interface name='" + intf.getName() + "'>");
- appendInterfaceFaults(buffer, intf);
- appendInterfaceOperations(buffer, intf);
- buffer.append("</interface>");
- }
- }
-
- private void appendInterfaceFaults(StringBuilder buffer, WSDLInterface intf)
- {
- WSDLInterfaceFault[] faults = intf.getFaults();
- for (int i = 0; i < faults.length; i++)
- {
- WSDLInterfaceFault fault = faults[i];
- buffer.append("<fault name='" + fault.getName() + "'");
- buffer.append(" element='" + getQNameRef(fault.getElement()) + "'>");
- if (fault.getDocumentation() != null)
- {
- buffer.append(fault.getDocumentation());
- }
- buffer.append("</fault>");
- }
- }
-
- private void appendInterfaceOperations(StringBuilder buffer, WSDLInterface intf)
- {
- WSDLInterfaceOperation[] operations = intf.getOperations();
- for (int i = 0; i < operations.length; i++)
- {
- WSDLInterfaceOperation operation = operations[i];
- buffer.append("<operation name='" + operation.getName() + "'>");
-
- WSDLInterfaceOperationInput[] inputs = operation.getInputs();
- for (int j = 0; j < inputs.length; j++)
- {
- WSDLInterfaceOperationInput ip = inputs[j];
- buffer.append("<input element='" + getQNameRef(ip.getElement()) + "'");
- if (ip.getMessageLabel() != null)
- {
- buffer.append(" messageLabel='" + ip.getMessageLabel() + "'");
- }
- buffer.append(">");
- appendProperties(buffer, ip.getProperties());
- buffer.append("</input>");
- }
-
- WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
- for (int j = 0; j < outputs.length; j++)
- {
- WSDLInterfaceOperationOutput op = outputs[j];
- buffer.append("<output element='" + getQNameRef(op.getElement()) + "'");
- if (op.getMessageLabel() != null)
- {
- buffer.append(" messageLabel='" + op.getMessageLabel() + "'");
- }
- buffer.append(">");
- appendProperties(buffer, op.getProperties());
- buffer.append("</output>");
- }
-
- WSDLInterfaceOperationOutfault[] outfaults = operation.getOutfaults();
- for (int j = 0; j < outfaults.length; j++)
- {
- WSDLInterfaceOperationOutfault outfault = outfaults[j];
- buffer.append("<outfault ref='" + getQNameRef(outfault.getRef()) + "'>");
- if (outfault.getMessageLabel() != null)
- {
- buffer.append(" messageLabel='" + outfault.getMessageLabel() + "'");
- }
- buffer.append("</outfault>");
- }
- buffer.append("</operation>");
- }
- }
-
- private void appendProperties(StringBuilder buffer, WSDLProperty[] wsdlProperties)
- {
- for (int i = 0; i < wsdlProperties.length; i++)
- {
- WSDLProperty wsdlProperty = wsdlProperties[i];
- String uri = wsdlProperty.getURI();
- String value = wsdlProperty.getValue();
- buffer.append("<property uri='" + uri + "'>" + (value != null ? "<value>" + value + "</value>" : "") + "</property>");
- }
- }
-
- protected void appendBindings(StringBuilder buffer, String namespace)
- {
- WSDLBinding[] bindings = wsdl.getBindings();
- for (int i = 0; i < bindings.length; i++)
- {
- WSDLBinding binding = bindings[i];
- buffer.append("<binding name='" + binding.getName() + "'");
- if (binding.getInterfaceName() != null)
- {
- buffer.append(" interface='" + getQNameRef(binding.getInterfaceName()) + "'");
- }
- buffer.append(">");
- appendBindingOperations(buffer, binding);
- buffer.append("</binding>");
- }
- }
-
- protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
- {
- WSDLBindingOperation[] operations = binding.getOperations();
- for (int i = 0; i < operations.length; i++)
- {
- WSDLBindingOperation operation = operations[i];
- buffer.append("<operation ref='" + getQNameRef(operation.getRef()) + "'>");
- buffer.append("</operation>");
- }
- }
-
- protected void appendServices(StringBuilder buffer, String namespace)
- {
- WSDLService[] services = wsdl.getServices();
- for (int i = 0; i < services.length; i++)
- {
- WSDLService service = services[i];
- buffer.append("<service name='" + service.getName() + "'");
- if (service.getInterfaceName() != null)
- {
- buffer.append(" interface='" + getQNameRef(service.getInterfaceName()) + "'");
- }
- buffer.append(">");
-
- WSDLEndpoint[] endpoints = service.getEndpoints();
- for (int j = 0; j < endpoints.length; j++)
- {
- WSDLEndpoint endpoint = endpoints[j];
- buffer.append("<endpoint name='" + endpoint.getName() + "'");
- if (endpoint.getBinding() != null)
- {
- buffer.append(" binding='" + getQNameRef(endpoint.getBinding()) + "'");
- }
- if (endpoint.getAddress() != null)
- {
- buffer.append(" address='" + endpoint.getAddress() + "'");
- }
- buffer.append("></endpoint>");
- }
-
- buffer.append("</service>");
- }
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitions.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitions.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitions.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -23,9 +23,7 @@
// $Id$
-import java.io.IOException;
import java.io.Serializable;
-import java.io.Writer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -37,8 +35,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.wsdl.WSDLWriter.WriterResolver;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Document;
@@ -299,28 +295,4 @@
if(pre != null && pre.equals(prefix))
namespaces.removePrefixMapping(prefix);
}
-
- /** Write the wsdl definition to the given writer, clients should not care about the wsdl version. */
- public void write(Writer writer, String charset) throws IOException
- {
- write(writer, charset, null);
- }
-
- public void write(Writer writer, String charset, WriterResolver resolver) throws IOException
- {
- if (Constants.NS_WSDL11.equals(wsdlNamespace))
- {
- WSDL11Writer wsdl11Writer = new WSDL11Writer(this);
- wsdl11Writer.write(writer, charset, resolver);
- }
- else if (Constants.NS_WSDL20.equals(wsdlNamespace))
- {
- WSDL20Writer wsdl20Writer = new WSDL20Writer(this);
- wsdl20Writer.write(writer);
- }
- else
- {
- throw new WSException("Unsupported wsdl version: " + wsdlNamespace);
- }
- }
}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,211 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.ConnectException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.parsers.DocumentBuilder;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.EntityResolver;
-
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
-/**
- * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
- *
- * This implementations deals with different WSDL versions so that clients of this
- * factory do need to know about WSDL version specifics. The Java object view of the
- * WSDL document (WSDLDefinitions) is modeled on WSDL-2.0
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class WSDLDefinitionsFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
-
- // This feature is set by default in wsdl4j, it means the object structure contains the imported arguments
- public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
- // Set this feature for additional debugging output
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
-
- // The WSDL reader features
- private Map features = new HashMap();
-
- // Hide constructor
- private WSDLDefinitionsFactory()
- {
- }
-
- /**
- * Create a new instance of a wsdl factory
- */
- public static WSDLDefinitionsFactory newInstance()
- {
- return new WSDLDefinitionsFactory();
- }
-
- /**
- * Set a feature on the underlying reader
- */
- public void setFeature(String name, boolean value) throws IllegalArgumentException
- {
- features.put(name, new Boolean(value));
- }
-
- /**
- * Read the wsdl document from the given URL
- */
- public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
- {
- if (wsdlLocation == null)
- throw new IllegalArgumentException("URL cannot be null");
-
- log.debug("parse: " + wsdlLocation.toExternalForm());
-
- EntityResolver entityResolver = new JBossWSEntityResolver();
- WSDLDefinitions wsdlDefinitions = null;
- try
- {
- Document wsdlDoc = getDocument(wsdlLocation);
- String defaultNamespace = getDefaultNamespace(wsdlDoc);
- if (Constants.NS_WSDL20.equals(defaultNamespace))
- {
- WSDL20Reader wsdlReader = new WSDL20Reader();
-
- // Setup reader features
- Iterator it = features.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Boolean flag = (Boolean)entry.getValue();
- wsdlReader.setFeature(key, flag.booleanValue());
- }
-
- wsdlDefinitions = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
- wsdlDefinitions.setWsdlDocument(wsdlDoc);
- }
- else if (Constants.NS_WSDL11.equals(defaultNamespace))
- {
- WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
-
- // Setup reader features
- Iterator it = features.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Boolean flag = (Boolean)entry.getValue();
- wsdlReader.setFeature(key, flag.booleanValue());
- }
-
- // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
- ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
-
- Definition definition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
- wsdlDefinitions = new WSDL11Reader().processDefinition(definition, wsdlLocation);
- wsdlDefinitions.setWsdlDocument(wsdlDoc);
- }
- else
- throw new WSDLException("Invalid default namespace: " + defaultNamespace);
-
- if (log.isTraceEnabled())
- {
- StringWriter stwr = new StringWriter();
- WSDL20Writer wsdl20Writer = new WSDL20Writer(wsdlDefinitions);
- wsdl20Writer.write(stwr);
- log.trace("\n" + stwr.toString());
- }
- }
- catch (WSDLException e)
- {
- throw e;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSDLException(e);
- }
-
- return wsdlDefinitions;
- }
-
- /** Get the WSDL document.
- */
- private Document getDocument(URL wsdlLocation) throws WSDLException
- {
- try
- {
- InputStream wsdlInputStream = wsdlLocation.openStream();
- try
- {
- DocumentBuilder builder = DOMUtils.getDocumentBuilder();
- return builder.parse(wsdlInputStream);
- }
- finally
- {
- wsdlInputStream.close();
- }
- }
- catch (ConnectException ex)
- {
- throw new WSDLException("Cannot connect to: " + wsdlLocation);
- }
- catch (Exception ex)
- {
- throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation, ex);
- }
- }
-
- /** Get the default namespace for the given WSDL
- */
- private String getDefaultNamespace(Document wsdlDoc) throws WSDLException
- {
- Element root = wsdlDoc.getDocumentElement();
- String defaultNamespace = root.getNamespaceURI();
- return defaultNamespace;
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLLocatorImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLLocatorImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLLocatorImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,159 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.wsdl.xml.WSDLLocator;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-/* A WSDLLocator that can handle wsdl imports
- */
-class WSDLLocatorImpl implements WSDLLocator
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
-
- private EntityResolver entityResolver;
- private URL wsdlURL;
- private String latestImportURI;
-
- public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
- {
- if (wsdlFile == null)
- throw new IllegalArgumentException("WSDL file argument cannot be null");
-
- this.entityResolver = entityResolver;
- this.wsdlURL = wsdlFile;
- }
-
- public InputSource getBaseInputSource()
- {
- log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
- try
- {
- InputStream is = wsdlURL.openStream();
- if (is == null)
- throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
-
- return new InputSource(is);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
- }
- }
-
- public String getBaseURI()
- {
- return wsdlURL.toExternalForm();
- }
-
- public InputSource getImportInputSource(String parent, String resource)
- {
- log.trace("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
-
- URL parentURL = null;
- try
- {
- parentURL = new URL(parent);
- }
- catch (MalformedURLException e)
- {
- log.error("Not a valid URL: " + parent);
- return null;
- }
-
- String wsdlImport = null;
- String external = parentURL.toExternalForm();
-
- // An external URL
- if (resource.startsWith("http://") || resource.startsWith("https://"))
- {
- wsdlImport = resource;
- }
-
- // Absolute path
- else if (resource.startsWith("/"))
- {
- String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
- wsdlImport = beforePath + resource;
- }
-
- // A relative path
- else
- {
- String parentDir = external.substring(0, external.lastIndexOf("/"));
-
- // remove references to current dir
- while (resource.startsWith("./"))
- resource = resource.substring(2);
-
- // remove references to parentdir
- while (resource.startsWith("../"))
- {
- parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
- resource = resource.substring(3);
- }
-
- wsdlImport = parentDir + "/" + resource;
- }
-
- try
- {
- log.trace("Trying to resolve: " + wsdlImport);
- InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
- if (inputSource != null)
- {
- latestImportURI = wsdlImport;
- }
- else
- {
- throw new IllegalArgumentException("Cannot resolve imported resource: " + wsdlImport);
- }
-
- return inputSource;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
- }
- }
-
- public String getLatestImportURI()
- {
- return latestImportURI;
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLWriter.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLWriter.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLWriter.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,207 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.common.metadata.wsdl;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.w3c.dom.Element;
-
-/**
- * A helper that writes out a WSDL definition
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @since 10-Oct-2004
- */
-public abstract class WSDLWriter
-{
- // provide logging
- protected static final Logger log = Logger.getLogger(WSDLWriter.class);
-
- protected WSDLDefinitions wsdl;
- protected WSDLUtils utils = WSDLUtils.getInstance();
-
- // The soap prefix
- protected String soapPrefix = "soap";
-
- /**
- * Include or import WSDL Types
- */
- protected boolean includeSchemaInWSDL = true;
-
- public static class ResolvedWriter
- {
- public String actualFile;
- public String charset;
- public Writer writer;
- }
-
- public static interface WriterResolver
- {
- public ResolvedWriter resolve(String suggestedFile) throws IOException;
- }
-
- /** Use WSDLDefinitions.writeWSDL instead. */
- protected WSDLWriter(WSDLDefinitions wsdl)
- {
- if (wsdl == null)
- throw new IllegalArgumentException("WSDL definitions is NULL");
-
- this.wsdl = wsdl;
- }
-
- public void write(Writer writer) throws IOException
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(Constants.XML_HEADER);
-
- appendDefinitions(buffer, wsdl.getTargetNamespace());
- appendTypes(buffer, wsdl.getTargetNamespace());
- appendInterfaces(buffer, wsdl.getTargetNamespace());
- appendBindings(buffer, wsdl.getTargetNamespace());
- appendServices(buffer, wsdl.getTargetNamespace());
-
- buffer.append("</definitions>");
-
- Element element = DOMUtils.parse(buffer.toString());
- new DOMWriter(writer).setPrettyprint(true).print(element);
- }
-
- protected void appendDefinitions(StringBuilder buffer, String namespace)
- {
- buffer.append("<definitions");
- //Append service name as done by wscompile, if there is just one
- WSDLService[] services = wsdl.getServices();
- if (services != null && services.length == 1)
- {
- WSDLService ser = services[0];
- buffer.append(" name='" + ser.getName() + "'");
- }
- buffer.append(" targetNamespace='" + namespace + "'");
- buffer.append(" xmlns='" + wsdl.getWsdlNamespace() + "'");
-
- Iterator it = wsdl.getRegisteredNamespaceURIs();
- while (it.hasNext())
- {
- String namespaceURI = (String)it.next();
- String prefix = wsdl.getPrefix(namespaceURI);
- if (prefix.length() > 0)
- {
- buffer.append(" xmlns:" + prefix + "='" + namespaceURI + "'");
- if (Constants.PREFIX_SOAP11.equals(prefix) || Constants.PREFIX_SOAP12.equals(prefix))
- soapPrefix = prefix;
- }
- }
- buffer.append(">");
- }
-
- protected void appendTypes(StringBuilder buffer, String namespace)
- {
- WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
- // If the type section is bound to a particular namespace, verify it mataches, otherwise skip
- if (wsdlTypes.getNamespace() != null && !wsdlTypes.getNamespace().equals(namespace))
- return;
-
- if (wsdlTypes instanceof XSModelTypes)
- {
- buffer.append("<types>");
- JBossXSModel xsM = WSDLUtils.getSchemaModel(wsdlTypes);
- String schema = xsM.serialize();
- buffer.append(schema);
- buffer.append("</types>");
- }
- else if (wsdlTypes instanceof DOMTypes)
- {
- synchronized (wsdlTypes)
- {
- buffer.append(DOMWriter.printNode(((DOMTypes)wsdlTypes).getElement(), true));
- }
- }
- }
-
- protected abstract void appendInterfaces(StringBuilder buffer, String namespace);
-
- protected abstract void appendBindings(StringBuilder buffer, String namespace);
-
- protected abstract void appendServices(StringBuilder buffer, String namespace);
-
- /** Get a prefixed name of form prefix:localPart */
- protected String getQNameRef(QName qname)
- {
- String retStr = qname.getLocalPart();
-
- String prefix = qname.getPrefix();
- String nsURI = qname.getNamespaceURI();
- if (prefix.length() == 0 && nsURI.length() > 0)
- {
- qname = wsdl.registerQName(qname);
- prefix = qname.getPrefix();
- }
-
- if (prefix.length() > 0)
- retStr = prefix + ":" + retStr;
-
- return retStr;
- }
-
- public WSDLDefinitions getWsdl()
- {
- return wsdl;
- }
-
- public void setWsdl(WSDLDefinitions wsdl)
- {
- this.wsdl = wsdl;
- }
-
- public boolean isIncludeTypesInWSDL()
- {
- return includeSchemaInWSDL;
- }
-
- public void logException(Exception e)
- {
- if (log.isTraceEnabled())
- {
- log.trace(e);
- }
- }
-
- public void logMessage(String msg)
- {
- if (log.isTraceEnabled())
- {
- log.trace(msg);
- }
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -44,12 +44,12 @@
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonBinding.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -29,8 +29,7 @@
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.umdm.OperationMetaData;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.soap.UnboundHeader;
/**
* The base interface for protocol bindings.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -47,14 +47,13 @@
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.common.utils.HolderUtils;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.core.soap.EndpointInfo;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPConnectionImpl;
+import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -32,6 +32,7 @@
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.core.server.MessageContextPropertyHelper;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -57,8 +57,6 @@
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.common.utils.MimeUtils;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.core.soap.MessageContextAssociation;
@@ -71,6 +69,7 @@
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.core.soap.SOAPHeaderElementImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
import org.jboss.ws.extras.xop.XOPContext;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/EndpointInvocation.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/EndpointInvocation.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,357 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+import org.jboss.ws.common.umdm.WrappedParameter;
+import org.jboss.ws.common.utils.HolderUtils;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.common.utils.MimeUtils;
+import org.jboss.ws.core.jaxrpc.ParameterWrapping;
+import org.jboss.ws.core.soap.SOAPContentElement;
+
+/** A web service invocation.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Oct-2004
+ */
+public class EndpointInvocation
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(EndpointInvocation.class);
+
+ // The operation meta data for this invocation
+ private OperationMetaData opMetaData;
+ // Map the named endpoint parameters
+ private Map<QName, Object> reqPayload = new LinkedHashMap<QName, Object>();
+ // Map the named endpoint parameters
+ private Map<QName, Object> resPayload = new LinkedHashMap<QName, Object>();
+ // The return value
+ private Object returnValue;
+ // Map of output parameters, key being the parameter index in the method signature
+ private Map<Integer, Object> outParameters = new HashMap<Integer, Object>();
+
+ public EndpointInvocation(OperationMetaData opMetaData)
+ {
+ this.opMetaData = opMetaData;
+ }
+
+ public OperationMetaData getOperationMetaData()
+ {
+ return opMetaData;
+ }
+
+ public Method getJavaMethod()
+ {
+ return opMetaData.getJavaMethod();
+ }
+
+ public Map<Integer, Object> getOutParameters()
+ {
+ return outParameters;
+ }
+
+ public List<QName> getRequestParamNames()
+ {
+ List<QName> xmlNames = new ArrayList<QName>();
+ xmlNames.addAll(reqPayload.keySet());
+ return xmlNames;
+ }
+
+ public void setRequestParamValue(QName xmlName, Object value)
+ {
+ log.debug("setRequestParamValue: [name=" + xmlName + ",value=" + getTypeName(value) + "]");
+ reqPayload.put(xmlName, value);
+ }
+
+ public Object getRequestParamValue(QName xmlName) throws SOAPException
+ {
+ log.debug("getRequestParamValue: " + xmlName);
+ Object paramValue = reqPayload.get(xmlName);
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ return paramValue;
+ }
+
+ /** Returns the payload that can be passed on to the endpoint implementation
+ */
+ public Object[] getRequestPayload() throws SOAPException
+ {
+ log.debug("getRequestPayload");
+ List<QName> xmlNames = getRequestParamNames();
+
+ Object[] payload = new Object[opMetaData.getJavaMethod().getParameterTypes().length];
+ for (int i = 0; i < xmlNames.size(); i++)
+ {
+ QName xmlName = xmlNames.get(i);
+ Object paramValue = getRequestParamValue(xmlName);
+
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ syncEndpointInputParam(paramMetaData, paramValue, payload);
+ }
+
+ return payload;
+ }
+
+ public List<QName> getResponseParamNames()
+ {
+ List<QName> xmlNames = new ArrayList<QName>();
+ xmlNames.addAll(resPayload.keySet());
+ return xmlNames;
+ }
+
+ public void setResponseParamValue(QName xmlName, Object value)
+ {
+ log.debug("setResponseParamValue: [name=" + xmlName + ",value=" + getTypeName(value) + "]");
+ resPayload.put(xmlName, value);
+ }
+
+ public Object getResponseParamValue(QName xmlName) throws SOAPException
+ {
+ log.debug("getResponseParamValue: " + xmlName);
+ Object paramValue = resPayload.get(xmlName);
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ if (paramValue != null)
+ {
+ Class valueType = paramValue.getClass();
+ if (HolderUtils.isHolderType(valueType))
+ {
+ paramValue = HolderUtils.getHolderValue(paramValue);
+ }
+ }
+ return paramValue;
+ }
+
+ public void setReturnValue(Object value)
+ {
+ ParameterMetaData retMetaData = opMetaData.getReturnParameter();
+ if (value != null && retMetaData == null)
+ throw new WSException("Operation does not have a return value: " + opMetaData.getQName());
+
+ log.debug("setReturnValue: " + getTypeName(value));
+ this.returnValue = value;
+ }
+
+ public Object getReturnValue() throws SOAPException
+ {
+ log.debug("getReturnValue");
+ Object paramValue = returnValue;
+ ParameterMetaData paramMetaData = opMetaData.getReturnParameter();
+ if (paramMetaData != null)
+ {
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ }
+ return paramValue;
+ }
+
+ private Object transformPayloadValue(ParameterMetaData paramMetaData, final Object paramValue) throws SOAPException
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ QName xmlType = paramMetaData.getXmlType();
+ Class javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+
+ if (xmlType == null)
+ throw new IllegalStateException("Cannot obtain xml type for: [xmlName=" + xmlName + ",javaName=" + javaName + "]");
+
+ Object retValue = paramValue;
+
+ // Handle attachment part
+ if (paramValue instanceof AttachmentPart)
+ {
+ AttachmentPart part = (AttachmentPart)paramValue;
+
+ Set mimeTypes = paramMetaData.getMimeTypes();
+ if (DataHandler.class.isAssignableFrom(javaType) && !javaType.equals(Object.class))
+ {
+ DataHandler handler = part.getDataHandler();
+ String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());
+
+ if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
+ throw new SOAPException("Mime type " + mimeType + " not allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
+
+ retValue = part.getDataHandler();
+ }
+ else
+ {
+ retValue = part.getContent();
+ String mimeType = MimeUtils.getBaseMimeType(part.getContentType());
+
+ if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
+ throw new SOAPException("Mime type " + mimeType + " not allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
+
+ if (retValue != null)
+ {
+ Class valueType = retValue.getClass();
+ if (JavaUtils.isAssignableFrom(javaType, valueType) == false)
+ throw new SOAPException("javaType [" + javaType.getName() + "] is not assignable from attachment content: " + valueType.getName());
+ }
+ }
+ }
+ else if (paramValue instanceof SOAPContentElement)
+ {
+ // For type other than xsd:anyType we return the object value
+ if (xmlType.getLocalPart().equals("anyType") == false)
+ {
+ SOAPContentElement soapElement = (SOAPContentElement)paramValue;
+ retValue = soapElement.getObjectValue();
+ }
+ }
+
+ log.debug("transformPayloadValue: " + getTypeName(paramValue) + " -> " + getTypeName(retValue));
+ return retValue;
+ }
+
+ /** Synchronize the operation IN, INOUT paramters with the call input parameters.
+ * Essetially it unwrapps holders and converts primitives to wrapper types.
+ */
+ public void initInputParams(Object[] inputParams)
+ {
+ for (ParameterMetaData paramMetaData : opMetaData.getParameters())
+ {
+ QName xmlName = paramMetaData.getXmlName();
+ Class javaType = paramMetaData.getJavaType();
+
+ Object value;
+ if (opMetaData.isDocumentWrapped() && paramMetaData.isInHeader() == false)
+ {
+ value = ParameterWrapping.wrapRequestParameters(paramMetaData, inputParams);
+ }
+ else
+ {
+ value = inputParams[paramMetaData.getIndex()];
+ if (value != null)
+ {
+ Class inputType = value.getClass();
+
+ if (HolderUtils.isHolderType(inputType))
+ {
+ // At runtime we lose the generic info for JAX-WS types,
+ // So we use the actual instance type if possible
+ value = HolderUtils.getHolderValue(value);
+ inputType = (value == null) ? HolderUtils.getValueType(inputType) : value.getClass();
+ }
+
+ // Verify that the java type matches a registered xmlType
+ // Attachments are skipped because they don't use type mapping
+ if (!paramMetaData.isSwA() && !paramMetaData.isXOP())
+ {
+ if (JavaUtils.isAssignableFrom(javaType, inputType) == false)
+ throw new WSException("Parameter '" + javaType + "' not assignable from: " + inputType);
+ }
+ }
+ }
+
+ setRequestParamValue(xmlName, value);
+ }
+ }
+
+ /**
+ * Synchronize the operation paramters with the endpoint method parameters
+ */
+ private void syncEndpointInputParam(ParameterMetaData paramMetaData, final Object paramValue, Object[] payload)
+ {
+ Object retValue = paramValue;
+ Method method = opMetaData.getJavaMethod();
+ Class[] targetParameterTypes = method.getParameterTypes();
+
+ if (opMetaData.isDocumentWrapped() && paramMetaData.isInHeader() == false && paramMetaData.isMessageType() == false)
+ {
+ outParameters = ParameterWrapping.unwrapRequestParameters(paramMetaData, paramValue, payload);
+ syncOutWrappedParameters(targetParameterTypes);
+ }
+ else
+ {
+ // Replace INOUT and OUT parameters by their respective holder values
+ int index = paramMetaData.getIndex();
+ Class targetParameterType = targetParameterTypes[index];
+
+ if (paramMetaData.getMode() == ParameterMode.INOUT || paramMetaData.getMode() == ParameterMode.OUT)
+ {
+ retValue = HolderUtils.createHolderInstance(paramValue, targetParameterType);
+
+ QName xmlName = paramMetaData.getXmlName();
+ setResponseParamValue(xmlName, retValue);
+ }
+
+ if (retValue != null)
+ {
+ Class valueType = retValue.getClass();
+ if (JavaUtils.isAssignableFrom(targetParameterType, valueType) == false)
+ throw new WSException("Parameter " + targetParameterType.getName() + " is not assignable from: " + getTypeName(retValue));
+
+ if (valueType.isArray())
+ retValue = JavaUtils.syncArray(retValue, targetParameterType);
+ }
+
+ log.debug("syncEndpointInputParam: " + getTypeName(paramValue) + " -> " + getTypeName(retValue) + "(" + index + ")");
+ payload[index] = retValue;
+ }
+ }
+
+ private void syncOutWrappedParameters(Class[] targetParameterTypes)
+ {
+ ParameterMetaData returnMetaData = opMetaData.getReturnParameter();
+ if (returnMetaData != null)
+ {
+ for (WrappedParameter param : returnMetaData.getWrappedParameters())
+ {
+ try
+ {
+ if (param.getIndex() >= 0)
+ outParameters.put(param.getIndex(), targetParameterTypes[param.getIndex()].newInstance());
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Could not add output param: " + param.getName(), e);
+
+ }
+ }
+ }
+ }
+
+ private String getTypeName(Object value)
+ {
+ String valueType = (value != null ? value.getClass().getName() : null);
+ return valueType;
+ }
+}
\ No newline at end of file
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core;
-
-/**
- * Interface to be implemented by property helpers to assist the retrieval
- * of objects added to the property context.
- *
- * If an instance of MessageContextPropertyHelper is added to the
- * CommonMessageContext a call to get for the same property will return
- * the result of callig get on the helper instead of returning the helper
- * itself.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Oct 22, 2006
- */
-public interface MessageContextPropertyHelper
-{
-
- public Object get();
-
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/SOAPMessageMarshaller.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageMarshaller.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageMarshaller.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/SOAPMessageMarshaller.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,92 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.core;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.invocation.OnewayInvocation;
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPElementWriter;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Nov-2004
+ */
+public class SOAPMessageMarshaller implements Marshaller
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(SOAPMessageMarshaller.class);
+
+ /**
+ * Marshaller will need to take the dataObject and convert
+ * into primitive java data types and write to the
+ * given output.
+ *
+ * @param dataObject Object to be writen to output
+ * @param output The data output to write the object
+ * data to.
+ */
+ public void write(Object dataObject, OutputStream output) throws IOException
+ {
+ if (dataObject instanceof InvocationRequest)
+ dataObject = ((InvocationRequest)dataObject).getParameter();
+
+ if (dataObject instanceof OnewayInvocation)
+ dataObject = ((OnewayInvocation)dataObject).getParameters()[0];
+
+ if ((dataObject instanceof SOAPMessage) == false)
+ throw new IllegalArgumentException("Not a SOAPMessage: " + dataObject);
+
+ try
+ {
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
+
+ // debug the outgoing message
+ if (log.isTraceEnabled())
+ {
+ SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
+ String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
+ log.trace("Outgoing SOAPMessage\n" + envStr);
+ }
+
+ soapMessage.writeTo(output);
+ }
+ catch (SOAPException e)
+ {
+ log.error("Cannot marshall SOAPMessage", e);
+ throw new IOException(e.toString());
+ }
+ }
+
+ public Marshaller cloneMarshaller() throws CloneNotSupportedException
+ {
+ return new SOAPMessageMarshaller();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/SOAPMessageUnMarshaller.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageUnMarshaller.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageUnMarshaller.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/SOAPMessageUnMarshaller.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Nov-2004
+ */
+public class SOAPMessageUnMarshaller implements UnMarshaller
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(SOAPMessageUnMarshaller.class);
+
+ private static List validResponseCodes = new ArrayList();
+ static
+ {
+ validResponseCodes.add(HttpServletResponse.SC_OK);
+ validResponseCodes.add(HttpServletResponse.SC_ACCEPTED);
+ validResponseCodes.add(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+
+ public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace("Read input stream with metadata=" + metadata);
+ }
+
+ try
+ {
+ Integer resCode = (Integer)metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
+ String resMessage = (String)metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
+ if (resCode != null && validResponseCodes.contains(resCode) == false)
+ throw new WSException("Invalid HTTP server response [" + resCode + "] - " + resMessage);
+
+ MimeHeaders mimeHeaders = getMimeHeaders(metadata);
+ SOAPMessage soapMsg = new MessageFactoryImpl().createMessageInternal(mimeHeaders, inputStream, true);
+ return soapMsg;
+ }
+ catch (SOAPException e)
+ {
+ log.error("Cannot unmarshall SOAPMessage", e);
+ throw new IOException(e.toString());
+ }
+ }
+
+ /**
+ * Set the class loader to use for unmarhsalling. This may
+ * be needed when need to have access to class definitions that
+ * are not part of this unmarshaller's parent classloader (especially
+ * when doing remote classloading).
+ *
+ * @param classloader
+ */
+ public void setClassLoader(ClassLoader classloader)
+ {
+ //NO OP
+ }
+
+ public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
+ {
+ return new SOAPMessageUnMarshaller();
+ }
+
+ private MimeHeaders getMimeHeaders(Map metadata)
+ {
+ log.debug("getMimeHeaders from: " + metadata);
+
+ MimeHeaders headers = new MimeHeaders();
+ Iterator i = metadata.keySet().iterator();
+ while (i.hasNext())
+ {
+ String key = (String)i.next();
+ Object value = metadata.get(key);
+ if (key != null && value instanceof List)
+ {
+ for (Object listValue : (List)value)
+ {
+ headers.addHeader(key, listValue.toString());
+ }
+ }
+ }
+ return headers;
+ }
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -58,10 +58,10 @@
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.core.CommonClient;
-import org.jboss.ws.core.binding.UnboundHeader;
import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.extras.xop.XOPContext;
/** Provides support for the dynamic invocation of a service endpoint.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/HTTPBindingJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/HTTPBindingJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/HTTPBindingJAXWS.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -35,8 +35,8 @@
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.EndpointInvocation;
+import org.jboss.ws.core.soap.UnboundHeader;
/**
* The HTTPBinding interface is an abstraction for the XML/HTTP binding.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/MessageBinding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/MessageBinding.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/MessageBinding.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -38,10 +38,10 @@
import org.jboss.ws.common.umdm.ParameterMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.UnboundHeader;
/** A binding for unprocessed SOAP Messages
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/PayloadBinding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/PayloadBinding.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/PayloadBinding.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -40,13 +40,13 @@
import org.jboss.ws.common.umdm.ParameterMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.CommonBinding;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.UnboundHeader;
/** A BindingProvider for a JAXWS payload
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -70,8 +70,6 @@
import org.jboss.ws.common.metadata.jsr181.HandlerChainsMetaData;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
-import org.jboss.ws.common.metadata.wsdl.WSDLWriter;
-import org.jboss.ws.common.metadata.wsdl.WSDLWriter.ResolvedWriter;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.FaultMetaData;
@@ -98,6 +96,8 @@
import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.jaxws.WSDLGenerator;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
+import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -849,17 +849,16 @@
wsdlTmpFile.deleteOnExit();
Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile, Constants.DEFAULT_XML_CHARSET);
- wsdlDefinitions.write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriter.WriterResolver()
+ new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriterResolver()
{
- public ResolvedWriter resolve(String suggestedFile) throws IOException
+ public WSDLWriterResolver resolve(String suggestedFile) throws IOException
{
File newTmpFile = File.createTempFile(suggestedFile, ".wsdl", tmpdir);
newTmpFile.deleteOnExit();
- WSDLWriter.ResolvedWriter resolvedWriter = new WSDLWriter.ResolvedWriter();
- resolvedWriter.actualFile = newTmpFile.getName();
- resolvedWriter.charset = Constants.DEFAULT_XML_CHARSET;
- resolvedWriter.writer = IOUtils.getCharsetFileWriter(newTmpFile, Constants.DEFAULT_XML_CHARSET);
- return resolvedWriter;
+ actualFile = newTmpFile.getName();
+ charset = Constants.DEFAULT_XML_CHARSET;
+ writer = IOUtils.getCharsetFileWriter(newTmpFile, Constants.DEFAULT_XML_CHARSET);
+ return this;
}
});
writer.close();
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -51,7 +51,7 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.jaxws.core.BindingProviderImpl;
import org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/MessageContextPropertyHelper.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/MessageContextPropertyHelper.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.server;
+
+/**
+ * Interface to be implemented by property helpers to assist the retrieval
+ * of objects added to the property context.
+ *
+ * If an instance of MessageContextPropertyHelper is added to the
+ * CommonMessageContext a call to get for the same property will return
+ * the result of callig get on the helper instead of returning the helper
+ * itself.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since Oct 22, 2006
+ */
+public interface MessageContextPropertyHelper
+{
+
+ public Object get();
+
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerJSE.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -34,7 +34,7 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -64,7 +64,6 @@
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.MessageContextPropertyHelper;
import org.jboss.ws.core.ThreadLocalAssociation;
import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -37,7 +37,6 @@
import javax.wsdl.Definition;
import javax.wsdl.Import;
import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
@@ -50,6 +49,7 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -102,7 +102,7 @@
{
Writer fWriter = IOUtils.getCharsetFileWriter(targetFile, Constants.DEFAULT_XML_CHARSET);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- wsdlDefinitions.write(fWriter, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);
URL wsdlPublishURL = targetFile.toURL();
log.info("WSDL published to: " + wsdlPublishURL);
@@ -167,7 +167,7 @@
targetFile.getParentFile().mkdirs();
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
- WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
+ javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
FileWriter fw = new FileWriter(targetFile);
wsdlWriter.writeWSDL(subdef, fw);
fw.close();
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -44,8 +44,8 @@
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-import org.jboss.ws.core.binding.soap.SOAPMessageMarshaller;
-import org.jboss.ws.core.binding.soap.SOAPMessageUnMarshaller;
+import org.jboss.ws.core.SOAPMessageMarshaller;
+import org.jboss.ws.core.SOAPMessageUnMarshaller;
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.extras.xop.XOPContext;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/UnboundHeader.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/UnboundHeader.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ParameterMetaData;
+
+/**
+ * Represents an unbound SOAPHeaderElement
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Jan-2005
+ */
+public class UnboundHeader
+{
+ private QName xmlName;
+ private QName xmlType;
+ private Class javaType;
+ private ParameterMode mode;
+ private Object headerValue;
+
+ public UnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode mode)
+ {
+ this.xmlName = xmlName;
+ this.xmlType = xmlType;
+ this.javaType = javaType;
+ this.mode = mode;
+ }
+
+ public QName getXmlName()
+ {
+ return xmlName;
+ }
+
+ public QName getXmlType()
+ {
+ return xmlType;
+ }
+
+ public Class getJavaType()
+ {
+ return javaType;
+ }
+
+ public ParameterMode getMode()
+ {
+ return mode;
+ }
+
+ public Object getHeaderValue()
+ {
+ return headerValue;
+ }
+
+ public void setHeaderValue(Object headerValue)
+ {
+ this.headerValue = headerValue;
+ }
+
+ public ParameterMetaData toParameterMetaData(OperationMetaData opMetaData)
+ {
+ ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaType.getName());
+ paramMetaData.setInHeader(true);
+ return paramMetaData;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nUnboundHeader:");
+ buffer.append("\n xmlName=" + getXmlName());
+ buffer.append("\n xmlType=" + getXmlType());
+ buffer.append("\n javaType=" + getJavaType().getName());
+ buffer.append("\n mode=" + getMode());
+ return buffer.toString();
+ }
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -185,7 +185,7 @@
* would already have been written.
*
* @see org.jboss.ws.core.soap.SOAPConnectionImpl#callInternal(javax.xml.soap.SOAPMessage, Object, boolean)
- * @see org.jboss.ws.core.binding.soap.SOAPMessageMarshaller#write(Object, java.io.OutputStream)
+ * @see org.jboss.ws.core.SOAPMessageMarshaller#write(Object, java.io.OutputStream)
*/
public static void eagerlyCreateAttachments()
{
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -33,7 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.ObjectNameFactory;
-import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.server.AbstractServiceEndpointInvoker;
import org.jboss.ws.core.server.ServiceEndpointInfo;
import org.jboss.ws.core.server.ServiceEndpointInvoker;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -41,10 +41,10 @@
import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.common.metadata.wsdl.WSDL11DefinitionFactory;
import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCClientDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
/**
* Binds a JAXRPC Service object in the client's ENC for every service-ref element in the
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -42,6 +42,7 @@
import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.tools.Configuration.OperationConfig;
import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.w3c.dom.Element;
/**
@@ -339,7 +340,7 @@
// Debug the generated wsdl
StringWriter sw = new StringWriter();
- wsdlDefinitions.write(sw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdlDefinitions).write(sw, Constants.DEFAULT_XML_CHARSET);
log.debug("Generated WSDL:\n" + sw.toString());
// Debug the generated mapping file
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -46,7 +46,6 @@
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.common.metadata.wsdl.NCName;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLException;
import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
@@ -60,6 +59,7 @@
import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -68,6 +68,7 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
/**
* Helper class used by the command line tool "jbossws"
@@ -125,7 +126,7 @@
String wsdlPath = outDir + "/wsdl/" + j2wc.serviceName + ".wsdl";
//Generate the WSDL
Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
- wsdl.write(fw, Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
fw.close();
//Generate the Mapping File
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java (from rev 1572, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11DefinitionFactory.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,96 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.wsdl;
+
+// $Id$
+
+import java.net.URL;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.xml.sax.EntityResolver;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
+/**
+ * A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-April-2004
+ */
+public class WSDL11DefinitionFactory
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WSDL11DefinitionFactory.class);
+
+ // This feature is set by default in wsdl4j, it means the object structore contains the imported arguments
+ public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
+ // Set this feature for additional debugging output
+ public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
+
+ // The WSDLReader that is used by this factory
+ private WSDLReader wsdlReader;
+
+ // Hide constructor
+ private WSDL11DefinitionFactory() throws WSDLException
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ wsdlReader = wsdlFactory.newWSDLReader();
+ wsdlReader.setFeature(WSDL11DefinitionFactory.FEATURE_VERBOSE, false);
+ }
+
+ /** Create a new instance of a wsdl factory */
+ public static WSDL11DefinitionFactory newInstance() throws WSDLException
+ {
+ return new WSDL11DefinitionFactory();
+ }
+
+ /** Set a feature on the underlying reader */
+ public void setFeature(String name, boolean value) throws IllegalArgumentException
+ {
+ wsdlReader.setFeature(name, value);
+ }
+
+ /**
+ * Read the wsdl document from the given URL
+ */
+ public Definition parse(URL wsdlLocation) throws WSDLException
+ {
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("URL cannot be null");
+
+ log.trace("parse: " + wsdlLocation.toExternalForm());
+
+ EntityResolver entityResolver = new JBossWSEntityResolver();
+
+ // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+ ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
+
+ Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
+ return wsdlDefinition;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java (from rev 1572, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,1219 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.wsdl;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Import;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.mime.MIMEContent;
+import javax.wsdl.extensions.mime.MIMEMultipartRelated;
+import javax.wsdl.extensions.mime.MIMEPart;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap.SOAPBinding;
+import javax.wsdl.extensions.soap.SOAPBody;
+import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.jaxrpc.Style;
+import org.jboss.ws.common.metadata.wsdl.NCName;
+import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingMessageReference;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLMIMEPart;
+import org.jboss.ws.common.metadata.wsdl.WSDLProperty;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.common.metadata.wsdl.WSDLSOAPHeader;
+import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.common.metadata.wsdl.XSModelTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.common.metadata.wsdl.xsd.SchemaUtils;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.jboss.ws.tools.JavaToXSD;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * A helper that translates a WSDL-1.1 object graph into a WSDL-2.0 object graph.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @since 10-Oct-2004
+ */
+public class WSDL11Reader
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDL11Reader.class);
+
+ private static QName SOAP12_BINDING = new QName(Constants.NS_SOAP12, "binding");
+ private static QName SOAP12_BODY = new QName(Constants.NS_SOAP12, "body");
+ private static QName SOAP12_OPERATION = new QName(Constants.NS_SOAP12, "operation");
+ private static QName SOAP12_ADDRESS = new QName(Constants.NS_SOAP12, "address");
+
+ private WSDLDefinitions destWsdl;
+
+ // Maps wsdl message parts to their corresponding element names
+ private Map<String, QName> messagePartToElementMap = new HashMap<String, QName>();
+
+ // Map of <ns,URL> for schemalocation keyed by namespace
+ private Map<String, URL> schemaLocationsMap = new HashMap<String, URL>();
+
+ private LinkedHashMap<QName, Binding> allBindings;
+ private LinkedHashMap<QName, Binding> portTypeBindings;
+
+ // Temporary files used by this reader.
+ private List<File> tempFiles = new ArrayList<File>();
+
+ /**
+ * Takes a WSDL11 Definition element and converts into
+ * our object graph that has been developed for WSDL20
+ *
+ * @param srcWsdl The src WSDL11 definition
+ * @param wsdlLoc The source location, if null we cannot process imports or includes
+ */
+ public WSDLDefinitions processDefinition(Definition srcWsdl, URL wsdlLoc) throws IOException
+ {
+ log.trace("processDefinition: " + wsdlLoc);
+
+ destWsdl = new WSDLDefinitions();
+ destWsdl.setWsdlTypes(new XSModelTypes());
+ destWsdl.setWsdlOneOneDefinition(srcWsdl);
+ destWsdl.setWsdlNamespace(Constants.NS_WSDL11);
+
+ processNamespaces(srcWsdl);
+ processTypes(srcWsdl, wsdlLoc);
+ processServices(srcWsdl);
+
+ if (getAllDefinedBindings(srcWsdl).size() != destWsdl.getBindings().length)
+ processUnreachableBindings(srcWsdl);
+
+ cleanupTemporaryFiles();
+
+ return destWsdl;
+ }
+
+ private void cleanupTemporaryFiles()
+ {
+ for (File current : tempFiles)
+ {
+ current.delete();
+ }
+ }
+
+ // process all bindings not within service separetly
+ private void processUnreachableBindings(Definition srcWsdl)
+ {
+ log.trace("processUnreachableBindings");
+
+ Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
+ while (it.hasNext())
+ {
+ Binding srcBinding = (Binding)it.next();
+ QName srcQName = srcBinding.getQName();
+
+ WSDLBinding destBinding = destWsdl.getBinding(new NCName(srcQName));
+ if (destBinding == null)
+ {
+ processBinding(srcWsdl, srcBinding);
+ }
+ }
+ }
+
+ private void processNamespaces(Definition srcWsdl)
+ {
+ String targetNS = srcWsdl.getTargetNamespace();
+ destWsdl.setTargetNamespace(targetNS);
+
+ // Copy wsdl namespaces
+ Map nsMap = srcWsdl.getNamespaces();
+ Iterator iter = nsMap.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)iter.next();
+ String prefix = (String)entry.getKey();
+ String nsURI = (String)entry.getValue();
+ destWsdl.registerNamespaceURI(nsURI, prefix);
+ }
+ }
+
+ private void processTypes(Definition srcWsdl, URL wsdlLoc) throws IOException
+ {
+ log.trace("BEGIN processTypes: " + wsdlLoc);
+
+ WSDLTypes destTypes = destWsdl.getWsdlTypes();
+
+ Types srcTypes = srcWsdl.getTypes();
+ if (srcTypes != null && srcTypes.getExtensibilityElements().size() > 0)
+ {
+ List extElements = srcTypes.getExtensibilityElements();
+ int len = extElements.size();
+
+ for (int i = 0; i < len; i++)
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(i);
+
+ Element domElement;
+ if (extElement instanceof Schema)
+ {
+ domElement = ((Schema)extElement).getElement();
+ }
+ else if (extElement instanceof UnknownExtensibilityElement)
+ {
+ domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ }
+ else
+ {
+ throw new WSException("Unsupported extensibility element: " + extElement);
+ }
+
+ Element domElementClone = (Element)domElement.cloneNode(true);
+ copyParentNamespaceDeclarations(domElementClone, domElement);
+
+ String localname = domElementClone.getLocalName();
+ try
+ {
+ if ("import".equals(localname))
+ {
+ processSchemaImport(destTypes, wsdlLoc, domElementClone);
+ }
+ else if ("schema".equals(localname))
+ {
+ processSchemaInclude(destTypes, wsdlLoc, domElementClone);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unsuported schema element: " + localname);
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot extract schema definition", e);
+ }
+ }
+
+ if (len > 0)
+ {
+ JavaToXSD jxsd = new JavaToXSD();
+ JBossXSModel xsmodel = jxsd.parseSchema(schemaLocationsMap);
+ WSDLUtils.addSchemaModel(destTypes, destWsdl.getTargetNamespace(), xsmodel);
+ }
+ }
+ else
+ {
+ log.trace("Empty wsdl types element, processing imports");
+ Iterator it = srcWsdl.getImports().values().iterator();
+ while (it.hasNext())
+ {
+ List<Import> srcImports = (List<Import>)it.next();
+ for (Import srcImport : srcImports)
+ {
+ Definition impDefinition = srcImport.getDefinition();
+ String impLoc = impDefinition.getDocumentBaseURI();
+ processTypes(impDefinition, new URL(impLoc));
+ }
+ }
+ }
+
+ log.trace("END processTypes: " + wsdlLoc + "\n" + destTypes);
+ }
+
+ private void copyParentNamespaceDeclarations(Element destElement, Element srcElement)
+ {
+ Node parent = srcElement.getParentNode();
+ while (parent != null)
+ {
+ if (parent.hasAttributes())
+ {
+ NamedNodeMap attributes = parent.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++)
+ {
+ Attr attr = (Attr)attributes.item(i);
+ String name = attr.getName();
+ String value = attr.getValue();
+ if (name.startsWith("xmlns:") && destElement.hasAttribute(name) == false)
+ destElement.setAttribute(name, value);
+ }
+ }
+ parent = parent.getParentNode();
+ }
+ }
+
+ private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl) throws IOException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process import, parent location not set");
+
+ log.trace("processSchemaImport: " + wsdlLoc);
+
+ String location = getOptionalAttribute(importEl, "schemaLocation");
+ if (location == null)
+ throw new IllegalArgumentException("schemaLocation is null for xsd:import");
+
+ URL locationURL = getLocationURL(wsdlLoc, location);
+ Element rootElement = DOMUtils.parse(locationURL.openStream());
+ URL newloc = processSchemaInclude(types, locationURL, rootElement);
+ if (newloc != null)
+ importEl.setAttribute("schemaLocation", newloc.toExternalForm());
+ }
+
+ private URL processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl) throws IOException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process iclude, parent location not set");
+
+ File tmpFile = null;
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process include, parent location not set");
+
+ log.trace("processSchemaInclude: " + wsdlLoc);
+
+ String schemaPrefix = schemaEl.getPrefix();
+
+ String importTag = (schemaPrefix == null) ? "import" : schemaPrefix + ":import";
+ Element importElement = schemaEl.getOwnerDocument().createElementNS(Constants.NS_SCHEMA_XSD, importTag);
+ importElement.setAttribute("namespace", Constants.URI_SOAP11_ENC);
+ schemaEl.insertBefore(importElement, DOMUtils.getFirstChildElement(schemaEl));
+
+ // Handle schema includes
+ Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "include"));
+ while (it.hasNext())
+ {
+ Element includeEl = (Element)it.next();
+ String location = getOptionalAttribute(includeEl, "schemaLocation");
+ if (location == null)
+ throw new IllegalArgumentException("schemaLocation is null for xsd:include");
+
+ URL locationURL = getLocationURL(wsdlLoc, location);
+ Element rootElement = DOMUtils.parse(locationURL.openStream());
+ URL newloc = processSchemaInclude(types, locationURL, rootElement);
+ if (newloc != null)
+ includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
+ }
+
+ String targetNS = getOptionalAttribute(schemaEl, "targetNamespace");
+ if (targetNS != null)
+ {
+ log.trace("processSchemaInclude: [targetNS=" + targetNS + ",parentURL=" + wsdlLoc + "]");
+
+ tmpFile = SchemaUtils.getSchemaTempFile(targetNS);
+ tempFiles.add(tmpFile);
+
+ FileWriter fwrite = new FileWriter(tmpFile);
+ new DOMWriter(fwrite).setPrettyprint(true).print(schemaEl);
+ fwrite.close();
+
+ schemaLocationsMap.put(targetNS, tmpFile.toURL());
+ }
+
+ // schema elements that have no target namespace are skipped
+ //
+ // <xsd:schema>
+ // <xsd:import namespace="http://org.jboss.webservice/example/types" schemaLocation="Hello.xsd"/>
+ // <xsd:import namespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservic..." schemaLocation="subdir/HelloArr.xsd"/>
+ // </xsd:schema>
+ if (targetNS == null)
+ {
+ log.trace("Schema element without target namespace in: " + wsdlLoc);
+ }
+
+ handleSchemaImports(schemaEl, wsdlLoc);
+
+ return tmpFile != null ? tmpFile.toURL() : null;
+ }
+
+ private void handleSchemaImports(Element schemaEl, URL wsdlLoc) throws MalformedURLException
+ {
+ if (wsdlLoc == null)
+ throw new IllegalArgumentException("Cannot process import, parent location not set");
+
+ Iterator it = DOMUtils.getChildElements(schemaEl, new QName(Constants.NS_SCHEMA_XSD, "import"));
+ while (it.hasNext())
+ {
+ Element includeEl = (Element)it.next();
+ String schemaLocation = getOptionalAttribute(includeEl, "schemaLocation");
+ String namespace = getOptionalAttribute(includeEl, "namespace");
+
+ log.trace("handleSchemaImport: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
+
+ // Skip, let the entity resolver resolve these
+ if (namespace != null && schemaLocation != null)
+ {
+ URL currLoc = getLocationURL(wsdlLoc, schemaLocation);
+ schemaLocationsMap.put(namespace, currLoc);
+ }
+ else
+ {
+ log.trace("Skip schema import: [namespace=" + namespace + ",schemaLocation=" + schemaLocation + "]");
+ }
+ }
+ }
+
+ private URL getLocationURL(URL parentURL, String location) throws MalformedURLException
+ {
+ log.trace("getLocationURL: [location=" + location + ",parent=" + parentURL + "]");
+
+ URL locationURL = null;
+ try
+ {
+ locationURL = new URL(location);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore malformed URL
+ }
+
+ if (locationURL == null)
+ {
+ String parentProtocol = parentURL.getProtocol();
+ if (parentProtocol.equals("file") && !location.startsWith("/"))
+ {
+ String path = parentURL.toExternalForm();
+ path = path.substring(0, path.lastIndexOf("/"));
+ locationURL = new URL(path + "/" + location);
+ }
+ else if (parentProtocol.startsWith("http") && location.startsWith("/"))
+ {
+ String path = parentProtocol + "://" + parentURL.getHost() + ":" + parentURL.getPort();
+ locationURL = new URL(path + location);
+ }
+ else if (parentProtocol.equals("jar") && !location.startsWith("/"))
+ {
+ String path = parentURL.toExternalForm();
+ path = path.substring(0, path.lastIndexOf("/"));
+ locationURL = new URL(path + "/" + location);
+ }
+ else
+ {
+ throw new WSException("Unsupported schemaLocation: " + location);
+ }
+ }
+
+ log.trace("Modified schemaLocation: " + locationURL);
+ return locationURL;
+ }
+
+ private void processPortType(Definition srcWsdl, PortType srcPortType)
+ {
+ log.trace("processPortType: " + srcPortType.getQName());
+
+ QName qname = srcPortType.getQName();
+ NCName ncName = new NCName(qname);
+ if (destWsdl.getInterface(ncName) == null)
+ {
+ WSDLInterface destInterface = new WSDLInterface(destWsdl);
+ destInterface.setName(ncName);
+ destInterface.setQName(qname);
+
+ // eventing extensions
+ QName eventSourceProp = (QName)srcPortType.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSE_EVENTSOURCE);
+ if (eventSourceProp != null && eventSourceProp.getLocalPart().equals(Boolean.TRUE.toString()))
+ {
+ destInterface.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_EVENTSOURCE, eventSourceProp.getLocalPart()));
+ }
+
+ destWsdl.addInterface(destInterface);
+
+ processPortTypeOperations(srcWsdl, destInterface, srcPortType);
+ }
+ }
+
+ private void processPortTypeOperations(Definition srcWsdl, WSDLInterface destInterface, PortType srcPortType)
+ {
+ Iterator itOperations = srcPortType.getOperations().iterator();
+ while (itOperations.hasNext())
+ {
+ Operation srcOperation = (Operation)itOperations.next();
+
+ WSDLInterfaceOperation destOperation = new WSDLInterfaceOperation(destInterface);
+ destOperation.setName(new NCName(srcOperation.getName()));
+ destOperation.setStyle(getOperationStyle(srcWsdl, srcPortType, srcOperation));
+
+ processOperationInput(srcWsdl, srcOperation, destOperation, srcPortType);
+ processOperationOutput(srcWsdl, srcOperation, destOperation, srcPortType);
+ processOperationFaults(srcOperation, destOperation, destInterface);
+
+ destInterface.addOperation(destOperation);
+ }
+ }
+
+ private void processOperationInput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
+ {
+ Input srcInput = srcOperation.getInput();
+ if (srcInput != null)
+ {
+ Message srcMessage = srcInput.getMessage();
+ log.trace("processOperationInput: " + srcMessage.getQName());
+
+ QName wsaAction = (QName)srcInput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
+ if (wsaAction != null)
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_IN, wsaAction.getLocalPart()));
+
+ List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
+ if (paramOrder != null)
+ {
+ for (String name : paramOrder)
+ {
+ if (srcMessage.getPart(name) != null)
+ destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
+ }
+ }
+
+ WSDLInterfaceOperationInput rpcInput = new WSDLInterfaceOperationInput(destOperation);
+ for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(paramOrder))
+ {
+ if (Constants.URI_STYLE_IRI == destOperation.getStyle())
+ {
+ WSDLInterfaceOperationInput destInput = new WSDLInterfaceOperationInput(destOperation);
+ QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ destInput.setElement(elementName);
+
+ //Lets remember the Message name
+ destInput.setMessageName(srcMessage.getQName());
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN, srcMessage.getQName().getLocalPart()));
+
+ destInput.setPartName(srcPart.getName());
+
+ destOperation.addInput(destInput);
+ }
+ else
+ {
+ // If we don't have a type then we aren't a valid RPC parameter
+ // This could happen on a header element, in which case the
+ // binding will pick it up
+ QName xmlType = srcPart.getTypeName();
+ if (xmlType != null)
+ rpcInput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
+ else
+ messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ }
+ }
+ if (Constants.URI_STYLE_RPC == destOperation.getStyle())
+ {
+ // This is really a place holder, but also the actual value used in
+ // WSDL 2.0 RPC bindings
+ rpcInput.setElement(destOperation.getQName());
+ rpcInput.setMessageName(srcMessage.getQName());
+ destOperation.addInput(rpcInput);
+ }
+ }
+ }
+
+ private void processOperationOutput(Definition srcWsdl, Operation srcOperation, WSDLInterfaceOperation destOperation, PortType srcPortType)
+ {
+ Output srcOutput = srcOperation.getOutput();
+ if (srcOutput == null)
+ {
+ destOperation.setPattern(Constants.WSDL20_PATTERN_IN_ONLY);
+ return;
+ }
+
+ Message srcMessage = srcOutput.getMessage();
+ log.trace("processOperationOutput: " + srcMessage.getQName());
+
+ destOperation.setPattern(Constants.WSDL20_PATTERN_IN_OUT);
+ QName wsaAction = (QName) srcOutput.getExtensionAttribute(Constants.WSDL_ATTRIBUTE_WSA_ACTION);
+ if (wsaAction != null)
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_ACTION_OUT, wsaAction.getLocalPart()));
+
+ List<String> paramOrder = (List<String>) srcOperation.getParameterOrdering();
+ if (paramOrder != null)
+ {
+ for (String name : paramOrder)
+ {
+ if (srcMessage.getPart(name) != null)
+ {
+ WSDLRPCSignatureItem item = destOperation.getRpcSignatureitem(name);
+ if (item != null)
+ item.setDirection(Direction.INOUT);
+ else
+ destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name, Direction.OUT));
+ }
+ }
+ }
+
+ WSDLInterfaceOperationOutput rpcOutput = new WSDLInterfaceOperationOutput(destOperation);
+ for (Part srcPart : (List<Part>) srcMessage.getOrderedParts(null))
+ {
+ if (Constants.URI_STYLE_IRI == destOperation.getStyle())
+ {
+ WSDLInterfaceOperationOutput destOutput = new WSDLInterfaceOperationOutput(destOperation);
+
+ QName elementName = messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ destOutput.setElement(elementName);
+
+ // Lets remember the Message name
+ destOutput.setMessageName(srcMessage.getQName());
+ destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName()
+ .getLocalPart()));
+
+ // Remember the original part name
+ destOutput.setPartName(srcPart.getName());
+
+ destOperation.addOutput(destOutput);
+ }
+ else
+ {
+ // If we don't have a type then we aren't a valid RPC parameter
+ // This could happen on a header element, in which case the
+ // binding will pick it up
+ QName xmlType = srcPart.getTypeName();
+ if (xmlType != null)
+ rpcOutput.addChildPart(new WSDLRPCPart(srcPart.getName(), destWsdl.registerQName(xmlType)));
+ else
+ messagePartToElementName(srcWsdl, srcPortType, srcOperation, srcMessage, srcPart);
+ }
+ }
+
+ if (Constants.URI_STYLE_RPC == destOperation.getStyle())
+ {
+ // This is really a place holder, but also the actual value used in
+ // WSDL 2.0 RPC bindings
+ QName name = destOperation.getQName();
+ rpcOutput.setElement(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
+ rpcOutput.setMessageName(srcMessage.getQName());
+ destOperation.addOutput(rpcOutput);
+ }
+ }
+
+ private void processOperationFaults(Operation srcOperation, WSDLInterfaceOperation destOperation, WSDLInterface destInterface)
+ {
+
+ Map faults = srcOperation.getFaults();
+ Iterator itFaults = faults.values().iterator();
+ while (itFaults.hasNext())
+ {
+ Fault srcFault = (Fault)itFaults.next();
+ processOperationFault(destOperation, destInterface, srcFault);
+ }
+ }
+
+ private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface destInterface, Fault srcFault)
+ {
+ String faultName = srcFault.getName();
+ log.trace("processOperationFault: " + faultName);
+
+ WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface);
+ NCName ncName = new NCName(faultName);
+ destFault.setName(ncName);
+
+ Message message = srcFault.getMessage();
+ QName messageName = message.getQName();
+
+ Map partsMap = message.getParts();
+ if (partsMap.size() != 1)
+ throw new WSException("Unsupported number of fault parts in message " + messageName);
+
+ Part part = (Part)partsMap.values().iterator().next();
+ QName xmlName = part.getElementName();
+
+ if (xmlName != null)
+ {
+ destFault.setElement(xmlName);
+ }
+ else
+ {
+ destFault.setElement(messageName);
+ log.warn("Unsupported fault message part in message: " + messageName);
+ }
+
+ WSDLInterfaceFault prevFault = destInterface.getFault(ncName);
+ if (prevFault != null && prevFault.getName().equals(ncName) == false)
+ throw new WSException("Fault name must be unique: " + faultName);
+
+ // Add the fault to the interface
+ destInterface.addFault(destFault);
+
+ // Add the fault refererence to the operation
+ WSDLInterfaceOperationOutfault opOutFault = new WSDLInterfaceOperationOutfault(destOperation);
+ opOutFault.setRef(new QName(destWsdl.getTargetNamespace(), faultName));
+ destOperation.addOutfault(opOutFault);
+ }
+
+ /** Translate the message part name into an XML element name.
+ */
+ private QName messagePartToElementName(Definition srcWsdl, PortType srcPortType, Operation srcOperation, Message srcMessage, Part srcPart)
+ {
+ // <part name="param" element="tns:SomeType" />
+ QName xmlName = srcPart.getElementName();
+
+ // <part name="param" type="xsd:string" />
+ if (xmlName == null)
+ xmlName = new QName(srcPart.getName());
+
+ xmlName = destWsdl.registerQName(xmlName);
+ String key = srcMessage.getQName() + "->" + srcPart.getName();
+ messagePartToElementMap.put(key, xmlName);
+
+ return xmlName;
+ }
+
+ private BindingOperation getBindingOperation(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
+ {
+ Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
+
+ if (srcBinding == null)
+ throw new WSException("Cannot find binding for: " + srcPortType.getQName());
+
+ String srcOperationName = srcOperation.getName();
+ BindingOperation srcBindingOperation = srcBinding.getBindingOperation(srcOperationName, null, null);
+ if (srcBindingOperation == null)
+ throw new WSException("Cannot find binding operation for: " + srcOperationName);
+ return srcBindingOperation;
+ }
+
+ private String getOperationStyle(Definition srcWsdl, PortType srcPortType, Operation srcOperation)
+ {
+ Binding srcBinding = getPortTypeBindings(srcWsdl).get(srcPortType.getQName());
+ BindingOperation srcBindingOperation = getBindingOperation(srcWsdl, srcPortType, srcOperation);
+
+ String operationStyle = null;
+ List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPOperation)
+ {
+ SOAPOperation soapOp = (SOAPOperation)extElement;
+ operationStyle = soapOp.getStyle();
+ }
+ else if (SOAP12_OPERATION.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ operationStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+
+ if (operationStyle == null)
+ {
+ for (ExtensibilityElement extElement : (List<ExtensibilityElement>) srcBinding.getExtensibilityElements())
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ SOAPBinding soapBinding = (SOAPBinding) extElement;
+ operationStyle = soapBinding.getStyle();
+ }
+ else if (SOAP12_BINDING.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement) extElement).getElement();
+ operationStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+ }
+
+ return ("rpc".equals(operationStyle)) ? Constants.URI_STYLE_RPC : Constants.URI_STYLE_IRI;
+ }
+
+ private void processBinding(Definition srcWsdl, Binding srcBinding)
+ {
+ QName srcBindingQName = srcBinding.getQName();
+ log.trace("processBinding: " + srcBindingQName);
+
+ NCName ncName = new NCName(srcBindingQName);
+ if (destWsdl.getBinding(ncName) == null)
+ {
+ PortType srcPortType = srcBinding.getPortType();
+ if (srcPortType == null)
+ throw new WSException("Cannot find port type for binding: " + ncName);
+
+ processPortType(srcWsdl, srcPortType);
+
+ WSDLBinding destBinding = new WSDLBinding(destWsdl);
+ destBinding.setQName(srcBindingQName);
+ destBinding.setName(ncName);
+ destBinding.setInterfaceName(srcPortType.getQName());
+
+ String bindingStyle = Style.getDefaultStyle().toString();
+ List<ExtensibilityElement> extList = srcBinding.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBinding)
+ {
+ destBinding.setType(Constants.NS_SOAP11);
+ SOAPBinding soapBinding = (SOAPBinding)extElement;
+ bindingStyle = soapBinding.getStyle();
+ }
+ else if (SOAP12_BINDING.equals(elementType))
+ {
+ destBinding.setType(Constants.NS_SOAP12);
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ bindingStyle = getOptionalAttribute(domElement, "style");
+ }
+ }
+ destWsdl.addBinding(destBinding);
+ processBindingOperations(destBinding, srcBinding, bindingStyle);
+ }
+ }
+
+ private Map<QName, Binding> getPortTypeBindings(Definition srcWsdl)
+ {
+ getAllDefinedBindings(srcWsdl);
+ return portTypeBindings;
+ }
+
+ private Map<QName, Binding> getAllDefinedBindings(Definition srcWsdl)
+ {
+ if (allBindings != null)
+ return allBindings;
+
+ allBindings = new LinkedHashMap<QName, Binding>();
+ portTypeBindings = new LinkedHashMap<QName, Binding>();
+ Map srcBindings = srcWsdl.getBindings();
+ Iterator itBinding = srcBindings.values().iterator();
+ while (itBinding.hasNext())
+ {
+ Binding srcBinding = (Binding)itBinding.next();
+ allBindings.put(srcBinding.getQName(), srcBinding);
+ portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
+ }
+
+ // Bindings not available when pulled in through <wsdl:import>
+ // http://sourceforge.net/tracker/index.php?func=detail&aid=1240323&group_id...
+ Iterator itService = srcWsdl.getServices().values().iterator();
+ while (itService.hasNext())
+ {
+ Service srcService = (Service)itService.next();
+ Iterator itPort = srcService.getPorts().values().iterator();
+ while (itPort.hasNext())
+ {
+ Port srcPort = (Port)itPort.next();
+ Binding srcBinding = srcPort.getBinding();
+ allBindings.put(srcBinding.getQName(), srcBinding);
+ portTypeBindings.put(srcBinding.getPortType().getQName(), srcBinding);
+ }
+ }
+
+ return allBindings;
+ }
+
+ private void processBindingOperations(WSDLBinding destBinding, Binding srcBinding, String bindingStyle)
+ {
+ Iterator it = srcBinding.getBindingOperations().iterator();
+ while (it.hasNext())
+ {
+ BindingOperation srcBindingOperation = (BindingOperation)it.next();
+ processBindingOperation(destBinding, bindingStyle, srcBindingOperation);
+ }
+ }
+
+ private void processBindingOperation(WSDLBinding destBinding, String bindingStyle, BindingOperation srcBindingOperation)
+ {
+ String srcBindingName = srcBindingOperation.getName();
+ log.trace("processBindingOperation: " + srcBindingName);
+
+ WSDLInterface destInterface = destBinding.getInterface();
+ String namespaceURI = destInterface.getQName().getNamespaceURI();
+
+ WSDLBindingOperation destBindingOperation = new WSDLBindingOperation(destBinding);
+ QName refQName = new QName(namespaceURI, srcBindingName);
+ destBindingOperation.setRef(refQName);
+ destBinding.addOperation(destBindingOperation);
+
+ String opName = srcBindingName;
+ WSDLInterfaceOperation destIntfOperation = destInterface.getOperation(new NCName(opName));
+
+ // Process soap:operation@soapAction, soap:operation@style
+ List<ExtensibilityElement> extList = srcBindingOperation.getExtensibilityElements();
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPOperation)
+ {
+ SOAPOperation soapOp = (SOAPOperation)extElement;
+ destBindingOperation.setSOAPAction(soapOp.getSoapActionURI());
+ }
+ else if (SOAP12_OPERATION.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ destBindingOperation.setSOAPAction(getOptionalAttribute(domElement, "soapAction"));
+ }
+ }
+
+ BindingInput srcBindingInput = srcBindingOperation.getBindingInput();
+ if (srcBindingInput != null)
+ {
+ processBindingInput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingInput);
+ }
+
+ BindingOutput srcBindingOutput = srcBindingOperation.getBindingOutput();
+ if (srcBindingOutput != null)
+ {
+ processBindingOutput(destBindingOperation, destIntfOperation, srcBindingOperation, srcBindingOutput);
+ }
+ }
+
+ interface ReferenceCallback
+ {
+ void removeReference(QName element);
+ void removeRPCPart(String partName);
+ QName getXmlType(String partName);
+ }
+
+ private void processBindingInput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingInput srcBindingInput)
+ {
+ log.trace("processBindingInput");
+
+ QName soap11Body = new QName(Constants.NS_SOAP11, "body");
+ List<ExtensibilityElement> extList = srcBindingInput.getExtensibilityElements();
+ WSDLBindingOperationInput input = new WSDLBindingOperationInput(destBindingOperation);
+ destBindingOperation.addInput(input);
+
+ ReferenceCallback cb = new ReferenceCallback()
+ {
+ public QName getXmlType(String partName)
+ {
+ return srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
+ }
+
+ public void removeReference(QName element)
+ {
+ WSDLInterfaceOperationInput destIntfInput = destIntfOperation.getInput(element);
+ if (destIntfInput == null)
+ destIntfOperation.removeInput(element);
+ }
+
+ public void removeRPCPart(String partName)
+ {
+ WSDLInterfaceOperationInput operationInput = destIntfOperation.getInput(destIntfOperation.getQName());
+ operationInput.removeChildPart(partName);
+ }
+ };
+
+ processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, input, cb);
+ }
+
+ private void processBindingOutput(WSDLBindingOperation destBindingOperation, final WSDLInterfaceOperation destIntfOperation, final BindingOperation srcBindingOperation, BindingOutput srcBindingOutput)
+ {
+ log.trace("processBindingInput");
+
+ QName soap11Body = new QName(Constants.NS_SOAP11, "body");
+ List<ExtensibilityElement> extList = srcBindingOutput.getExtensibilityElements();
+ WSDLBindingOperationOutput output = new WSDLBindingOperationOutput(destBindingOperation);
+ destBindingOperation.addOutput(output);
+
+ ReferenceCallback cb = new ReferenceCallback()
+ {
+ public QName getXmlType(String partName)
+ {
+ return srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
+ }
+
+ public void removeReference(QName element)
+ {
+ WSDLInterfaceOperationOutput destIntfOutput = destIntfOperation.getOutput(element);
+ if (destIntfOutput == null)
+ destIntfOperation.removeInput(element);
+ }
+
+ public void removeRPCPart(String partName)
+ {
+ QName name = destIntfOperation.getQName();
+ WSDLInterfaceOperationOutput operationOutput = destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
+ operationOutput.removeChildPart(partName);
+ }
+ };
+
+ processBindingReference(destBindingOperation, destIntfOperation, soap11Body, extList, output, cb);
+ }
+
+
+ private void processBindingReference(WSDLBindingOperation destBindingOperation, WSDLInterfaceOperation destIntfOperation,
+ QName soap11Body, List<ExtensibilityElement> extList, WSDLBindingMessageReference reference, ReferenceCallback callback)
+ {
+ for (ExtensibilityElement extElement : extList)
+ {
+ QName elementType = extElement.getElementType();
+ if (soap11Body.equals(elementType) || SOAP12_BODY.equals(elementType))
+ {
+ processEncodingStyle(extElement, destBindingOperation);
+ }
+ else if (extElement instanceof SOAPHeader)
+ {
+ SOAPHeader header = (SOAPHeader)extElement;
+ QName messageQName = header.getMessage();
+ String partName = header.getPart();
+
+ String key = messageQName + "->" + partName;
+ QName elementName = (QName)messagePartToElementMap.get(key);
+ if (elementName == null)
+ throw new WSException("Could not determine element name from header: " + partName);
+
+ reference.addSoapHeader(new WSDLSOAPHeader(elementName, partName));
+ if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
+ {
+ callback.removeReference(elementName);
+ }
+ else
+ {
+ // Just in case
+ callback.removeRPCPart(partName);
+ }
+ }
+ else if (extElement instanceof MIMEMultipartRelated)
+ {
+ MIMEMultipartRelated related = (MIMEMultipartRelated)extElement;
+ Iterator i = related.getMIMEParts().iterator();
+ while (i.hasNext())
+ {
+ MIMEPart part = (MIMEPart)i.next();
+ Iterator j = part.getExtensibilityElements().iterator();
+ String name = null;
+ String types = null;
+
+ while (j.hasNext())
+ {
+ ExtensibilityElement inner = (ExtensibilityElement)j.next();
+ if (inner instanceof MIMEContent)
+ {
+ MIMEContent content = (MIMEContent)inner;
+ name = content.getPart();
+ if (types == null)
+ {
+ types = content.getType();
+ }
+ else
+ {
+ types += "," + content.getType();
+ }
+ }
+ }
+
+ // Found content types in this part
+ if (name != null)
+ {
+ QName xmlType = callback.getXmlType(name);
+ reference.addMimePart(new WSDLMIMEPart(name, xmlType, types));
+ if (Constants.URI_STYLE_IRI == destIntfOperation.getStyle())
+ {
+ // A mime part must be defined as <part type="">
+ callback.removeReference(new QName(name));
+ }
+ else
+ {
+ callback.removeRPCPart(name);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ private void processEncodingStyle(ExtensibilityElement extElement, WSDLBindingOperation destBindingOperation)
+ {
+ log.trace("processEncodingStyle");
+
+ String encStyle = null;
+ QName elementType = extElement.getElementType();
+ if (extElement instanceof SOAPBody)
+ {
+ SOAPBody body = (SOAPBody)extElement;
+ List encStyleList = body.getEncodingStyles();
+ if (encStyleList != null)
+ {
+ if (encStyleList.size() > 1)
+ log.warn("Multiple encoding styles not supported: " + encStyleList);
+
+ if (encStyleList.size() > 0)
+ {
+ encStyle = (String)encStyleList.get(0);
+ }
+ }
+ }
+ else if (SOAP12_BODY.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ encStyle = getOptionalAttribute(domElement, "encodingStyle");
+ }
+
+ if (encStyle != null)
+ {
+ String setStyle = destBindingOperation.getEncodingStyle();
+ if (encStyle.equals(setStyle) == false)
+ log.warn("Encoding style '" + encStyle + "' not supported for: " + destBindingOperation.getRef());
+
+ destBindingOperation.setEncodingStyle(encStyle);
+ }
+ }
+
+ private void processServices(Definition srcWsdl)
+ {
+ log.trace("BEGIN processServices: " + srcWsdl.getDocumentBaseURI());
+
+ // Each definition needs a clear binding cache
+ allBindings = null;
+
+ if (srcWsdl.getServices().size() > 0)
+ {
+ Iterator it = srcWsdl.getServices().values().iterator();
+ while (it.hasNext())
+ {
+ Service srcService = (Service)it.next();
+ QName qname = srcService.getQName();
+ WSDLService destService = new WSDLService(destWsdl);
+ destService.setName(new NCName(qname));
+ destService.setQName(qname);
+ destWsdl.addService(destService);
+ processPorts(srcWsdl, destService, srcService);
+ }
+ }
+ else
+ {
+ log.trace("Empty wsdl services, processing imports");
+ Iterator it = srcWsdl.getImports().values().iterator();
+ while (it.hasNext())
+ {
+ List<Import> srcImports = (List<Import>)it.next();
+ for (Import srcImport : srcImports)
+ {
+ Definition importDefinition = srcImport.getDefinition();
+ processServices(importDefinition);
+ }
+ }
+
+ // The binding cache must be clear after imports, so that undefined bindings can be located
+ allBindings = null;
+ }
+
+ log.trace("END processServices: " + srcWsdl.getDocumentBaseURI());
+ }
+
+ private void processPorts(Definition srcWsdl, WSDLService destService, Service srcService)
+ {
+ Iterator it = srcService.getPorts().values().iterator();
+ while (it.hasNext())
+ {
+ Port srcPort = (Port)it.next();
+ processPort(srcWsdl, destService, srcPort);
+ }
+ }
+
+ private void processPort(Definition srcWsdl, WSDLService destService, Port srcPort)
+ {
+ log.trace("processPort: " + srcPort.getName());
+
+ Binding srcBinding = srcPort.getBinding();
+
+ WSDLEndpoint destEndpoint = new WSDLEndpoint(destService);
+ destEndpoint.setName(new NCName(srcPort.getName()));
+ destEndpoint.setBinding(srcBinding.getQName());
+ destEndpoint.setQName(new QName(srcWsdl.getTargetNamespace(), srcPort.getName()));
+ destEndpoint.setAddress(getSOAPAddress(srcPort));
+ destService.addEndpoint(destEndpoint);
+
+ processBinding(srcWsdl, srcBinding);
+ }
+
+ /** Get the endpoint address from the ports extensible element
+ */
+ private String getSOAPAddress(Port srcPort)
+ {
+ String soapAddress = "dummy";
+
+ Iterator it = srcPort.getExtensibilityElements().iterator();
+ while (it.hasNext())
+ {
+ ExtensibilityElement extElement = (ExtensibilityElement)it.next();
+ QName elementType = extElement.getElementType();
+
+ if (extElement instanceof SOAPAddress)
+ {
+ SOAPAddress addr = (SOAPAddress)extElement;
+ soapAddress = addr.getLocationURI();
+ break;
+ }
+ else if (SOAP12_ADDRESS.equals(elementType))
+ {
+ Element domElement = ((UnknownExtensibilityElement)extElement).getElement();
+ soapAddress = getOptionalAttribute(domElement, "location");
+ break;
+ }
+ else if ("address".equals(elementType.getLocalPart()))
+ {
+ log.warn("Unprocessed extension element: " + elementType);
+ }
+ }
+
+ if (soapAddress == null)
+ throw new WSException("Cannot obtain SOAP address");
+
+ return soapAddress;
+ }
+
+ private String getOptionalAttribute(Element domElement, String attrName)
+ {
+ String attrValue = domElement.getAttribute(attrName);
+ return (attrValue.length() > 0 ? attrValue : null);
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java (from rev 1572, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,538 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.wsdl;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.HashSet;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.wsdl.NCName;
+import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingMessageReference;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.common.metadata.wsdl.WSDLImport;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceMessageReference;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
+import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCPart;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem;
+import org.jboss.ws.common.metadata.wsdl.WSDLSOAPHeader;
+import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.common.metadata.wsdl.WSDLRPCSignatureItem.Direction;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.w3c.dom.Element;
+
+/**
+ * A WSDL Writer that writes a WSDL 1.1 file. It works off
+ * of the WSDL20 Object Graph.
+ * @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ */
+public class WSDL11Writer extends WSDLWriter
+{
+ //Used Internally
+ private String wsdlStyle = Constants.RPC_LITERAL;
+
+ // Used to prevent duplicates
+ private HashSet<String> writtenFaultMessages = new HashSet<String>();
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ public WSDL11Writer(WSDLDefinitions wsdl)
+ {
+ super(wsdl);
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ write(writer, null);
+ }
+
+
+ public void write(Writer writer, String charset) throws IOException
+ {
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws IOException
+ {
+ // Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
+ if (wsdl.getWsdlOneOneDefinition() != null)
+ {
+ Definition wsdlDefinition = wsdl.getWsdlOneOneDefinition();
+ try
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
+ wsdlWriter.writeWSDL(wsdlDefinition, writer);
+ }
+ catch (WSDLException e)
+ {
+ this.logException(e);
+ throw new IOException(e.toString());
+ }
+ }
+ else
+ {
+ StringBuilder buffer = new StringBuilder();
+
+ //Detect the WSDL Style early
+ wsdlStyle = utils.getWSDLStyle(wsdl);
+
+ StringBuilder importBuffer = new StringBuilder();
+ for (WSDLImport wsdlImport : wsdl.getImports())
+ {
+ if (resolver == null)
+ continue;
+
+ WSDLWriterResolver resolved = resolver.resolve(wsdlImport.getLocation());
+ if (resolved == null)
+ continue;
+
+ String namespace = wsdlImport.getNamespace();
+ importBuffer.append("<import namespace='" + namespace + "' location='" + resolved.actualFile + "'/>");
+ if (resolved != null)
+ {
+ StringBuilder builder = new StringBuilder();
+
+ appendDefinitions(builder, namespace);
+ appendBody(builder, namespace);
+ writeBuilder(builder, resolved.writer, resolved.charset);
+ resolved.writer.close();
+ }
+ }
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ if (importBuffer.length() > 0)
+ buffer.append(importBuffer);
+
+ appendBody(buffer, wsdl.getTargetNamespace());
+ writeBuilder(buffer, writer, charset);
+ }
+ }
+
+ private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws IOException
+ {
+ Element element = DOMUtils.parse(builder.toString());
+
+ if (charset != null)
+ writer.write("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendBody(StringBuilder builder, String namespace)
+ {
+ writtenFaultMessages.clear();
+
+ appendTypes(builder, namespace);
+ appendMessages(builder, namespace);
+ appendInterfaces(builder, namespace);
+ appendBindings(builder, namespace);
+ appendServices(builder, namespace);
+ builder.append("</definitions>");
+ }
+
+ protected void appendMessages(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] interfaces = wsdl.getInterfaces();
+ int len = interfaces != null ? interfaces.length : 0;
+ for (int i = 0; i < len; i++)
+ {
+ WSDLInterface intf = interfaces[i];
+ if (! namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ WSDLInterfaceOperation[] operations = intf.getSortedOperations();
+ int lenOps = operations.length;
+ for (int j = 0; j < lenOps; j++)
+ {
+ appendMessage(buffer, operations[j]);
+ appendMessagesForExceptions(buffer, operations[j]);
+ }
+ }
+ }
+
+ private void appendMessage(StringBuilder buffer, WSDLInterfaceOperation operation)
+ {
+ String opname = operation.getName().toString();
+ //Determine the style of the wsdl
+ if (Constants.URI_STYLE_RPC.equals(operation.getStyle()) == false)
+ wsdlStyle = Constants.DOCUMENT_LITERAL; //Not RPC/Literal
+
+ String interfaceName = operation.getWsdlInterface().getName().toString();
+ buffer.append("<message name='" + interfaceName + "_" + opname + "' >");
+ for (WSDLInterfaceOperationInput input : operation.getInputs())
+ appendMessageParts(buffer, input);
+ buffer.append("</message>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
+ {
+ buffer.append("<message name='" + interfaceName + "_" + opname + "Response' >");
+ WSDLInterfaceOperationOutput[] outputs = operation.getOutputs();
+ for (WSDLInterfaceOperationOutput output : outputs)
+ appendMessageParts(buffer, output);
+ buffer.append("</message>");
+ }
+ }
+
+ private void appendMessagesForExceptions(StringBuilder buffer, WSDLInterfaceOperation operation)
+ {
+ //Get the outfaults
+ WSDLInterfaceOperationOutfault[] faults = operation.getOutfaults();
+ int len = faults != null ? faults.length : 0;
+
+ for (int i = 0; i < len; i++)
+ {
+ WSDLInterfaceOperationOutfault fault = faults[i];
+ String exceptionName = fault.getRef().getLocalPart();
+ if (writtenFaultMessages.contains(exceptionName))
+ continue;
+
+ WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(new NCName(exceptionName));
+ QName xmlName = interfaceFault.getElement();
+
+ buffer.append("<message name='" + exceptionName + "' >");
+ String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
+ String xmlNameStr = prefix + ":" + xmlName.getLocalPart();
+ buffer.append("<part name='" + exceptionName + "' element='" + xmlNameStr + "' />");
+ buffer.append("</message>");
+
+ writtenFaultMessages.add(exceptionName);
+ }
+ }
+
+ private String getReferenceString(QName name)
+ {
+ String namespaceURI = name.getNamespaceURI();
+ String prefix = wsdl.getPrefix(namespaceURI);
+ if (prefix == null)
+ throw new WSException("Prefix not bound for namespace: " + namespaceURI);
+
+ return prefix + ":" + name.getLocalPart();
+ }
+
+ private void appendMessageParts(StringBuilder buffer, WSDLInterfaceMessageReference reference)
+ {
+ if (wsdlStyle.equals(Constants.RPC_LITERAL))
+ {
+ for (WSDLRPCPart part : reference.getChildParts())
+ {
+ buffer.append("<part name='" + part.getName()).append('\'');
+ buffer.append(" type='" + getReferenceString(part.getType()) + "'/>");
+ }
+ }
+ else
+ {
+ QName element = reference.getElement();
+ // Null represents empty message
+ if (element != null)
+ {
+ buffer.append("<part name='" + reference.getPartName() + '\'');
+ buffer.append(" element='" + getReferenceString(element) + "'/>");
+ }
+ }
+
+ WSDLBindingMessageReference bindingReference = getBindingReference(reference);
+ if (bindingReference == null)
+ return;
+
+ for (WSDLSOAPHeader header : bindingReference.getSoapHeaders())
+ {
+ if (header.isIncludeInSignature());
+ {
+ QName element = header.getElement();
+ buffer.append("<part name='" + header.getPartName() + '\'');
+ buffer.append(" element='" + getReferenceString(element) + "'/>");
+ }
+ }
+ }
+
+ private WSDLBindingMessageReference getBindingReference(WSDLInterfaceMessageReference reference)
+ {
+ WSDLInterfaceOperation operation = reference.getWsdlOperation();
+ WSDLInterface wsdlInterface = operation.getWsdlInterface();
+ WSDLBinding binding = wsdlInterface.getWsdlDefinitions().getBindingByInterfaceName(wsdlInterface.getQName());
+ WSDLBindingOperation bindingOperation = binding.getOperationByRef(operation.getQName());
+ WSDLBindingMessageReference[] bindingReferences;
+
+ if (reference instanceof WSDLInterfaceOperationInput)
+ bindingReferences = bindingOperation.getInputs();
+ else
+ bindingReferences = bindingOperation.getOutputs();
+
+ if (bindingReferences.length > 1)
+ throw new IllegalArgumentException("WSDl 1.1 only supports In-Only, and In-Out MEPS, more than reference input found");
+
+ if (bindingReferences.length == 1)
+ return bindingReferences[0];
+
+ return null;
+ }
+
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
+ {
+ WSDLInterface[] intfs = wsdl.getInterfaces();
+ for (int i = 0; i < intfs.length; i++)
+ {
+ WSDLInterface intf = intfs[i];
+ if (!namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ buffer.append("<portType name='" + intf.getName() + "'>");
+ appendPortOperations(buffer, intf);
+ buffer.append("</portType>");
+ }
+ }
+
+ private String getParameterOrder(WSDLInterfaceOperation operation)
+ {
+ StringBuilder builder = new StringBuilder();
+ for (WSDLRPCSignatureItem item : operation.getRpcSignatureItems())
+ {
+ if (item.getDirection() != Direction.RETURN)
+ {
+ if (builder.length() > 0)
+ builder.append(' ');
+ builder.append(item.getName());
+ }
+ }
+
+ return builder.toString();
+ }
+
+ protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
+ {
+ String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
+ WSDLInterfaceOperation[] operations = intf.getSortedOperations();
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLInterfaceOperation operation = operations[i];
+ buffer.append("<operation name='" + operation.getName().toString() + "'");
+
+ String parameterOrder = getParameterOrder(operation);
+ if (parameterOrder.length() > 0)
+ buffer.append(" parameterOrder='").append(parameterOrder).append("'");
+ buffer.append(">");
+
+ String opname = operation.getName().toString();
+ String interfaceName = operation.getWsdlInterface().getName().toString();
+ String msgEl = prefix + ":" + interfaceName + "_" + opname;
+
+ buffer.append("<input message='" + msgEl + "'>").append("</input>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(operation.getPattern()))
+ {
+ buffer.append("<output message='" + msgEl + "Response'>");
+ buffer.append("</output>");
+ }
+
+ //Append the Faults
+ for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
+ {
+ QName element = fault.getRef();
+ buffer.append("<fault message='" + utils.getFormattedString(element));
+ buffer.append("' name='" + element.getLocalPart() + "'/>");
+ }
+
+ buffer.append("</operation>");
+ }
+ }
+
+ protected void appendBindings(StringBuilder buffer, String namespace)
+ {
+ WSDLBinding[] bindings = wsdl.getBindings();
+ for (int i = 0; i < bindings.length; i++)
+ {
+ WSDLBinding binding = bindings[i];
+ if (!namespace.equals(binding.getQName().getNamespaceURI()))
+ continue;
+ buffer.append("<binding name='" + binding.getName() + "' type='" + getQNameRef(binding.getInterfaceName()) + "'>");
+ //TODO:Need to derive the WSDLStyle from the Style attribute of InterfaceOperation
+ if (wsdlStyle == null)
+ throw new IllegalArgumentException("WSDL Style is null (should be rpc or document");
+ String style = "rpc";
+ if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
+ style = "document";
+ buffer.append("<" + soapPrefix + ":binding transport='http://schemas.xmlsoap.org/soap/http' style='" + style + "'/>");
+ appendBindingOperations(buffer, binding);
+ buffer.append("</binding>");
+ }
+ }
+
+ protected void appendBindingOperations(StringBuilder buffer, WSDLBinding binding)
+ {
+ WSDLBindingOperation[] operations = binding.getOperations();
+ Arrays.sort(operations);
+
+ for (int i = 0; i < operations.length; i++)
+ {
+ WSDLBindingOperation operation = operations[i];
+ String interfaceName = operation.getWsdlBinding().getInterfaceName().getLocalPart();
+
+ WSDLInterface wsdlInterface = wsdl.getInterface(new NCName(interfaceName));
+ if (wsdlInterface == null)
+ throw new WSException("WSDL Interface should not be null");
+ WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
+
+ buffer.append("<operation name='" + interfaceOperation.getName() + "'>");
+ String soapAction = (operation.getSOAPAction() != null ? operation.getSOAPAction() : "");
+ buffer.append("<" + soapPrefix + ":operation soapAction=\"" + soapAction + "\"/>");
+
+ WSDLBindingOperationInput[] inputs = operation.getInputs();
+ if (inputs.length != 1)
+ throw new WSException("WSDl 1.1 only supports In-Only, and In-Out MEPS.");
+
+ buffer.append("<input>");
+ appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
+ buffer.append("</input>");
+
+ if (! Constants.WSDL20_PATTERN_IN_ONLY.equals(getBindingOperationPattern(operation)))
+ {
+ buffer.append("<output>");
+ WSDLBindingOperationOutput[] outputs = operation.getOutputs();
+ appendSOAPBinding(buffer, wsdlInterface, operation, outputs);
+ buffer.append("</output>");
+ }
+
+ //Append faults
+ WSDLInterfaceOperationOutfault[] faults = interfaceOperation.getOutfaults();
+ if (faults != null)
+ {
+ for (WSDLInterfaceOperationOutfault fault : faults)
+ {
+ String n = "name='" + fault.getRef().getLocalPart() + "'";
+ buffer.append("<fault " + n + ">");
+ buffer.append("<" + soapPrefix + ":fault " + n + " use='literal' />");
+ buffer.append("</fault>");
+ }
+ buffer.append("</operation>");
+ }
+ }
+ }
+
+ private void appendSOAPBinding(StringBuilder buffer, WSDLInterface wsdlInterface, WSDLBindingOperation operation, WSDLBindingMessageReference[] inputs)
+ {
+ String tns = wsdl.getTargetNamespace();
+ WSDLInterfaceOperation interfaceOperation = wsdlInterface.getOperation(new NCName(operation.getRef().getLocalPart()));
+ WSDLInterfaceMessageReference reference = (inputs instanceof WSDLBindingOperationInput[]) ? interfaceOperation.getInputs()[0]
+ : interfaceOperation.getOutputs()[0];
+
+ StringBuilder bodyParts = new StringBuilder();
+ if (Constants.DOCUMENT_LITERAL == wsdlStyle)
+ {
+ bodyParts.append(reference.getPartName());
+ }
+ else
+ {
+ for (WSDLRPCPart part : reference.getChildParts())
+ {
+ if (bodyParts.length() > 0)
+ bodyParts.append(" ");
+ bodyParts.append(part.getName());
+ }
+ }
+
+ StringBuilder soapHeader = new StringBuilder();
+ for (WSDLSOAPHeader header : inputs[0].getSoapHeaders())
+ {
+ if (header.isIncludeInSignature())
+ {
+ String messageName = wsdlInterface.getName() + "_" + operation.getRef().getLocalPart();
+ if (reference instanceof WSDLInterfaceOperationOutput)
+ messageName += "Response";
+ soapHeader.append("<").append(soapPrefix).append(":header use='literal' message='tns:").append(messageName);
+ soapHeader.append("' part='").append(header.getElement().getLocalPart()).append("'/>");
+ }
+ }
+
+ buffer.append("<" + soapPrefix + ":body use='literal'");
+ if (wsdlStyle != Constants.DOCUMENT_LITERAL)
+ buffer.append(" namespace='" + tns + "'");
+ if (soapHeader.length() > 0)
+ {
+ buffer.append(" parts='").append(bodyParts).append("'/>");
+ buffer.append(soapHeader);
+ }
+ else
+ {
+ buffer.append("/>");
+ }
+ }
+
+ private String getBindingOperationPattern(WSDLBindingOperation operation)
+ {
+ WSDLBinding binding = operation.getWsdlBinding();
+ String pattern = binding.getInterface().getOperation(new NCName(operation.getRef().getLocalPart())).getPattern();
+
+ return pattern;
+ }
+
+ protected void appendServices(StringBuilder buffer, String namespace)
+ {
+ WSDLService[] services = wsdl.getServices();
+ int len = services.length;
+ for (int i = 0; i < len; i++)
+ {
+
+ WSDLService service = services[i];
+ if (!namespace.equals(service.getQName().getNamespaceURI()))
+ continue;
+ buffer.append("<service name='" + service.getName() + "'>");
+ WSDLEndpoint[] endpoints = service.getEndpoints();
+ int lenend = endpoints.length;
+ for (int j = 0; j < lenend; j++)
+ {
+ WSDLEndpoint endpoint = endpoints[j];
+ appendServicePort(buffer, endpoint);
+ }
+
+ buffer.append("</service>");
+ }
+ }
+
+ protected void appendServicePort(StringBuilder buffer, WSDLEndpoint endpoint)
+ {
+ String name = endpoint.getName().toString();
+ QName endpointBinding = endpoint.getBinding();
+ String prefix = endpointBinding.getPrefix();
+ prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
+ String ebname = prefix + ":" + endpointBinding.getLocalPart();
+ buffer.append("<port name='" + name + "' binding='" + ebname + "'>");
+ buffer.append("<" + soapPrefix + ":address location='" + endpoint.getAddress() + "'/>");
+ buffer.append("</port>");
+ }
+}
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java (from rev 1572, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,196 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.tools.wsdl;
+
+// $Id$
+
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.ConnectException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.parsers.DocumentBuilder;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLException;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
+/**
+ * A factory that creates a <code>WSDLDefinitions</code> object from an URL.
+ *
+ * This implementations deals with different WSDL versions so that clients of this
+ * factory do need to know about WSDL version specifics. The Java object view of the
+ * WSDL document (WSDLDefinitions) is modeled on WSDL-2.0
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLDefinitionsFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
+
+ // This feature is set by default in wsdl4j, it means the object structure contains the imported arguments
+ public static final String FEATURE_IMPORT_DOCUMENTS = "javax.wsdl.importDocuments";
+ // Set this feature for additional debugging output
+ public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
+
+ // The WSDL reader features
+ private Map features = new HashMap();
+
+ // Hide constructor
+ private WSDLDefinitionsFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a wsdl factory
+ */
+ public static WSDLDefinitionsFactory newInstance()
+ {
+ return new WSDLDefinitionsFactory();
+ }
+
+ /**
+ * Set a feature on the underlying reader
+ */
+ public void setFeature(String name, boolean value) throws IllegalArgumentException
+ {
+ features.put(name, new Boolean(value));
+ }
+
+ /**
+ * Read the wsdl document from the given URL
+ */
+ public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
+ {
+ if (wsdlLocation == null)
+ throw new IllegalArgumentException("URL cannot be null");
+
+ log.debug("parse: " + wsdlLocation.toExternalForm());
+
+ EntityResolver entityResolver = new JBossWSEntityResolver();
+ WSDLDefinitions wsdlDefinitions = null;
+ try
+ {
+ Document wsdlDoc = getDocument(wsdlLocation);
+ String defaultNamespace = getDefaultNamespace(wsdlDoc);
+ if (Constants.NS_WSDL11.equals(defaultNamespace))
+ {
+ WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+ WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+
+ // Setup reader features
+ Iterator it = features.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Boolean flag = (Boolean)entry.getValue();
+ wsdlReader.setFeature(key, flag.booleanValue());
+ }
+
+ // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
+ ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
+
+ Definition definition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
+ wsdlDefinitions = new WSDL11Reader().processDefinition(definition, wsdlLocation);
+ wsdlDefinitions.setWsdlDocument(wsdlDoc);
+ }
+ else
+ throw new WSDLException("Invalid default namespace: " + defaultNamespace);
+
+ if (log.isTraceEnabled())
+ {
+ StringWriter stwr = new StringWriter();
+ WSDL11Writer wsdlWriter = new WSDL11Writer(wsdlDefinitions);
+ wsdlWriter.write(stwr);
+ log.trace("\n" + stwr.toString());
+ }
+ }
+ catch (WSDLException e)
+ {
+ throw e;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSDLException(e);
+ }
+
+ return wsdlDefinitions;
+ }
+
+ /** Get the WSDL document.
+ */
+ private Document getDocument(URL wsdlLocation) throws WSDLException
+ {
+ try
+ {
+ InputStream wsdlInputStream = wsdlLocation.openStream();
+ try
+ {
+ DocumentBuilder builder = DOMUtils.getDocumentBuilder();
+ return builder.parse(wsdlInputStream);
+ }
+ finally
+ {
+ wsdlInputStream.close();
+ }
+ }
+ catch (ConnectException ex)
+ {
+ throw new WSDLException("Cannot connect to: " + wsdlLocation);
+ }
+ catch (Exception ex)
+ {
+ throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation, ex);
+ }
+ }
+
+ /** Get the default namespace for the given WSDL
+ */
+ private String getDefaultNamespace(Document wsdlDoc) throws WSDLException
+ {
+ Element root = wsdlDoc.getDocumentElement();
+ String defaultNamespace = root.getNamespaceURI();
+ return defaultNamespace;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java (from rev 1572, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLLocatorImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLLocatorImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.wsdl.xml.WSDLLocator;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+/* A WSDLLocator that can handle wsdl imports
+ */
+class WSDLLocatorImpl implements WSDLLocator
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
+
+ private EntityResolver entityResolver;
+ private URL wsdlURL;
+ private String latestImportURI;
+
+ public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
+ {
+ if (wsdlFile == null)
+ throw new IllegalArgumentException("WSDL file argument cannot be null");
+
+ this.entityResolver = entityResolver;
+ this.wsdlURL = wsdlFile;
+ }
+
+ public InputSource getBaseInputSource()
+ {
+ log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+ try
+ {
+ InputStream is = wsdlURL.openStream();
+ if (is == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
+
+ return new InputSource(is);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
+ }
+ }
+
+ public String getBaseURI()
+ {
+ return wsdlURL.toExternalForm();
+ }
+
+ public InputSource getImportInputSource(String parent, String resource)
+ {
+ log.trace("getImportInputSource [parent=" + parent + ",resource=" + resource + "]");
+
+ URL parentURL = null;
+ try
+ {
+ parentURL = new URL(parent);
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Not a valid URL: " + parent);
+ return null;
+ }
+
+ String wsdlImport = null;
+ String external = parentURL.toExternalForm();
+
+ // An external URL
+ if (resource.startsWith("http://") || resource.startsWith("https://"))
+ {
+ wsdlImport = resource;
+ }
+
+ // Absolute path
+ else if (resource.startsWith("/"))
+ {
+ String beforePath = external.substring(0, external.indexOf(parentURL.getPath()));
+ wsdlImport = beforePath + resource;
+ }
+
+ // A relative path
+ else
+ {
+ String parentDir = external.substring(0, external.lastIndexOf("/"));
+
+ // remove references to current dir
+ while (resource.startsWith("./"))
+ resource = resource.substring(2);
+
+ // remove references to parentdir
+ while (resource.startsWith("../"))
+ {
+ parentDir = parentDir.substring(0, parentDir.lastIndexOf("/"));
+ resource = resource.substring(3);
+ }
+
+ wsdlImport = parentDir + "/" + resource;
+ }
+
+ try
+ {
+ log.trace("Trying to resolve: " + wsdlImport);
+ InputSource inputSource = entityResolver.resolveEntity(wsdlImport, wsdlImport);
+ if (inputSource != null)
+ {
+ latestImportURI = wsdlImport;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot resolve imported resource: " + wsdlImport);
+ }
+
+ return inputSource;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Cannot access imported wsdl [" + wsdlImport + "], " + e.getMessage());
+ }
+ }
+
+ public String getLatestImportURI()
+ {
+ return latestImportURI;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java (from rev 1572, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLWriter.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLWriter.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -0,0 +1,228 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.wsdl;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.wsdl.DOMTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
+import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.common.metadata.wsdl.XSModelTypes;
+import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.w3c.dom.Element;
+
+/**
+ * A helper that writes out a WSDL definition
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Anil.Saldhana(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class WSDLWriter
+{
+ // provide logging
+ protected static final Logger log = Logger.getLogger(WSDLWriter.class);
+
+ protected WSDLDefinitions wsdl;
+ protected WSDLUtils utils = WSDLUtils.getInstance();
+
+ // The soap prefix
+ protected String soapPrefix = "soap";
+
+ /**
+ * Include or import WSDL Types
+ */
+ protected boolean includeSchemaInWSDL = true;
+
+ /** Use WSDLDefinitions.writeWSDL instead. */
+ public WSDLWriter(WSDLDefinitions wsdl)
+ {
+ if (wsdl == null)
+ throw new IllegalArgumentException("WSDL definitions is NULL");
+
+ this.wsdl = wsdl;
+ }
+
+ /** Write the wsdl definition to the given writer, clients should not care about the wsdl version. */
+ public void write(Writer writer, String charset) throws IOException
+ {
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WSDLWriterResolver resolver) throws IOException
+ {
+ String wsdlNamespace = wsdl.getWsdlNamespace();
+ if (Constants.NS_WSDL11.equals(wsdlNamespace))
+ {
+ WSDL11Writer wsdl11Writer = new WSDL11Writer(wsdl);
+ wsdl11Writer.write(writer, charset, resolver);
+ }
+ else
+ {
+ throw new WSException("Unsupported wsdl version: " + wsdlNamespace);
+ }
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(Constants.XML_HEADER);
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ appendTypes(buffer, wsdl.getTargetNamespace());
+ appendInterfaces(buffer, wsdl.getTargetNamespace());
+ appendBindings(buffer, wsdl.getTargetNamespace());
+ appendServices(buffer, wsdl.getTargetNamespace());
+
+ buffer.append("</definitions>");
+
+ Element element = DOMUtils.parse(buffer.toString());
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendDefinitions(StringBuilder buffer, String namespace)
+ {
+ buffer.append("<definitions");
+ //Append service name as done by wscompile, if there is just one
+ WSDLService[] services = wsdl.getServices();
+ if (services != null && services.length == 1)
+ {
+ WSDLService ser = services[0];
+ buffer.append(" name='" + ser.getName() + "'");
+ }
+ buffer.append(" targetNamespace='" + namespace + "'");
+ buffer.append(" xmlns='" + wsdl.getWsdlNamespace() + "'");
+
+ Iterator it = wsdl.getRegisteredNamespaceURIs();
+ while (it.hasNext())
+ {
+ String namespaceURI = (String)it.next();
+ String prefix = wsdl.getPrefix(namespaceURI);
+ if (prefix.length() > 0)
+ {
+ buffer.append(" xmlns:" + prefix + "='" + namespaceURI + "'");
+ if (Constants.PREFIX_SOAP11.equals(prefix) || Constants.PREFIX_SOAP12.equals(prefix))
+ soapPrefix = prefix;
+ }
+ }
+ buffer.append(">");
+ }
+
+ protected void appendTypes(StringBuilder buffer, String namespace)
+ {
+ WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
+ // If the type section is bound to a particular namespace, verify it mataches, otherwise skip
+ if (wsdlTypes.getNamespace() != null && !wsdlTypes.getNamespace().equals(namespace))
+ return;
+
+ if (wsdlTypes instanceof XSModelTypes)
+ {
+ buffer.append("<types>");
+ JBossXSModel xsM = WSDLUtils.getSchemaModel(wsdlTypes);
+ String schema = xsM.serialize();
+ buffer.append(schema);
+ buffer.append("</types>");
+ }
+ else if (wsdlTypes instanceof DOMTypes)
+ {
+ synchronized (wsdlTypes)
+ {
+ buffer.append(DOMWriter.printNode(((DOMTypes)wsdlTypes).getElement(), true));
+ }
+ }
+ }
+
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
+ {
+ }
+
+ protected void appendBindings(StringBuilder buffer, String namespace)
+ {
+ }
+
+ protected void appendServices(StringBuilder buffer, String namespace)
+ {
+ }
+
+ /** Get a prefixed name of form prefix:localPart */
+ protected String getQNameRef(QName qname)
+ {
+ String retStr = qname.getLocalPart();
+
+ String prefix = qname.getPrefix();
+ String nsURI = qname.getNamespaceURI();
+ if (prefix.length() == 0 && nsURI.length() > 0)
+ {
+ qname = wsdl.registerQName(qname);
+ prefix = qname.getPrefix();
+ }
+
+ if (prefix.length() > 0)
+ retStr = prefix + ":" + retStr;
+
+ return retStr;
+ }
+
+ public WSDLDefinitions getWsdl()
+ {
+ return wsdl;
+ }
+
+ public void setWsdl(WSDLDefinitions wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public boolean isIncludeTypesInWSDL()
+ {
+ return includeSchemaInWSDL;
+ }
+
+ public void logException(Exception e)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace(e);
+ }
+ }
+
+ public void logMessage(String msg)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace(msg);
+ }
+ }
+}
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -44,12 +44,12 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.binding.EndpointInvocation;
-import org.jboss.ws.core.binding.UnboundHeader;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.UnboundHeader;
/**
* Test the SOAPBindingProvider
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -46,7 +46,7 @@
import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.binding.EndpointInvocation;
+import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MicrosoftGeneratedWSDLTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -25,9 +25,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Tests WSDL11Reader ability to parse WSDL Files
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/MultiSchemaTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -25,9 +25,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the XSModel, and how it handles multiple schemas
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/SimpleFileImportTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -31,7 +31,7 @@
import org.jboss.net.protocol.URLStreamHandlerFactory;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.common.metadata.wsdl.WSDL11DefinitionFactory;
+import org.jboss.ws.tools.wsdl.WSDL11DefinitionFactory;
/**
* Test a wsdl import functionality.
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDL11TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -29,7 +29,6 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.metadata.wsdl.NCName;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
@@ -40,6 +39,7 @@
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.extras.eventing.EventingConstants;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the unmarshalling of wsdl-1.1 into the unified wsdl structure
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/wsdl11/WSDLTypesTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -26,9 +26,9 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* The WSDL may contain or import XSD schema definitions.
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1068/JBWS1068TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Cannot handle xsd:import of xml schema
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -28,9 +28,9 @@
import org.jboss.ws.common.config.ServerConfig;
import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
*
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws958/JBWS958TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -26,7 +26,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* XML entity usage in wsdl contained schema
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -35,8 +35,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefEJBTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -35,8 +35,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXRPC <service-ref>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/DIIClientTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -44,7 +44,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceExt;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
import org.jboss.ws.core.jaxrpc.StubExt;
@@ -59,6 +58,7 @@
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wseventing/EventingSupport.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -36,7 +36,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.extras.addressing.AddressingClientUtil;
import org.jboss.ws.extras.eventing.EventSourceEndpoint;
@@ -47,6 +46,7 @@
import org.jboss.ws.extras.eventing.element.FilterType;
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Eventing test case support.
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/context/WebServiceContextTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS WebServiceContext
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -43,7 +43,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test JAXWS Endpoint deployment
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -30,9 +30,9 @@
import org.jboss.ws.common.config.ServerConfig;
import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
*
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws860/JBWS860TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Investigate "Is Not A Servlet" error with multiple servlets in the web.xml
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* EJB3 jmx name is incorrectly derrived
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -30,7 +30,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
// $Id$
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -48,7 +48,7 @@
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareRequest;
import org.jboss.test.ws.jaxws.jsr181.soapbinding.SubmitBareResponse;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -37,7 +37,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test a Provider<SOAPMessage>
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -34,8 +34,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -25,7 +25,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import javax.xml.namespace.QName;
import java.net.MalformedURLException;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -33,7 +33,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -34,7 +34,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -35,7 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test the JAXWS annotation: javax.xml.ws.WebServiceref
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToJavaTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -32,10 +32,10 @@
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.common.metadata.wsdl.WSDL20Writer;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
+import org.jboss.ws.tools.wsdl.WSDL20Writer;
/**
* Test jbossws WSDL11 -> Java
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSDL11ToWSDL20TestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -32,11 +32,11 @@
import org.jboss.test.ws.tools.validation.WSDL11Validator;
import org.jboss.test.ws.tools.validation.WSDLValidator;
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.common.metadata.wsdl.WSDL20Writer;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.WSDLToJava;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
+import org.jboss.ws.tools.wsdl.WSDL20Writer;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Test jbossws WSDL11 -> Java -> WSDL20
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/WSToolsTest.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -43,7 +43,6 @@
import org.jboss.ws.common.jaxrpc.Style;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
@@ -54,6 +53,7 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/holders/StandardHoldersTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -33,7 +33,6 @@
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.common.jaxrpc.Style;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.IOUtils;
import org.jboss.ws.tools.JavaToWSDL;
@@ -41,6 +40,7 @@
import org.jboss.ws.tools.WSToolsConstants;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
import org.jboss.ws.tools.interfaces.WSDLToJavaIntf;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDL11ValidationTestCase.java 2006-12-06 14:11:26 UTC (rev 1573)
@@ -26,8 +26,8 @@
import junit.framework.TestCase;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.tools.exceptions.JBossWSToolsException;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
/**
* Testcase to test the WSDL Validator
19 years, 5 months
JBossWS SVN: r1572 - in branches/tdiesler/trunk/src: main/java/org/jboss/ws/common main/java/org/jboss/ws/common/binding main/java/org/jboss/ws/common/config main/java/org/jboss/ws/common/jaxrpc main/java/org/jboss/ws/common/jaxrpc/encoding main/java/org/jboss/ws/common/jbossxb main/java/org/jboss/ws/common/metadata main/java/org/jboss/ws/common/metadata/config main/java/org/jboss/ws/common/metadata/config/jaxrpc main/java/org/jboss/ws/common/metadata/config/jaxws main/java/org/jboss/ws/co
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-06 06:19:33 -0500 (Wed, 06 Dec 2006)
New Revision: 1572
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/NameImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/binding/ComplexTypeDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/binding/ComplexTypeSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/ServerConfig.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/ServerConfigFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/EncodedTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/TypeMappingRegistryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/Use.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBConstants.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSupport.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/MarshalException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/SchemaBindingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/UnmarshalException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/XercesXSMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/WSCommonConfig.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/WSConfigFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSClientConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSCommonConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigFactoryJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigRootJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSEndpointConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedApplicationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedBeanMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedHandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedMessageDrivenMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedPortComponentRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedServiceRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedSessionMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebSecurityMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainsMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/ThreadLocalAssociation.java
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBConstants.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSupport.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/MarshalException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/SchemaBindingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/UnmarshalException.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/XercesXSMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSClientConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSCommonConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigFactoryJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigRootJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSEndpointConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedApplicationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedBeanMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedHandlerMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedMessageDrivenMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedPortComponentRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedServiceRefMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedSessionMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebSecurityMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainsMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/ThreadLocalAssociation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/Constants.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/PortComponentMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xsd/SchemaUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
Log:
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/Constants.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/Constants.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/Constants.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -25,7 +25,6 @@
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
-import org.jboss.ws.core.soap.NameImpl;
/**
* A collection of constants relevant to JBossWS
@@ -69,6 +68,11 @@
/** The namespace for XOP. */
static final String NS_XOP = "http://www.w3.org/2004/08/xop/include";
+ /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
+ static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+ /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
+ static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+
/** SOAP-1.1 encoding URI */
static final String URI_SOAP11_ENC = "http://schemas.xmlsoap.org/soap/encoding/";
/** SOAP-1.2 encoding URI */
@@ -127,91 +131,91 @@
static final String DEFAULT_RPC_RETURN_NAME = "result"; // FIXME: According to JSR-181 this should be 'return'
/** Standard Literal XML types */
- public static final QName TYPE_LITERAL_ANYSIMPLETYPE = new QName(NS_SCHEMA_XSD, "anySimpleType", PREFIX_XSD);
- public static final QName TYPE_LITERAL_ANYTYPE = new QName(NS_SCHEMA_XSD, "anyType", PREFIX_XSD);
- public static final QName TYPE_LITERAL_ANYURI = new QName(NS_SCHEMA_XSD, "anyURI", PREFIX_XSD);
- public static final QName TYPE_LITERAL_BASE64BINARY = new QName(NS_SCHEMA_XSD, "base64Binary", PREFIX_XSD);
- public static final QName TYPE_LITERAL_BOOLEAN = new QName(NS_SCHEMA_XSD, "boolean", PREFIX_XSD);
- public static final QName TYPE_LITERAL_BYTE = new QName(NS_SCHEMA_XSD, "byte", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DATE = new QName(NS_SCHEMA_XSD, "date", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DATETIME = new QName(NS_SCHEMA_XSD, "dateTime", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DECIMAL = new QName(NS_SCHEMA_XSD, "decimal", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DOUBLE = new QName(NS_SCHEMA_XSD, "double", PREFIX_XSD);
- public static final QName TYPE_LITERAL_DURATION = new QName(NS_SCHEMA_XSD, "duration", PREFIX_XSD);
- public static final QName TYPE_LITERAL_FLOAT = new QName(NS_SCHEMA_XSD, "float", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GDAY = new QName(NS_SCHEMA_XSD, "gDay", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GMONTH = new QName(NS_SCHEMA_XSD, "gMonth", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GMONTHDAY = new QName(NS_SCHEMA_XSD, "gMonthDay", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GYEAR = new QName(NS_SCHEMA_XSD, "gYear", PREFIX_XSD);
- public static final QName TYPE_LITERAL_GYEARMONTH = new QName(NS_SCHEMA_XSD, "gYearMonth", PREFIX_XSD);
- public static final QName TYPE_LITERAL_HEXBINARY = new QName(NS_SCHEMA_XSD, "hexBinary", PREFIX_XSD);
- public static final QName TYPE_LITERAL_ID = new QName(NS_SCHEMA_XSD, "ID", PREFIX_XSD);
- public static final QName TYPE_LITERAL_INT = new QName(NS_SCHEMA_XSD, "int", PREFIX_XSD);
- public static final QName TYPE_LITERAL_INTEGER = new QName(NS_SCHEMA_XSD, "integer", PREFIX_XSD);
- public static final QName TYPE_LITERAL_LANGUAGE = new QName(NS_SCHEMA_XSD, "language", PREFIX_XSD);
- public static final QName TYPE_LITERAL_LONG = new QName(NS_SCHEMA_XSD, "long", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NAME = new QName(NS_SCHEMA_XSD, "Name", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NCNAME = new QName(NS_SCHEMA_XSD, "NCName", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NEGATIVEINTEGER = new QName(NS_SCHEMA_XSD, "negativeInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NMTOKEN = new QName(NS_SCHEMA_XSD, "NMTOKEN", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NMTOKENS = new QName(NS_SCHEMA_XSD, "NMTOKENS", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NONNEGATIVEINTEGER = new QName(NS_SCHEMA_XSD, "nonNegativeInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NONPOSITIVEINTEGER = new QName(NS_SCHEMA_XSD, "nonPositiveInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_NORMALIZEDSTRING = new QName(NS_SCHEMA_XSD, "normalizedString", PREFIX_XSD);
- public static final QName TYPE_LITERAL_POSITIVEINTEGER = new QName(NS_SCHEMA_XSD, "positiveInteger", PREFIX_XSD);
- public static final QName TYPE_LITERAL_QNAME = new QName(NS_SCHEMA_XSD, "QName", PREFIX_XSD);
- public static final QName TYPE_LITERAL_SHORT = new QName(NS_SCHEMA_XSD, "short", PREFIX_XSD);
- public static final QName TYPE_LITERAL_STRING = new QName(NS_SCHEMA_XSD, "string", PREFIX_XSD);
- public static final QName TYPE_LITERAL_TIME = new QName(NS_SCHEMA_XSD, "time", PREFIX_XSD);
- public static final QName TYPE_LITERAL_TOKEN = new QName(NS_SCHEMA_XSD, "token", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDBYTE = new QName(NS_SCHEMA_XSD, "unsignedByte", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDINT = new QName(NS_SCHEMA_XSD, "unsignedInt", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDLONG = new QName(NS_SCHEMA_XSD, "unsignedLong", PREFIX_XSD);
- public static final QName TYPE_LITERAL_UNSIGNEDSHORT = new QName(NS_SCHEMA_XSD, "unsignedShort", PREFIX_XSD);
+ static final QName TYPE_LITERAL_ANYSIMPLETYPE = new QName(NS_SCHEMA_XSD, "anySimpleType", PREFIX_XSD);
+ static final QName TYPE_LITERAL_ANYTYPE = new QName(NS_SCHEMA_XSD, "anyType", PREFIX_XSD);
+ static final QName TYPE_LITERAL_ANYURI = new QName(NS_SCHEMA_XSD, "anyURI", PREFIX_XSD);
+ static final QName TYPE_LITERAL_BASE64BINARY = new QName(NS_SCHEMA_XSD, "base64Binary", PREFIX_XSD);
+ static final QName TYPE_LITERAL_BOOLEAN = new QName(NS_SCHEMA_XSD, "boolean", PREFIX_XSD);
+ static final QName TYPE_LITERAL_BYTE = new QName(NS_SCHEMA_XSD, "byte", PREFIX_XSD);
+ static final QName TYPE_LITERAL_DATE = new QName(NS_SCHEMA_XSD, "date", PREFIX_XSD);
+ static final QName TYPE_LITERAL_DATETIME = new QName(NS_SCHEMA_XSD, "dateTime", PREFIX_XSD);
+ static final QName TYPE_LITERAL_DECIMAL = new QName(NS_SCHEMA_XSD, "decimal", PREFIX_XSD);
+ static final QName TYPE_LITERAL_DOUBLE = new QName(NS_SCHEMA_XSD, "double", PREFIX_XSD);
+ static final QName TYPE_LITERAL_DURATION = new QName(NS_SCHEMA_XSD, "duration", PREFIX_XSD);
+ static final QName TYPE_LITERAL_FLOAT = new QName(NS_SCHEMA_XSD, "float", PREFIX_XSD);
+ static final QName TYPE_LITERAL_GDAY = new QName(NS_SCHEMA_XSD, "gDay", PREFIX_XSD);
+ static final QName TYPE_LITERAL_GMONTH = new QName(NS_SCHEMA_XSD, "gMonth", PREFIX_XSD);
+ static final QName TYPE_LITERAL_GMONTHDAY = new QName(NS_SCHEMA_XSD, "gMonthDay", PREFIX_XSD);
+ static final QName TYPE_LITERAL_GYEAR = new QName(NS_SCHEMA_XSD, "gYear", PREFIX_XSD);
+ static final QName TYPE_LITERAL_GYEARMONTH = new QName(NS_SCHEMA_XSD, "gYearMonth", PREFIX_XSD);
+ static final QName TYPE_LITERAL_HEXBINARY = new QName(NS_SCHEMA_XSD, "hexBinary", PREFIX_XSD);
+ static final QName TYPE_LITERAL_ID = new QName(NS_SCHEMA_XSD, "ID", PREFIX_XSD);
+ static final QName TYPE_LITERAL_INT = new QName(NS_SCHEMA_XSD, "int", PREFIX_XSD);
+ static final QName TYPE_LITERAL_INTEGER = new QName(NS_SCHEMA_XSD, "integer", PREFIX_XSD);
+ static final QName TYPE_LITERAL_LANGUAGE = new QName(NS_SCHEMA_XSD, "language", PREFIX_XSD);
+ static final QName TYPE_LITERAL_LONG = new QName(NS_SCHEMA_XSD, "long", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NAME = new QName(NS_SCHEMA_XSD, "Name", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NCNAME = new QName(NS_SCHEMA_XSD, "NCName", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NEGATIVEINTEGER = new QName(NS_SCHEMA_XSD, "negativeInteger", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NMTOKEN = new QName(NS_SCHEMA_XSD, "NMTOKEN", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NMTOKENS = new QName(NS_SCHEMA_XSD, "NMTOKENS", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NONNEGATIVEINTEGER = new QName(NS_SCHEMA_XSD, "nonNegativeInteger", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NONPOSITIVEINTEGER = new QName(NS_SCHEMA_XSD, "nonPositiveInteger", PREFIX_XSD);
+ static final QName TYPE_LITERAL_NORMALIZEDSTRING = new QName(NS_SCHEMA_XSD, "normalizedString", PREFIX_XSD);
+ static final QName TYPE_LITERAL_POSITIVEINTEGER = new QName(NS_SCHEMA_XSD, "positiveInteger", PREFIX_XSD);
+ static final QName TYPE_LITERAL_QNAME = new QName(NS_SCHEMA_XSD, "QName", PREFIX_XSD);
+ static final QName TYPE_LITERAL_SHORT = new QName(NS_SCHEMA_XSD, "short", PREFIX_XSD);
+ static final QName TYPE_LITERAL_STRING = new QName(NS_SCHEMA_XSD, "string", PREFIX_XSD);
+ static final QName TYPE_LITERAL_TIME = new QName(NS_SCHEMA_XSD, "time", PREFIX_XSD);
+ static final QName TYPE_LITERAL_TOKEN = new QName(NS_SCHEMA_XSD, "token", PREFIX_XSD);
+ static final QName TYPE_LITERAL_UNSIGNEDBYTE = new QName(NS_SCHEMA_XSD, "unsignedByte", PREFIX_XSD);
+ static final QName TYPE_LITERAL_UNSIGNEDINT = new QName(NS_SCHEMA_XSD, "unsignedInt", PREFIX_XSD);
+ static final QName TYPE_LITERAL_UNSIGNEDLONG = new QName(NS_SCHEMA_XSD, "unsignedLong", PREFIX_XSD);
+ static final QName TYPE_LITERAL_UNSIGNEDSHORT = new QName(NS_SCHEMA_XSD, "unsignedShort", PREFIX_XSD);
/** Standard SOAP-1.1 encoded XML types */
- public static final QName TYPE_SOAP11_ANYSIMPLETYPE = new QName(URI_SOAP11_ENC, "anySimpleType", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_ANYTYPE = new QName(URI_SOAP11_ENC, "anyType", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_ANYURI = new QName(URI_SOAP11_ENC, "anyURI", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BASE64 = new QName(URI_SOAP11_ENC, "base64", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BASE64BINARY = new QName(URI_SOAP11_ENC, "base64Binary", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BOOLEAN = new QName(URI_SOAP11_ENC, "boolean", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_BYTE = new QName(URI_SOAP11_ENC, "byte", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DATE = new QName(URI_SOAP11_ENC, "date", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DATETIME = new QName(URI_SOAP11_ENC, "dateTime", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DECIMAL = new QName(URI_SOAP11_ENC, "decimal", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DOUBLE = new QName(URI_SOAP11_ENC, "double", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_DURATION = new QName(URI_SOAP11_ENC, "duration", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_FLOAT = new QName(URI_SOAP11_ENC, "float", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GDAY = new QName(URI_SOAP11_ENC, "gDay", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GMONTH = new QName(URI_SOAP11_ENC, "gMonth", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GMONTHDAY = new QName(URI_SOAP11_ENC, "gMonthDay", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GYEAR = new QName(URI_SOAP11_ENC, "gYear", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_GYEARMONTH = new QName(URI_SOAP11_ENC, "gYearMonth", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_HEXBINARY = new QName(URI_SOAP11_ENC, "hexBinary", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_ID = new QName(URI_SOAP11_ENC, "ID", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_INT = new QName(URI_SOAP11_ENC, "int", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_INTEGER = new QName(URI_SOAP11_ENC, "integer", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_LANGUAGE = new QName(URI_SOAP11_ENC, "language", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_LONG = new QName(URI_SOAP11_ENC, "long", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NAME = new QName(URI_SOAP11_ENC, "Name", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NCNAME = new QName(URI_SOAP11_ENC, "NCName", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NEGATIVEINTEGER = new QName(URI_SOAP11_ENC, "negativeInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NMTOKEN = new QName(URI_SOAP11_ENC, "NMTOKEN", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NMTOKENS = new QName(URI_SOAP11_ENC, "NMTOKENS", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NONNEGATIVEINTEGER = new QName(URI_SOAP11_ENC, "nonNegativeInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NONPOSITIVEINTEGER = new QName(URI_SOAP11_ENC, "nonPositiveInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_NORMALIZEDSTRING = new QName(URI_SOAP11_ENC, "normalizedString", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_POSITIVEINTEGER = new QName(URI_SOAP11_ENC, "positiveInteger", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_QNAME = new QName(URI_SOAP11_ENC, "QName", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_SHORT = new QName(URI_SOAP11_ENC, "short", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_STRING = new QName(URI_SOAP11_ENC, "string", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_TIME = new QName(URI_SOAP11_ENC, "time", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_TOKEN = new QName(URI_SOAP11_ENC, "token", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDBYTE = new QName(URI_SOAP11_ENC, "unsignedByte", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDINT = new QName(URI_SOAP11_ENC, "unsignedInt", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDLONG = new QName(URI_SOAP11_ENC, "unsignedLong", PREFIX_SOAP11_ENC);
- public static final QName TYPE_SOAP11_UNSIGNEDSHORT = new QName(URI_SOAP11_ENC, "unsignedShort", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_ANYSIMPLETYPE = new QName(URI_SOAP11_ENC, "anySimpleType", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_ANYTYPE = new QName(URI_SOAP11_ENC, "anyType", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_ANYURI = new QName(URI_SOAP11_ENC, "anyURI", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_BASE64 = new QName(URI_SOAP11_ENC, "base64", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_BASE64BINARY = new QName(URI_SOAP11_ENC, "base64Binary", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_BOOLEAN = new QName(URI_SOAP11_ENC, "boolean", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_BYTE = new QName(URI_SOAP11_ENC, "byte", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_DATE = new QName(URI_SOAP11_ENC, "date", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_DATETIME = new QName(URI_SOAP11_ENC, "dateTime", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_DECIMAL = new QName(URI_SOAP11_ENC, "decimal", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_DOUBLE = new QName(URI_SOAP11_ENC, "double", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_DURATION = new QName(URI_SOAP11_ENC, "duration", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_FLOAT = new QName(URI_SOAP11_ENC, "float", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_GDAY = new QName(URI_SOAP11_ENC, "gDay", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_GMONTH = new QName(URI_SOAP11_ENC, "gMonth", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_GMONTHDAY = new QName(URI_SOAP11_ENC, "gMonthDay", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_GYEAR = new QName(URI_SOAP11_ENC, "gYear", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_GYEARMONTH = new QName(URI_SOAP11_ENC, "gYearMonth", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_HEXBINARY = new QName(URI_SOAP11_ENC, "hexBinary", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_ID = new QName(URI_SOAP11_ENC, "ID", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_INT = new QName(URI_SOAP11_ENC, "int", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_INTEGER = new QName(URI_SOAP11_ENC, "integer", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_LANGUAGE = new QName(URI_SOAP11_ENC, "language", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_LONG = new QName(URI_SOAP11_ENC, "long", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NAME = new QName(URI_SOAP11_ENC, "Name", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NCNAME = new QName(URI_SOAP11_ENC, "NCName", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NEGATIVEINTEGER = new QName(URI_SOAP11_ENC, "negativeInteger", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NMTOKEN = new QName(URI_SOAP11_ENC, "NMTOKEN", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NMTOKENS = new QName(URI_SOAP11_ENC, "NMTOKENS", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NONNEGATIVEINTEGER = new QName(URI_SOAP11_ENC, "nonNegativeInteger", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NONPOSITIVEINTEGER = new QName(URI_SOAP11_ENC, "nonPositiveInteger", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_NORMALIZEDSTRING = new QName(URI_SOAP11_ENC, "normalizedString", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_POSITIVEINTEGER = new QName(URI_SOAP11_ENC, "positiveInteger", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_QNAME = new QName(URI_SOAP11_ENC, "QName", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_SHORT = new QName(URI_SOAP11_ENC, "short", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_STRING = new QName(URI_SOAP11_ENC, "string", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_TIME = new QName(URI_SOAP11_ENC, "time", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_TOKEN = new QName(URI_SOAP11_ENC, "token", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_UNSIGNEDBYTE = new QName(URI_SOAP11_ENC, "unsignedByte", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_UNSIGNEDINT = new QName(URI_SOAP11_ENC, "unsignedInt", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_UNSIGNEDLONG = new QName(URI_SOAP11_ENC, "unsignedLong", PREFIX_SOAP11_ENC);
+ static final QName TYPE_SOAP11_UNSIGNEDSHORT = new QName(URI_SOAP11_ENC, "unsignedShort", PREFIX_SOAP11_ENC);
/** Encoded mime type namespace for internall and DII use */
static final String NS_ATTACHMENT_MIME_TYPE = "http://www.jboss.org/jbossws/attachment/mimetype";
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/NameImpl.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/NameImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,127 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common;
+
+// $Id$
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+
+/**
+ * An implementation of a Name
+ * <p/>
+ * At this time of writing, the spec does not say anything about null values.
+ * We assume emty string for any null value.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 01-June-2004
+ */
+public class NameImpl implements Name
+{
+ private QName qname;
+
+ public NameImpl(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ public NameImpl(String local)
+ {
+ qname = new QName(local);
+ }
+
+ public NameImpl(String local, String prefix, String uri)
+ {
+ if (prefix != null)
+ qname = new QName(uri, local, prefix);
+ else
+ qname = new QName(uri, local);
+ }
+
+ /**
+ * Gets the local name part of the XML name that this Name object represents.
+ *
+ * @return a string giving the local name
+ */
+ public String getLocalName()
+ {
+ return qname.getLocalPart();
+ }
+
+ /**
+ * Returns the prefix that was specified when this Name object was initialized.
+ * This prefix is associated with the namespace for the XML name that this Name object represents.
+ *
+ * @return the prefix as a string
+ */
+ public String getPrefix()
+ {
+ return qname.getPrefix();
+ }
+
+ /**
+ * Gets the namespace-qualified name of the XML name that this Name object represents.
+ *
+ * @return the namespace-qualified name as a string
+ */
+ public String getQualifiedName()
+ {
+ String prefix = getPrefix();
+ if (prefix.length() > 0)
+ return prefix + ":" + qname.getLocalPart();
+ else
+ return qname.getLocalPart();
+ }
+
+ /**
+ * Returns the URI of the namespace for the XML name that this Name object represents.
+ *
+ * @return the URI as a string
+ */
+ public String getURI()
+ {
+ return qname.getNamespaceURI();
+ }
+
+ public int hashCode()
+ {
+ return qname.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof NameImpl)) return false;
+ if (obj == this) return true;
+ NameImpl other = (NameImpl)obj;
+ return qname.equals(other.qname);
+ }
+
+ public QName toQName()
+ {
+ return qname;
+ }
+
+ public String toString()
+ {
+ return qname.toString();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/binding/ComplexTypeDeserializer.java (from rev 1569, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/binding/ComplexTypeDeserializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.binding;
+
+
+// $Id$
+
+/**
+ * A Deserializer that can handle complex types by delegating to JAXB.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public abstract class ComplexTypeDeserializer extends DeserializerSupport
+{
+
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/binding/ComplexTypeSerializer.java (from rev 1569, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/binding/ComplexTypeSerializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.binding;
+
+
+// $Id$
+
+/**
+ * A Serializer that can handle complex types by delegating to JAXB.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public abstract class ComplexTypeSerializer extends SerializerSupport
+{
+
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/ServerConfig.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/ServerConfig.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.config;
+
+// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+
+/**
+ * Interface to container independent config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public interface ServerConfig
+{
+ static final String BEAN_NAME = "ServerConfig";
+
+ File getServerTempDir();
+
+ File getServerDataDir();
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/ServerConfigFactory.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/config/ServerConfigFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.config;
+
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.server.KernelLocator;
+
+// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z thomas.diesler(a)jboss.com $
+
+/**
+ * Factory to container independent config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ServerConfigFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServerConfigFactory.class);
+
+ private static ServerConfigFactory instance = new ServerConfigFactory();
+
+ // Hide ctor
+ protected ServerConfigFactory()
+ {
+ }
+
+ public static ServerConfigFactory getInstance()
+ {
+ return instance;
+ }
+
+ public ServerConfig getServerConfig()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ return (ServerConfig)registry.getEntry(ServerConfig.BEAN_NAME).getTarget();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/EncodedTypeMapping.java (from rev 1569, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/EncodedTypeMapping.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,182 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.jaxrpc;
+
+// $Id$
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.jaxrpc.encoding.Base64DeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.Base64SerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.CalendarDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.CalendarSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.DateDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.DateSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.ElementDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.ElementSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.HexDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.HexSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.QNameDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.QNameSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.SOAPElementDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.SOAPElementSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.SimpleDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.SimpleSerializerFactory;
+import org.w3c.dom.Element;
+
+/**
+ * This is the representation of a type mapping.
+ * This TypeMapping implementation supports the encoded encoding style.
+ *
+ * The TypeMapping instance maintains a tuple of the type
+ * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Oct-2004
+ */
+public class EncodedTypeMapping extends TypeMappingImpl
+{
+
+ /**
+ * Construct the default encoded type mapping.
+ * Registers javaTypes for all standard XMLSchema types specified by JAXRPC.
+ *
+ * Note, the order of registered types is important
+ * The last xmlType wins for a given javaType
+ *
+ */
+ public EncodedTypeMapping()
+ {
+ registerStandardLiteralTypes();
+ registerStandardSOAP11EncodedTypes();
+
+ // register mapping for xsd:anyType
+ registerInternal(SOAPElement.class, Constants.TYPE_SOAP11_ANYTYPE, new SOAPElementSerializerFactory(), new SOAPElementDeserializerFactory());
+ registerInternal(Element.class, Constants.TYPE_SOAP11_ANYTYPE, new ElementSerializerFactory(), new ElementDeserializerFactory());
+ }
+
+ private void registerStandardSOAP11EncodedTypes()
+ {
+ registerInternal(BigDecimal.class, Constants.TYPE_SOAP11_DECIMAL, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_POSITIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NEGATIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONPOSITIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONNEGATIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_UNSIGNEDLONG, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(BigInteger.class, Constants.TYPE_SOAP11_INTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(Date.class, Constants.TYPE_SOAP11_DATETIME, new DateSerializerFactory(), new DateDeserializerFactory());
+
+ registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATE, new CalendarSerializerFactory(), new CalendarDeserializerFactory());
+ registerInternal(Calendar.class, Constants.TYPE_SOAP11_TIME, new CalendarSerializerFactory(), new CalendarDeserializerFactory());
+ registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATETIME, new CalendarSerializerFactory(), new CalendarDeserializerFactory());
+
+ registerInternal(QName.class, Constants.TYPE_SOAP11_QNAME, new QNameSerializerFactory(), new QNameDeserializerFactory());
+
+ registerInternal(String.class, Constants.TYPE_SOAP11_ANYSIMPLETYPE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_DURATION, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GDAY, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GMONTH, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GMONTHDAY, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GYEAR, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_GYEARMONTH, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_ID, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_LANGUAGE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NAME, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NCNAME, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NMTOKEN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_NORMALIZEDSTRING, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_TOKEN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(String.class, Constants.TYPE_SOAP11_STRING, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(String[].class, Constants.TYPE_SOAP11_NMTOKENS, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(URI.class, Constants.TYPE_SOAP11_ANYURI, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(byte.class, Constants.TYPE_SOAP11_BYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Byte.class, Constants.TYPE_SOAP11_BYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new HexSerializerFactory(), new HexDeserializerFactory());
+ registerInternal(Byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new HexSerializerFactory(), new HexDeserializerFactory());
+ registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64, new Base64SerializerFactory(), new Base64DeserializerFactory());
+ registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64, new Base64SerializerFactory(), new Base64DeserializerFactory());
+
+ registerInternal(double.class, Constants.TYPE_SOAP11_DOUBLE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Double.class, Constants.TYPE_SOAP11_DOUBLE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(float.class, Constants.TYPE_SOAP11_FLOAT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Float.class, Constants.TYPE_SOAP11_FLOAT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(int.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Integer.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(int.class, Constants.TYPE_SOAP11_INT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Integer.class, Constants.TYPE_SOAP11_INT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(long.class, Constants.TYPE_SOAP11_LONG, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Long.class, Constants.TYPE_SOAP11_LONG, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+
+ registerInternal(short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(short.class, Constants.TYPE_SOAP11_SHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ registerInternal(Short.class, Constants.TYPE_SOAP11_SHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
+ }
+
+ /**
+ * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.
+ * A TypeMapping that contains only encoding style independent serializers and deserializers
+ * returns null from this method.
+ *
+ * @return Array of encodingStyle URIs for the supported encoding styles
+ */
+ public String[] getSupportedEncodings()
+ {
+ return new String[] { "encoded" };
+ }
+
+ /**
+ * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping that contains only encoding
+ * independent serializers and deserializers requires null as the parameter for this method.
+ *
+ * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding styles
+ */
+ public void setSupportedEncodings(String[] encodingStyleURIs)
+ {
+ throw new NotImplementedException();
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/TypeMappingRegistryImpl.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/TypeMappingRegistryImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,164 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.jaxrpc;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.encoding.TypeMapping;
+import javax.xml.rpc.encoding.TypeMappingRegistry;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.Constants;
+
+/**
+ * This defines a registry of TypeMapping instances for encoding styles.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class TypeMappingRegistryImpl implements TypeMappingRegistry
+{
+ // The registered typeMapping for the literal encoding style
+ private Map<String, TypeMappingImpl> typeMappings = new HashMap<String, TypeMappingImpl>();
+
+ public TypeMappingRegistryImpl()
+ {
+ typeMappings.put(Constants.URI_LITERAL_ENC, new LiteralTypeMapping());
+ typeMappings.put(Constants.URI_SOAP11_ENC, new EncodedTypeMapping());
+ }
+
+ /**
+ * Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.
+ */
+ public void clear()
+ {
+ typeMappings.clear();
+ }
+
+ /**
+ * Gets the registered default TypeMapping instance.
+ * This method returns null if there is no registered default TypeMapping in the registry.
+ * @return The registered default TypeMapping instance or null
+ */
+ public TypeMapping getDefaultTypeMapping()
+ {
+ return typeMappings.get(Constants.URI_LITERAL_ENC);
+ }
+
+ /**
+ * Registers the TypeMapping instance that is default for all encoding styles supported by the TypeMappingRegistry.
+ * A default TypeMapping should include serializers and deserializers that are independent of and usable with any
+ * encoding style. Successive invocations of the registerDefault method replace any existing default TypeMapping instance.
+ *
+ * If the default TypeMapping is registered, any other TypeMapping instances registered through the
+ * TypeMappingRegistry.register method (for a set of encodingStyle URIs) override the default TypeMapping.
+ *
+ * @param mapping TypeMapping instance
+ * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of the default TypeMapping
+ */
+ public void registerDefault(TypeMapping mapping)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a new empty TypeMapping object.
+ * @return TypeMapping instance
+ */
+ public TypeMapping createTypeMapping()
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Returns the registered TypeMapping for the specified encodingStyle URI. If there is no registered TypeMapping for
+ * the specified encodingStyleURI, this method returns null.
+ * @param encodingStyleURI Encoding style specified as an URI
+ * @return TypeMapping for the specified encodingStyleURI or null
+ */
+ public TypeMapping getTypeMapping(String encodingStyleURI)
+ {
+ assertEncodingStyle(encodingStyleURI);
+ return typeMappings.get(encodingStyleURI);
+ }
+
+ /**
+ * Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.
+ * @return Array of the registered encodingStyle URIs
+ */
+ public String[] getRegisteredEncodingStyleURIs()
+ {
+ return new String[]{Constants.URI_LITERAL_ENC, Constants.URI_SOAP11_ENC};
+ }
+
+ /**
+ * Registers a TypeMapping instance with the TypeMappingRegistry.
+ * This method replaces any existing registered TypeMapping instance for the specified encodingStyleURI.
+ *
+ * @param encodingStyleURI An encoding style specified as an URI.
+ * @param mapping TypeMapping instance
+ * @return Previous TypeMapping associated with the specified encodingStyleURI, or null if there was no
+ * TypeMapping associated with the specified encodingStyleURI
+ * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of the TypeMapping for the specified encodingStyleURI.
+ */
+ public TypeMapping register(String encodingStyleURI, TypeMapping mapping)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.
+ * @param encodingStyleURI Encoding style specified as an URI
+ * @return TypeMapping instance that has been unregistered or null if there was no
+ * TypeMapping registered for the specified encodingStyleURI
+ */
+ public TypeMapping unregisterTypeMapping(String encodingStyleURI)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Removes a TypeMapping from the TypeMappingRegistry.
+ * A TypeMapping is associated with 1 or more encodingStyleURIs. This method unregisters the specified
+ * TypeMapping instance from all associated encodingStyleURIs and then removes this TypeMapping
+ * instance from the registry.
+ *
+ * @param mapping TypeMapping to be removed
+ * @return true if specified TypeMapping is removed from the TypeMappingRegistry;
+ * false if the specified TypeMapping was not in the TypeMappingRegistry
+ */
+ public boolean removeTypeMapping(TypeMapping mapping)
+ {
+ throw new NotImplementedException();
+ }
+
+ /** Assert the literal encoding style */
+ private void assertEncodingStyle(String encURI)
+ {
+ if (Constants.URI_LITERAL_ENC.equals(encURI) == false && Constants.URI_SOAP11_ENC.equals(encURI) == false)
+ throw new JAXRPCException("Unsupported encoding style: " + encURI);
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/Use.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/Use.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.jaxrpc;
+
+import org.jboss.ws.common.Constants;
+
+// $Id$
+
+/** A type-safe enumeration for encoding use.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Oct-2005
+ */
+public class Use
+{
+ private String use;
+
+ public static final Use LITERAL = new Use("literal");
+ public static final Use ENCODED = new Use("encoded");
+
+ private Use(String use)
+ {
+ this.use = use;
+ }
+
+ public static Use getDefaultUse()
+ {
+ return LITERAL;
+ }
+
+ public static Use valueOf(String encodingStyle)
+ {
+ if (Constants.URI_LITERAL_ENC.equals(encodingStyle) || LITERAL.use.equals(encodingStyle))
+ return LITERAL;
+ if (Constants.URI_SOAP11_ENC.equals(encodingStyle) || ENCODED.use.equals(encodingStyle))
+ return ENCODED;
+
+ throw new IllegalArgumentException("Unsupported encoding style: " + encodingStyle);
+ }
+
+ public String toURI()
+ {
+ String encURI = null;
+ if (this == LITERAL)
+ encURI = Constants.URI_LITERAL_ENC;
+ else if (this == ENCODED)
+ encURI = Constants.URI_SOAP11_ENC;
+ return encURI;
+ }
+
+ public String toString()
+ {
+ return use;
+ }
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,13 +30,13 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
+import org.jboss.ws.common.binding.ComplexTypeDeserializer;
import org.jboss.ws.common.binding.SerializationContext;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshaller;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshaller;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
/**
* A Deserializer that can handle complex types by delegating to JAXB.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,14 +30,14 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
+import org.jboss.ws.common.binding.ComplexTypeSerializer;
import org.jboss.ws.common.binding.SerializationContext;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshaller;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.common.jbossxb.XercesXSMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshaller;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
-import org.jboss.ws.core.jbossxb.XercesXSMarshallerImpl;
import org.w3c.dom.NamedNodeMap;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -25,14 +25,17 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* A deserializer that can handle xsd:anyType
@@ -51,8 +54,7 @@
try
{
Element domElement = DOMUtils.parse(xmlFragment);
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPElement soapElement = soapFactory.createElement(domElement, true);
+ SOAPElement soapElement = createElement(domElement, true);
return soapElement;
}
catch (RuntimeException rte)
@@ -64,4 +66,56 @@
throw new BindingException();
}
}
+
+ /**
+ * Create a SOAPElement from a DOM Element.
+ * This method is not part of the javax.xml.soap.SOAPFactory interface.
+ */
+ public SOAPElement createElement(Element domNode, boolean deep) throws SOAPException
+ {
+ if (domNode == null)
+ throw new IllegalArgumentException("Source node cannot be null");
+
+ String localName = domNode.getLocalName();
+ String prefix = domNode.getPrefix() != null ? domNode.getPrefix() : "";
+ String nsURI = domNode.getNamespaceURI() != null ? domNode.getNamespaceURI() : "";
+
+ SOAPFactory factory = SOAPFactory.newInstance();
+ SOAPElement soapElement = factory.createElement(localName, prefix, nsURI);
+
+ // Add the child elements as well
+ if (deep)
+ {
+ if (domNode instanceof Element)
+ DOMUtils.copyAttributes(soapElement, (Element)domNode);
+
+ NodeList nlist = domNode.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short nodeType = child.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE)
+ {
+ SOAPElement soapChild = createElement((Element)child, true);
+ soapElement.addChildElement(soapChild);
+ }
+ else if (nodeType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
+ else if (nodeType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.trace("Ignore child type: " + nodeType);
+ }
+ }
+ }
+
+ return soapElement;
+ }
}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb)
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBConstants.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBConstants.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBConstants.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-/** JBossXB Constants
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public interface JBossXBConstants
-{
- /** Set this property with a Reader to the xsdSchema */
- String JBXB_SCHEMA_READER = "org.jboss.xb.xsd.reader";
- /** Set this property with a the QName of the root element */
- String JBXB_ROOT_QNAME = "org.jboss.xb.root.qname";
- /** Set this property with a the QName of the root type */
- String JBXB_TYPE_QNAME = "org.jboss.xb.type.qname";
- /** Set this property with an instance of JavaWsdlMapping */
- String JBXB_JAVA_MAPPING = "org.jboss.xb.java.mapping";
- /** Set this property to the XSModel to pull schema info from */
- String JBXB_XS_MODEL = "org.jboss.xb.xsd.xsmodel";
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBConstants.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBConstants.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBConstants.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBConstants.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.jbossxb;
+
+// $Id$
+
+/** JBossXB Constants
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public interface JBossXBConstants
+{
+ /** Set this property with a Reader to the xsdSchema */
+ String JBXB_SCHEMA_READER = "org.jboss.xb.xsd.reader";
+ /** Set this property with a the QName of the root element */
+ String JBXB_ROOT_QNAME = "org.jboss.xb.root.qname";
+ /** Set this property with a the QName of the root type */
+ String JBXB_TYPE_QNAME = "org.jboss.xb.type.qname";
+ /** Set this property with an instance of JavaWsdlMapping */
+ String JBXB_JAVA_MAPPING = "org.jboss.xb.java.mapping";
+ /** Set this property to the XSModel to pull schema info from */
+ String JBXB_XS_MODEL = "org.jboss.xb.xsd.xsmodel";
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBDeserializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.ComplexTypeDeserializer;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-
-/**
- * A Deserializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBDeserializer extends ComplexTypeDeserializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBDeserializer.class);
-
- private JBossXBUnmarshaller unmarshaller;
-
- public JBossXBDeserializer() throws BindingException
- {
- // Get the JAXB marshaller for complex objects
- unmarshaller = new JBossXBUnmarshallerImpl();
- }
-
- /**
- * For unmarshalling the WS layer passes to the JAXB layer
- *
- * - required self contained xml content
- * - required map of packaged or generated XSDSchema
- * - optional QName of the root complex type
- * - optional instance of JavaWsdlMapping
- *
- * The xmlType is redundant if the root element name corresponds to a global element definition in schema.
- * If the java mapping is null, default mapping rules apply.
- *
- * The result is an object instance or null.
- * In case of an unmarshalling problem a descriptive exception is thrown.
- */
- public Object deserialize(QName xmlName, QName xmlType, String val, SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
-
- // Expect the specific JAXRPC serialization context
- SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
-
- Object value = null;
- String typeName = xmlType.getLocalPart();
-
- try
- {
- // Get the parsed model
- XSModel model = jaxrpcContext.getXsModel();
-
- // Get the jaxrpc-mapping.xml meta data
- JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
-
- unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
- unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
- unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
- unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
-
- ByteArrayInputStream ins = new ByteArrayInputStream(val.getBytes("UTF-8"));
- value = unmarshaller.unmarshal(ins);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException(ex);
- }
-
- log.debug("deserialized: " + (value != null ? value.getClass().getName() : null));
- return value;
-
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBDeserializerFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializerFactory.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBDeserializerFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jbossxb;
-
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.encoding.DeserializerFactoryBase;
-
-// $Id$
-
-/**
- * A factory for a Deserializer that can handle complex types
- * by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBDeserializerFactory extends DeserializerFactoryBase
-{
- public DeserializerSupport getDeserializer() throws BindingException
- {
- return new JBossXBDeserializer();
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshaller.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshaller.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,48 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jbossxb;
-
-import org.xml.sax.ContentHandler;
-import org.w3c.dom.Node;
-
-import java.io.Writer;
-import java.io.OutputStream;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Jul 5, 2006
- */
-public interface JBossXBMarshaller {
-
- void marshal(Object obj, Writer writer) throws MarshalException;
-
- void marshal(Object obj, ContentHandler handler);
-
- void marshal(Object obj, Node node);
-
- void marshal(Object obj, OutputStream os) throws MarshalException;
-
- Object getProperty(String name);
-
- void setProperty(String name, Object value);
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshaller.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshaller.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.jbossxb;
+
+import java.io.OutputStream;
+import java.io.Writer;
+
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Jul 5, 2006
+ */
+public interface JBossXBMarshaller {
+
+ void marshal(Object obj, Writer writer) throws MarshalException;
+
+ void marshal(Object obj, ContentHandler handler);
+
+ void marshal(Object obj, Node node);
+
+ void marshal(Object obj, OutputStream os) throws MarshalException;
+
+ Object getProperty(String name);
+
+ void setProperty(String name, Object value);
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshallerImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,233 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
-import org.jboss.xb.binding.Constants;
-
-import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-import javax.xml.namespace.QName;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-
-/**
- * An implementation of a JAXB Marshaller that uses the JBossXB schema binding marshaller.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.org
- * @since 05-Jul-2006
- */
-public class JBossXBMarshallerImpl implements JBossXBMarshaller {
-
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBMarshallerImpl.class);
-
- // The marshaller properties
- private HashMap properties = new HashMap();
-
- private MarshallerImpl delegate;
-
- public JBossXBMarshallerImpl()
- {
-
- //ClassInfos.disableCache();
-
- delegate = new MarshallerImpl();
- delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_XML_VERSION, "false");
- delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION, "false");
- delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE);
- delegate.setSupportNil(true);
- }
-
- /**
- * Marshal the content tree rooted at obj into a Writer.
- */
- public void marshal(Object obj, Writer writer) throws MarshalException
- {
- assertRequiredProperties();
-
- try
- {
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- delegate.addRootElement(xmlName);
-
- QName xmlType = (QName)getProperty(JBossXBConstants.JBXB_TYPE_QNAME);
- boolean isAnonymousType = (xmlType != null && xmlType.getLocalPart().startsWith(">"));
- if (xmlType != null && !isAnonymousType)
- {
- delegate.setRootTypeQName(xmlType);
- }
-
- if (xmlName.getNamespaceURI().length() > 0)
- {
- String prefix = xmlName.getPrefix();
- String nsURI = xmlName.getNamespaceURI();
- delegate.declareNamespace(prefix, nsURI);
- }
-
- // wildcards still need to be mapped
- // todo: cleanup XB API
- JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
- if (wsdlMapping != null)
- {
- JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings();
- if (javaXmlMappings != null)
- {
- for (int i = 0; i < javaXmlMappings.length; ++i)
- {
- JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i];
- VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings();
-
- if (variableMappings != null)
- {
- String clsName = javaXmlMapping.getJavaType();
- Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader());
- QName clsQName = javaXmlMapping.getRootTypeQName();
-
- if (clsQName != null)
- {
- // TODO: legacy API usage, see JBWS-1091
- if ("complexType".equalsIgnoreCase(javaXmlMapping.getQnameScope()))
- {
- delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart());
- }
- }
-
- for (int j = 0; j < variableMappings.length; ++j)
- {
- VariableMapping variableMapping = variableMappings[j];
- if (variableMapping.getXmlWildcard())
- {
- delegate.mapFieldToWildcard(cls, "_any", JBossXBSupport.getWildcardMarshaller());
- }
- }
- }
- }
- }
- }
-
- // the actual marshalling
- SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties);
- schemaBinding.setXopMarshaller(new XOPMarshallerImpl());
- delegate.marshal(schemaBinding, null, obj, writer);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new MarshalException(e);
- }
- }
-
- /**
- * Marshal the content tree rooted at obj into SAX2 events.
- */
- public void marshal(Object obj, ContentHandler handler)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into a DOM tree.
- */
- public void marshal(Object obj, Node node)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into an output stream.
- */
- public void marshal(Object obj, OutputStream os) throws MarshalException
- {
- marshal(obj, new OutputStreamWriter(os));
- }
-
- /**
- * Get the particular property in the underlying implementation of
- * Marshaller.
- */
- public Object getProperty(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- return properties.get(name);
- }
-
- /**
- * Set the particular property in the underlying implementation of
- * Marshaller.
- *
- */
- public void setProperty(String name, Object value)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- properties.put(name, value);
- }
-
- /**
- * Get a DOM tree view of the content tree(Optional).
- */
- public Node getNode(Object contentTree)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Assert the required properties
- */
- private void assertRequiredProperties()
- {
- if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null && getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_XS_MODEL);
-
- if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_JAVA_MAPPING);
-
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- if (xmlName == null)
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_ROOT_QNAME);
-
- if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0)
- throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshallerImpl.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBMarshallerImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,233 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jbossxb;
+
+// $Id$
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
+import org.jboss.xb.binding.Constants;
+import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+
+/**
+ * An implementation of a JAXB Marshaller that uses the JBossXB schema binding marshaller.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.org
+ * @since 05-Jul-2006
+ */
+public class JBossXBMarshallerImpl implements JBossXBMarshaller {
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossXBMarshallerImpl.class);
+
+ // The marshaller properties
+ private HashMap properties = new HashMap();
+
+ private MarshallerImpl delegate;
+
+ public JBossXBMarshallerImpl()
+ {
+
+ //ClassInfos.disableCache();
+
+ delegate = new MarshallerImpl();
+ delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_XML_VERSION, "false");
+ delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION, "false");
+ delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE);
+ delegate.setSupportNil(true);
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into a Writer.
+ */
+ public void marshal(Object obj, Writer writer) throws MarshalException
+ {
+ assertRequiredProperties();
+
+ try
+ {
+ QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
+ delegate.addRootElement(xmlName);
+
+ QName xmlType = (QName)getProperty(JBossXBConstants.JBXB_TYPE_QNAME);
+ boolean isAnonymousType = (xmlType != null && xmlType.getLocalPart().startsWith(">"));
+ if (xmlType != null && !isAnonymousType)
+ {
+ delegate.setRootTypeQName(xmlType);
+ }
+
+ if (xmlName.getNamespaceURI().length() > 0)
+ {
+ String prefix = xmlName.getPrefix();
+ String nsURI = xmlName.getNamespaceURI();
+ delegate.declareNamespace(prefix, nsURI);
+ }
+
+ // wildcards still need to be mapped
+ // todo: cleanup XB API
+ JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
+ if (wsdlMapping != null)
+ {
+ JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings();
+ if (javaXmlMappings != null)
+ {
+ for (int i = 0; i < javaXmlMappings.length; ++i)
+ {
+ JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i];
+ VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings();
+
+ if (variableMappings != null)
+ {
+ String clsName = javaXmlMapping.getJavaType();
+ Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader());
+ QName clsQName = javaXmlMapping.getRootTypeQName();
+
+ if (clsQName != null)
+ {
+ // TODO: legacy API usage, see JBWS-1091
+ if ("complexType".equalsIgnoreCase(javaXmlMapping.getQnameScope()))
+ {
+ delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart());
+ }
+ }
+
+ for (int j = 0; j < variableMappings.length; ++j)
+ {
+ VariableMapping variableMapping = variableMappings[j];
+ if (variableMapping.getXmlWildcard())
+ {
+ delegate.mapFieldToWildcard(cls, "_any", JBossXBSupport.getWildcardMarshaller());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // the actual marshalling
+ SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties);
+ schemaBinding.setXopMarshaller(new XOPMarshallerImpl());
+ delegate.marshal(schemaBinding, null, obj, writer);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new MarshalException(e);
+ }
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into SAX2 events.
+ */
+ public void marshal(Object obj, ContentHandler handler)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into a DOM tree.
+ */
+ public void marshal(Object obj, Node node)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into an output stream.
+ */
+ public void marshal(Object obj, OutputStream os) throws MarshalException
+ {
+ marshal(obj, new OutputStreamWriter(os));
+ }
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * Marshaller.
+ */
+ public Object getProperty(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("name parameter is null");
+
+ return properties.get(name);
+ }
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * Marshaller.
+ *
+ */
+ public void setProperty(String name, Object value)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("name parameter is null");
+
+ properties.put(name, value);
+ }
+
+ /**
+ * Get a DOM tree view of the content tree(Optional).
+ */
+ public Node getNode(Object contentTree)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Assert the required properties
+ */
+ private void assertRequiredProperties()
+ {
+ if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null && getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_XS_MODEL);
+
+ if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_JAVA_MAPPING);
+
+ QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
+ if (xmlName == null)
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_ROOT_QNAME);
+
+ if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0)
+ throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSerializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSerializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.ComplexTypeSerializer;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.w3c.dom.NamedNodeMap;
-
-import javax.xml.namespace.QName;
-import java.io.StringWriter;
-
-/**
- * A Serializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBSerializer extends ComplexTypeSerializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBSerializer.class);
-
- private JBossXBMarshaller marshaller;
-
- public JBossXBSerializer() throws BindingException
- {
- // Get the JAXB marshaller for complex objects
- marshaller = new JBossXBMarshallerImpl();
- }
-
- /**
- * For marshalling the WS layer passes to the JAXB layer
- *
- * - optional java object instance
- * - required map of packaged or generated XSDSchema
- * - required QName of the root element
- * - optional QName of the root complex type
- * - optional instance of JavaWsdlMapping
- *
- * If the object value is null, the corresponding XML representation of the nillable element should be marshalled.
- * The xmlType is redundant if the xmlName corresponds to a global element definition in schema.
- * If the java mapping is null, default mapping rules apply.
- *
- * The result is a self contained (i.e. contains all namespace definitions) XML document without the XML declaration.
- * In case of an marshalling problem a descriptive exception is thrown.
- */
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
-
- // Expect the specific JAXRPC serialization context
- SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
-
- try
- {
- // Get the parsed model
- XSModel model = jaxrpcContext.getXsModel();
-
- // Get the jaxrpc-mapping.xml object graph
- JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
-
- // schemabinding marshaller is the default delegate
- JBossXBMarshaller delegate = marshaller;
-
- if(value instanceof Exception)
- {
- // todo: CTS workaround for custom exceptions, clarify when Alexey is back
- // causes NPE in MarshallerImpl:458
- delegate = new XercesXSMarshallerImpl();
- }
-
- // marshalling context
- delegate.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
- delegate.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
- delegate.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
- delegate.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
-
- // marshall
- StringWriter strwr = new StringWriter();
- delegate.marshal(value, strwr);
- String xmlFragment = strwr.toString();
-
- log.debug("serialized: " + xmlFragment);
- return xmlFragment;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException(ex);
- }
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSerializerFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializerFactory.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSerializerFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,44 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jbossxb;
-
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.core.jaxrpc.encoding.SerializerFactoryBase;
-
-// $Id$
-
-
-/**
- * A factory for a Serializer that can handle complex types
- * by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBSerializerFactory extends SerializerFactoryBase
-{
- public SerializerSupport getSerializer() throws BindingException
- {
- return new JBossXBSerializer();
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSupport.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSupport.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,106 +0,0 @@
-package org.jboss.ws.core.jbossxb;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.OperationMetaData;
-import org.jboss.ws.common.umdm.ServiceMetaData;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.xb.binding.MarshallingContext;
-import org.jboss.xb.binding.ObjectLocalMarshaller;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.util.Dom2Sax;
-import org.w3c.dom.Element;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @since May 31, 2006
- */
-public class JBossXBSupport {
-
- /**
- * Setup SchemaBinding associated with the ServiceMetaData.
- * In case of an unconfigured call it will be generated from JAXB properties.
- * <p>
- * The SchemaBinding expects to have an element binding for the
- * incomming xml element. Because the same element name can be reused
- * by various operations with different xml types, we have to add the
- * element binding on every invocation.
- *
- * @see JBossXBConstants#JBXB_ROOT_QNAME
- * @see JBossXBConstants#JBXB_TYPE_QNAME
- */
- public static SchemaBinding getOrCreateSchemaBinding(Map properties)
- {
- SchemaBinding schemaBinding = null;
- SchemaBindingBuilder bindingBuilder = new SchemaBindingBuilder();
-
- QName xmlName = (QName)properties.get(JBossXBConstants.JBXB_ROOT_QNAME);
- QName xmlType = (QName)properties.get(JBossXBConstants.JBXB_TYPE_QNAME);
-
- // Get the eagerly initialized SchemaBinding from the ServiceMetaData
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext != null)
- {
- OperationMetaData opMetaData = msgContext.getOperationMetaData();
- EndpointMetaData epMetaData = opMetaData.getEndpointMetaData();
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- schemaBinding = serviceMetaData.getSchemaBinding();
- }
-
- // In case of an unconfigured call generate the SchemaBinding from JAXB properties
- if (schemaBinding == null)
- {
- JBossXSModel xsModel = (JBossXSModel)properties.get(JBossXBConstants.JBXB_XS_MODEL);
- JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)properties.get(JBossXBConstants.JBXB_JAVA_MAPPING);
- schemaBinding = bindingBuilder.buildSchemaBinding(xsModel, wsdlMapping);
- }
-
- // The SchemaBinding expects to have an element binding for the
- // incomming xml element. Because the same element name can be reused
- // by various operations with different xml types, we have to add the
- // element binding on every invocation.
- bindingBuilder.bindParameterToElement(schemaBinding, xmlName, xmlType);
-
- return schemaBinding;
- }
-
- /**
- * Create a Marshaller that serializes
- * <code>org.w3c.dom.Element</code>'s to a <code>org.xml.sax.ContentHandler</code>
- *
- * @return ObjectLocalMarshaller
- *
- * @see org.jboss.xb.binding.MarshallingContext#getContentHandler()
- */
- public static ObjectLocalMarshaller getWildcardMarshaller()
- {
- return new ObjectLocalMarshaller() {
- public void marshal(MarshallingContext ctx, Object o)
- {
- if (o == null)
- {
- return;
- }
-
- Element e = (Element)o;
- ContentHandler ch = ctx.getContentHandler();
- try
- {
- Dom2Sax.dom2sax(e, ch);
- }
- catch (SAXException e1)
- {
- throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage());
- }
- }
- };
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSupport.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSupport.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBSupport.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,106 @@
+package org.jboss.ws.common.jbossxb;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.OperationMetaData;
+import org.jboss.ws.common.umdm.ServiceMetaData;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.xb.binding.MarshallingContext;
+import org.jboss.xb.binding.ObjectLocalMarshaller;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.util.Dom2Sax;
+import org.w3c.dom.Element;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @since May 31, 2006
+ */
+public class JBossXBSupport {
+
+ /**
+ * Setup SchemaBinding associated with the ServiceMetaData.
+ * In case of an unconfigured call it will be generated from JAXB properties.
+ * <p>
+ * The SchemaBinding expects to have an element binding for the
+ * incomming xml element. Because the same element name can be reused
+ * by various operations with different xml types, we have to add the
+ * element binding on every invocation.
+ *
+ * @see JBossXBConstants#JBXB_ROOT_QNAME
+ * @see JBossXBConstants#JBXB_TYPE_QNAME
+ */
+ public static SchemaBinding getOrCreateSchemaBinding(Map properties)
+ {
+ SchemaBinding schemaBinding = null;
+ SchemaBindingBuilder bindingBuilder = new SchemaBindingBuilder();
+
+ QName xmlName = (QName)properties.get(JBossXBConstants.JBXB_ROOT_QNAME);
+ QName xmlType = (QName)properties.get(JBossXBConstants.JBXB_TYPE_QNAME);
+
+ // Get the eagerly initialized SchemaBinding from the ServiceMetaData
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext != null)
+ {
+ OperationMetaData opMetaData = msgContext.getOperationMetaData();
+ EndpointMetaData epMetaData = opMetaData.getEndpointMetaData();
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+ schemaBinding = serviceMetaData.getSchemaBinding();
+ }
+
+ // In case of an unconfigured call generate the SchemaBinding from JAXB properties
+ if (schemaBinding == null)
+ {
+ JBossXSModel xsModel = (JBossXSModel)properties.get(JBossXBConstants.JBXB_XS_MODEL);
+ JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)properties.get(JBossXBConstants.JBXB_JAVA_MAPPING);
+ schemaBinding = bindingBuilder.buildSchemaBinding(xsModel, wsdlMapping);
+ }
+
+ // The SchemaBinding expects to have an element binding for the
+ // incomming xml element. Because the same element name can be reused
+ // by various operations with different xml types, we have to add the
+ // element binding on every invocation.
+ bindingBuilder.bindParameterToElement(schemaBinding, xmlName, xmlType);
+
+ return schemaBinding;
+ }
+
+ /**
+ * Create a Marshaller that serializes
+ * <code>org.w3c.dom.Element</code>'s to a <code>org.xml.sax.ContentHandler</code>
+ *
+ * @return ObjectLocalMarshaller
+ *
+ * @see org.jboss.xb.binding.MarshallingContext#getContentHandler()
+ */
+ public static ObjectLocalMarshaller getWildcardMarshaller()
+ {
+ return new ObjectLocalMarshaller() {
+ public void marshal(MarshallingContext ctx, Object o)
+ {
+ if (o == null)
+ {
+ return;
+ }
+
+ Element e = (Element)o;
+ ContentHandler ch = ctx.getContentHandler();
+ try
+ {
+ Dom2Sax.dom2sax(e, ch);
+ }
+ catch (SAXException e1)
+ {
+ throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage());
+ }
+ }
+ };
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshaller.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshaller.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshaller.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,37 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jbossxb;
-
-import java.io.InputStream;
-
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since Jul 5, 2006
- */
-public interface JBossXBUnmarshaller {
- Object unmarshal(InputStream is) throws UnmarshalException;
-
- Object getProperty(String name);
-
- void setProperty(String name, Object value);
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshaller.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshaller.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshaller.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshaller.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.jbossxb;
+
+import java.io.InputStream;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Jul 5, 2006
+ */
+public interface JBossXBUnmarshaller {
+ Object unmarshal(InputStream is) throws UnmarshalException;
+
+ Object getProperty(String name);
+
+ void setProperty(String name, Object value);
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import java.io.InputStream;
-import java.util.HashMap;
-
-/**
- * An implementation of a JAXB Unmarshaller.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Alexey.Loubyansky(a)jboss.org
- * @since 18-Oct-2004
- */
-public class JBossXBUnmarshallerImpl implements JBossXBUnmarshaller
-{
- // The marshaller properties
- private HashMap<String, Object> properties = new HashMap<String, Object>();
-
- /**
- * Unmarshal XML data from the specified InputStream and return the resulting content tree.
- */
- public Object unmarshal(InputStream is) throws UnmarshalException
- {
- assertRequiredProperties();
-
- org.jboss.xb.binding.Unmarshaller unm = UnmarshallerFactory.newInstance().newUnmarshaller();
- SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties);
- XOPUnmarshallerImpl xopUnmarshaller = new XOPUnmarshallerImpl();
- schemaBinding.setXopUnmarshaller(xopUnmarshaller);
-
- try
- {
- return unm.unmarshal(is, schemaBinding);
- }
- catch (JBossXBException e)
- {
- throw new UnmarshalException(e.getMessage(), e);
- }
- }
-
- /**
- * Get the particular property in the underlying implementation of Unmarshaller.
- */
- public Object getProperty(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- return properties.get(name);
- }
-
- /**
- * Set the particular property in the underlying implementation of Unmarshaller.
- */
- public void setProperty(String name, Object value)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- properties.put(name, value);
- }
-
-
- /** Assert the required properties
- */
- private void assertRequiredProperties()
- {
- if (getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- {
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_XS_MODEL);
- }
-
- if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- {
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_JAVA_MAPPING);
- }
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshallerImpl.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jbossxb;
+
+// $Id$
+
+import java.io.InputStream;
+import java.util.HashMap;
+
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+
+/**
+ * An implementation of a JAXB Unmarshaller.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Alexey.Loubyansky(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class JBossXBUnmarshallerImpl implements JBossXBUnmarshaller
+{
+ // The marshaller properties
+ private HashMap<String, Object> properties = new HashMap<String, Object>();
+
+ /**
+ * Unmarshal XML data from the specified InputStream and return the resulting content tree.
+ */
+ public Object unmarshal(InputStream is) throws UnmarshalException
+ {
+ assertRequiredProperties();
+
+ org.jboss.xb.binding.Unmarshaller unm = UnmarshallerFactory.newInstance().newUnmarshaller();
+ SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties);
+ XOPUnmarshallerImpl xopUnmarshaller = new XOPUnmarshallerImpl();
+ schemaBinding.setXopUnmarshaller(xopUnmarshaller);
+
+ try
+ {
+ return unm.unmarshal(is, schemaBinding);
+ }
+ catch (JBossXBException e)
+ {
+ throw new UnmarshalException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Get the particular property in the underlying implementation of Unmarshaller.
+ */
+ public Object getProperty(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("name parameter is null");
+
+ return properties.get(name);
+ }
+
+ /**
+ * Set the particular property in the underlying implementation of Unmarshaller.
+ */
+ public void setProperty(String name, Object value)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("name parameter is null");
+
+ properties.put(name, value);
+ }
+
+
+ /** Assert the required properties
+ */
+ private void assertRequiredProperties()
+ {
+ if (getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
+ {
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_XS_MODEL);
+ }
+
+ if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
+ {
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_JAVA_MAPPING);
+ }
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/MarshalException.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/MarshalException.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/MarshalException.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-/**
- * A marshal exception.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-Jun-2006
- */
-public class MarshalException extends Exception
-{
-
- public MarshalException()
- {
- super();
- }
-
- public MarshalException(String msg, Throwable th)
- {
- super(msg, th);
- }
-
- public MarshalException(String msg)
- {
- super(msg);
- }
-
- public MarshalException(Throwable th)
- {
- super(th);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/MarshalException.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/MarshalException.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/MarshalException.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/MarshalException.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jbossxb;
+
+/**
+ * A marshal exception.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-Jun-2006
+ */
+public class MarshalException extends Exception
+{
+
+ public MarshalException()
+ {
+ super();
+ }
+
+ public MarshalException(String msg, Throwable th)
+ {
+ super(msg, th);
+ }
+
+ public MarshalException(String msg)
+ {
+ super(msg);
+ }
+
+ public MarshalException(Throwable th)
+ {
+ super(th);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/SchemaBindingBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/SchemaBindingBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,613 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.jaxrpcmapping.*;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.jboss.ws.extras.xop.jaxrpc.JBossXBContentAdapter;
-import org.jboss.xb.binding.metadata.ClassMetaData;
-import org.jboss.xb.binding.metadata.PackageMetaData;
-import org.jboss.xb.binding.metadata.PropertyMetaData;
-import org.jboss.xb.binding.metadata.ValueMetaData;
-import org.jboss.xb.binding.sunday.unmarshalling.*;
-import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * Create SchemaBinding from XSModel and jaxrpc-mapping.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Alexey.Loubyansky(a)jboss.org
- * @since 18-Oct-2004
- * @see XSModel
- * @see JavaWsdlMapping
- */
-public class SchemaBindingBuilder
-{
- // provide logging
- private static final Logger log = Logger.getLogger(SchemaBindingBuilder.class);
-
- /**
- * Creates and initializes an instance of SchemaBinding
- */
- public SchemaBinding buildSchemaBinding(XSModel model, JavaWsdlMapping wsdlMapping)
- {
- JBossEntityResolver resolver = new JBossWSEntityResolver();
- SchemaBinding schemaBinding = XsdBinder.bind(model, new DefaultSchemaResolver(resolver));
-
- schemaBinding.setIgnoreLowLine(false);
- schemaBinding.setIgnoreUnresolvedFieldOrClass(false);
- schemaBinding.setUnmarshalListsToArrays(true); // note: default jaxb2.0 is false!
- schemaBinding.setSimpleContentProperty("_value");
- schemaBinding.setUseNoArgCtorIfFound(true);
- if (wsdlMapping != null)
- {
- bindSchemaToJava(schemaBinding, wsdlMapping);
- }
-
- // setup MTOM handler
- JBossXBContentAdapter.register(schemaBinding);
-
- return schemaBinding;
- }
-
- /** Merges JavaWsdlMapping into SchemaBinding
- */
- private void bindSchemaToJava(SchemaBinding schemaBinding, JavaWsdlMapping wsdlMapping)
- {
- if (log.isTraceEnabled())
- log.trace("bindSchemaToJava: " + schemaBinding);
-
- for (PackageMapping packageMapping : wsdlMapping.getPackageMappings())
- {
- processPackageMapping(schemaBinding, packageMapping);
- }
-
- for (JavaXmlTypeMapping typeMapping : wsdlMapping.getJavaXmlTypeMappings())
- {
- processJavaXmlTypeMapping(schemaBinding, typeMapping);
- }
- }
-
- private void processPackageMapping(SchemaBinding schemaBinding, PackageMapping packageMapping)
- {
- PackageMetaData packageMetaData = schemaBinding.getPackageMetaData();
- if (packageMetaData == null)
- {
- packageMetaData = new PackageMetaData();
- schemaBinding.setPackageMetaData(packageMetaData);
- }
-
- if (log.isTraceEnabled())
- log.trace("Bound namespace " + packageMapping.getNamespaceURI() + " to package " + packageMapping.getPackageType());
-
- packageMetaData.setName(packageMapping.getPackageType());
- }
-
- private void processJavaXmlTypeMapping(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
- {
- String javaType = typeMapping.getJavaType();
- if (javaType.endsWith("[]"))
- {
- processArrayType(schemaBinding, typeMapping);
- }
- else
- {
- processNonArrayType(schemaBinding, typeMapping);
- }
- }
-
- private void processArrayType(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
- {
- QName xmlType = getXmlType(typeMapping);
- log.trace("Ignore array type: " + xmlType);
- }
-
- private void processNonArrayType(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
- {
- QName xmlType = getXmlType(typeMapping);
- String javaType = typeMapping.getJavaType();
- log.trace("processNonArrayType: [xmlType=" + xmlType + ",javaType=" + javaType + "]");
-
- TypeBinding typeBinding = getTypeBinding(schemaBinding, typeMapping);
- if (typeBinding != null)
- {
- // Set the java type, but skip SimpleTypes
- boolean isSimpleTypeBinding = (typeBinding instanceof SimpleTypeBinding);
- if(isSimpleTypeBinding == false)
- {
- ClassMetaData classMetaData = typeBinding.getClassMetaData();
- if (classMetaData == null)
- {
- classMetaData = new ClassMetaData();
- typeBinding.setClassMetaData(classMetaData);
- }
- classMetaData.setImpl(javaType);
-
- // exception mapping drives whether we should use the noarg ctor
- JavaWsdlMapping wsdlMapping = typeMapping.getJavaWsdlMapping();
- for (ExceptionMapping aux : wsdlMapping.getExceptionMappings())
- {
- if (javaType.equals(aux.getExceptionType()))
- {
- classMetaData.setUseNoArgCtor(false);
- break;
- }
- }
-
- if (log.isTraceEnabled())
- {
- QName typeQName = typeBinding.getQName();
- log.trace("Bound: [xmlType=" + typeQName + ",javaType=" + javaType + "]");
- }
- }
-
- VariableMapping[] variableMappings = typeMapping.getVariableMappings();
- for (VariableMapping varMapping : variableMappings)
- {
- if (varMapping.getXmlElementName() != null)
- {
- processXmlElementName(typeBinding, varMapping);
- }
- else if (varMapping.getXmlAttributeName() != null)
- {
- processXmlAttributeName(typeBinding, varMapping);
- }
- else if (varMapping.getXmlWildcard())
- {
- processWildcard(typeBinding, varMapping);
- }
- }
- }
- else
- {
- log.warn("Cannot obtain type binding for: " + xmlType);
- }
- }
-
- private void processXmlAttributeName(TypeBinding typeBinding, VariableMapping varMapping)
- {
- String xmlAttrName = varMapping.getXmlAttributeName();
- log.trace("processXmlAttributeName: " + xmlAttrName);
-
- QName xmlName = new QName(xmlAttrName);
- AttributeBinding attrBinding = typeBinding.getAttribute(xmlName);
- if (attrBinding == null)
- {
- Iterator i = typeBinding.getAttributes().iterator();
- while (i.hasNext())
- {
- AttributeBinding auxBinding = (AttributeBinding)i.next();
- if (auxBinding.getQName().getLocalPart().equals(xmlAttrName))
- {
- if (attrBinding != null)
- log.warn("Ambiguous binding for attribute: " + xmlAttrName);
-
- attrBinding = auxBinding;
- }
- }
- }
-
- if (attrBinding == null)
- {
- // attributeFormDefault="qualified"
- String nsURI = typeBinding.getQName().getNamespaceURI();
- if (Constants.SOAP11_ATTR_MUST_UNDERSTAND.equals(xmlAttrName) || Constants.SOAP11_ATTR_ACTOR.equals(xmlAttrName)
- || Constants.SOAP11_ATTR_ROLE.equals(xmlAttrName))
- {
- nsURI = Constants.NS_SOAP11_ENV;
- }
- QName auxName = new QName(nsURI, xmlAttrName);
- attrBinding = typeBinding.getAttribute(auxName);
- }
-
- if (attrBinding == null)
- {
- QName typeQName = typeBinding.getQName();
- throw new WSException("Attribute " + xmlName + " found in jaxrpc-mapping but not in the schema: " + typeQName);
- }
-
- String javaVariableName = varMapping.getJavaVariableName();
- PropertyMetaData prop = new PropertyMetaData();
- prop.setName(javaVariableName);
- attrBinding.setPropertyMetaData(prop);
-
- if (log.isTraceEnabled())
- log.trace("Bound attribute " + xmlName + " to property " + prop.getName());
- }
-
- private void processXmlElementName(TypeBinding typeBinding, VariableMapping varMapping)
- {
- QName xmlName = new QName(varMapping.getXmlElementName());
- log.trace("processXmlElementName: " + xmlName);
-
- ElementBinding element = typeBinding.getElement(xmlName);
- QName typeQName = typeBinding.getQName();
- if (element == null && typeQName != null)
- {
- // elementFormDefault="qualified"
- String nsURI = typeQName.getNamespaceURI();
- QName auxName = new QName(nsURI, varMapping.getXmlElementName());
- element = typeBinding.getElement(auxName);
- }
-
- if (element == null)
- {
- // <element ref=
- ParticleBinding particle = typeBinding.getParticle();
- if (particle != null)
- {
- TermBinding term = particle.getTerm();
- if (term instanceof ModelGroupBinding)
- {
- Iterator iterator = ((ModelGroupBinding)term).getParticles().iterator();
- element = findLocalPathElement(iterator, new String[] { varMapping.getXmlElementName() }, 0);
- }
- }
- }
-
- if (element == null)
- throw new WSException("Element " + xmlName + " found in jaxrpc-mapping but not in the schema: " + typeQName);
-
- String javaVariableName = varMapping.getJavaVariableName();
- if (javaVariableName != null)
- {
- PropertyMetaData prop = new PropertyMetaData();
- prop.setName(javaVariableName);
- element.setPropertyMetaData(prop);
-
- if (log.isTraceEnabled())
- log.trace("Bound element " + xmlName + " to property " + prop.getName());
- }
- }
-
- private void processWildcard(TypeBinding typeBinding, VariableMapping varMapping)
- {
- log.trace("processWildcard: " + typeBinding.getQName());
-
- PropertyMetaData prop = null;
- String javaVariableName = varMapping.getJavaVariableName();
- if (javaVariableName != null)
- {
- prop = new PropertyMetaData();
- prop.setName(javaVariableName);
- }
-
- if (prop == null)
- {
- prop = new PropertyMetaData();
- prop.setName("_any");
- }
-
- WildcardBinding wildcard = typeBinding.getWildcard();
- wildcard.setUnresolvedElementHandler(new SoapElementHandler());
- wildcard.setUnresolvedCharactersHandler(new SoapCharactersHandler());
- wildcard.setPropertyMetaData(prop);
-
- if (log.isTraceEnabled())
- log.trace("Bound wildcard of " + typeBinding.getQName() + " to property " + prop.getName());
- }
-
- private TypeBinding getTypeBinding(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
- {
- String qnameScope = typeMapping.getQnameScope();
- QName anonymousTypeQName = typeMapping.getAnonymousTypeQName();
- if (anonymousTypeQName != null)
- {
- return getAnonymousTypeBinding(schemaBinding, anonymousTypeQName);
- }
-
- QName xmlType = typeMapping.getRootTypeQName();
-
- TypeBinding typeBinding = null;
- if ("complexType".equals(qnameScope) || "simpleType".equals(qnameScope))
- {
- typeBinding = schemaBinding.getType(xmlType);
- if (typeBinding == null)
- {
- log.warn("Type definition not found in schema: " + xmlType);
- }
- }
- else if ("element".equals(qnameScope))
- {
- ElementBinding element = schemaBinding.getElement(xmlType);
- if (element != null)
- {
- typeBinding = element.getType();
- }
- else
- {
- log.warn("Global element not found in schema: " + xmlType);
- }
- }
- else
- {
- throw new WSException("Unexpected qname-scope for " + typeMapping.getJavaType() + ": " + qnameScope);
- }
- return typeBinding;
- }
-
- public TypeBinding getAnonymousTypeBinding(SchemaBinding schemaBinding, QName typeQName)
- {
- String expression = typeQName.getLocalPart();
- if (log.isTraceEnabled())
- log.trace("Searching for anonymous expression: " + expression);
-
- ArrayList list = new ArrayList(10);
-
- for (int i = 0, begin = -1; i < expression.length(); i++)
- {
- if (expression.charAt(i) == '>')
- {
- if (begin != -1)
- {
- list.add(expression.substring(begin, i));
- begin = -1;
- }
- }
- else
- {
- if (begin == -1)
- begin = i;
- else if (i == expression.length() - 1)
- list.add(expression.substring(begin));
- }
- }
-
- ElementBinding element = findLocalPathElement(schemaBinding.getElements(), ((String[])list.toArray(new String[0])));
- if (element == null)
- element = findLocalPathElementInTypes(schemaBinding.getTypes(), ((String[])list.toArray(new String[0])));
-
- if (element == null)
- return null;
-
- return element.getType();
- }
-
- public void bindParameterToElement(SchemaBinding schemaBinding, QName xmlName, QName xmlType)
- {
- TypeBinding typeBinding;
- boolean isAnonymousType = xmlType.getLocalPart().startsWith(">");
- if (isAnonymousType)
- {
- typeBinding = getAnonymousTypeBinding(schemaBinding, xmlType);
- }
- else
- {
- typeBinding = schemaBinding.getType(xmlType);
- }
-
- if (typeBinding != null)
- {
- if(!isAnonymousType)
- schemaBinding.addElement(xmlName, typeBinding);
- }
- else if (xmlType.equals(Constants.TYPE_LITERAL_ANYTYPE) == false)
- {
- throw new WSException("Root type " + xmlType + " not found in the schema.");
- }
- }
-
- private ElementBinding findLocalPathElement(Iterator elements, String[] path)
- {
- while (elements.hasNext())
- {
- ElementBinding element = (ElementBinding)elements.next();
- element = findLocalPathElement(element, path, 0);
- if (element != null)
- return element;
- }
-
- return null;
- }
-
- private ElementBinding findLocalPathElementInTypes(Iterator types, String[] path)
- {
- while (types.hasNext())
- {
- TypeBinding type = (TypeBinding)types.next();
- if (type.getQName().getLocalPart().equals(path[0]))
- {
- ParticleBinding particle = type.getParticle();
- if (particle == null)
- continue;
-
- TermBinding term = particle.getTerm();
- if (!term.isModelGroup())
- continue;
-
- return findLocalPathElement(((ModelGroupBinding)term).getParticles().iterator(), path, 1);
- }
- }
-
- return null;
- }
-
- private ElementBinding findLocalPathElement(ElementBinding element, String[] path, int pos)
- {
- String name = path[pos];
- if (!name.equals(element.getQName().getLocalPart()))
- return null;
-
- // End of path
- if (path.length - 1 == pos)
- return element;
-
- ParticleBinding particle = element.getType().getParticle();
- if (particle == null)
- return null;
-
- TermBinding term = particle.getTerm();
- if (!term.isModelGroup())
- return null;
-
- ModelGroupBinding group = (ModelGroupBinding)term;
- Iterator i = group.getParticles().iterator();
-
- // Increase depth
- return findLocalPathElement(i, path, pos + 1);
- }
-
- private ElementBinding findLocalPathElement(Iterator particles, String[] path, int pos)
- {
- while (particles.hasNext())
- {
- TermBinding term = ((ParticleBinding)particles.next()).getTerm();
- if (term instanceof ElementBinding)
- {
- ElementBinding element = (ElementBinding)term;
- element = findLocalPathElement(element, path, pos);
- if (element != null)
- return element;
-
- }
- else if (term instanceof ModelGroupBinding)
- {
- Iterator i = ((ModelGroupBinding)term).getParticles().iterator();
- ElementBinding element = findLocalPathElement(i, path, pos);
- if (element != null)
- return element;
- }
- }
-
- return null;
- }
-
- /** Get the <root-type-qname>, fall back to <anonymous-type-qname>
- */
- private QName getXmlType(JavaXmlTypeMapping typeMapping)
- {
- QName xmlType = typeMapping.getRootTypeQName();
- if (xmlType == null && typeMapping.getAnonymousTypeQName() != null)
- xmlType = typeMapping.getAnonymousTypeQName();
-
- return xmlType;
- }
-
- // Inner
-
- public static class SoapCharactersHandler extends CharactersHandler
- {
- public Object unmarshalEmpty(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData)
- {
- return "";
- }
-
- public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData, String value)
- {
- return value;
- }
-
- public void setValue(QName qName, ElementBinding element, Object owner, Object value)
- {
- SOAPElement e = (SOAPElement)owner;
- Text textNode = e.getOwnerDocument().createTextNode((String)value);
- e.appendChild(textNode);
- }
- }
-
- public static class SoapElementHandler extends RtElementHandler implements ParticleHandler
- {
- private SOAPFactory factory;
-
- public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
- {
- SOAPFactory factory = getFactory();
- SOAPElement element = null;
- try
- {
- String prefix = elementName.getPrefix();
- String ns = elementName.getNamespaceURI();
- if (ns != null && ns.length() > 0)
- {
- prefix = nsCtx.getPrefix(ns);
- }
-
- element = factory.createElement(elementName.getLocalPart(), prefix, ns);
- }
- catch (SOAPException e)
- {
- throw new IllegalStateException("Failed to create SOAPElement", e);
- }
-
- if (attrs != null)
- {
- for (int i = 0; i < attrs.getLength(); ++i)
- {
- element.setAttribute(attrs.getLocalName(i), attrs.getValue(i));
- }
- }
-
- return element;
- }
-
- public Object endParticle(Object o, QName elementName, ParticleBinding particle)
- {
- return o;
- }
-
- public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
- {
- if (parent instanceof SOAPElement)
- {
- ((SOAPElement)parent).appendChild((Element)o);
- }
- else
- {
- super.setParent(parent, o, elementName, particle, parentParticle);
- }
- }
-
- private SOAPFactory getFactory()
- {
- if (factory == null)
- {
- try
- {
- factory = SOAPFactory.newInstance();
- }
- catch (SOAPException e)
- {
- throw new IllegalStateException("Failed to create soap element factory", e);
- }
- }
- return factory;
- }
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/SchemaBindingBuilder.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/SchemaBindingBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,630 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jbossxb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+import org.apache.xerces.xs.XSModel;
+import org.jboss.logging.Logger;
+import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.jaxrpcmapping.ExceptionMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.ws.extras.xop.jaxrpc.JBossXBContentAdapter;
+import org.jboss.xb.binding.metadata.ClassMetaData;
+import org.jboss.xb.binding.metadata.PackageMetaData;
+import org.jboss.xb.binding.metadata.PropertyMetaData;
+import org.jboss.xb.binding.metadata.ValueMetaData;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SimpleTypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler;
+import org.w3c.dom.Element;
+import org.w3c.dom.Text;
+import org.xml.sax.Attributes;
+
+/**
+ * Create SchemaBinding from XSModel and jaxrpc-mapping.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Alexey.Loubyansky(a)jboss.org
+ * @since 18-Oct-2004
+ * @see XSModel
+ * @see JavaWsdlMapping
+ */
+public class SchemaBindingBuilder
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(SchemaBindingBuilder.class);
+
+ /**
+ * Creates and initializes an instance of SchemaBinding
+ */
+ public SchemaBinding buildSchemaBinding(XSModel model, JavaWsdlMapping wsdlMapping)
+ {
+ JBossEntityResolver resolver = new JBossWSEntityResolver();
+ SchemaBinding schemaBinding = XsdBinder.bind(model, new DefaultSchemaResolver(resolver));
+
+ schemaBinding.setIgnoreLowLine(false);
+ schemaBinding.setIgnoreUnresolvedFieldOrClass(false);
+ schemaBinding.setUnmarshalListsToArrays(true); // note: default jaxb2.0 is false!
+ schemaBinding.setSimpleContentProperty("_value");
+ schemaBinding.setUseNoArgCtorIfFound(true);
+ if (wsdlMapping != null)
+ {
+ bindSchemaToJava(schemaBinding, wsdlMapping);
+ }
+
+ // setup MTOM handler
+ JBossXBContentAdapter.register(schemaBinding);
+
+ return schemaBinding;
+ }
+
+ /** Merges JavaWsdlMapping into SchemaBinding
+ */
+ private void bindSchemaToJava(SchemaBinding schemaBinding, JavaWsdlMapping wsdlMapping)
+ {
+ if (log.isTraceEnabled())
+ log.trace("bindSchemaToJava: " + schemaBinding);
+
+ for (PackageMapping packageMapping : wsdlMapping.getPackageMappings())
+ {
+ processPackageMapping(schemaBinding, packageMapping);
+ }
+
+ for (JavaXmlTypeMapping typeMapping : wsdlMapping.getJavaXmlTypeMappings())
+ {
+ processJavaXmlTypeMapping(schemaBinding, typeMapping);
+ }
+ }
+
+ private void processPackageMapping(SchemaBinding schemaBinding, PackageMapping packageMapping)
+ {
+ PackageMetaData packageMetaData = schemaBinding.getPackageMetaData();
+ if (packageMetaData == null)
+ {
+ packageMetaData = new PackageMetaData();
+ schemaBinding.setPackageMetaData(packageMetaData);
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("Bound namespace " + packageMapping.getNamespaceURI() + " to package " + packageMapping.getPackageType());
+
+ packageMetaData.setName(packageMapping.getPackageType());
+ }
+
+ private void processJavaXmlTypeMapping(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
+ {
+ String javaType = typeMapping.getJavaType();
+ if (javaType.endsWith("[]"))
+ {
+ processArrayType(schemaBinding, typeMapping);
+ }
+ else
+ {
+ processNonArrayType(schemaBinding, typeMapping);
+ }
+ }
+
+ private void processArrayType(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
+ {
+ QName xmlType = getXmlType(typeMapping);
+ log.trace("Ignore array type: " + xmlType);
+ }
+
+ private void processNonArrayType(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
+ {
+ QName xmlType = getXmlType(typeMapping);
+ String javaType = typeMapping.getJavaType();
+ log.trace("processNonArrayType: [xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ TypeBinding typeBinding = getTypeBinding(schemaBinding, typeMapping);
+ if (typeBinding != null)
+ {
+ // Set the java type, but skip SimpleTypes
+ boolean isSimpleTypeBinding = (typeBinding instanceof SimpleTypeBinding);
+ if(isSimpleTypeBinding == false)
+ {
+ ClassMetaData classMetaData = typeBinding.getClassMetaData();
+ if (classMetaData == null)
+ {
+ classMetaData = new ClassMetaData();
+ typeBinding.setClassMetaData(classMetaData);
+ }
+ classMetaData.setImpl(javaType);
+
+ // exception mapping drives whether we should use the noarg ctor
+ JavaWsdlMapping wsdlMapping = typeMapping.getJavaWsdlMapping();
+ for (ExceptionMapping aux : wsdlMapping.getExceptionMappings())
+ {
+ if (javaType.equals(aux.getExceptionType()))
+ {
+ classMetaData.setUseNoArgCtor(false);
+ break;
+ }
+ }
+
+ if (log.isTraceEnabled())
+ {
+ QName typeQName = typeBinding.getQName();
+ log.trace("Bound: [xmlType=" + typeQName + ",javaType=" + javaType + "]");
+ }
+ }
+
+ VariableMapping[] variableMappings = typeMapping.getVariableMappings();
+ for (VariableMapping varMapping : variableMappings)
+ {
+ if (varMapping.getXmlElementName() != null)
+ {
+ processXmlElementName(typeBinding, varMapping);
+ }
+ else if (varMapping.getXmlAttributeName() != null)
+ {
+ processXmlAttributeName(typeBinding, varMapping);
+ }
+ else if (varMapping.getXmlWildcard())
+ {
+ processWildcard(typeBinding, varMapping);
+ }
+ }
+ }
+ else
+ {
+ log.warn("Cannot obtain type binding for: " + xmlType);
+ }
+ }
+
+ private void processXmlAttributeName(TypeBinding typeBinding, VariableMapping varMapping)
+ {
+ String xmlAttrName = varMapping.getXmlAttributeName();
+ log.trace("processXmlAttributeName: " + xmlAttrName);
+
+ QName xmlName = new QName(xmlAttrName);
+ AttributeBinding attrBinding = typeBinding.getAttribute(xmlName);
+ if (attrBinding == null)
+ {
+ Iterator i = typeBinding.getAttributes().iterator();
+ while (i.hasNext())
+ {
+ AttributeBinding auxBinding = (AttributeBinding)i.next();
+ if (auxBinding.getQName().getLocalPart().equals(xmlAttrName))
+ {
+ if (attrBinding != null)
+ log.warn("Ambiguous binding for attribute: " + xmlAttrName);
+
+ attrBinding = auxBinding;
+ }
+ }
+ }
+
+ if (attrBinding == null)
+ {
+ // attributeFormDefault="qualified"
+ String nsURI = typeBinding.getQName().getNamespaceURI();
+ if (Constants.SOAP11_ATTR_MUST_UNDERSTAND.equals(xmlAttrName) || Constants.SOAP11_ATTR_ACTOR.equals(xmlAttrName)
+ || Constants.SOAP11_ATTR_ROLE.equals(xmlAttrName))
+ {
+ nsURI = Constants.NS_SOAP11_ENV;
+ }
+ QName auxName = new QName(nsURI, xmlAttrName);
+ attrBinding = typeBinding.getAttribute(auxName);
+ }
+
+ if (attrBinding == null)
+ {
+ QName typeQName = typeBinding.getQName();
+ throw new WSException("Attribute " + xmlName + " found in jaxrpc-mapping but not in the schema: " + typeQName);
+ }
+
+ String javaVariableName = varMapping.getJavaVariableName();
+ PropertyMetaData prop = new PropertyMetaData();
+ prop.setName(javaVariableName);
+ attrBinding.setPropertyMetaData(prop);
+
+ if (log.isTraceEnabled())
+ log.trace("Bound attribute " + xmlName + " to property " + prop.getName());
+ }
+
+ private void processXmlElementName(TypeBinding typeBinding, VariableMapping varMapping)
+ {
+ QName xmlName = new QName(varMapping.getXmlElementName());
+ log.trace("processXmlElementName: " + xmlName);
+
+ ElementBinding element = typeBinding.getElement(xmlName);
+ QName typeQName = typeBinding.getQName();
+ if (element == null && typeQName != null)
+ {
+ // elementFormDefault="qualified"
+ String nsURI = typeQName.getNamespaceURI();
+ QName auxName = new QName(nsURI, varMapping.getXmlElementName());
+ element = typeBinding.getElement(auxName);
+ }
+
+ if (element == null)
+ {
+ // <element ref=
+ ParticleBinding particle = typeBinding.getParticle();
+ if (particle != null)
+ {
+ TermBinding term = particle.getTerm();
+ if (term instanceof ModelGroupBinding)
+ {
+ Iterator iterator = ((ModelGroupBinding)term).getParticles().iterator();
+ element = findLocalPathElement(iterator, new String[] { varMapping.getXmlElementName() }, 0);
+ }
+ }
+ }
+
+ if (element == null)
+ throw new WSException("Element " + xmlName + " found in jaxrpc-mapping but not in the schema: " + typeQName);
+
+ String javaVariableName = varMapping.getJavaVariableName();
+ if (javaVariableName != null)
+ {
+ PropertyMetaData prop = new PropertyMetaData();
+ prop.setName(javaVariableName);
+ element.setPropertyMetaData(prop);
+
+ if (log.isTraceEnabled())
+ log.trace("Bound element " + xmlName + " to property " + prop.getName());
+ }
+ }
+
+ private void processWildcard(TypeBinding typeBinding, VariableMapping varMapping)
+ {
+ log.trace("processWildcard: " + typeBinding.getQName());
+
+ PropertyMetaData prop = null;
+ String javaVariableName = varMapping.getJavaVariableName();
+ if (javaVariableName != null)
+ {
+ prop = new PropertyMetaData();
+ prop.setName(javaVariableName);
+ }
+
+ if (prop == null)
+ {
+ prop = new PropertyMetaData();
+ prop.setName("_any");
+ }
+
+ WildcardBinding wildcard = typeBinding.getWildcard();
+ wildcard.setUnresolvedElementHandler(new SoapElementHandler());
+ wildcard.setUnresolvedCharactersHandler(new SoapCharactersHandler());
+ wildcard.setPropertyMetaData(prop);
+
+ if (log.isTraceEnabled())
+ log.trace("Bound wildcard of " + typeBinding.getQName() + " to property " + prop.getName());
+ }
+
+ private TypeBinding getTypeBinding(SchemaBinding schemaBinding, JavaXmlTypeMapping typeMapping)
+ {
+ String qnameScope = typeMapping.getQnameScope();
+ QName anonymousTypeQName = typeMapping.getAnonymousTypeQName();
+ if (anonymousTypeQName != null)
+ {
+ return getAnonymousTypeBinding(schemaBinding, anonymousTypeQName);
+ }
+
+ QName xmlType = typeMapping.getRootTypeQName();
+
+ TypeBinding typeBinding = null;
+ if ("complexType".equals(qnameScope) || "simpleType".equals(qnameScope))
+ {
+ typeBinding = schemaBinding.getType(xmlType);
+ if (typeBinding == null)
+ {
+ log.warn("Type definition not found in schema: " + xmlType);
+ }
+ }
+ else if ("element".equals(qnameScope))
+ {
+ ElementBinding element = schemaBinding.getElement(xmlType);
+ if (element != null)
+ {
+ typeBinding = element.getType();
+ }
+ else
+ {
+ log.warn("Global element not found in schema: " + xmlType);
+ }
+ }
+ else
+ {
+ throw new WSException("Unexpected qname-scope for " + typeMapping.getJavaType() + ": " + qnameScope);
+ }
+ return typeBinding;
+ }
+
+ public TypeBinding getAnonymousTypeBinding(SchemaBinding schemaBinding, QName typeQName)
+ {
+ String expression = typeQName.getLocalPart();
+ if (log.isTraceEnabled())
+ log.trace("Searching for anonymous expression: " + expression);
+
+ ArrayList list = new ArrayList(10);
+
+ for (int i = 0, begin = -1; i < expression.length(); i++)
+ {
+ if (expression.charAt(i) == '>')
+ {
+ if (begin != -1)
+ {
+ list.add(expression.substring(begin, i));
+ begin = -1;
+ }
+ }
+ else
+ {
+ if (begin == -1)
+ begin = i;
+ else if (i == expression.length() - 1)
+ list.add(expression.substring(begin));
+ }
+ }
+
+ ElementBinding element = findLocalPathElement(schemaBinding.getElements(), ((String[])list.toArray(new String[0])));
+ if (element == null)
+ element = findLocalPathElementInTypes(schemaBinding.getTypes(), ((String[])list.toArray(new String[0])));
+
+ if (element == null)
+ return null;
+
+ return element.getType();
+ }
+
+ public void bindParameterToElement(SchemaBinding schemaBinding, QName xmlName, QName xmlType)
+ {
+ TypeBinding typeBinding;
+ boolean isAnonymousType = xmlType.getLocalPart().startsWith(">");
+ if (isAnonymousType)
+ {
+ typeBinding = getAnonymousTypeBinding(schemaBinding, xmlType);
+ }
+ else
+ {
+ typeBinding = schemaBinding.getType(xmlType);
+ }
+
+ if (typeBinding != null)
+ {
+ if(!isAnonymousType)
+ schemaBinding.addElement(xmlName, typeBinding);
+ }
+ else if (xmlType.equals(Constants.TYPE_LITERAL_ANYTYPE) == false)
+ {
+ throw new WSException("Root type " + xmlType + " not found in the schema.");
+ }
+ }
+
+ private ElementBinding findLocalPathElement(Iterator elements, String[] path)
+ {
+ while (elements.hasNext())
+ {
+ ElementBinding element = (ElementBinding)elements.next();
+ element = findLocalPathElement(element, path, 0);
+ if (element != null)
+ return element;
+ }
+
+ return null;
+ }
+
+ private ElementBinding findLocalPathElementInTypes(Iterator types, String[] path)
+ {
+ while (types.hasNext())
+ {
+ TypeBinding type = (TypeBinding)types.next();
+ if (type.getQName().getLocalPart().equals(path[0]))
+ {
+ ParticleBinding particle = type.getParticle();
+ if (particle == null)
+ continue;
+
+ TermBinding term = particle.getTerm();
+ if (!term.isModelGroup())
+ continue;
+
+ return findLocalPathElement(((ModelGroupBinding)term).getParticles().iterator(), path, 1);
+ }
+ }
+
+ return null;
+ }
+
+ private ElementBinding findLocalPathElement(ElementBinding element, String[] path, int pos)
+ {
+ String name = path[pos];
+ if (!name.equals(element.getQName().getLocalPart()))
+ return null;
+
+ // End of path
+ if (path.length - 1 == pos)
+ return element;
+
+ ParticleBinding particle = element.getType().getParticle();
+ if (particle == null)
+ return null;
+
+ TermBinding term = particle.getTerm();
+ if (!term.isModelGroup())
+ return null;
+
+ ModelGroupBinding group = (ModelGroupBinding)term;
+ Iterator i = group.getParticles().iterator();
+
+ // Increase depth
+ return findLocalPathElement(i, path, pos + 1);
+ }
+
+ private ElementBinding findLocalPathElement(Iterator particles, String[] path, int pos)
+ {
+ while (particles.hasNext())
+ {
+ TermBinding term = ((ParticleBinding)particles.next()).getTerm();
+ if (term instanceof ElementBinding)
+ {
+ ElementBinding element = (ElementBinding)term;
+ element = findLocalPathElement(element, path, pos);
+ if (element != null)
+ return element;
+
+ }
+ else if (term instanceof ModelGroupBinding)
+ {
+ Iterator i = ((ModelGroupBinding)term).getParticles().iterator();
+ ElementBinding element = findLocalPathElement(i, path, pos);
+ if (element != null)
+ return element;
+ }
+ }
+
+ return null;
+ }
+
+ /** Get the <root-type-qname>, fall back to <anonymous-type-qname>
+ */
+ private QName getXmlType(JavaXmlTypeMapping typeMapping)
+ {
+ QName xmlType = typeMapping.getRootTypeQName();
+ if (xmlType == null && typeMapping.getAnonymousTypeQName() != null)
+ xmlType = typeMapping.getAnonymousTypeQName();
+
+ return xmlType;
+ }
+
+ // Inner
+
+ public static class SoapCharactersHandler extends CharactersHandler
+ {
+ public Object unmarshalEmpty(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData)
+ {
+ return "";
+ }
+
+ public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData, String value)
+ {
+ return value;
+ }
+
+ public void setValue(QName qName, ElementBinding element, Object owner, Object value)
+ {
+ SOAPElement e = (SOAPElement)owner;
+ Text textNode = e.getOwnerDocument().createTextNode((String)value);
+ e.appendChild(textNode);
+ }
+ }
+
+ public static class SoapElementHandler extends RtElementHandler implements ParticleHandler
+ {
+ private SOAPFactory factory;
+
+ public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx)
+ {
+ SOAPFactory factory = getFactory();
+ SOAPElement element = null;
+ try
+ {
+ String prefix = elementName.getPrefix();
+ String ns = elementName.getNamespaceURI();
+ if (ns != null && ns.length() > 0)
+ {
+ prefix = nsCtx.getPrefix(ns);
+ }
+
+ element = factory.createElement(elementName.getLocalPart(), prefix, ns);
+ }
+ catch (SOAPException e)
+ {
+ throw new IllegalStateException("Failed to create SOAPElement", e);
+ }
+
+ if (attrs != null)
+ {
+ for (int i = 0; i < attrs.getLength(); ++i)
+ {
+ element.setAttribute(attrs.getLocalName(i), attrs.getValue(i));
+ }
+ }
+
+ return element;
+ }
+
+ public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+ {
+ return o;
+ }
+
+ public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+ {
+ if (parent instanceof SOAPElement)
+ {
+ ((SOAPElement)parent).appendChild((Element)o);
+ }
+ else
+ {
+ super.setParent(parent, o, elementName, particle, parentParticle);
+ }
+ }
+
+ private SOAPFactory getFactory()
+ {
+ if (factory == null)
+ {
+ try
+ {
+ factory = SOAPFactory.newInstance();
+ }
+ catch (SOAPException e)
+ {
+ throw new IllegalStateException("Failed to create soap element factory", e);
+ }
+ }
+ return factory;
+ }
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/UnmarshalException.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/UnmarshalException.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/UnmarshalException.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-/**
- * A marshal exception.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 06-Jun-2006
- */
-public class UnmarshalException extends Exception
-{
-
- public UnmarshalException()
- {
- super();
- }
-
- public UnmarshalException(String msg, Throwable th)
- {
- super(msg, th);
- }
-
- public UnmarshalException(String msg)
- {
- super(msg);
- }
-
- public UnmarshalException(Throwable th)
- {
- super(th);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/UnmarshalException.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/UnmarshalException.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/UnmarshalException.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/UnmarshalException.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jbossxb;
+
+/**
+ * A marshal exception.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 06-Jun-2006
+ */
+public class UnmarshalException extends Exception
+{
+
+ public UnmarshalException()
+ {
+ super();
+ }
+
+ public UnmarshalException(String msg, Throwable th)
+ {
+ super(msg, th);
+ }
+
+ public UnmarshalException(String msg)
+ {
+ super(msg);
+ }
+
+ public UnmarshalException(Throwable th)
+ {
+ super(th);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/XercesXSMarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/XercesXSMarshallerImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,250 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
-import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
-import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.xb.binding.Constants;
-import org.jboss.xb.binding.MappingObjectModelProvider;
-import org.jboss.xb.binding.XercesXsMarshaller;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-import javax.xml.namespace.QName;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-
-/**
- * An implementation of a JAXB Marshaller that user XercesXSMarshaller impl.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Oct-2004
- */
-public class XercesXSMarshallerImpl implements JBossXBMarshaller
-{
-
- // provide logging
- private static final Logger log = Logger.getLogger(XercesXSMarshallerImpl.class);
-
- // The marshaller properties
- private HashMap properties = new HashMap();
-
- private XercesXsMarshaller delegate;
-
- public XercesXSMarshallerImpl()
- {
- delegate = new XercesXsMarshaller();
- delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_XML_VERSION, "false");
- delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_INDENTATION, "false");
- delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE);
- delegate.setSupportNil(true);
- delegate.setSimpleContentProperty("_value");
- }
-
- /**
- * Marshal the content tree rooted at obj into a Writer.
- */
- public void marshal(Object obj, Writer writer) throws MarshalException
- {
- assertRequiredProperties();
-
- try
- {
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- delegate.addRootElement(xmlName);
-
- QName xmlType = (QName)getProperty(JBossXBConstants.JBXB_TYPE_QNAME);
- if (xmlType != null)
- {
- delegate.setRootTypeQName(xmlType);
- }
-
- if (xmlName.getNamespaceURI().length() > 0)
- {
- String prefix = xmlName.getPrefix();
- String nsURI = xmlName.getNamespaceURI();
- delegate.declareNamespace(prefix, nsURI);
- }
-
- MappingObjectModelProvider provider = new MappingObjectModelProvider();
- provider.setIgnoreLowLine(false);
- provider.setIgnoreNotFoundField(false);
-
- // todo complete wsdl mapping merge
- JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
- if (wsdlMapping != null)
- {
- JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings();
- if (javaXmlMappings != null)
- {
- for (int i = 0; i < javaXmlMappings.length; ++i)
- {
- JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i];
- VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings();
- if (variableMappings != null)
- {
- String clsName = javaXmlMapping.getJavaType();
- Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader());
- QName clsQName = javaXmlMapping.getRootTypeQName();
-
- if (clsQName != null)
- {
- if ("element".equals(javaXmlMapping.getQnameScope()))
- {
- delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider);
- }
- else
- {
- delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider);
- delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart());
- }
- }
-
- for (int j = 0; j < variableMappings.length; ++j)
- {
- VariableMapping variableMapping = variableMappings[j];
- String javaName = variableMapping.getJavaVariableName();
- if (variableMapping.getXmlElementName() != null)
- {
- String xmlElementName = variableMapping.getXmlElementName();
- provider.mapFieldToElement(cls, javaName, "", xmlElementName, null);
- }
- else if (variableMapping.getXmlAttributeName() != null)
- {
- log.trace("Unmapped attribute: " + javaName);
- }
- else if (variableMapping.getXmlWildcard())
- {
- delegate.mapFieldToWildcard(cls, "_any", JBossXBSupport.getWildcardMarshaller());
- }
- else
- {
- log.warn("Unmapped variable: " + javaName);
- }
- }
- }
- }
- }
- }
-
- if (getProperty(JBossXBConstants.JBXB_XS_MODEL) != null)
- {
- XSModel model = (XSModel)getProperty(JBossXBConstants.JBXB_XS_MODEL);
- delegate.marshal(model, provider, obj, writer);
- }
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new MarshalException(e);
- }
- }
-
- /**
- * Marshal the content tree rooted at obj into SAX2 events.
- */
- public void marshal(Object obj, ContentHandler handler)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into a DOM tree.
- */
- public void marshal(Object obj, Node node)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Marshal the content tree rooted at obj into an output stream.
- */
- public void marshal(Object obj, OutputStream os) throws MarshalException
- {
- marshal(obj, new OutputStreamWriter(os));
- }
-
- /**
- * Get the particular property in the underlying implementation of
- * Marshaller.
- */
- public Object getProperty(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- return properties.get(name);
- }
-
- /**
- * Set the particular property in the underlying implementation of
- * Marshaller.
- *
- */
- public void setProperty(String name, Object value)
- {
- if (name == null)
- throw new IllegalArgumentException("name parameter is null");
-
- properties.put(name, value);
- }
-
- /**
- * Get a DOM tree view of the content tree(Optional).
- */
- public Node getNode(Object contentTree)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Assert the required properties
- */
- private void assertRequiredProperties()
- {
- if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null && getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_XS_MODEL);
-
- if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_JAVA_MAPPING);
-
- QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
- if (xmlName == null)
- throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_ROOT_QNAME);
-
- if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0)
- throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/XercesXSMarshallerImpl.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jbossxb/XercesXSMarshallerImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,251 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jbossxb;
+
+// $Id$
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.XSModel;
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
+import org.jboss.ws.common.utils.JavaUtils;
+import org.jboss.xb.binding.Constants;
+import org.jboss.xb.binding.MappingObjectModelProvider;
+import org.jboss.xb.binding.XercesXsMarshaller;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+
+/**
+ * An implementation of a JAXB Marshaller that user XercesXSMarshaller impl.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Oct-2004
+ */
+public class XercesXSMarshallerImpl implements JBossXBMarshaller
+{
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(XercesXSMarshallerImpl.class);
+
+ // The marshaller properties
+ private HashMap properties = new HashMap();
+
+ private XercesXsMarshaller delegate;
+
+ public XercesXSMarshallerImpl()
+ {
+ delegate = new XercesXsMarshaller();
+ delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_XML_VERSION, "false");
+ delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_INDENTATION, "false");
+ delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE);
+ delegate.setSupportNil(true);
+ delegate.setSimpleContentProperty("_value");
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into a Writer.
+ */
+ public void marshal(Object obj, Writer writer) throws MarshalException
+ {
+ assertRequiredProperties();
+
+ try
+ {
+ QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
+ delegate.addRootElement(xmlName);
+
+ QName xmlType = (QName)getProperty(JBossXBConstants.JBXB_TYPE_QNAME);
+ if (xmlType != null)
+ {
+ delegate.setRootTypeQName(xmlType);
+ }
+
+ if (xmlName.getNamespaceURI().length() > 0)
+ {
+ String prefix = xmlName.getPrefix();
+ String nsURI = xmlName.getNamespaceURI();
+ delegate.declareNamespace(prefix, nsURI);
+ }
+
+ MappingObjectModelProvider provider = new MappingObjectModelProvider();
+ provider.setIgnoreLowLine(false);
+ provider.setIgnoreNotFoundField(false);
+
+ // todo complete wsdl mapping merge
+ JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JBossXBConstants.JBXB_JAVA_MAPPING);
+ if (wsdlMapping != null)
+ {
+ JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings();
+ if (javaXmlMappings != null)
+ {
+ for (int i = 0; i < javaXmlMappings.length; ++i)
+ {
+ JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i];
+ VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings();
+ if (variableMappings != null)
+ {
+ String clsName = javaXmlMapping.getJavaType();
+ Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader());
+ QName clsQName = javaXmlMapping.getRootTypeQName();
+
+ if (clsQName != null)
+ {
+ if ("element".equals(javaXmlMapping.getQnameScope()))
+ {
+ delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider);
+ }
+ else
+ {
+ delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider);
+ delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart());
+ }
+ }
+
+ for (int j = 0; j < variableMappings.length; ++j)
+ {
+ VariableMapping variableMapping = variableMappings[j];
+ String javaName = variableMapping.getJavaVariableName();
+ if (variableMapping.getXmlElementName() != null)
+ {
+ String xmlElementName = variableMapping.getXmlElementName();
+ provider.mapFieldToElement(cls, javaName, "", xmlElementName, null);
+ }
+ else if (variableMapping.getXmlAttributeName() != null)
+ {
+ log.trace("Unmapped attribute: " + javaName);
+ }
+ else if (variableMapping.getXmlWildcard())
+ {
+ delegate.mapFieldToWildcard(cls, "_any", JBossXBSupport.getWildcardMarshaller());
+ }
+ else
+ {
+ log.warn("Unmapped variable: " + javaName);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (getProperty(JBossXBConstants.JBXB_XS_MODEL) != null)
+ {
+ XSModel model = (XSModel)getProperty(JBossXBConstants.JBXB_XS_MODEL);
+ delegate.marshal(model, provider, obj, writer);
+ }
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new MarshalException(e);
+ }
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into SAX2 events.
+ */
+ public void marshal(Object obj, ContentHandler handler)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into a DOM tree.
+ */
+ public void marshal(Object obj, Node node)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Marshal the content tree rooted at obj into an output stream.
+ */
+ public void marshal(Object obj, OutputStream os) throws MarshalException
+ {
+ marshal(obj, new OutputStreamWriter(os));
+ }
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * Marshaller.
+ */
+ public Object getProperty(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("name parameter is null");
+
+ return properties.get(name);
+ }
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * Marshaller.
+ *
+ */
+ public void setProperty(String name, Object value)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("name parameter is null");
+
+ properties.put(name, value);
+ }
+
+ /**
+ * Get a DOM tree view of the content tree(Optional).
+ */
+ public Node getNode(Object contentTree)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Assert the required properties
+ */
+ private void assertRequiredProperties()
+ {
+ if (getProperty(JBossXBConstants.JBXB_SCHEMA_READER) == null && getProperty(JBossXBConstants.JBXB_XS_MODEL) == null)
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_XS_MODEL);
+
+ if (getProperty(JBossXBConstants.JBXB_JAVA_MAPPING) == null)
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_JAVA_MAPPING);
+
+ QName xmlName = (QName)getProperty(JBossXBConstants.JBXB_ROOT_QNAME);
+ if (xmlName == null)
+ throw new WSException("Cannot find required property: " + JBossXBConstants.JBXB_ROOT_QNAME);
+
+ if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0)
+ throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName);
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/WSCommonConfig.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/WSCommonConfig.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config;
+
+//$Id$
+
+import java.util.List;
+
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * A common configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class WSCommonConfig
+{
+ private String configName;
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type);
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/WSConfigFactory.java (from rev 1570, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/WSConfigFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
+import org.jboss.ws.common.metadata.config.jaxws.WSConfigFactoryJAXWS;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+import org.w3c.dom.Element;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(WSConfigFactory.class);
+
+ private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
+ private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
+
+ // Hide constructor
+ private WSConfigFactory()
+ {
+ }
+
+ /** Create a new instance of the factory
+ */
+ public static WSConfigFactory newInstance()
+ {
+ return new WSConfigFactory();
+ }
+
+ public Object parseWithSchemaBinding(URL configURL) throws IOException, JBossXBException
+ {
+ log.debug("parse: " + configURL);
+
+ String configSchema = "schema/jaxrpc-config_2_0.xsd";
+ URL xsdURL = Thread.currentThread().getContextClassLoader().getResource(configSchema);
+ if (xsdURL == null)
+ throw new WSException("Cannot find: " + configSchema);
+
+ InputStream xsd = xsdURL.openStream();
+ SchemaBinding schemaBinding = XsdBinder.bind(xsd, "UTF-8");
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setEntityResolver(new JBossWSEntityResolver());
+ Object wsConfig = unmarshaller.unmarshal(configURL.openStream(), schemaBinding);
+ return wsConfig;
+ }
+
+ // Below is ObjectModelFactory stuff, which should be removed when parseWithSchemaBinding works.
+
+ public Object parseWithObjectModelFactory(URL configURL) throws IOException, JBossXBException
+ {
+ log.debug("parse: " + configURL);
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+
+ Object wsConfig;
+ String nsURI = getNamespaceURI(configURL);
+ if (URN_JAXRPC_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new WSConfigFactoryJAXRPC(), null);
+ }
+ else if (URN_JAXWS_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new WSConfigFactoryJAXWS(), null);
+ }
+ else
+ {
+ throw new WSException("Invalid config namespace: " + nsURI);
+ }
+
+ return wsConfig;
+ }
+
+ private String getNamespaceURI(URL configURL)
+ {
+ try
+ {
+ Element root = DOMUtils.parse(configURL.openStream());
+ return root.getNamespaceURI();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc)
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxrpc;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSClientConfigJAXRPC.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxrpc;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSClientConfigJAXRPC extends WSCommonConfigJAXRPC
+{
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.WSCommonConfig;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXRPC extends WSCommonConfig
-{
- private HandlerChainMetaData preHandlerChain;
- private HandlerChainMetaData postHandlerChain;
-
- public HandlerChainMetaData getPostHandlerChain()
- {
- return postHandlerChain;
- }
-
- public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
- {
- this.postHandlerChain = postHandlerChain;
- }
-
- public HandlerChainMetaData getPreHandlerChain()
- {
- return preHandlerChain;
- }
-
- public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
- {
- this.preHandlerChain = preHandlerChain;
- }
-
- @Override
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- HandlerChainMetaData handlerChain;
- if (type == HandlerType.PRE)
- handlerChain = getPreHandlerChain();
- else if (type == HandlerType.POST)
- handlerChain = getPostHandlerChain();
- else
- throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChain != null)
- {
- for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
- }
- }
-
- return handlers;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.metadata.config.WSCommonConfig;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class WSCommonConfigJAXRPC extends WSCommonConfig
+{
+ private HandlerChainMetaData preHandlerChain;
+ private HandlerChainMetaData postHandlerChain;
+
+ public HandlerChainMetaData getPostHandlerChain()
+ {
+ return postHandlerChain;
+ }
+
+ public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
+ {
+ this.postHandlerChain = postHandlerChain;
+ }
+
+ public HandlerChainMetaData getPreHandlerChain()
+ {
+ return preHandlerChain;
+ }
+
+ public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
+ {
+ this.preHandlerChain = preHandlerChain;
+ }
+
+ @Override
+ public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
+ {
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+
+ HandlerChainMetaData handlerChain;
+ if (type == HandlerType.PRE)
+ handlerChain = getPreHandlerChain();
+ else if (type == HandlerType.POST)
+ handlerChain = getPostHandlerChain();
+ else
+ throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ if (handlerChain != null)
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
+ {
+ handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
+ }
+ }
+
+ return handlers;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxrpc;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXRPC implements ObjectModelFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXRPC.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
- {
- return new WSConfigRootJAXRPC();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXRPC wsConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXRPC wsEndpointConfig = new WSEndpointConfigJAXRPC();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXRPC wsClientConfig = new WSClientConfigJAXRPC();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chain".equals(localName))
- {
- HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPreHandlerChain(preHandlerChain);
- return preHandlerChain;
- }
- if ("post-handler-chain".equals(localName))
- {
- HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPostHandlerChain(postHandlerChain);
- return postHandlerChain;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainConfig newChild: " + localName);
- if ("handler".equals(localName))
- {
- UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData(handlerChainMetaData);
- List<UnifiedHandlerMetaData> handlers = handlerChainMetaData.getHandlers();
- handlers.add(handler);
- return handler;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- else if (localName.equals("soap-header"))
- handler.addSoapHeader(navigator.resolveQName(value));
- else if (localName.equals("soap-role"))
- handler.addSoapRole(value);
- else if (localName.equals("port-name"))
- handler.addPortName(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxrpc;
+
+//$Id$
+
+import java.util.List;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigFactoryJAXRPC implements ObjectModelFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(WSConfigFactoryJAXRPC.class);
+
+ public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new WSConfigRootJAXRPC();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSConfigRootJAXRPC wsConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSConfig newChild: " + localName);
+ if ("endpoint-config".equals(localName))
+ {
+ WSEndpointConfigJAXRPC wsEndpointConfig = new WSEndpointConfigJAXRPC();
+ wsConfig.getEndpointConfig().add(wsEndpointConfig);
+ return wsEndpointConfig;
+ }
+ if ("client-config".equals(localName))
+ {
+ WSClientConfigJAXRPC wsClientConfig = new WSClientConfigJAXRPC();
+ wsConfig.getClientConfig().add(wsClientConfig);
+ return wsClientConfig;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("config-name"))
+ wsCommonConfig.setConfigName(value);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSCommonConfig newChild: " + localName);
+
+ if ("pre-handler-chain".equals(localName))
+ {
+ HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
+ wsCommonConfig.setPreHandlerChain(preHandlerChain);
+ return preHandlerChain;
+ }
+ if ("post-handler-chain".equals(localName))
+ {
+ HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
+ wsCommonConfig.setPostHandlerChain(postHandlerChain);
+ return postHandlerChain;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSHandlerChainConfig newChild: " + localName);
+ if ("handler".equals(localName))
+ {
+ UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData(handlerChainMetaData);
+ List<UnifiedHandlerMetaData> handlers = handlerChainMetaData.getHandlers();
+ handlers.add(handler);
+ return handler;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("handler-name"))
+ handler.setHandlerName(value);
+ else if (localName.equals("handler-class"))
+ handler.setHandlerClass(value);
+ else if (localName.equals("soap-header"))
+ handler.addSoapHeader(navigator.resolveQName(value));
+ else if (localName.equals("soap-role"))
+ handler.addSoapRole(value);
+ else if (localName.equals("port-name"))
+ handler.addPortName(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("param-name"))
+ param.setParamName(value);
+ else if (localName.equals("param-value"))
+ param.setParamValue(value);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXRPC
-{
- private List<WSClientConfigJAXRPC> clientConfigList = new ArrayList<WSClientConfigJAXRPC>();
- private List<WSEndpointConfigJAXRPC> endpointConfigList = new ArrayList<WSEndpointConfigJAXRPC>();
-
- public List<WSClientConfigJAXRPC> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXRPC> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXRPC> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXRPC> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXRPC getClientConfigByName(String configName)
- {
- WSClientConfigJAXRPC config = null;
- for(WSClientConfigJAXRPC aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXRPC getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXRPC config = null;
- for(WSEndpointConfigJAXRPC aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigRootJAXRPC.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigRootJAXRPC
+{
+ private List<WSClientConfigJAXRPC> clientConfigList = new ArrayList<WSClientConfigJAXRPC>();
+ private List<WSEndpointConfigJAXRPC> endpointConfigList = new ArrayList<WSEndpointConfigJAXRPC>();
+
+ public List<WSClientConfigJAXRPC> getClientConfig()
+ {
+ return clientConfigList;
+ }
+
+ public void setClientConfig(List<WSClientConfigJAXRPC> clientConfig)
+ {
+ this.clientConfigList = clientConfig;
+ }
+
+ public List<WSEndpointConfigJAXRPC> getEndpointConfig()
+ {
+ return endpointConfigList;
+ }
+
+ public void setEndpointConfig(List<WSEndpointConfigJAXRPC> endpointConfig)
+ {
+ this.endpointConfigList = endpointConfig;
+ }
+
+ public WSClientConfigJAXRPC getClientConfigByName(String configName)
+ {
+ WSClientConfigJAXRPC config = null;
+ for(WSClientConfigJAXRPC aux : clientConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && clientConfigList.size() == 1)
+ config = clientConfigList.get(0);
+
+ return config;
+ }
+
+ public WSEndpointConfigJAXRPC getEndpointConfigByName(String configName)
+ {
+ WSEndpointConfigJAXRPC config = null;
+ for(WSEndpointConfigJAXRPC aux : endpointConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && endpointConfigList.size() == 1)
+ config = endpointConfigList.get(0);
+
+ return config;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxrpc;
+
+
+
+// $Id$
+
+/**
+ * A JBossWS endpoint configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSEndpointConfigJAXRPC extends WSCommonConfigJAXRPC
+{
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws)
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSClientConfigJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxws;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSClientConfigJAXWS.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxws;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSClientConfigJAXWS extends WSCommonConfigJAXWS
+{
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSCommonConfigJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.WSCommonConfig;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXWS extends WSCommonConfig
-{
- private WSHandlerChainsConfigJAXWS preHandlerChains;
- private WSHandlerChainsConfigJAXWS postHandlerChains;
-
- public WSHandlerChainsConfigJAXWS getPostHandlerChains()
- {
- return postHandlerChains;
- }
-
- public void setPostHandlerChains(WSHandlerChainsConfigJAXWS postHandlerChain)
- {
- this.postHandlerChains = postHandlerChain;
- }
-
- public WSHandlerChainsConfigJAXWS getPreHandlerChains()
- {
- return preHandlerChains;
- }
-
- public void setPreHandlerChains(WSHandlerChainsConfigJAXWS preHandlerChains)
- {
- this.preHandlerChains = preHandlerChains;
- }
-
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- WSHandlerChainsConfigJAXWS handlerChains;
- if (type == HandlerType.PRE)
- handlerChains = getPreHandlerChains();
- else if (type == HandlerType.POST)
- handlerChains = getPostHandlerChains();
- else throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChains != null)
- {
- for (HandlerChainMetaData handlerChainMetaData : handlerChains.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
- }
- }
- }
-
- return handlers;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSCommonConfigJAXWS.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.metadata.config.WSCommonConfig;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class WSCommonConfigJAXWS extends WSCommonConfig
+{
+ private WSHandlerChainsConfigJAXWS preHandlerChains;
+ private WSHandlerChainsConfigJAXWS postHandlerChains;
+
+ public WSHandlerChainsConfigJAXWS getPostHandlerChains()
+ {
+ return postHandlerChains;
+ }
+
+ public void setPostHandlerChains(WSHandlerChainsConfigJAXWS postHandlerChain)
+ {
+ this.postHandlerChains = postHandlerChain;
+ }
+
+ public WSHandlerChainsConfigJAXWS getPreHandlerChains()
+ {
+ return preHandlerChains;
+ }
+
+ public void setPreHandlerChains(WSHandlerChainsConfigJAXWS preHandlerChains)
+ {
+ this.preHandlerChains = preHandlerChains;
+ }
+
+ public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
+ {
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+
+ WSHandlerChainsConfigJAXWS handlerChains;
+ if (type == HandlerType.PRE)
+ handlerChains = getPreHandlerChains();
+ else if (type == HandlerType.POST)
+ handlerChains = getPostHandlerChains();
+ else throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ if (handlerChains != null)
+ {
+ for (HandlerChainMetaData handlerChainMetaData : handlerChains.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
+ {
+ handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
+ }
+ }
+ }
+
+ return handlers;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigFactoryJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxws;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXWS extends HandlerChainFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXWS.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
- {
- return new WSConfigRootJAXWS();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXWS wsConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXWS wsEndpointConfig = new WSEndpointConfigJAXWS();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXWS wsClientConfig = new WSClientConfigJAXWS();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS preHandlerChains = new WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPreHandlerChains(preHandlerChains);
- return preHandlerChains;
- }
- if ("post-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS postHandlerChains = new WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPostHandlerChains(postHandlerChains);
- return postHandlerChains;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSHandlerChainsConfigJAXWS wsHandlerChains, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainsConfig newChild: " + localName);
-
- if ("handler-chain".equals(localName))
- {
- HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
- wsHandlerChains.getHandlerChains().add(handlerChain);
- return handlerChain;
- }
- return null;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigFactoryJAXWS.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxws;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainFactory;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigFactoryJAXWS extends HandlerChainFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(WSConfigFactoryJAXWS.class);
+
+ public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new WSConfigRootJAXWS();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSConfigRootJAXWS wsConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSConfig newChild: " + localName);
+ if ("endpoint-config".equals(localName))
+ {
+ WSEndpointConfigJAXWS wsEndpointConfig = new WSEndpointConfigJAXWS();
+ wsConfig.getEndpointConfig().add(wsEndpointConfig);
+ return wsEndpointConfig;
+ }
+ if ("client-config".equals(localName))
+ {
+ WSClientConfigJAXWS wsClientConfig = new WSClientConfigJAXWS();
+ wsConfig.getClientConfig().add(wsClientConfig);
+ return wsClientConfig;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("config-name"))
+ wsCommonConfig.setConfigName(value);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSCommonConfig newChild: " + localName);
+
+ if ("pre-handler-chains".equals(localName))
+ {
+ WSHandlerChainsConfigJAXWS preHandlerChains = new WSHandlerChainsConfigJAXWS();
+ wsCommonConfig.setPreHandlerChains(preHandlerChains);
+ return preHandlerChains;
+ }
+ if ("post-handler-chains".equals(localName))
+ {
+ WSHandlerChainsConfigJAXWS postHandlerChains = new WSHandlerChainsConfigJAXWS();
+ wsCommonConfig.setPostHandlerChains(postHandlerChains);
+ return postHandlerChains;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSHandlerChainsConfigJAXWS wsHandlerChains, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSHandlerChainsConfig newChild: " + localName);
+
+ if ("handler-chain".equals(localName))
+ {
+ HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
+ wsHandlerChains.getHandlerChains().add(handlerChain);
+ return handlerChain;
+ }
+ return null;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigRootJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXWS
-{
- private List<WSClientConfigJAXWS> clientConfigList = new ArrayList<WSClientConfigJAXWS>();
- private List<WSEndpointConfigJAXWS> endpointConfigList = new ArrayList<WSEndpointConfigJAXWS>();
-
- public List<WSClientConfigJAXWS> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXWS> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXWS> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXWS> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXWS getClientConfigByName(String configName)
- {
- WSClientConfigJAXWS config = null;
- for(WSClientConfigJAXWS aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXWS getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXWS config = null;
- for(WSEndpointConfigJAXWS aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigRootJAXWS.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSConfigRootJAXWS
+{
+ private List<WSClientConfigJAXWS> clientConfigList = new ArrayList<WSClientConfigJAXWS>();
+ private List<WSEndpointConfigJAXWS> endpointConfigList = new ArrayList<WSEndpointConfigJAXWS>();
+
+ public List<WSClientConfigJAXWS> getClientConfig()
+ {
+ return clientConfigList;
+ }
+
+ public void setClientConfig(List<WSClientConfigJAXWS> clientConfig)
+ {
+ this.clientConfigList = clientConfig;
+ }
+
+ public List<WSEndpointConfigJAXWS> getEndpointConfig()
+ {
+ return endpointConfigList;
+ }
+
+ public void setEndpointConfig(List<WSEndpointConfigJAXWS> endpointConfig)
+ {
+ this.endpointConfigList = endpointConfig;
+ }
+
+ public WSClientConfigJAXWS getClientConfigByName(String configName)
+ {
+ WSClientConfigJAXWS config = null;
+ for(WSClientConfigJAXWS aux : clientConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && clientConfigList.size() == 1)
+ config = clientConfigList.get(0);
+
+ return config;
+ }
+
+ public WSEndpointConfigJAXWS getEndpointConfigByName(String configName)
+ {
+ WSEndpointConfigJAXWS config = null;
+ for(WSEndpointConfigJAXWS aux : endpointConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && endpointConfigList.size() == 1)
+ config = endpointConfigList.get(0);
+
+ return config;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSEndpointConfigJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSEndpointConfigJAXWS.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxws;
+
+
+// $Id$
+
+/**
+ * A JBossWS endpoint configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSEndpointConfigJAXWS extends WSCommonConfigJAXWS
+{
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
-
-/**
- * A JBossWS handler chains configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSHandlerChainsConfigJAXWS
-{
- private List<HandlerChainMetaData> chains = new ArrayList<HandlerChainMetaData>();
-
- public WSHandlerChainsConfigJAXWS()
- {
- }
-
- public List<HandlerChainMetaData> getHandlerChains()
- {
- return chains;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+
+
+/**
+ * A JBossWS handler chains configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class WSHandlerChainsConfigJAXWS
+{
+ private List<HandlerChainMetaData> chains = new ArrayList<HandlerChainMetaData>();
+
+ public WSHandlerChainsConfigJAXWS()
+ {
+ }
+
+ public List<HandlerChainMetaData> getHandlerChains()
+ {
+ return chains;
+ }
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee)
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedApplicationMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * The container independent top level meta data from the jboss.xml and ejb-jar.xml descriptor.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedApplicationMetaData
-{
- /** ArrayList<BeanMetaData> for the ejbs */
- private List<UnifiedBeanMetaData> beans = new ArrayList<UnifiedBeanMetaData>();
- /** The optional JBossWS config-name */
- private String configName;
- /** The optional JBossWS config-file */
- private String configFile;
- /** The web context root to use for web services */
- private String webServiceContextRoot;
- /** The security-domain value assigned to the application */
- private String securityDomain;
- /** A HashMap<String, String> for webservice description publish locations */
- private PublishLocationAdapter publishLocationAdapter;
-
- public UnifiedBeanMetaData getBeanByEjbName(String ejbName)
- {
- for (UnifiedBeanMetaData beanMetaData : beans)
- {
- if (beanMetaData.getEjbName().equals(ejbName))
- {
- return beanMetaData;
- }
- }
- return null;
- }
-
- public Iterator<UnifiedBeanMetaData> getEnterpriseBeans()
- {
- return beans.iterator();
- }
-
- public void setEnterpriseBeans(List<UnifiedBeanMetaData> beans)
- {
- this.beans = beans;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getWebServiceContextRoot()
- {
- return webServiceContextRoot;
- }
-
- public void setWebServiceContextRoot(String contextRoot)
- {
- this.webServiceContextRoot = contextRoot;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
- {
- this.publishLocationAdapter = publishLocationAdapter;
- }
-
- public String getWsdlPublishLocationByName(String name)
- {
- String publishLocation = null;
- if (publishLocationAdapter != null)
- publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
- return publishLocation;
-
- }
-
- public interface PublishLocationAdapter
- {
- String getWsdlPublishLocationByName(String name);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedApplicationMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedApplicationMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * The container independent top level meta data from the jboss.xml and ejb-jar.xml descriptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedApplicationMetaData
+{
+ /** ArrayList<BeanMetaData> for the ejbs */
+ private List<UnifiedBeanMetaData> beans = new ArrayList<UnifiedBeanMetaData>();
+ /** The optional JBossWS config-name */
+ private String configName;
+ /** The optional JBossWS config-file */
+ private String configFile;
+ /** The web context root to use for web services */
+ private String webServiceContextRoot;
+ /** The security-domain value assigned to the application */
+ private String securityDomain;
+ /** A HashMap<String, String> for webservice description publish locations */
+ private PublishLocationAdapter publishLocationAdapter;
+
+ public UnifiedBeanMetaData getBeanByEjbName(String ejbName)
+ {
+ for (UnifiedBeanMetaData beanMetaData : beans)
+ {
+ if (beanMetaData.getEjbName().equals(ejbName))
+ {
+ return beanMetaData;
+ }
+ }
+ return null;
+ }
+
+ public Iterator<UnifiedBeanMetaData> getEnterpriseBeans()
+ {
+ return beans.iterator();
+ }
+
+ public void setEnterpriseBeans(List<UnifiedBeanMetaData> beans)
+ {
+ this.beans = beans;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getWebServiceContextRoot()
+ {
+ return webServiceContextRoot;
+ }
+
+ public void setWebServiceContextRoot(String contextRoot)
+ {
+ this.webServiceContextRoot = contextRoot;
+ }
+
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ public void setSecurityDomain(String securityDomain)
+ {
+ this.securityDomain = securityDomain;
+ }
+
+ public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
+ {
+ this.publishLocationAdapter = publishLocationAdapter;
+ }
+
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String publishLocation = null;
+ if (publishLocationAdapter != null)
+ publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
+ return publishLocation;
+
+ }
+
+ public interface PublishLocationAdapter
+ {
+ String getWsdlPublishLocationByName(String name);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedBeanMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-//$Id$
-
-/**
- * The container independent common meta data class for the entity, message-driven and session beans.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedBeanMetaData
-{
- /** The ejb-name element specifies an enterprise bean's name. */
- private String ejbName;
- /** The ejb-class element contains the fully-qualified name of the enterprise bean's class. */
- private String ejbClass;
- /** The home element contains the fully-qualified name of the enterprise
- bean's home interface. */
- private String homeClass;
- /** The local-home element contains the fully-qualified name of the
- enterprise bean's local home interface. */
- private String localHomeClass;
- /** The service-endpoint element contains the fully-qualified name of the beans service endpoint interface (SEI) */
- protected String seiName;
- /** The JNDI name under with the home interface should be bound */
- private String jndiName;
- /** The JNDI name under with the local home interface should be bound */
- private String localJndiName;
- /** The jboss port-component binding for a ejb webservice */
- protected UnifiedEjbPortComponentMetaData portComponent;
-
- public String getEjbName()
- {
- return ejbName;
- }
-
- public void setEjbName(String ejbName)
- {
- this.ejbName = ejbName;
- }
-
- public String getEjbClass()
- {
- return ejbClass;
- }
-
- public void setEjbClass(String ejbClass)
- {
- this.ejbClass = ejbClass;
- }
-
- public UnifiedEjbPortComponentMetaData getPortComponent()
- {
- return portComponent;
- }
-
- public void setPortComponent(UnifiedEjbPortComponentMetaData portComponent)
- {
- this.portComponent = portComponent;
- }
-
- public String getServiceEndpoint()
- {
- return seiName;
- }
-
- public void setServiceEndpoint(String seiName)
- {
- this.seiName = seiName;
- }
-
- public String getContainerObjectNameJndiName()
- {
- return getHome() != null ? getJndiName() : getLocalJndiName();
- }
-
- public String getHome()
- {
- return homeClass;
- }
-
- public void setHome(String homeClass)
- {
- this.homeClass = homeClass;
- }
-
- public String getJndiName()
- {
- return jndiName;
- }
-
- public void setJndiName(String jndiName)
- {
- this.jndiName = jndiName;
- }
-
- public String getLocalHome()
- {
- return localHomeClass;
- }
-
- public void setLocalHome(String localHomeClass)
- {
- this.localHomeClass = localHomeClass;
- }
-
- public String getLocalJndiName()
- {
- return localJndiName;
- }
-
- public void setLocalJndiName(String localJndiName)
- {
- this.localJndiName = localJndiName;
- }
-
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedBeanMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedBeanMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+//$Id$
+
+/**
+ * The container independent common meta data class for the entity, message-driven and session beans.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedBeanMetaData
+{
+ /** The ejb-name element specifies an enterprise bean's name. */
+ private String ejbName;
+ /** The ejb-class element contains the fully-qualified name of the enterprise bean's class. */
+ private String ejbClass;
+ /** The home element contains the fully-qualified name of the enterprise
+ bean's home interface. */
+ private String homeClass;
+ /** The local-home element contains the fully-qualified name of the
+ enterprise bean's local home interface. */
+ private String localHomeClass;
+ /** The service-endpoint element contains the fully-qualified name of the beans service endpoint interface (SEI) */
+ protected String seiName;
+ /** The JNDI name under with the home interface should be bound */
+ private String jndiName;
+ /** The JNDI name under with the local home interface should be bound */
+ private String localJndiName;
+ /** The jboss port-component binding for a ejb webservice */
+ protected UnifiedEjbPortComponentMetaData portComponent;
+
+ public String getEjbName()
+ {
+ return ejbName;
+ }
+
+ public void setEjbName(String ejbName)
+ {
+ this.ejbName = ejbName;
+ }
+
+ public String getEjbClass()
+ {
+ return ejbClass;
+ }
+
+ public void setEjbClass(String ejbClass)
+ {
+ this.ejbClass = ejbClass;
+ }
+
+ public UnifiedEjbPortComponentMetaData getPortComponent()
+ {
+ return portComponent;
+ }
+
+ public void setPortComponent(UnifiedEjbPortComponentMetaData portComponent)
+ {
+ this.portComponent = portComponent;
+ }
+
+ public String getServiceEndpoint()
+ {
+ return seiName;
+ }
+
+ public void setServiceEndpoint(String seiName)
+ {
+ this.seiName = seiName;
+ }
+
+ public String getContainerObjectNameJndiName()
+ {
+ return getHome() != null ? getJndiName() : getLocalJndiName();
+ }
+
+ public String getHome()
+ {
+ return homeClass;
+ }
+
+ public void setHome(String homeClass)
+ {
+ this.homeClass = homeClass;
+ }
+
+ public String getJndiName()
+ {
+ return jndiName;
+ }
+
+ public void setJndiName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ public String getLocalHome()
+ {
+ return localHomeClass;
+ }
+
+ public void setLocalHome(String localHomeClass)
+ {
+ this.localHomeClass = localHomeClass;
+ }
+
+ public String getLocalJndiName()
+ {
+ return localJndiName;
+ }
+
+ public void setLocalJndiName(String localJndiName)
+ {
+ this.localJndiName = localJndiName;
+ }
+
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedEjbPortComponentMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-
-//$Id$
-
-
-/**
- * The container independent metadata for session/port-component element from jboss.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedEjbPortComponentMetaData
-{
- private String portComponentName;
- private String portComponentURI;
- private String authMethod;
- private String transportGuarantee;
-
- public String getPortComponentName()
- {
- return portComponentName;
- }
-
- public void setPortComponentName(String portComponentName)
- {
- this.portComponentName = portComponentName;
- }
-
- public String getPortComponentURI()
- {
- return portComponentURI;
- }
-
- public void setPortComponentURI(String portComponentURI)
- {
- this.portComponentURI = portComponentURI;
- }
-
- public String getURLPattern()
- {
- String pattern = "/*";
- if (portComponentURI != null)
- {
- return portComponentURI;
- }
- return pattern;
- }
-
- public String getAuthMethod()
- {
- return authMethod;
- }
-
- public void setAuthMethod(String authMethod)
- {
- this.authMethod = authMethod;
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedEjbPortComponentMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedEjbPortComponentMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+
+//$Id$
+
+
+/**
+ * The container independent metadata for session/port-component element from jboss.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedEjbPortComponentMetaData
+{
+ private String portComponentName;
+ private String portComponentURI;
+ private String authMethod;
+ private String transportGuarantee;
+
+ public String getPortComponentName()
+ {
+ return portComponentName;
+ }
+
+ public void setPortComponentName(String portComponentName)
+ {
+ this.portComponentName = portComponentName;
+ }
+
+ public String getPortComponentURI()
+ {
+ return portComponentURI;
+ }
+
+ public void setPortComponentURI(String portComponentURI)
+ {
+ this.portComponentURI = portComponentURI;
+ }
+
+ public String getURLPattern()
+ {
+ String pattern = "/*";
+ if (portComponentURI != null)
+ {
+ return portComponentURI;
+ }
+ return pattern;
+ }
+
+ public String getAuthMethod()
+ {
+ return authMethod;
+ }
+
+ public void setAuthMethod(String authMethod)
+ {
+ this.authMethod = authMethod;
+ }
+
+ public String getTransportGuarantee()
+ {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee)
+ {
+ this.transportGuarantee = transportGuarantee;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedHandlerMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,183 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-//$Id$
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaDataJAXRPC;
-import org.jboss.ws.common.umdm.HandlerMetaDataJAXWS;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
-/**
- * The container independent metdata data for a handler element
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedHandlerMetaData implements Serializable
-{
- private static final long serialVersionUID = -3019416564080333900L;
-
- private HandlerChainMetaData chainConfig;
-
- // The required <handler-name> element
- private String handlerName;
- // The required <handler-class> element
- private String handlerClass;
- // The optional <init-param> elements
- private ArrayList<HandlerInitParam> initParams = new ArrayList<HandlerInitParam>();
- // The optional <soap-header> elements
- private Set<QName> soapHeaders = new HashSet<QName>();
- // The optional <soap-role> elements
- private Set<String> soapRoles = new HashSet<String>();
- // The optional <port-name> elements
- private Set<String> portNames = new HashSet<String>();
-
- public UnifiedHandlerMetaData(HandlerChainMetaData handlerChainMetaData)
- {
- this.chainConfig = handlerChainMetaData;
- }
-
- public void setHandlerName(String value)
- {
- this.handlerName = value;
- }
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerClass(String handlerClass)
- {
- this.handlerClass = handlerClass;
- }
-
- public String getHandlerClass()
- {
- return handlerClass;
- }
-
- public void addInitParam(HandlerInitParam param)
- {
- initParams.add(param);
- }
-
- public List<HandlerInitParam> getInitParams()
- {
- return initParams;
- }
-
- public void addSoapRole(String value)
- {
- soapRoles.add(value);
- }
-
- public Set<String> getSoapRoles()
- {
- return soapRoles;
- }
-
- public void addSoapHeader(QName qName)
- {
- soapHeaders.add(qName);
- }
-
- public Set<QName> getSoapHeaders()
- {
- return soapHeaders;
- }
-
- public String getProtocolBindings()
- {
- return (chainConfig != null ? chainConfig.getProtocolBindings() : null);
- }
-
- public QName getServiceNamePattern()
- {
- return (chainConfig != null ? chainConfig.getServiceNamePattern() : null);
- }
-
- public QName getPortNamePattern()
- {
- return (chainConfig != null ? chainConfig.getPortNamePattern() : null);
- }
-
- public void addPortName(String portName)
- {
- portNames.add(portName);
- }
-
- public Set<String> getPortNames()
- {
- return portNames;
- }
-
- public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData, HandlerType type)
- {
- HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
- hmd.setHandlerName(getHandlerName());
- hmd.setHandlerClassName(getHandlerClass());
- hmd.seiInitParams(getInitParams());
- hmd.setSoapHeaders(getSoapHeaders());
- hmd.setSoapRoles(getSoapRoles());
- hmd.setPortNames(getPortNames());
- return hmd;
- }
-
- public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData, HandlerType type)
- {
- HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
- hmd.setHandlerName(getHandlerName());
- hmd.setHandlerClassName(getHandlerClass());
- hmd.seiInitParams(getInitParams());
- hmd.setProtocolBindings(getProtocolBindings());
- hmd.setServiceNamePattern(getServiceNamePattern());
- hmd.setPortNamePattern(getPortNamePattern());
- return hmd;
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer("\nUnifiedHandlerMetaData:");
- buffer.append("\n name=" + getHandlerName());
- buffer.append("\n class=" + getHandlerClass());
- buffer.append("\n params=" + getInitParams());
- buffer.append("\n headers=" + getSoapHeaders());
- buffer.append("\n roles=" + getSoapRoles());
- buffer.append("\n protocols=" + getProtocolBindings());
- buffer.append("\n services=" + getServiceNamePattern());
- buffer.append("\n ports=" + (getPortNamePattern() != null ? getPortNamePattern() : portNames));
- return buffer.toString();
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedHandlerMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedHandlerMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+//$Id$
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.common.umdm.EndpointMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.common.umdm.HandlerMetaDataJAXWS;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * The container independent metdata data for a handler element
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedHandlerMetaData implements Serializable
+{
+ private static final long serialVersionUID = -3019416564080333900L;
+
+ private HandlerChainMetaData chainConfig;
+
+ // The required <handler-name> element
+ private String handlerName;
+ // The required <handler-class> element
+ private String handlerClass;
+ // The optional <init-param> elements
+ private ArrayList<HandlerInitParam> initParams = new ArrayList<HandlerInitParam>();
+ // The optional <soap-header> elements
+ private Set<QName> soapHeaders = new HashSet<QName>();
+ // The optional <soap-role> elements
+ private Set<String> soapRoles = new HashSet<String>();
+ // The optional <port-name> elements
+ private Set<String> portNames = new HashSet<String>();
+
+ public UnifiedHandlerMetaData(HandlerChainMetaData handlerChainMetaData)
+ {
+ this.chainConfig = handlerChainMetaData;
+ }
+
+ public void setHandlerName(String value)
+ {
+ this.handlerName = value;
+ }
+
+ public String getHandlerName()
+ {
+ return handlerName;
+ }
+
+ public void setHandlerClass(String handlerClass)
+ {
+ this.handlerClass = handlerClass;
+ }
+
+ public String getHandlerClass()
+ {
+ return handlerClass;
+ }
+
+ public void addInitParam(HandlerInitParam param)
+ {
+ initParams.add(param);
+ }
+
+ public List<HandlerInitParam> getInitParams()
+ {
+ return initParams;
+ }
+
+ public void addSoapRole(String value)
+ {
+ soapRoles.add(value);
+ }
+
+ public Set<String> getSoapRoles()
+ {
+ return soapRoles;
+ }
+
+ public void addSoapHeader(QName qName)
+ {
+ soapHeaders.add(qName);
+ }
+
+ public Set<QName> getSoapHeaders()
+ {
+ return soapHeaders;
+ }
+
+ public String getProtocolBindings()
+ {
+ return (chainConfig != null ? chainConfig.getProtocolBindings() : null);
+ }
+
+ public QName getServiceNamePattern()
+ {
+ return (chainConfig != null ? chainConfig.getServiceNamePattern() : null);
+ }
+
+ public QName getPortNamePattern()
+ {
+ return (chainConfig != null ? chainConfig.getPortNamePattern() : null);
+ }
+
+ public void addPortName(String portName)
+ {
+ portNames.add(portName);
+ }
+
+ public Set<String> getPortNames()
+ {
+ return portNames;
+ }
+
+ public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData, HandlerType type)
+ {
+ HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
+ hmd.setHandlerName(getHandlerName());
+ hmd.setHandlerClassName(getHandlerClass());
+ hmd.seiInitParams(getInitParams());
+ hmd.setSoapHeaders(getSoapHeaders());
+ hmd.setSoapRoles(getSoapRoles());
+ hmd.setPortNames(getPortNames());
+ return hmd;
+ }
+
+ public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData, HandlerType type)
+ {
+ HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
+ hmd.setHandlerName(getHandlerName());
+ hmd.setHandlerClassName(getHandlerClass());
+ hmd.seiInitParams(getInitParams());
+ hmd.setProtocolBindings(getProtocolBindings());
+ hmd.setServiceNamePattern(getServiceNamePattern());
+ hmd.setPortNamePattern(getPortNamePattern());
+ return hmd;
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("\nUnifiedHandlerMetaData:");
+ buffer.append("\n name=" + getHandlerName());
+ buffer.append("\n class=" + getHandlerClass());
+ buffer.append("\n params=" + getInitParams());
+ buffer.append("\n headers=" + getSoapHeaders());
+ buffer.append("\n roles=" + getSoapRoles());
+ buffer.append("\n protocols=" + getProtocolBindings());
+ buffer.append("\n services=" + getServiceNamePattern());
+ buffer.append("\n ports=" + (getPortNamePattern() != null ? getPortNamePattern() : portNames));
+ return buffer.toString();
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedMessageDrivenMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-
-// $Id$
-
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedMessageDrivenMetaData extends UnifiedBeanMetaData
-{
- private String destinationJndiName;
-
- public String getDestinationJndiName()
- {
- return destinationJndiName;
- }
-
- public void setDestinationJndiName(String destinationJndiName)
- {
- this.destinationJndiName = destinationJndiName;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedMessageDrivenMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedMessageDrivenMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+
+// $Id$
+
+
+/**
+ * The container independent metadata of a message driven bean.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedMessageDrivenMetaData extends UnifiedBeanMetaData
+{
+ private String destinationJndiName;
+
+ public String getDestinationJndiName()
+ {
+ return destinationJndiName;
+ }
+
+ public void setDestinationJndiName(String destinationJndiName)
+ {
+ this.destinationJndiName = destinationJndiName;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedPortComponentRefMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-//$Id$
-
-/**
- * The container independent metdata data from handler init params
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedPortComponentRefMetaData implements Serializable
-{
- private static final long serialVersionUID = -7030007637678646740L;
-
- // The required <service-endpoint-interface> element
- private String serviceEndpointInterface;
- // The optional <port-component-link> element
- private String portComponentLink;
-
- /** Arbitrary proxy properties given by <call-property> */
- private Properties callProperties;
-
- public String getPortComponentLink()
- {
- return portComponentLink;
- }
-
- public void setPortComponentLink(String portComponentLink)
- {
- this.portComponentLink = portComponentLink;
- }
-
- public String getServiceEndpointInterface()
- {
- return serviceEndpointInterface;
- }
-
- public void setServiceEndpointInterface(String serviceEndpointInterface)
- {
- this.serviceEndpointInterface = serviceEndpointInterface;
- }
-
- public Properties getCallProperties()
- {
- return callProperties;
- }
-
- public void setCallProperties(Properties callProperties)
- {
- this.callProperties = callProperties;
- }
-
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedPortComponentRefMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedPortComponentRefMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+//$Id$
+
+/**
+ * The container independent metdata data from handler init params
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedPortComponentRefMetaData implements Serializable
+{
+ private static final long serialVersionUID = -7030007637678646740L;
+
+ // The required <service-endpoint-interface> element
+ private String serviceEndpointInterface;
+ // The optional <port-component-link> element
+ private String portComponentLink;
+
+ /** Arbitrary proxy properties given by <call-property> */
+ private Properties callProperties;
+
+ public String getPortComponentLink()
+ {
+ return portComponentLink;
+ }
+
+ public void setPortComponentLink(String portComponentLink)
+ {
+ this.portComponentLink = portComponentLink;
+ }
+
+ public String getServiceEndpointInterface()
+ {
+ return serviceEndpointInterface;
+ }
+
+ public void setServiceEndpointInterface(String serviceEndpointInterface)
+ {
+ this.serviceEndpointInterface = serviceEndpointInterface;
+ }
+
+ public Properties getCallProperties()
+ {
+ return callProperties;
+ }
+
+ public void setCallProperties(Properties callProperties)
+ {
+ this.callProperties = callProperties;
+ }
+
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedServiceRefMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,258 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-//$Id$
-
-import java.io.Serializable;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.namespace.QName;
-
-
-/**
- * The container independent metdata data from service-ref element in web.xml, ejb-jar.xml, and
- * application-client.xml.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedServiceRefMetaData implements Serializable
-{
- private static final long serialVersionUID = 122554634182144069L;
-
- // The required <service-ref-name> element
- private String serviceRefName;
- // The required <service-interface> element
- private String serviceInterface;
- // The optional <wsdl-file> element
- private String wsdlFile;
- // The optional <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
- // The optional <service-qname> element
- private QName serviceQName;
- // The LinkedHashMap<String, UnifiedPortComponentRefMetaData> for <port-component-ref> elements
- private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
- // The optional <handler> elements
- private List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
-
- // The optional JBossWS config-name
- private String configName;
- // The optional JBossWS config-file
- private String configFile;
- /** The URL of the actual WSDL to use, <wsdl-override> */
- private URL wsdlOverride;
- /** Arbitrary proxy properties given by <call-property> */
- private Properties callProperties;
-
- // The wsdl definition, if we have one
- private Object wsdlDefinition;
- // The java/wsdl mapping, if we have one
- private Object javaWsdlMapping;
-
- //The ClassLoader to load additional resources
- private transient URLClassLoader resourceCL;
-
- /** Set the resource classloader that can load the wsdl file
- * On the client side this is set expicitly after unmarshalling.
- */
- public void setResourceCL(URLClassLoader resourceCL)
- {
- if (resourceCL == null)
- throw new IllegalArgumentException("ResourceClassLoader cannot be null");
-
- this.resourceCL = resourceCL;
- }
-
- public URLClassLoader getResourceCL()
- {
- if (resourceCL == null)
- resourceCL = new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader());
-
- return resourceCL;
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
-
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- public URL getJavaWsdlMappingURL()
- {
- URL mappingURL = null;
- if (jaxrpcMappingFile != null)
- {
- mappingURL = getResourceCL().findResource(jaxrpcMappingFile);
- if (mappingURL == null)
- throw new IllegalStateException("Cannot find resource: " + jaxrpcMappingFile);
- }
- return mappingURL;
- }
-
- public Object getJavaWsdlMapping()
- {
- return javaWsdlMapping;
- }
-
- public void setJavaWsdlMapping(Object javaWsdlMapping)
- {
- this.javaWsdlMapping = javaWsdlMapping;
- }
-
- public UnifiedPortComponentRefMetaData[] getPortComponentRefs()
- {
- UnifiedPortComponentRefMetaData[] array = new UnifiedPortComponentRefMetaData[portComponentRefs.size()];
- portComponentRefs.values().toArray(array);
- return array;
- }
-
- public void setPortComponentRefs(LinkedHashMap<String, UnifiedPortComponentRefMetaData> portComponentRefs)
- {
- this.portComponentRefs = portComponentRefs;
- }
-
- public UnifiedHandlerMetaData[] getHandlers()
- {
- UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
- handlers.toArray(array);
- return array;
- }
-
- public void setHandlers(ArrayList<UnifiedHandlerMetaData> handlers)
- {
- this.handlers = handlers;
- }
-
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
- public void setServiceInterface(String serviceInterface)
- {
- this.serviceInterface = serviceInterface;
- }
-
- public QName getServiceQName()
- {
- return serviceQName;
- }
-
- public void setServiceQName(QName serviceQName)
- {
- this.serviceQName = serviceQName;
- }
-
- public String getServiceRefName()
- {
- return serviceRefName;
- }
-
- public void setServiceRefName(String serviceRefName)
- {
- this.serviceRefName = serviceRefName;
- }
-
- public String getWsdlFile()
- {
- return wsdlFile;
- }
-
- public void setWsdlFile(String wsdlFile)
- {
- this.wsdlFile = wsdlFile;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public URL getWsdlOverride()
- {
- return wsdlOverride;
- }
-
-
- public void setWsdlOverride(URL wsdlOverride)
- {
- this.wsdlOverride = wsdlOverride;
- }
-
- public URL getWsdlURL()
- {
- URL wsdlURL = wsdlOverride;
- if (wsdlURL == null && wsdlFile != null)
- {
- wsdlURL = getResourceCL().findResource(wsdlFile);
- if (wsdlURL == null)
- throw new IllegalStateException("Cannot find resource: " + wsdlFile);
- }
- return wsdlURL;
- }
-
- public Properties getCallProperties()
- {
- return callProperties;
- }
-
- public void setCallProperties(Properties callProperties)
- {
- this.callProperties = callProperties;
- }
-
- public Object getWsdlDefinition()
- {
- return wsdlDefinition;
- }
-
- public void setWsdlDefinition(Object wsdlDefinition)
- {
- this.wsdlDefinition = wsdlDefinition;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedServiceRefMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedServiceRefMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,258 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+//$Id$
+
+import java.io.Serializable;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * The container independent metdata data from service-ref element in web.xml, ejb-jar.xml, and
+ * application-client.xml.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedServiceRefMetaData implements Serializable
+{
+ private static final long serialVersionUID = 122554634182144069L;
+
+ // The required <service-ref-name> element
+ private String serviceRefName;
+ // The required <service-interface> element
+ private String serviceInterface;
+ // The optional <wsdl-file> element
+ private String wsdlFile;
+ // The optional <jaxrpc-mapping-file> element
+ private String jaxrpcMappingFile;
+ // The optional <service-qname> element
+ private QName serviceQName;
+ // The LinkedHashMap<String, UnifiedPortComponentRefMetaData> for <port-component-ref> elements
+ private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ // The optional <handler> elements
+ private List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
+
+ // The optional JBossWS config-name
+ private String configName;
+ // The optional JBossWS config-file
+ private String configFile;
+ /** The URL of the actual WSDL to use, <wsdl-override> */
+ private URL wsdlOverride;
+ /** Arbitrary proxy properties given by <call-property> */
+ private Properties callProperties;
+
+ // The wsdl definition, if we have one
+ private Object wsdlDefinition;
+ // The java/wsdl mapping, if we have one
+ private Object javaWsdlMapping;
+
+ //The ClassLoader to load additional resources
+ private transient URLClassLoader resourceCL;
+
+ /** Set the resource classloader that can load the wsdl file
+ * On the client side this is set expicitly after unmarshalling.
+ */
+ public void setResourceCL(URLClassLoader resourceCL)
+ {
+ if (resourceCL == null)
+ throw new IllegalArgumentException("ResourceClassLoader cannot be null");
+
+ this.resourceCL = resourceCL;
+ }
+
+ public URLClassLoader getResourceCL()
+ {
+ if (resourceCL == null)
+ resourceCL = new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader());
+
+ return resourceCL;
+ }
+
+ public String getJaxrpcMappingFile()
+ {
+ return jaxrpcMappingFile;
+ }
+
+ public void setJaxrpcMappingFile(String jaxrpcMappingFile)
+ {
+ this.jaxrpcMappingFile = jaxrpcMappingFile;
+ }
+
+ public URL getJavaWsdlMappingURL()
+ {
+ URL mappingURL = null;
+ if (jaxrpcMappingFile != null)
+ {
+ mappingURL = getResourceCL().findResource(jaxrpcMappingFile);
+ if (mappingURL == null)
+ throw new IllegalStateException("Cannot find resource: " + jaxrpcMappingFile);
+ }
+ return mappingURL;
+ }
+
+ public Object getJavaWsdlMapping()
+ {
+ return javaWsdlMapping;
+ }
+
+ public void setJavaWsdlMapping(Object javaWsdlMapping)
+ {
+ this.javaWsdlMapping = javaWsdlMapping;
+ }
+
+ public UnifiedPortComponentRefMetaData[] getPortComponentRefs()
+ {
+ UnifiedPortComponentRefMetaData[] array = new UnifiedPortComponentRefMetaData[portComponentRefs.size()];
+ portComponentRefs.values().toArray(array);
+ return array;
+ }
+
+ public void setPortComponentRefs(LinkedHashMap<String, UnifiedPortComponentRefMetaData> portComponentRefs)
+ {
+ this.portComponentRefs = portComponentRefs;
+ }
+
+ public UnifiedHandlerMetaData[] getHandlers()
+ {
+ UnifiedHandlerMetaData[] array = new UnifiedHandlerMetaData[handlers.size()];
+ handlers.toArray(array);
+ return array;
+ }
+
+ public void setHandlers(ArrayList<UnifiedHandlerMetaData> handlers)
+ {
+ this.handlers = handlers;
+ }
+
+ public String getServiceInterface()
+ {
+ return serviceInterface;
+ }
+
+ public void setServiceInterface(String serviceInterface)
+ {
+ this.serviceInterface = serviceInterface;
+ }
+
+ public QName getServiceQName()
+ {
+ return serviceQName;
+ }
+
+ public void setServiceQName(QName serviceQName)
+ {
+ this.serviceQName = serviceQName;
+ }
+
+ public String getServiceRefName()
+ {
+ return serviceRefName;
+ }
+
+ public void setServiceRefName(String serviceRefName)
+ {
+ this.serviceRefName = serviceRefName;
+ }
+
+ public String getWsdlFile()
+ {
+ return wsdlFile;
+ }
+
+ public void setWsdlFile(String wsdlFile)
+ {
+ this.wsdlFile = wsdlFile;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public URL getWsdlOverride()
+ {
+ return wsdlOverride;
+ }
+
+
+ public void setWsdlOverride(URL wsdlOverride)
+ {
+ this.wsdlOverride = wsdlOverride;
+ }
+
+ public URL getWsdlURL()
+ {
+ URL wsdlURL = wsdlOverride;
+ if (wsdlURL == null && wsdlFile != null)
+ {
+ wsdlURL = getResourceCL().findResource(wsdlFile);
+ if (wsdlURL == null)
+ throw new IllegalStateException("Cannot find resource: " + wsdlFile);
+ }
+ return wsdlURL;
+ }
+
+ public Properties getCallProperties()
+ {
+ return callProperties;
+ }
+
+ public void setCallProperties(Properties callProperties)
+ {
+ this.callProperties = callProperties;
+ }
+
+ public Object getWsdlDefinition()
+ {
+ return wsdlDefinition;
+ }
+
+ public void setWsdlDefinition(Object wsdlDefinition)
+ {
+ this.wsdlDefinition = wsdlDefinition;
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedSessionMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-
-// $Id$
-
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedSessionMetaData extends UnifiedBeanMetaData
-{
-
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedSessionMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedSessionMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+
+// $Id$
+
+
+/**
+ * The container independent metadata of a message driven bean.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedSessionMetaData extends UnifiedBeanMetaData
+{
+
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The container independent representation of the web.xml and jboss-web.xml deployment descriptors
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedWebMetaData
-{
- /** The war context root as specified at the jboss-web.xml descriptor level. */
- private String contextRoot;
- /** The servlet-mapping <servlet-name, url-pattern> */
- private Map<String, String> servletMappings = new HashMap<String, String>();
- /** The servlet <servlet-name, servlet-class> */
- private Map<String, String> servletClassNames = new HashMap<String, String>();
- /** The optional JBossWS config-name */
- private String configName;
- /** The optional JBossWS config-file */
- private String configFile;
- /** The security-domain value assigned to the application */
- private String securityDomain;
- /** A HashMap<String, String> for webservice description publish locations */
- private PublishLocationAdapter publishLocationAdapter;
- /** web.xml security-constraints */
- private List<UnifiedWebSecurityMetaData> securityMetaData;
-
- public String getContextRoot()
- {
- return contextRoot;
- }
-
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
-
- public Map<String, String> getServletMappings()
- {
- return servletMappings;
- }
-
- public void setServletMappings(Map<String, String> servletMappings)
- {
- this.servletMappings = servletMappings;
- }
-
- public Map<String, String> getServletClassNames()
- {
- return servletClassNames;
- }
-
- public void setServletClassNames(Map<String, String> servletClassNames)
- {
- this.servletClassNames = servletClassNames;
- }
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public String getConfigFile()
- {
- return configFile;
- }
-
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
-
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- public void setSecurityDomain(String securityDomain)
- {
- this.securityDomain = securityDomain;
- }
-
- public List<UnifiedWebSecurityMetaData> getSecurityMetaData()
- {
- return securityMetaData;
- }
-
- public void setSecurityMetaData(List<UnifiedWebSecurityMetaData> securityMetaData)
- {
- this.securityMetaData = securityMetaData;
- }
-
- public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
- {
- this.publishLocationAdapter = publishLocationAdapter;
- }
-
- public String getWsdlPublishLocationByName(String name)
- {
- String publishLocation = null;
- if (publishLocationAdapter != null)
- publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
- return publishLocation;
-
- }
-
- public interface PublishLocationAdapter
- {
- String getWsdlPublishLocationByName(String name);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The container independent representation of the web.xml and jboss-web.xml deployment descriptors
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedWebMetaData
+{
+ /** The war context root as specified at the jboss-web.xml descriptor level. */
+ private String contextRoot;
+ /** The servlet-mapping <servlet-name, url-pattern> */
+ private Map<String, String> servletMappings = new HashMap<String, String>();
+ /** The servlet <servlet-name, servlet-class> */
+ private Map<String, String> servletClassNames = new HashMap<String, String>();
+ /** The optional JBossWS config-name */
+ private String configName;
+ /** The optional JBossWS config-file */
+ private String configFile;
+ /** The security-domain value assigned to the application */
+ private String securityDomain;
+ /** A HashMap<String, String> for webservice description publish locations */
+ private PublishLocationAdapter publishLocationAdapter;
+ /** web.xml security-constraints */
+ private List<UnifiedWebSecurityMetaData> securityMetaData;
+
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+
+ public void setContextRoot(String contextRoot)
+ {
+ this.contextRoot = contextRoot;
+ }
+
+ public Map<String, String> getServletMappings()
+ {
+ return servletMappings;
+ }
+
+ public void setServletMappings(Map<String, String> servletMappings)
+ {
+ this.servletMappings = servletMappings;
+ }
+
+ public Map<String, String> getServletClassNames()
+ {
+ return servletClassNames;
+ }
+
+ public void setServletClassNames(Map<String, String> servletClassNames)
+ {
+ this.servletClassNames = servletClassNames;
+ }
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public String getConfigFile()
+ {
+ return configFile;
+ }
+
+ public void setConfigFile(String configFile)
+ {
+ this.configFile = configFile;
+ }
+
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ public void setSecurityDomain(String securityDomain)
+ {
+ this.securityDomain = securityDomain;
+ }
+
+ public List<UnifiedWebSecurityMetaData> getSecurityMetaData()
+ {
+ return securityMetaData;
+ }
+
+ public void setSecurityMetaData(List<UnifiedWebSecurityMetaData> securityMetaData)
+ {
+ this.securityMetaData = securityMetaData;
+ }
+
+ public void setPublishLocationAdapter(PublishLocationAdapter publishLocationAdapter)
+ {
+ this.publishLocationAdapter = publishLocationAdapter;
+ }
+
+ public String getWsdlPublishLocationByName(String name)
+ {
+ String publishLocation = null;
+ if (publishLocationAdapter != null)
+ publishLocation = publishLocationAdapter.getWsdlPublishLocationByName(name);
+ return publishLocation;
+
+ }
+
+ public interface PublishLocationAdapter
+ {
+ String getWsdlPublishLocationByName(String name);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebSecurityMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.j2ee;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-
-/**
- *
- * @author darran.lofthouse(a)jboss.com
- * @since Oct 22, 2006
- */
-public class UnifiedWebSecurityMetaData
-{
-
- /** The optional security-constraint/user-data-constraint/transport-guarantee */
- private String transportGuarantee;
-
- /**
- * The HashMap for the security-constraint/web-resource-collection
- * elements.
- */
- private HashMap<String, UnifiedWebResourceCollection> webResources = new HashMap<String, UnifiedWebResourceCollection>();
-
- public UnifiedWebResourceCollection addWebResource(final String name)
- {
- UnifiedWebResourceCollection wrc = new UnifiedWebResourceCollection(name);
- webResources.put(name, wrc);
-
- return wrc;
- }
-
- public Collection<UnifiedWebResourceCollection> getWebResources()
- {
- return webResources.values();
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-
- public static class UnifiedWebResourceCollection
- {
- private String name;
- /** The required url-pattern element(s) */
- private HashSet<String> urlPatterns = new HashSet<String>();
-
- public UnifiedWebResourceCollection(final String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void addPattern(String pattern)
- {
- urlPatterns.add(pattern);
- }
-
- public HashSet<String> getUrlPatterns()
- {
- return urlPatterns;
- }
- }
-
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebSecurityMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/j2ee/UnifiedWebSecurityMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.metadata.j2ee;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since Oct 22, 2006
+ */
+public class UnifiedWebSecurityMetaData
+{
+
+ /** The optional security-constraint/user-data-constraint/transport-guarantee */
+ private String transportGuarantee;
+
+ /**
+ * The HashMap for the security-constraint/web-resource-collection
+ * elements.
+ */
+ private HashMap<String, UnifiedWebResourceCollection> webResources = new HashMap<String, UnifiedWebResourceCollection>();
+
+ public UnifiedWebResourceCollection addWebResource(final String name)
+ {
+ UnifiedWebResourceCollection wrc = new UnifiedWebResourceCollection(name);
+ webResources.put(name, wrc);
+
+ return wrc;
+ }
+
+ public Collection<UnifiedWebResourceCollection> getWebResources()
+ {
+ return webResources.values();
+ }
+
+ public String getTransportGuarantee()
+ {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee)
+ {
+ this.transportGuarantee = transportGuarantee;
+ }
+
+ public static class UnifiedWebResourceCollection
+ {
+ private String name;
+ /** The required url-pattern element(s) */
+ private HashSet<String> urlPatterns = new HashSet<String>();
+
+ public UnifiedWebResourceCollection(final String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void addPattern(String pattern)
+ {
+ urlPatterns.add(pattern);
+ }
+
+ public HashSet<String> getUrlPatterns()
+ {
+ return urlPatterns;
+ }
+ }
+
+}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181 (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181)
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,164 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.metadata.jsr181;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB factory for jsr181 the HandlerChain annotation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainFactory implements ObjectModelFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HandlerChainFactory.class);
-
- public HandlerChainFactory()
- {
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing starts.
- *
- * @return the root of the object model.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- HandlerChainsMetaData handlerConfigMetaData = new HandlerChainsMetaData(HandlerType.ENDPOINT);
- return handlerConfigMetaData;
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainsMetaData handlerConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler-chain".equals(localName))
- return new HandlerChainMetaData(handlerConfig);
- else
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(HandlerChainsMetaData handlerConfig, HandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandlerChain(handlerChain);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData chainConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("handler".equals(localName))
- return new UnifiedHandlerMetaData(chainConfig);
- else
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(HandlerChainMetaData handlerConfig, UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handlerConfig.addHandler(handler);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- if ("init-param".equals(localName))
- return new HandlerInitParam();
- else return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- handler.addInitParam(param);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(HandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("HandlerChainMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("protocol-bindings"))
- handlerChain.setProtocolBindings(value);
- else if (localName.equals("service-name-pattern"))
- handlerChain.setServiceNamePattern(navigator.resolveQName(value));
- else if (localName.equals("port-name-pattern"))
- handlerChain.setPortNamePattern(navigator.resolveQName(value));
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainFactory.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainFactory.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,164 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.metadata.jsr181;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB factory for jsr181 the HandlerChain annotation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Oct-2005
+ */
+public class HandlerChainFactory implements ObjectModelFactory
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(HandlerChainFactory.class);
+
+ public HandlerChainFactory()
+ {
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing starts.
+ *
+ * @return the root of the object model.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ HandlerChainsMetaData handlerConfigMetaData = new HandlerChainsMetaData(HandlerType.ENDPOINT);
+ return handlerConfigMetaData;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainsMetaData handlerConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler-chain".equals(localName))
+ return new HandlerChainMetaData(handlerConfig);
+ else
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(HandlerChainsMetaData handlerConfig, HandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handlerConfig.addHandlerChain(handlerChain);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainMetaData chainConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler".equals(localName))
+ return new UnifiedHandlerMetaData(chainConfig);
+ else
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(HandlerChainMetaData handlerConfig, UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handlerConfig.addHandler(handler);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("init-param".equals(localName))
+ return new HandlerInitParam();
+ else return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(UnifiedHandlerMetaData handler, HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ handler.addInitParam(param);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(HandlerChainMetaData handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("HandlerChainMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("protocol-bindings"))
+ handlerChain.setProtocolBindings(value);
+ else if (localName.equals("service-name-pattern"))
+ handlerChain.setServiceNamePattern(navigator.resolveQName(value));
+ else if (localName.equals("port-name-pattern"))
+ handlerChain.setPortNamePattern(navigator.resolveQName(value));
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("handler-name"))
+ handler.setHandlerName(value);
+ else if (localName.equals("handler-class"))
+ handler.setHandlerClass(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("param-name"))
+ param.setParamName(value);
+ else if (localName.equals("param-value"))
+ param.setParamValue(value);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,104 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.metadata.jsr181;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-
-/**
- * XML Binding element for handler-config/handler-chain elements
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainMetaData
-{
- // provide logging
- private static final Logger log = Logger.getLogger(HandlerChainMetaData.class);
-
- // The parent element
- private HandlerChainsMetaData handlerChainsMetaData;
-
- private String protocolBindings;
- private QName serviceNamePattern;
- private QName portNamePattern;
- private ArrayList<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
-
- public HandlerChainMetaData(HandlerChainsMetaData handlerConfig)
- {
- this.handlerChainsMetaData = handlerConfig;
- }
-
- public HandlerChainsMetaData getHandlerChainsMetaData()
- {
- return handlerChainsMetaData;
- }
-
- public void addHandler(UnifiedHandlerMetaData handlerMetaData)
- {
- handlers.add(handlerMetaData);
- }
-
- public List<UnifiedHandlerMetaData> getHandlers()
- {
- return handlers;
- }
-
- public QName getPortNamePattern()
- {
- return portNamePattern;
- }
-
- public void setPortNamePattern(QName portNamePattern)
- {
- this.portNamePattern = portNamePattern;
- }
-
- public String getProtocolBindings()
- {
- return protocolBindings;
- }
-
- public void setProtocolBindings(String protocolBindings)
- {
- this.protocolBindings = protocolBindings;
- }
-
- public QName getServiceNamePattern()
- {
- return serviceNamePattern;
- }
-
- public void setServiceNamePattern(QName serviceNamePattern)
- {
- this.serviceNamePattern = serviceNamePattern;
- }
-
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,103 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.common.metadata.jsr181;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+
+/**
+ * XML Binding element for handler-config/handler-chain elements
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Oct-2005
+ */
+public class HandlerChainMetaData
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(HandlerChainMetaData.class);
+
+ // The parent element
+ private HandlerChainsMetaData handlerChainsMetaData;
+
+ private String protocolBindings;
+ private QName serviceNamePattern;
+ private QName portNamePattern;
+ private ArrayList<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>();
+
+ public HandlerChainMetaData(HandlerChainsMetaData handlerConfig)
+ {
+ this.handlerChainsMetaData = handlerConfig;
+ }
+
+ public HandlerChainsMetaData getHandlerChainsMetaData()
+ {
+ return handlerChainsMetaData;
+ }
+
+ public void addHandler(UnifiedHandlerMetaData handlerMetaData)
+ {
+ handlers.add(handlerMetaData);
+ }
+
+ public List<UnifiedHandlerMetaData> getHandlers()
+ {
+ return handlers;
+ }
+
+ public QName getPortNamePattern()
+ {
+ return portNamePattern;
+ }
+
+ public void setPortNamePattern(QName portNamePattern)
+ {
+ this.portNamePattern = portNamePattern;
+ }
+
+ public String getProtocolBindings()
+ {
+ return protocolBindings;
+ }
+
+ public void setProtocolBindings(String protocolBindings)
+ {
+ this.protocolBindings = protocolBindings;
+ }
+
+ public QName getServiceNamePattern()
+ {
+ return serviceNamePattern;
+ }
+
+ public void setServiceNamePattern(QName serviceNamePattern)
+ {
+ this.serviceNamePattern = serviceNamePattern;
+ }
+
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainsMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,66 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-// $Id$
-package org.jboss.ws.core.metadata.jsr181;
-
-//$Id$
-
-import java.util.ArrayList;
-
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-
-/**
- * XML Binding root element for JSR-181 HandlerChain
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 15-Oct-2005
- */
-public class HandlerChainsMetaData
-{
- // The required handler type
- private HandlerType handlerType;
- // The required <handler-chain> elements
- private ArrayList<HandlerChainMetaData> handlerChains = new ArrayList<HandlerChainMetaData>();
-
- public HandlerChainsMetaData(HandlerType handlerType)
- {
- this.handlerType = handlerType;
- }
-
- public HandlerType getHandlerType()
- {
- return handlerType;
- }
-
-
- public void addHandlerChain(HandlerChainMetaData handlerChain)
- {
- handlerChains.add(handlerChain);
- }
-
- public HandlerChainMetaData[] getHandlerChains()
- {
- HandlerChainMetaData[] array = new HandlerChainMetaData[handlerChains.size()];
- handlerChains.toArray(array);
- return array;
- }
-}
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainsMetaData.java (from rev 1571, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jsr181/HandlerChainsMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+// $Id$
+package org.jboss.ws.common.metadata.jsr181;
+
+//$Id$
+
+import java.util.ArrayList;
+
+import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
+
+/**
+ * XML Binding root element for JSR-181 HandlerChain
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 15-Oct-2005
+ */
+public class HandlerChainsMetaData
+{
+ // The required handler type
+ private HandlerType handlerType;
+ // The required <handler-chain> elements
+ private ArrayList<HandlerChainMetaData> handlerChains = new ArrayList<HandlerChainMetaData>();
+
+ public HandlerChainsMetaData(HandlerType handlerType)
+ {
+ this.handlerType = handlerType;
+ }
+
+ public HandlerType getHandlerType()
+ {
+ return handlerType;
+ }
+
+
+ public void addHandlerChain(HandlerChainMetaData handlerChain)
+ {
+ handlerChains.add(handlerChain);
+ }
+
+ public HandlerChainMetaData[] getHandlerChains()
+ {
+ HandlerChainMetaData[] array = new HandlerChainMetaData[handlerChains.size()];
+ handlerChains.toArray(array);
+ return array;
+ }
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/PortComponentMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/PortComponentMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/PortComponentMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,7 +30,7 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
/**
* XML Binding and ws4ee meta-data element for
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -26,8 +26,8 @@
import java.net.URL;
import org.jboss.logging.Logger;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xsd/SchemaUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xsd/SchemaUtils.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xsd/SchemaUtils.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -49,14 +49,14 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSComplexTypeDefinition;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSElementDeclaration;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSErrorHandler;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSSimpleTypeDefinition;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSStringList;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSTypeDefinition;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
/**
* Util class that deals with XML Schema
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,10 +30,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.config.WSConfigFactory;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.common.metadata.config.jaxws.WSConfigRootJAXWS;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.WSConfigFactory;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.core.metadata.config.jaxws.WSConfigRootJAXWS;
/**
* Client side endpoint meta data.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/EndpointMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -41,17 +41,16 @@
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.jaxrpc.Style;
import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.common.jaxrpc.Use;
import org.jboss.ws.common.jaxrpc.encoding.JBossXBDeserializerFactory;
import org.jboss.ws.common.jaxrpc.encoding.JBossXBSerializerFactory;
import org.jboss.ws.common.jaxrpc.encoding.SOAPArrayDeserializerFactory;
import org.jboss.ws.common.jaxrpc.encoding.SOAPArraySerializerFactory;
+import org.jboss.ws.common.metadata.config.WSCommonConfig;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
-import org.jboss.ws.core.metadata.config.WSCommonConfig;
/**
* A Service component describes a set of endpoints.
@@ -122,7 +121,7 @@
this.type = type;
// The default binding
- this.bindingId = CommonSOAPBinding.SOAP11HTTP_BINDING;
+ this.bindingId = Constants.SOAP11HTTP_BINDING;
}
public ServiceMetaData getServiceMetaData()
@@ -181,7 +180,7 @@
public void setBindingId(String bindingId)
{
- if (!CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) && !CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+ if (!Constants.SOAP11HTTP_BINDING.equals(bindingId) && !Constants.SOAP12HTTP_BINDING.equals(bindingId))
throw new WSException("Unsupported binding: " + bindingId);
this.bindingId = bindingId;
}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/OperationMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -36,9 +36,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.jaxrpc.Style;
+import org.jboss.ws.common.jaxrpc.Use;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.jaxrpc.Use;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServerEndpointMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -31,11 +31,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.config.WSCommonConfig;
+import org.jboss.ws.common.metadata.config.WSConfigFactory;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.common.metadata.config.jaxws.WSConfigRootJAXWS;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.WSCommonConfig;
-import org.jboss.ws.core.metadata.config.WSConfigFactory;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.core.metadata.config.jaxws.WSConfigRootJAXWS;
import org.jboss.ws.core.server.ServiceEndpoint;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ServiceMetaData.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -38,6 +38,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.common.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.common.jaxrpc.Use;
+import org.jboss.ws.common.jbossxb.SchemaBindingBuilder;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
@@ -46,9 +49,6 @@
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.common.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jbossxb.SchemaBindingBuilder;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -38,8 +38,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
/**
* IO utilites
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/ThreadLocalAssociation.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/ThreadLocalAssociation.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/ThreadLocalAssociation.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.common.utils;
-
-// $Id$
-
-import java.util.Stack;
-
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.extras.security.SecurityStore;
-
-/**
- * Maintain thread locals at a single point.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @author Thomas.Diesler(a)jboss.com
- * @since 10-Apr-2006
- */
-public class ThreadLocalAssociation {
-
- /**
- * Handles invocations on MDB endpoints.
- */
- private static ThreadLocal invokerMDBAssoc = new ThreadLocal();
-
- /**
- * SOAP message context
- * @see org.jboss.ws.core.soap.MessageContextAssociation
- */
- private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc = new ThreadLocal<Stack<CommonMessageContext>>();
-
- /**
- * @see org.jboss.ws.extras.security.STRTransform
- */
- private static ThreadLocal<SecurityStore> strTransformAssoc = new ThreadLocal<SecurityStore>();
-
- public static ThreadLocal localInvokerMDBAssoc() {
- return invokerMDBAssoc;
- }
-
- public static ThreadLocal<Stack<CommonMessageContext>> localMsgContextAssoc() {
- return msgContextAssoc;
- }
-
- public static ThreadLocal<SecurityStore> localStrTransformAssoc() {
- return strTransformAssoc;
- }
-
- public static void clear() {
- invokerMDBAssoc.set(null);
- msgContextAssoc.set(null);
- strTransformAssoc.set(null);
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -28,8 +28,8 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.jaxrpc.Use;
import org.jboss.ws.common.umdm.OperationMetaData;
-import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.soap.MessageFactoryImpl;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -47,6 +47,7 @@
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.jaxrpc.Style;
@@ -62,7 +63,6 @@
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPBodyElementDoc;
import org.jboss.ws.core.soap.SOAPBodyElementRpc;
import org.jboss.ws.core.soap.SOAPContentElement;
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/ThreadLocalAssociation.java (from rev 1568, branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/ThreadLocalAssociation.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/ThreadLocalAssociation.java 2006-12-06 05:06:23 UTC (rev 1568)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/ThreadLocalAssociation.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core;
+
+// $Id$
+
+import java.util.Stack;
+
+import org.jboss.ws.extras.security.SecurityStore;
+
+/**
+ * Maintain thread locals at a single point.
+ *
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 10-Apr-2006
+ */
+public class ThreadLocalAssociation
+{
+
+ /**
+ * Handles invocations on MDB endpoints.
+ */
+ private static ThreadLocal invokerMDBAssoc = new ThreadLocal();
+
+ /**
+ * SOAP message context
+ * @see org.jboss.ws.core.soap.MessageContextAssociation
+ */
+ private static ThreadLocal<Stack<CommonMessageContext>> msgContextAssoc = new ThreadLocal<Stack<CommonMessageContext>>();
+
+ /**
+ * @see org.jboss.ws.extras.security.STRTransform
+ */
+ private static ThreadLocal<SecurityStore> strTransformAssoc = new ThreadLocal<SecurityStore>();
+
+ public static ThreadLocal localInvokerMDBAssoc()
+ {
+ return invokerMDBAssoc;
+ }
+
+ public static ThreadLocal<Stack<CommonMessageContext>> localMsgContextAssoc()
+ {
+ return msgContextAssoc;
+ }
+
+ public static ThreadLocal<SecurityStore> localStrTransformAssoc()
+ {
+ return strTransformAssoc;
+ }
+
+ public static void clear()
+ {
+ invokerMDBAssoc.set(null);
+ msgContextAssoc.set(null);
+ strTransformAssoc.set(null);
+ }
+}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeDeserializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.binding;
-
-import org.jboss.ws.common.binding.DeserializerSupport;
-
-// $Id$
-
-/**
- * A Deserializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class ComplexTypeDeserializer extends DeserializerSupport
-{
-
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/ComplexTypeSerializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.binding;
-
-import org.jboss.ws.common.binding.SerializerSupport;
-
-// $Id$
-
-/**
- * A Serializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public abstract class ComplexTypeSerializer extends SerializerSupport
-{
-
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,183 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jaxrpc;
-
-// $Id$
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URI;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.common.jaxrpc.encoding.Base64DeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.Base64SerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.CalendarDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.CalendarSerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.DateDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.DateSerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.ElementDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.ElementSerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.HexDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.HexSerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.QNameDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.QNameSerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.SOAPElementDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.SOAPElementSerializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.SimpleDeserializerFactory;
-import org.jboss.ws.common.jaxrpc.encoding.SimpleSerializerFactory;
-import org.w3c.dom.Element;
-
-/**
- * This is the representation of a type mapping.
- * This TypeMapping implementation supports the encoded encoding style.
- *
- * The TypeMapping instance maintains a tuple of the type
- * {XML typeQName, Java Class, SerializerFactory, DeserializerFactory}.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-Oct-2004
- */
-public class EncodedTypeMapping extends TypeMappingImpl
-{
-
- /**
- * Construct the default encoded type mapping.
- * Registers javaTypes for all standard XMLSchema types specified by JAXRPC.
- *
- * Note, the order of registered types is important
- * The last xmlType wins for a given javaType
- *
- */
- public EncodedTypeMapping()
- {
- registerStandardLiteralTypes();
- registerStandardSOAP11EncodedTypes();
-
- // register mapping for xsd:anyType
- registerInternal(SOAPElement.class, Constants.TYPE_SOAP11_ANYTYPE, new SOAPElementSerializerFactory(), new SOAPElementDeserializerFactory());
- registerInternal(Element.class, Constants.TYPE_SOAP11_ANYTYPE, new ElementSerializerFactory(), new ElementDeserializerFactory());
- }
-
- private void registerStandardSOAP11EncodedTypes()
- {
- registerInternal(BigDecimal.class, Constants.TYPE_SOAP11_DECIMAL, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_POSITIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NEGATIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONPOSITIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_NONNEGATIVEINTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_UNSIGNEDLONG, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(BigInteger.class, Constants.TYPE_SOAP11_INTEGER, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(Date.class, Constants.TYPE_SOAP11_DATETIME, new DateSerializerFactory(), new DateDeserializerFactory());
-
- registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATE, new CalendarSerializerFactory(), new CalendarDeserializerFactory());
- registerInternal(Calendar.class, Constants.TYPE_SOAP11_TIME, new CalendarSerializerFactory(), new CalendarDeserializerFactory());
- registerInternal(Calendar.class, Constants.TYPE_SOAP11_DATETIME, new CalendarSerializerFactory(), new CalendarDeserializerFactory());
-
- registerInternal(QName.class, Constants.TYPE_SOAP11_QNAME, new QNameSerializerFactory(), new QNameDeserializerFactory());
-
- registerInternal(String.class, Constants.TYPE_SOAP11_ANYSIMPLETYPE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_DURATION, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GDAY, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GMONTH, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GMONTHDAY, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GYEAR, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_GYEARMONTH, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_ID, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_LANGUAGE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NAME, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NCNAME, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NMTOKEN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_NORMALIZEDSTRING, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_TOKEN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(String.class, Constants.TYPE_SOAP11_STRING, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(String[].class, Constants.TYPE_SOAP11_NMTOKENS, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(URI.class, Constants.TYPE_SOAP11_ANYURI, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Boolean.class, Constants.TYPE_SOAP11_BOOLEAN, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(byte.class, Constants.TYPE_SOAP11_BYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Byte.class, Constants.TYPE_SOAP11_BYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new HexSerializerFactory(), new HexDeserializerFactory());
- registerInternal(Byte[].class, Constants.TYPE_SOAP11_HEXBINARY, new HexSerializerFactory(), new HexDeserializerFactory());
- registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64BINARY, new Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(byte[].class, Constants.TYPE_SOAP11_BASE64, new Base64SerializerFactory(), new Base64DeserializerFactory());
- registerInternal(Byte[].class, Constants.TYPE_SOAP11_BASE64, new Base64SerializerFactory(), new Base64DeserializerFactory());
-
- registerInternal(double.class, Constants.TYPE_SOAP11_DOUBLE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Double.class, Constants.TYPE_SOAP11_DOUBLE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(float.class, Constants.TYPE_SOAP11_FLOAT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Float.class, Constants.TYPE_SOAP11_FLOAT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(int.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Integer.class, Constants.TYPE_SOAP11_UNSIGNEDSHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(int.class, Constants.TYPE_SOAP11_INT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Integer.class, Constants.TYPE_SOAP11_INT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Long.class, Constants.TYPE_SOAP11_UNSIGNEDINT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(long.class, Constants.TYPE_SOAP11_LONG, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Long.class, Constants.TYPE_SOAP11_LONG, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
-
- registerInternal(short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Short.class, Constants.TYPE_SOAP11_UNSIGNEDBYTE, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(short.class, Constants.TYPE_SOAP11_SHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- registerInternal(Short.class, Constants.TYPE_SOAP11_SHORT, new SimpleSerializerFactory(), new SimpleDeserializerFactory());
- }
-
- /**
- * Returns the encodingStyle URIs (as String[]) supported by this TypeMapping instance.
- * A TypeMapping that contains only encoding style independent serializers and deserializers
- * returns null from this method.
- *
- * @return Array of encodingStyle URIs for the supported encoding styles
- */
- public String[] getSupportedEncodings()
- {
- return new String[] { "encoded" };
- }
-
- /**
- * Sets the encodingStyle URIs supported by this TypeMapping instance. A TypeMapping that contains only encoding
- * independent serializers and deserializers requires null as the parameter for this method.
- *
- * @param encodingStyleURIs Array of encodingStyle URIs for the supported encoding styles
- */
- public void setSupportedEncodings(String[] encodingStyleURIs)
- {
- throw new NotImplementedException();
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -44,6 +44,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
@@ -58,7 +59,6 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.jboss.xb.binding.NamespaceRegistry;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -38,13 +38,13 @@
import javax.xml.rpc.handler.HandlerChain;
import javax.xml.rpc.handler.HandlerRegistry;
+import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder;
-import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceObjectFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -58,6 +58,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData;
@@ -65,8 +67,6 @@
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.core.server.ServiceEndpoint;
import org.jboss.ws.core.server.ServiceEndpointManager;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -35,9 +35,9 @@
import javax.naming.Referenceable;
import javax.naming.StringRefAddr;
-import org.jboss.ws.core.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfigurationFactory;
import org.jboss.ws.core.server.ServiceEndpointManager;
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,166 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jaxrpc;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.rpc.encoding.TypeMappingRegistry;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
-import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
-
-/**
- * This defines a registry of TypeMapping instances for encoding styles.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class TypeMappingRegistryImpl implements TypeMappingRegistry
-{
- // The registered typeMapping for the literal encoding style
- private Map<String, TypeMappingImpl> typeMappings = new HashMap<String, TypeMappingImpl>();
-
- public TypeMappingRegistryImpl()
- {
- typeMappings.put(Constants.URI_LITERAL_ENC, new LiteralTypeMapping());
- typeMappings.put(Constants.URI_SOAP11_ENC, new EncodedTypeMapping());
- }
-
- /**
- * Removes all registered TypeMappings and encodingStyleURIs from this TypeMappingRegistry.
- */
- public void clear()
- {
- typeMappings.clear();
- }
-
- /**
- * Gets the registered default TypeMapping instance.
- * This method returns null if there is no registered default TypeMapping in the registry.
- * @return The registered default TypeMapping instance or null
- */
- public TypeMapping getDefaultTypeMapping()
- {
- return typeMappings.get(Constants.URI_LITERAL_ENC);
- }
-
- /**
- * Registers the TypeMapping instance that is default for all encoding styles supported by the TypeMappingRegistry.
- * A default TypeMapping should include serializers and deserializers that are independent of and usable with any
- * encoding style. Successive invocations of the registerDefault method replace any existing default TypeMapping instance.
- *
- * If the default TypeMapping is registered, any other TypeMapping instances registered through the
- * TypeMappingRegistry.register method (for a set of encodingStyle URIs) override the default TypeMapping.
- *
- * @param mapping TypeMapping instance
- * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of the default TypeMapping
- */
- public void registerDefault(TypeMapping mapping)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Creates a new empty TypeMapping object.
- * @return TypeMapping instance
- */
- public TypeMapping createTypeMapping()
- {
- throw new NotImplementedException();
- }
-
- /**
- * Returns the registered TypeMapping for the specified encodingStyle URI. If there is no registered TypeMapping for
- * the specified encodingStyleURI, this method returns null.
- * @param encodingStyleURI Encoding style specified as an URI
- * @return TypeMapping for the specified encodingStyleURI or null
- */
- public TypeMapping getTypeMapping(String encodingStyleURI)
- {
- assertEncodingStyle(encodingStyleURI);
- return typeMappings.get(encodingStyleURI);
- }
-
- /**
- * Returns a list of registered encodingStyle URIs in this TypeMappingRegistry instance.
- * @return Array of the registered encodingStyle URIs
- */
- public String[] getRegisteredEncodingStyleURIs()
- {
- return new String[]{Constants.URI_LITERAL_ENC, Constants.URI_SOAP11_ENC};
- }
-
- /**
- * Registers a TypeMapping instance with the TypeMappingRegistry.
- * This method replaces any existing registered TypeMapping instance for the specified encodingStyleURI.
- *
- * @param encodingStyleURI An encoding style specified as an URI.
- * @param mapping TypeMapping instance
- * @return Previous TypeMapping associated with the specified encodingStyleURI, or null if there was no
- * TypeMapping associated with the specified encodingStyleURI
- * @throws javax.xml.rpc.JAXRPCException If there is an error in the registration of the TypeMapping for the specified encodingStyleURI.
- */
- public TypeMapping register(String encodingStyleURI, TypeMapping mapping)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Unregisters a TypeMapping instance, if present, from the specified encodingStyleURI.
- * @param encodingStyleURI Encoding style specified as an URI
- * @return TypeMapping instance that has been unregistered or null if there was no
- * TypeMapping registered for the specified encodingStyleURI
- */
- public TypeMapping unregisterTypeMapping(String encodingStyleURI)
- {
- throw new NotImplementedException();
- }
-
- /**
- * Removes a TypeMapping from the TypeMappingRegistry.
- * A TypeMapping is associated with 1 or more encodingStyleURIs. This method unregisters the specified
- * TypeMapping instance from all associated encodingStyleURIs and then removes this TypeMapping
- * instance from the registry.
- *
- * @param mapping TypeMapping to be removed
- * @return true if specified TypeMapping is removed from the TypeMappingRegistry;
- * false if the specified TypeMapping was not in the TypeMappingRegistry
- */
- public boolean removeTypeMapping(TypeMapping mapping)
- {
- throw new NotImplementedException();
- }
-
- /** Assert the literal encoding style */
- private void assertEncodingStyle(String encURI)
- {
- if (Constants.URI_LITERAL_ENC.equals(encURI) == false && Constants.URI_SOAP11_ENC.equals(encURI) == false)
- throw new JAXRPCException("Unsupported encoding style: " + encURI);
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/Use.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,74 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.jaxrpc;
-
-import org.jboss.ws.common.Constants;
-
-// $Id$
-
-/** A type-safe enumeration for encoding use.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2005
- */
-public class Use
-{
- private String use;
-
- public static final Use LITERAL = new Use("literal");
- public static final Use ENCODED = new Use("encoded");
-
- private Use(String use)
- {
- this.use = use;
- }
-
- public static Use getDefaultUse()
- {
- return LITERAL;
- }
-
- public static Use valueOf(String encodingStyle)
- {
- if (Constants.URI_LITERAL_ENC.equals(encodingStyle) || LITERAL.use.equals(encodingStyle))
- return LITERAL;
- if (Constants.URI_SOAP11_ENC.equals(encodingStyle) || ENCODED.use.equals(encodingStyle))
- return ENCODED;
-
- throw new IllegalArgumentException("Unsupported encoding style: " + encodingStyle);
- }
-
- public String toURI()
- {
- String encURI = null;
- if (this == LITERAL)
- encURI = Constants.URI_LITERAL_ENC;
- else if (this == ENCODED)
- encURI = Constants.URI_SOAP11_ENC;
- return encURI;
- }
-
- public String toString()
- {
- return use;
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,9 +34,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
+import org.jboss.ws.common.binding.ComplexTypeDeserializer;
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.extras.xop.jaxws.AttachmentUnmarshallerImpl;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -33,9 +33,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
+import org.jboss.ws.common.binding.ComplexTypeSerializer;
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.extras.xop.jaxws.AttachmentMarshallerImpl;
import org.w3c.dom.NamedNodeMap;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/core/SOAPFaultHelperJAXWS.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -39,6 +39,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
import org.jboss.ws.common.binding.SerializationContext;
@@ -52,7 +53,6 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/MetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -45,6 +45,14 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.jaxrpc.Use;
+import org.jboss.ws.common.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.common.metadata.wsdl.NCName;
import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
@@ -57,14 +65,6 @@
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.utils.ObjectNameFactory;
import org.jboss.ws.core.CommonSOAPBinding;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfigurationFactory;
import org.jboss.ws.core.server.ServiceEndpointManager;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -32,6 +32,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSClientConfigJAXRPC;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
@@ -45,9 +48,6 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSClientConfigJAXRPC;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfigurationFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -41,6 +41,8 @@
import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.common.jaxrpc.Style;
import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.common.jaxrpc.TypeMappingRegistryImpl;
+import org.jboss.ws.common.jaxrpc.Use;
import org.jboss.ws.common.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
@@ -82,9 +84,7 @@
import org.jboss.ws.common.umdm.TypesMetaData;
import org.jboss.ws.common.umdm.WrappedParameter;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
-import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.metadata.builder.MetaDataBuilder;
import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extras.addressing.metadata.AddressingOpMetaExt;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -29,6 +29,12 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
+import org.jboss.ws.common.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
import org.jboss.ws.common.metadata.webservices.PortComponentMetaData;
@@ -41,12 +47,6 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
-import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,9 +27,9 @@
import javax.xml.ws.BindingType;
import org.jboss.logging.Logger;
+import org.jboss.ws.common.metadata.config.jaxws.WSClientConfigJAXWS;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.jaxws.WSClientConfigJAXWS;
/**
* A client side meta data builder that is based on JSR-181 annotations
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -26,9 +26,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -29,9 +29,9 @@
import org.jboss.annotation.security.SecurityDomain;
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -26,8 +26,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -62,6 +62,12 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.jaxrpc.Style;
+import org.jboss.ws.common.jaxrpc.Use;
+import org.jboss.ws.common.metadata.config.jaxws.WSEndpointConfigJAXWS;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainFactory;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainsMetaData;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
import org.jboss.ws.common.metadata.wsdl.WSDLWriter;
@@ -82,16 +88,10 @@
import org.jboss.ws.common.utils.IOUtils;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.core.jaxws.WrapperGenerator;
import org.jboss.ws.core.metadata.acessor.JAXBAccessor;
import org.jboss.ws.core.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.core.metadata.config.jaxws.WSEndpointConfigJAXWS;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainsMetaData;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.extras.addressing.AddressingPropertiesImpl;
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSCommonConfig.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-
-/**
- * A common configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfig
-{
- private String configName;
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type);
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.metadata.config;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
-import org.jboss.ws.core.metadata.config.jaxws.WSConfigFactoryJAXWS;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
-import org.w3c.dom.Element;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactory.class);
-
- private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
- private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
-
- // Hide constructor
- private WSConfigFactory()
- {
- }
-
- /** Create a new instance of the factory
- */
- public static WSConfigFactory newInstance()
- {
- return new WSConfigFactory();
- }
-
- public Object parseWithSchemaBinding(URL configURL) throws IOException, JBossXBException
- {
- log.debug("parse: " + configURL);
-
- String configSchema = "schema/jaxrpc-config_2_0.xsd";
- URL xsdURL = Thread.currentThread().getContextClassLoader().getResource(configSchema);
- if (xsdURL == null)
- throw new WSException("Cannot find: " + configSchema);
-
- InputStream xsd = xsdURL.openStream();
- SchemaBinding schemaBinding = XsdBinder.bind(xsd, "UTF-8");
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setEntityResolver(new JBossWSEntityResolver());
- Object wsConfig = unmarshaller.unmarshal(configURL.openStream(), schemaBinding);
- return wsConfig;
- }
-
- // Below is ObjectModelFactory stuff, which should be removed when parseWithSchemaBinding works.
-
- public Object parseWithObjectModelFactory(URL configURL) throws IOException, JBossXBException
- {
- log.debug("parse: " + configURL);
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
-
- Object wsConfig;
- String nsURI = getNamespaceURI(configURL);
- if (URN_JAXRPC_CONFIG.equals(nsURI))
- {
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new WSConfigFactoryJAXRPC(), null);
- }
- else if (URN_JAXWS_CONFIG.equals(nsURI))
- {
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new WSConfigFactoryJAXWS(), null);
- }
- else
- {
- throw new WSException("Invalid config namespace: " + nsURI);
- }
-
- return wsConfig;
- }
-
- private String getNamespaceURI(URL configURL)
- {
- try
- {
- Element root = DOMUtils.parse(configURL.openStream());
- return root.getNamespaceURI();
- }
- catch (IOException ex)
- {
- throw new WSException(ex);
- }
- }
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfig.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.server;
-
-// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-
-/**
- * Interface to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public interface ServerConfig
-{
- static final String BEAN_NAME = "ServerConfig";
-
- File getServerTempDir();
-
- File getServerDataDir();
-}
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServerConfigFactory.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.server;
-
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.logging.Logger;
-
-// $Id: ServiceEndpointManagerFactory.java 293 2006-05-08 16:31:50Z thomas.diesler(a)jboss.com $
-
-/**
- * Factory to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ServerConfigFactory
-{
- // provide logging
- private static final Logger log = Logger.getLogger(ServerConfigFactory.class);
-
- private static ServerConfigFactory instance = new ServerConfigFactory();
-
- // Hide ctor
- protected ServerConfigFactory()
- {
- }
-
- public static ServerConfigFactory getInstance()
- {
- return instance;
- }
-
- public ServerConfig getServerConfig()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- return (ServerConfig)registry.getEntry(ServerConfig.BEAN_NAME).getTarget();
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointInfo.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -26,11 +26,11 @@
import javax.management.ObjectName;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedSessionMetaData;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedSessionMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -63,9 +63,9 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.common.utils.ThreadLocalAssociation;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.MessageContextPropertyHelper;
+import org.jboss.ws.core.ThreadLocalAssociation;
import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -43,6 +43,8 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,6 +34,7 @@
import javax.xml.soap.SOAPHeader;
import javax.xml.transform.stream.StreamSource;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -26,8 +26,8 @@
import java.util.Stack;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.ThreadLocalAssociation;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.ThreadLocalAssociation;
/**
* A thread local association with the current message context
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/NameImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,127 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.ws.core.soap;
-
-// $Id$
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-
-/**
- * An implementation of a Name
- * <p/>
- * At this time of writing, the spec does not say anything about null values.
- * We assume emty string for any null value.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 01-June-2004
- */
-public class NameImpl implements Name
-{
- private QName qname;
-
- public NameImpl(QName qname)
- {
- this.qname = qname;
- }
-
- public NameImpl(String local)
- {
- qname = new QName(local);
- }
-
- public NameImpl(String local, String prefix, String uri)
- {
- if (prefix != null)
- qname = new QName(uri, local, prefix);
- else
- qname = new QName(uri, local);
- }
-
- /**
- * Gets the local name part of the XML name that this Name object represents.
- *
- * @return a string giving the local name
- */
- public String getLocalName()
- {
- return qname.getLocalPart();
- }
-
- /**
- * Returns the prefix that was specified when this Name object was initialized.
- * This prefix is associated with the namespace for the XML name that this Name object represents.
- *
- * @return the prefix as a string
- */
- public String getPrefix()
- {
- return qname.getPrefix();
- }
-
- /**
- * Gets the namespace-qualified name of the XML name that this Name object represents.
- *
- * @return the namespace-qualified name as a string
- */
- public String getQualifiedName()
- {
- String prefix = getPrefix();
- if (prefix.length() > 0)
- return prefix + ":" + qname.getLocalPart();
- else
- return qname.getLocalPart();
- }
-
- /**
- * Returns the URI of the namespace for the XML name that this Name object represents.
- *
- * @return the URI as a string
- */
- public String getURI()
- {
- return qname.getNamespaceURI();
- }
-
- public int hashCode()
- {
- return qname.hashCode();
- }
-
- public boolean equals(Object obj)
- {
- if (!(obj instanceof NameImpl)) return false;
- if (obj == this) return true;
- NameImpl other = (NameImpl)obj;
- return qname.equals(other.qname);
- }
-
- public QName toQName()
- {
- return qname;
- }
-
- public String toString()
- {
- return qname.toString();
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -35,6 +35,7 @@
import javax.xml.soap.SOAPHeader;
import org.jboss.logging.Logger;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.jaxrpc.Style;
import org.jboss.ws.common.utils.DOMUtils;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -36,6 +36,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import org.jboss.ws.common.NameImpl;
import org.w3c.dom.Element;
import com.ctc.wstx.stax.WstxInputFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -47,6 +47,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -40,6 +40,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -40,6 +40,7 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
import org.w3c.dom.Attr;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -37,6 +37,7 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.w3c.dom.Document;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,6 +30,8 @@
import javax.xml.soap.SOAPFactory;
import org.jboss.logging.Logger;
+import org.jboss.ws.common.NameImpl;
+import org.jboss.ws.common.jaxrpc.encoding.SOAPElementDeserializer;
import org.jboss.ws.common.utils.DOMUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -65,49 +67,8 @@
*/
public SOAPElementImpl createElement(Element domNode, boolean deep) throws SOAPException
{
- if (domNode == null)
- throw new IllegalArgumentException("Source node cannot be null");
-
- String localName = domNode.getLocalName();
- String prefix = domNode.getPrefix() != null ? domNode.getPrefix() : "";
- String nsURI = domNode.getNamespaceURI() != null ? domNode.getNamespaceURI() : "";
-
- SOAPElementImpl soapElement = new SOAPElementImpl(localName, prefix, nsURI);
-
- // Add the child elements as well
- if (deep)
- {
- if (domNode instanceof Element)
- DOMUtils.copyAttributes(soapElement, (Element)domNode);
-
- NodeList nlist = domNode.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- short nodeType = child.getNodeType();
- if (nodeType == Node.ELEMENT_NODE)
- {
- SOAPElementImpl soapChild = createElement((Element)child, true);
- soapElement.addChildElement(soapChild);
- }
- else if (nodeType == Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapElement.addTextNode(nodeValue);
- }
- else if (nodeType == Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapElement.addTextNode(nodeValue);
- }
- else
- {
- log.trace("Ignore child type: " + nodeType);
- }
- }
- }
-
- return soapElement;
+ SOAPElementDeserializer des = new SOAPElementDeserializer();
+ return (SOAPElementImpl)des.createElement(domNode, deep);
}
public Detail createDetail() throws SOAPException
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,6 +34,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -46,8 +46,8 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.jboss.ws.extras.addressing.AddressingConstantsImpl;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/security/STRTransform.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -35,7 +35,7 @@
import org.apache.xml.security.utils.XMLUtils;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.ThreadLocalAssociation;
+import org.jboss.ws.core.ThreadLocalAssociation;
import org.jboss.ws.extras.security.element.BinarySecurityToken;
import org.jboss.ws.extras.security.element.SecurityTokenReference;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -35,6 +35,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.JavaUtils;
@@ -42,7 +43,6 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.attachment.MimeConstants;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -43,9 +43,9 @@
import org.jboss.metadata.web.Servlet;
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,10 +34,10 @@
import org.jboss.ejb3.SessionContainer;
import org.jboss.ejb3.mdb.MessagingContainer;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedSessionMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedMessageDrivenMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedSessionMetaData;
/**
* Build container independent application meta data
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -29,10 +29,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.config.WSCommonConfig;
import org.jboss.ws.common.umdm.HandlerMetaData;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.config.WSCommonConfig;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.ServiceEndpoint;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServerConfigImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,8 +30,8 @@
import javax.management.ObjectName;
import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.common.config.ServerConfig;
import org.jboss.ws.common.utils.ObjectNameFactory;
-import org.jboss.ws.core.server.ServerConfig;
/**
* JBoss specific implementation of a ServerConfig
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointGeneratorEJB.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,14 +34,14 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.DOMWriter;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -38,12 +38,12 @@
import org.jboss.naming.Util;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.metadata.wsdl.WSDL11DefinitionFactory;
import org.jboss.ws.core.jaxrpc.ServiceReferenceable;
import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCClientDeployment;
-import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -32,10 +32,10 @@
import org.jboss.webservice.metadata.serviceref.InitParamMetaData;
import org.jboss.webservice.metadata.serviceref.PortComponentRefMetaData;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedPortComponentRefMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedServiceRefMetaData;
/**
* Build container independent service ref meta data
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,10 +34,10 @@
import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
import org.jboss.metadata.web.Servlet;
import org.jboss.metadata.web.ServletMapping;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData.PublishLocationAdapter;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
/**
* Build container independent web meta data
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -37,10 +37,10 @@
import javax.servlet.ServletContext;
import org.jboss.ws.common.WSException;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.common.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.w3c.dom.Element;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/ServerConfigImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -26,7 +26,7 @@
import java.io.File;
import java.io.IOException;
-import org.jboss.ws.core.server.ServerConfig;
+import org.jboss.ws.common.config.ServerConfig;
/**
* Tomcat specific implementation of a ServerConfig
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -24,11 +24,11 @@
import java.io.File;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.core.metadata.config.WSConfigFactory;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.common.metadata.config.WSConfigFactory;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSConfigRootJAXRPC;
+import org.jboss.ws.common.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
+import org.jboss.ws.common.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.common.metadata.jsr181.HandlerChainMetaData;
/**
* Test parsing of the JBossWS config
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -36,10 +36,10 @@
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.ws.common.binding.SerializerSupport;
import org.jboss.ws.common.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.common.jaxrpc.TypeMappingRegistryImpl;
import org.jboss.ws.common.jaxrpc.encoding.DeserializerFactoryBase;
import org.jboss.ws.common.jaxrpc.encoding.SerializerFactoryBase;
import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
import org.jboss.xb.binding.NamespaceRegistry;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayMarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -28,10 +28,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
/**
* Test the JAXB marshalling of array types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -28,10 +28,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
/**
* Test the JAXB marshalling of array types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayMarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
/**
* Test the JAXB marshalling of array types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/CalendarArrayUnmarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
/**
* Test the JAXB marshalling of array types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayMarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,10 +27,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
/**
* Test the JAXB marshalling of array types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/array/QNameArrayUnmarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,10 +27,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
/**
* Test the JAXB marshalling of array types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeMarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,11 +30,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
/**
* Test the JAXB marshalling of complex types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,10 +30,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.tools.JavaToXSD;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -30,11 +30,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
/**
* Test the JAXB marshalling of complex types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -29,10 +29,10 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
/**
* Test the JAXB unmarshalling of complex types
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,11 +27,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBMarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.PackageMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
/**
* Test the JAXB marshalling of a SimpleUserType
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,11 +27,11 @@
import org.apache.xerces.xs.XSModel;
import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.ws.common.jbossxb.JBossXBConstants;
+import org.jboss.ws.common.jbossxb.JBossXBUnmarshallerImpl;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.PackageMapping;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.jbossxb.JBossXBConstants;
-import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
/**
* Test the JAXB unmarshalling of a SimpleUserType
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -33,7 +33,7 @@
import javax.xml.soap.Text;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
/**
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderElementTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -32,9 +32,9 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
/**
* Test the SOAPHeaderElement
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPHeaderTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -34,9 +34,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
/**
* Test the SOAPHeader
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -25,12 +25,12 @@
import java.io.FilenameFilter;
import java.net.MalformedURLException;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
/**
*
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1205/TestEndpointImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -28,8 +28,8 @@
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
/**
* @author darran.lofthouse(a)jboss.com
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/InlineHandler.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxrpc.xop.doclit;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.common.NameImpl;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.HandlerInfo;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/InlineHandler.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -1,7 +1,7 @@
package org.jboss.test.ws.jaxrpc.xop.rpclit;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.common.NameImpl;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,7 +27,7 @@
import javax.xml.soap.SOAPFault;
import javax.xml.ws.soap.SOAPFaultException;
-import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.core.soap.SOAPFaultImpl;
@WebService(endpointInterface="org.jboss.test.ws.jaxws.exception.ExceptionEndpoint")
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -27,12 +27,12 @@
import javax.jws.WebService;
+import org.jboss.ws.common.config.ServerConfig;
+import org.jboss.ws.common.config.ServerConfigFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitionsFactory;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
/**
*
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -39,7 +39,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.soap.NameImpl;
+import org.jboss.ws.common.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.SOAPBinding
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/JSR181WebMethodTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -41,8 +41,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.soap.NameImpl;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
Modified: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webresult/JSR181WebResultTestCase.java 2006-12-06 11:19:33 UTC (rev 1572)
@@ -37,10 +37,10 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.common.NameImpl;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.core.jaxrpc.CallImpl;
import org.jboss.ws.core.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
/**
* Test the JSR-181 annotation: javax.jws.webresult
19 years, 5 months
JBossWS SVN: r1571 - in trunk/src: main/java/org/jboss/ws/jaxws/spi main/java/org/jboss/ws/tools/jaxws test/java/org/jboss/test/ws/jaxws/xop/doclit test/resources/jaxrpc/xop test/resources/jaxrpc/xop/shared test/resources/jaxws test/resources/jaxws/xop test/resources/jaxws/xop/shared
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-06 05:47:51 -0500 (Wed, 06 Dec 2006)
New Revision: 1571
Added:
trunk/src/test/resources/jaxrpc/xop/shared/
trunk/src/test/resources/jaxrpc/xop/shared/attach.jpeg
trunk/src/test/resources/jaxrpc/xop/shared/attach.txt
trunk/src/test/resources/jaxrpc/xop/shared/attach.xml
trunk/src/test/resources/jaxrpc/xop/shared/disguised_jpeg.xcf
trunk/src/test/resources/jaxws/xop/
trunk/src/test/resources/jaxws/xop/shared/
trunk/src/test/resources/jaxws/xop/shared/attach.jpeg
trunk/src/test/resources/jaxws/xop/shared/attach.txt
trunk/src/test/resources/jaxws/xop/shared/attach.xml
trunk/src/test/resources/jaxws/xop/shared/disguised_jpeg.xcf
Modified:
trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java
trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
Log:
added missing directory
Modified: trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java 2006-12-06 10:47:51 UTC (rev 1571)
@@ -23,26 +23,6 @@
// $Id$
-import java.lang.reflect.Proxy;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import javax.jws.WebService;
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-
import org.jboss.ws.Constants;
import org.jboss.ws.jaxws.client.ClientImpl;
import org.jboss.ws.jaxws.client.ClientProxy;
@@ -50,12 +30,32 @@
import org.jboss.ws.jaxws.handler.HandlerResolverImpl;
import org.jboss.ws.metadata.ClientEndpointMetaData;
import org.jboss.ws.metadata.EndpointMetaData;
-import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.ws.metadata.EndpointMetaData.Type;
import org.jboss.ws.metadata.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.ServiceMetaData;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientEndpointMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
+import org.jboss.logging.Logger;
+import javax.jws.WebService;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.spi.ServiceDelegate;
+import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
/**
* Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.
*
@@ -67,6 +67,9 @@
*/
public class ServiceDelegateImpl extends ServiceDelegate
{
+
+ private final Logger log = Logger.getLogger(ServiceDelegateImpl.class);
+
// The executor service
private static ExecutorService defaultExecutor = Executors.newCachedThreadPool();
@@ -159,6 +162,11 @@
metaDataBuilder.rebuildEndpointMetaData(epMetaData, seiClass);
}
}
+ else
+ {
+ // TODO: should'nt this throw an exception?
+ log.warn("SEI is missing @WebService annotation: " + seiClass);
+ }
return (T)createProxy(seiClass, epMetaData);
}
Modified: trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06 10:47:51 UTC (rev 1571)
@@ -309,8 +309,7 @@
/**
* Generate a WSDL object model from the passed in ServiceMetaData.
*
- * @param service the service
- * @param ctx the JAXB context containing all types referenced
+ * @param service the service
* @return the WSDL object model
*/
public WSDLDefinitions generate(ServiceMetaData service)
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-06 10:47:51 UTC (rev 1571)
@@ -35,6 +35,11 @@
public DHRequest() {
}
+
+ public DHRequest(DataHandler dataHandler) {
+ this.dataHandler = dataHandler;
+ }
+
private DataHandler dataHandler;
@XmlMimeType("text/xml")
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-06 10:47:51 UTC (rev 1571)
@@ -1,13 +1,11 @@
package org.jboss.test.ws.jaxws.xop.doclit;
+import javax.ejb.Remote;
import javax.jws.WebMethod;
import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.ejb.Remote;
@Remote
-@WebService(name = "MTOMEndpoint", targetNamespace = "http://org.jboss.ws/xop/doclit", serviceName = "MTOMService")
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebService
public interface MTOMEndpoint {
@WebMethod
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-06 10:47:51 UTC (rev 1571)
@@ -21,17 +21,22 @@
*/
package org.jboss.test.ws.jaxws.xop.doclit;
+import org.jboss.ws.annotation.PortComponent;
+
import javax.jws.WebMethod;
import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
import javax.ejb.Stateless;
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.xop.doclit.MTOMEndpoint", name="MTOMEndpoint")
+@WebService(name = "MTOMEndpoint", targetNamespace = "http://org.jboss.ws/xop/doclit", serviceName = "MTOMService")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class MTOMEndpointBean implements MTOMEndpoint {
@WebMethod
public DHResponse echoDataHandler(DHRequest request) {
+
System.out.println("Recv " + request.getDataHandler().getContentType());
return new DHResponse(
request.getDataHandler()
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-06 10:47:51 UTC (rev 1571)
@@ -26,7 +26,11 @@
import junit.framework.Test;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Binding;
+import javax.activation.DataHandler;
import java.net.URL;
+import java.util.Map;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -35,7 +39,7 @@
*/
public class XOPTestCase extends JBossWSTest {
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-xop-doclit/MTOMEndpointBean";
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8081/jaxws-xop-doclit/MTOMEndpointBean";
private MTOMEndpoint mtomWS;
@@ -47,15 +51,22 @@
protected void setUp() throws Exception
{
- QName serviceName = new QName("http://org.jboss.ws/xop/doclit", "MTOMEndpointService");
+ QName serviceName = new QName("http://org.jboss.ws/xop/doclit", "MTOMService");
URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS+"?wsdl");
javax.xml.ws.Service service = javax.xml.ws.Service.create(wsdlURL, serviceName);
mtomWS = service.getPort(MTOMEndpoint.class);
+ BindingProvider bp = (BindingProvider)mtomWS;
+ Map<String,Object> context = bp.getRequestContext();
+ context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, TARGET_ENDPOINT_ADDRESS);
}
public void testRequestResponseOptimized() throws Exception
{
-
+ URL url = new URL("file:resources/jaxws/xop/shared/attach.xml");
+ DataHandler dh = new DataHandler(url);
+ DHResponse response = mtomWS.echoDataHandler(new DHRequest(dh));
+ assertNotNull(response);
+ assertEquals(response.getDataHandler().getContentType(), "text/xml");
}
}
\ No newline at end of file
Added: trunk/src/test/resources/jaxrpc/xop/shared/attach.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/src/test/resources/jaxrpc/xop/shared/attach.jpeg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/test/resources/jaxrpc/xop/shared/attach.txt
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/shared/attach.txt 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/resources/jaxrpc/xop/shared/attach.txt 2006-12-06 10:47:51 UTC (rev 1571)
@@ -0,0 +1 @@
+This is a plain text attachment.
Property changes on: trunk/src/test/resources/jaxrpc/xop/shared/attach.txt
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/resources/jaxrpc/xop/shared/attach.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/shared/attach.xml 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/resources/jaxrpc/xop/shared/attach.xml 2006-12-06 10:47:51 UTC (rev 1571)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<mime-message>This is an xml attachment.</mime-message>
Property changes on: trunk/src/test/resources/jaxrpc/xop/shared/attach.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/test/resources/jaxrpc/xop/shared/disguised_jpeg.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/src/test/resources/jaxrpc/xop/shared/disguised_jpeg.xcf
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/test/resources/jaxws/xop/shared/attach.jpeg
===================================================================
--- trunk/src/test/resources/jaxws/xop/shared/attach.jpeg 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/resources/jaxws/xop/shared/attach.jpeg 2006-12-06 10:47:51 UTC (rev 1571)
@@ -0,0 +1,113 @@
+����
+��
+%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
+��
+$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������
t}������~�:!���?�]3�f��~$����&O]x�ís�֯�CL����Bà�/ǯ������O����_�}���
+�g����o��O���j������iZf�a����}��P[G�{_
+��
+��
+��
+��
+��
+O��Gƿ�_��K�
|8���|@��4�
�_����o�Mmb�
���~�:�
~�b����7�7����
������KJ�Ѭ~�_��]���1�|Z�?h|V��/����� |_�~��i�����7�U�� >=���
+<+���~��
+���
+x;T�e֣c�]7�_>x�����-���k������}z��Y���=gQ�ӣ���J�nR+9�>`���
+��|@�����
+��/g�3��'��D�
+��+*�������*�����3����G�/ك���e�>/��~�#��?mo�^ �+�C|Z��^���
+��G�o�'Lҭ��_�J�пik�_TռA�Oٺ�ş��CĿ�w��k���d���g����[~�^���?إ�?�/ڧT����?�������G�_���>(���G]
ׁ�
+��
� ���2_��zg�+�o
�V��
��~�/�??��|��
+�O¾ӭ�xk�^������gg���6�gk�izu������E�o�E�C��_��
?U�ֽS�{[�t�N�K��t���5�
+�
+�
+�
�M>���g��Լ7gm�\h�wl�v&���
+�WFӭ��؛g�{�����
+��
+M�S|^��������_��|1��
+<ς^>��4���|����,~8���3L���{�;�
{W���5�gT���uMF�����{�啀0���t?���
����������>�2���
i^,�
x�Z�ŏ�� ��?�.����_�'�&<��.�~.|\�M��
k?�>��C�cş�W���<�ȟ
+|1���
sſo�
+�:����L� ~��
+|]�����
+x��l> �J����
��ᛯ|-�e����6_~Z�_��
+�5������3Oo����Y�;����
+4��zj3�zߎu���
+������3�V�izV�r� ռ��:_��e��N��U�c�j��q}�i�O�_�'��R���0��
+_�� ��Xo�Jw�?��?c�
�O�_�c�x��߳��Y�ᯉuKO �
+�sN[}#��6����YA��
+Gg��|y�
+��
+5���
+����L�G��%�3��
+��O�~��s�K�/��
wP��Th^,Կh��w�?�%�> j�_�
+�'�O�(��+���
+���|@���K��
>|>�|[��gş x���/ ~�o>�����3�_�G���
�T���[@�����_ >O��@�G��o�?i��
�f��Ws�
+���
+3��[^�� ��}x���xW��c�����ĺGſ��
+�
+�
�?|+���t��+�_�L����"��
��^7���⯌�
+5O���+�k��u~��Q�ښ����q�Xǂ4���}��]'F����>мi�������/��s�o��(�����
+��㟃�'~����Ӥ�1��
x�]�|Y�ox���o�$��>.���>x������������_���O
+�WPO��?��&���f�V�7¸>|3�Ɯ�v���~�m����<o�x}-�a�}r��O�o��*�>!x��ڎ��_
|;��/�χ��E
^���?�����c�/�g/��?����
+����Go���[�
+��E�
O��
+����_j��
+��g�O�ڟ۟���;���_a�����
+(��
+���k�\�
Tּ3�K.��Ԭ��B�4���_8���
��_
_�Oÿ������x_��
+|U�};�:dž�5�'�:������t��uMF�=旨��w��}amqm�
+[�_�� ѿি�M���,�<=�
�i��犼5�[?�������xs��^7m�������Ş��W-��]�נxO�����{�_
x��������Ox�����=�;�>����~�g�����LJ��k�:?�/4�w����^Y�7�M.��ƚ��um}c��m<R���QE
+�C����O�O����
�|L�����O�t�o�����_��������=��~?��^o��#�^Ѿ0h�)���uK��}�E~p���
+A�x/�?V��[���s�;�7���w�j�M�/�.�!j��|-�᷇u��oB��>:x���|j�
+(��
+(��
+(��
+(��
+������`����/gi�_��
�
+O�n��Z���>
|`��_��Ǐ���>�~�������n5�/Kҵ�D~���l��8��$����
+7�x�V������jٚ����
>5�;K�g���͏���
+�T�^��Xx��G�
+(��>`��~
+x������k�������|o���`���S�ڧ�.�
+�*������
�V�
+���xC�?�|9��gL��?�������m�����:��| �n���|7��m?F��������υ~���d?�%������@�!�����>9�J��
�������
~|+�Οa�/�O�
+(��
+(��
+(��
+(��
+(��
+(��
+�����;���
S���=�
��E�'o�
��E�'o�
��E�'o�
��E�'o�
��E�'o�
��E�'o�
+��o�L�;�
+��.�o�"_�7�?�
+���
�
+����
+��
+�>���>���0~Қ���h��)�|мU�i�3�{7�5��3��I���:�H����c�x��wJ���W�L:橣
�
+Y_W�?�O��_�w���
+Y@QE
+k?�?�<+�?
+�h����?��/�i/گ�}��?j������������izu��5��Ϋ
�s�
7�J ����B�
�<�%�4����
+a�
++�y��?�o�n�)��$����
+a�
++�y��?�o�n�)��$����
+a�
++�y��?�o�n�)��$����
+a�
++�y��?�o�n�)��$����
+a�
++�y��?�o�������gĿ�����
+����"�'�j^�v�������I������_P��
+��y��
+�� ;�
+(��>`�/���/�%�������`��y� �N��O�~>�)о2]x�ǰh�^�շ�
SŖ�6��4����<'�E����85�m��=Rŧ�F�g�|G���G���|?�j�����u���Ν�j>�U�|5�?
x����{�x���4�w�m�mb+=F
+���^!�ٴ�wK���a�o�U��2�����
���~Ŀ5/x���
+�m�xV���ӵ؛kk�:)>��
ľ��t����U��
+�z7�
w����y����(��
+��
+~�u��_�_�pw���
���|%��>���?5�?� ���
+���ڏ���h];�f���A��
+|Q�߇>(�����
x~�����
+��!�R����W�=�7�/�3F��ƺ��;�u��j��ğx�Ě���PEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEP�c
sǿ|G�F|5��?i�
+��¿�i��_���K�T���}3�^��A|F���iڦ�u�C�Os�Cx�
\ No newline at end of file
Added: trunk/src/test/resources/jaxws/xop/shared/attach.txt
===================================================================
--- trunk/src/test/resources/jaxws/xop/shared/attach.txt 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/resources/jaxws/xop/shared/attach.txt 2006-12-06 10:47:51 UTC (rev 1571)
@@ -0,0 +1 @@
+This is a plain text attachment.
Added: trunk/src/test/resources/jaxws/xop/shared/attach.xml
===================================================================
--- trunk/src/test/resources/jaxws/xop/shared/attach.xml 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/resources/jaxws/xop/shared/attach.xml 2006-12-06 10:47:51 UTC (rev 1571)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<mime-message>This is an xml attachment.</mime-message>
Added: trunk/src/test/resources/jaxws/xop/shared/disguised_jpeg.xcf
===================================================================
--- trunk/src/test/resources/jaxws/xop/shared/disguised_jpeg.xcf 2006-12-06 10:29:48 UTC (rev 1570)
+++ trunk/src/test/resources/jaxws/xop/shared/disguised_jpeg.xcf 2006-12-06 10:47:51 UTC (rev 1571)
@@ -0,0 +1,22 @@
+����
+
+
$.' ",#(7),01444'9=82<.342��
2!!22222222222222222222222222222222222222222222222222��
+�U��UA�TT*��QF���G�"IQ����*��x^�O�x}/ϭF��)��(�p������l%%����I�t/�R����w4�Y���g�c��y^�_Lk�z-S��cO_���\�������^S�dZ�NQ���T^oo�C�я��ج&��U�?L�K�a��P��td�����.�Q�4[ftoѽ�.�َi�ggvr�6_q|�T�����Wk��x��\9����&~i���Gg�W!��խ�W�\A�n��C;�.�N�zG�Q��jS�C�ϨUP�h6Ӷ�ݡ������k:F�Y�j��
+W�
+R����(_��
�N��>|��^]3&e�LYE�ot�����
+#��
+��wL���ۚ-�Syi�
+��T�U7we�[n�a٨S�ɜ��V�����py>҅JM�q�����CŎ���k�wxH���u�L�M����͛�-�CТ.��4���Ux�Iͱuܲ=�-?Ԡݼ��}�O��y�<��Nm�wf%ds�h?x}3�l�i-=?��
+'�1��N�J�*W����H�p�,y"�gٴʕ+J��J�*V�+�j���?�Fܨ4G�K��� �Jӽ�D��?�?�%��YOw�2�@�g�2l@�C��\3m���D�{��[
�&�� ���Pa��?$;��Ϙ��̅&)C*l�<@=�gܝ9�pz#���;��#y̜J@�ܼ�(�&_�Gæ��SѦ��T���f^�
�L�Y#�1�R���
>�1�Z ��yX��8��ʕ�"/���1J�3��Z���T����˃;X�p�
+�����`"�.Y]"�w
+���o�J�t(}����6Dm6RW�.b���ZLN>0�l4���)S���O�[��w[��K��c�˗.\�^�Җ�pGm�^������Uۍv�2����1bot�<���9�H����iㇼe-*K��ߕ�I�3\߷�_��~�t���x�贎�
dCb$�e�O
[��:N�L����@.Q����?��F� �ɀAC5��q�
+�!B� �Х- Sk�����]zA>�=CP�!��c��%�J���%-����T�̢����}���Z[=��A ==7�9���Cv�'*����8��:e��n��+�YNp�l!p������\�k�s���� *�n�=Ɠ�/m��4�~�&]V����0v��w2����A6D�
+}���.��(���C�hV�\
+�uA���
+->L������@w_D[�V#��B����a�ҭ� ��� t[)�0<���yT
��M9
��lt�ە�;�03Q`���&
��֕��<g�-������9��2���r[g��|������Q1�4�\XX���$g-� `��y��ļٍL�Y��f�F,�q6ZPܶ�"C�yʤ0
+���o��a�R8���A;%��l4:���]_5Ԇӭ��,�7��FE-U�5��c_���%��)�ĵ#��8D�N8��d�'l<����Z�am�E*��c��{Gco��1.�R��=���?�[_�v�
��
"d��%:w�����D]+���t z�l�k�i�����
�F)��[=S��p�.+��"�Sޏ��Zr��!c�
+&W�M[z��9V�� �
+�"����z��'��P�wU�
+�;P!�[�n}nP~�8�-�QVcN�n]H(�pO����bܹq�[Z�%Y\N`W�q�rR�:�t�^��hxa��n�),�LM�/�.��0���
+���h�k�!^�l&���\
+���Kr���;�����DE�8Lnl��[����?��
\ No newline at end of file
19 years, 5 months
JBossWS SVN: r1570 - in branches/tdiesler/trunk/src/main/java: javax/xml/ws org/jboss/ws/common/jaxrpc org/jboss/ws/common/jaxrpc/encoding org/jboss/ws/common/metadata/jaxrpcmapping org/jboss/ws/common/metadata/webservices org/jboss/ws/common/metadata/wsdl org/jboss/ws/common/metadata/wsdl/xmlschema org/jboss/ws/common/umdm org/jboss/ws/common/utils org/jboss/ws/core org/jboss/ws/core/binding/soap org/jboss/ws/core/jaxrpc org/jboss/ws/core/jaxws/client org/jboss/ws/core/jaxws/handler org/j
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-06 05:29:48 -0500 (Wed, 06 Dec 2006)
New Revision: 1570
Added:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java
Modified:
branches/tdiesler/trunk/src/main/java/javax/xml/ws/WebServiceRefs.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/LiteralTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/Base64Deserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializerFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SimpleDeserializer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaWsdlMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLInterfaceFault.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSObjectList.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ExtensibleMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/HandlerMetaDataJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/DOMWriter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/JavaUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/MimeUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageMarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
Log:
partial commit
Modified: branches/tdiesler/trunk/src/main/java/javax/xml/ws/WebServiceRefs.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/javax/xml/ws/WebServiceRefs.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/javax/xml/ws/WebServiceRefs.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,11 +21,12 @@
*/
package javax.xml.ws;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
/**
* The <code>WebServiceRefs</code> annotation allows
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/LiteralTypeMapping.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/LiteralTypeMapping.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/LiteralTypeMapping.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,8 @@
// $Id$
+import java.awt.Image;
+
import javax.activation.DataHandler;
import javax.mail.internet.MimeMultipart;
import javax.xml.soap.SOAPElement;
@@ -30,9 +32,13 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.jaxrpc.encoding.*;
+import org.jboss.ws.common.jaxrpc.encoding.ElementDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.ElementSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.JBossXBDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.JBossXBSerializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.SOAPElementDeserializerFactory;
+import org.jboss.ws.common.jaxrpc.encoding.SOAPElementSerializerFactory;
import org.w3c.dom.Element;
-import java.awt.*;
/**
* This is the representation of a type mapping.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/Base64Deserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/Base64Deserializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/Base64Deserializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,8 @@
// $Id$
+import java.io.IOException;
+
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
@@ -36,8 +38,6 @@
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
import org.w3c.dom.Element;
-
-import java.io.IOException;
/**
* Deserializer for Base64
*
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java (from rev 1569, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jaxrpc.encoding;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.XSModel;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.binding.BindingException;
+import org.jboss.ws.common.binding.SerializationContext;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.binding.ComplexTypeDeserializer;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jbossxb.JBossXBUnmarshaller;
+import org.jboss.ws.core.jbossxb.JBossXBUnmarshallerImpl;
+
+/**
+ * A Deserializer that can handle complex types by delegating to JAXB.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class JBossXBDeserializer extends ComplexTypeDeserializer
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossXBDeserializer.class);
+
+ private JBossXBUnmarshaller unmarshaller;
+
+ public JBossXBDeserializer() throws BindingException
+ {
+ // Get the JAXB marshaller for complex objects
+ unmarshaller = new JBossXBUnmarshallerImpl();
+ }
+
+ /**
+ * For unmarshalling the WS layer passes to the JAXB layer
+ *
+ * - required self contained xml content
+ * - required map of packaged or generated XSDSchema
+ * - optional QName of the root complex type
+ * - optional instance of JavaWsdlMapping
+ *
+ * The xmlType is redundant if the root element name corresponds to a global element definition in schema.
+ * If the java mapping is null, default mapping rules apply.
+ *
+ * The result is an object instance or null.
+ * In case of an unmarshalling problem a descriptive exception is thrown.
+ */
+ public Object deserialize(QName xmlName, QName xmlType, String val, SerializationContext serContext) throws BindingException
+ {
+ log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
+
+ // Expect the specific JAXRPC serialization context
+ SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
+
+ Object value = null;
+ String typeName = xmlType.getLocalPart();
+
+ try
+ {
+ // Get the parsed model
+ XSModel model = jaxrpcContext.getXsModel();
+
+ // Get the jaxrpc-mapping.xml meta data
+ JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
+
+ unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
+ unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
+ unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
+ unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
+
+ ByteArrayInputStream ins = new ByteArrayInputStream(val.getBytes("UTF-8"));
+ value = unmarshaller.unmarshal(ins);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new BindingException(ex);
+ }
+
+ log.debug("deserialized: " + (value != null ? value.getClass().getName() : null));
+ return value;
+
+ }
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializerFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializerFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBDeserializerFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,7 +23,6 @@
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
-import org.jboss.ws.core.jbossxb.JBossXBDeserializer;
// $Id$
Copied: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java (from rev 1569, branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java)
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common.jaxrpc.encoding;
+
+// $Id$
+
+import java.io.StringWriter;
+
+import javax.xml.namespace.QName;
+
+import org.apache.xerces.xs.XSModel;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.binding.BindingException;
+import org.jboss.ws.common.binding.SerializationContext;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.core.binding.ComplexTypeSerializer;
+import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
+import org.jboss.ws.core.jbossxb.JBossXBConstants;
+import org.jboss.ws.core.jbossxb.JBossXBMarshaller;
+import org.jboss.ws.core.jbossxb.JBossXBMarshallerImpl;
+import org.jboss.ws.core.jbossxb.XercesXSMarshallerImpl;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * A Serializer that can handle complex types by delegating to JAXB.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Dec-2004
+ */
+public class JBossXBSerializer extends ComplexTypeSerializer
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JBossXBSerializer.class);
+
+ private JBossXBMarshaller marshaller;
+
+ public JBossXBSerializer() throws BindingException
+ {
+ // Get the JAXB marshaller for complex objects
+ marshaller = new JBossXBMarshallerImpl();
+ }
+
+ /**
+ * For marshalling the WS layer passes to the JAXB layer
+ *
+ * - optional java object instance
+ * - required map of packaged or generated XSDSchema
+ * - required QName of the root element
+ * - optional QName of the root complex type
+ * - optional instance of JavaWsdlMapping
+ *
+ * If the object value is null, the corresponding XML representation of the nillable element should be marshalled.
+ * The xmlType is redundant if the xmlName corresponds to a global element definition in schema.
+ * If the java mapping is null, default mapping rules apply.
+ *
+ * The result is a self contained (i.e. contains all namespace definitions) XML document without the XML declaration.
+ * In case of an marshalling problem a descriptive exception is thrown.
+ */
+ public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ {
+ log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
+
+ // Expect the specific JAXRPC serialization context
+ SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
+
+ try
+ {
+ // Get the parsed model
+ XSModel model = jaxrpcContext.getXsModel();
+
+ // Get the jaxrpc-mapping.xml object graph
+ JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
+
+ // schemabinding marshaller is the default delegate
+ JBossXBMarshaller delegate = marshaller;
+
+ if(value instanceof Exception)
+ {
+ // todo: CTS workaround for custom exceptions, clarify when Alexey is back
+ // causes NPE in MarshallerImpl:458
+ delegate = new XercesXSMarshallerImpl();
+ }
+
+ // marshalling context
+ delegate.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
+ delegate.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
+ delegate.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
+ delegate.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
+
+ // marshall
+ StringWriter strwr = new StringWriter();
+ delegate.marshal(value, strwr);
+ String xmlFragment = strwr.toString();
+
+ log.debug("serialized: " + xmlFragment);
+ return xmlFragment;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new BindingException(ex);
+ }
+ }
+}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializerFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializerFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/JBossXBSerializerFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,7 +23,6 @@
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.SerializerSupport;
-import org.jboss.ws.core.jbossxb.JBossXBSerializer;
// $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SOAPElementDeserializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -24,13 +24,13 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.w3c.dom.Element;
@@ -52,7 +52,7 @@
{
Element domElement = DOMUtils.parse(xmlFragment);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPElementImpl soapElement = soapFactory.createElement(domElement, true);
+ SOAPElement soapElement = soapFactory.createElement(domElement, true);
return soapElement;
}
catch (RuntimeException rte)
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SimpleDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SimpleDeserializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/jaxrpc/encoding/SimpleDeserializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,14 +23,14 @@
// $Id$
+import javax.xml.namespace.QName;
+
import org.jboss.logging.Logger;
import org.jboss.ws.common.binding.BindingException;
import org.jboss.ws.common.binding.DeserializerSupport;
import org.jboss.ws.common.binding.SerializationContext;
import org.jboss.xb.binding.SimpleTypeBindings;
-import javax.xml.namespace.QName;
-
/**
* A deserializer that can handle XMLSchema simple types.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaWsdlMapping.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaWsdlMapping.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,15 +23,15 @@
// $Id$
-import org.jboss.logging.Logger;
-
-import javax.xml.namespace.QName;
-
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+
/**
* XML mapping of the java-wsdl-mapping root element in jaxrpc-mapping.xml
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaXmlTypeMapping.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/JavaXmlTypeMapping.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,11 +23,11 @@
// $Id$
-import javax.xml.namespace.QName;
-
import java.io.Serializable;
import java.util.ArrayList;
+import javax.xml.namespace.QName;
+
/**
* XML mapping of the java-wsdl-mapping/java-xml-type-mapping element.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceEndpointInterfaceMapping.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,13 +23,13 @@
// $Id$
-import javax.xml.namespace.QName;
-
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import javax.xml.namespace.QName;
+
/**
* XML mapping of the java-wsdl-mapping/service-endpoint-interface-mapping element.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceInterfaceMapping.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/jaxrpcmapping/ServiceInterfaceMapping.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,13 +23,13 @@
// $Id$
-import javax.xml.namespace.QName;
-
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import javax.xml.namespace.QName;
+
/**
* XML mapping of the java-wsdl-mapping/service-interface-mapping element.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/webservices/WebservicesFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -27,7 +27,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11DefinitionFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,23 +23,19 @@
// $Id$
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.utils.JBossWSEntityResolver;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
+import java.net.URL;
-import com.ibm.wsdl.xml.WSDLReaderImpl;
-
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLLocator;
import javax.wsdl.xml.WSDLReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.xml.sax.EntityResolver;
+
+import com.ibm.wsdl.xml.WSDLReaderImpl;
+
/**
* A factory that creates a WSDL-1.1 <code>Definition</code> from an URL.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Reader.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -29,7 +29,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDL11Writer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -25,7 +25,6 @@
import java.io.Writer;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.Set;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLDefinitionsFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -34,7 +34,6 @@
import javax.wsdl.Definition;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
-import javax.xml.bind.JAXBContext;
import javax.xml.parsers.DocumentBuilder;
import org.jboss.logging.Logger;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLInterfaceFault.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLInterfaceFault.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLInterfaceFault.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -27,8 +27,6 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.common.WSException;
-
/**
* An Interface Fault component describes a fault that MAY occur during invocation of an operation of the
* interface. The Interface Fault component declares an abstract fault by naming it and indicating the
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLUtils.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/WSDLUtils.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -31,7 +31,6 @@
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
-import java.util.EmptyStackException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -67,7 +66,6 @@
import javax.xml.rpc.holders.StringHolder;
import org.apache.xerces.xs.XSComplexTypeDefinition;
-import org.apache.xerces.xs.XSModel;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSNamespaceItem.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -28,7 +28,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.TreeSet;
import org.apache.xerces.xs.StringList;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSObjectList.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/metadata/wsdl/xmlschema/JBossXSObjectList.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -22,7 +22,6 @@
package org.jboss.ws.common.metadata.wsdl.xmlschema;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import org.apache.xerces.xs.XSObject;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ClientEndpointMetaData.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -25,22 +25,15 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.umdm.EndpointMetaData.Type;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.metadata.config.WSConfigFactory;
-import org.jboss.ws.core.metadata.config.jaxrpc.WSClientConfigJAXRPC;
import org.jboss.ws.core.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.core.metadata.config.jaxws.WSClientConfigJAXWS;
import org.jboss.ws.core.metadata.config.jaxws.WSConfigRootJAXWS;
-import org.jboss.ws.core.metadata.config.jaxws.WSHandlerChainsConfigJAXWS;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
/**
* Client side endpoint meta data.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ExtensibleMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ExtensibleMetaData.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/ExtensibleMetaData.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,7 +1,7 @@
package org.jboss.ws.common.umdm;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/HandlerMetaDataJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/HandlerMetaDataJAXRPC.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/umdm/HandlerMetaDataJAXRPC.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -26,9 +26,7 @@
import java.util.HashSet;
import java.util.Set;
-import javax.xml.namespace.QName;
-
/**
* The JAXRPC metdata data for a handler element
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/DOMWriter.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/DOMWriter.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/DOMWriter.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -67,12 +67,12 @@
import java.util.Iterator;
import java.util.Map;
+import org.jboss.logging.Logger;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.jboss.logging.Logger;
/**
* Traverse a DOM tree in order to print a document that is parsed.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/IOUtils.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,15 +23,24 @@
// $Id$
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import javax.activation.DataHandler;
+
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.core.server.ServerConfig;
import org.jboss.ws.core.server.ServerConfigFactory;
-import javax.activation.DataHandler;
-
/**
* IO utilites
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/JavaUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/JavaUtils.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/JavaUtils.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -29,7 +29,6 @@
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
-import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.HashSet;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/MimeUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/MimeUtils.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/utils/MimeUtils.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -25,23 +25,29 @@
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGImageDecoder;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
-import org.jboss.ws.common.Constants;
-import org.jboss.ws.common.WSException;
+import java.awt.image.BufferedImage;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
import javax.mail.internet.ContentType;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.ParseException;
import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;
-import java.awt.image.BufferedImage;
-import java.io.*;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import org.jboss.ws.common.Constants;
+import org.jboss.ws.common.WSException;
+
+import com.sun.image.codec.jpeg.JPEGCodec;
+import com.sun.image.codec.jpeg.JPEGImageDecoder;
+import com.sun.image.codec.jpeg.JPEGImageEncoder;
+
/**
* Generic mime utility class.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -60,7 +60,6 @@
import org.jboss.ws.core.binding.UnboundHeader;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.jaxrpc.StubExt;
-import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageMarshaller.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageMarshaller.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/binding/soap/SOAPMessageMarshaller.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -32,8 +32,6 @@
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.invocation.OnewayInvocation;
import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPElementWriter;
import org.jboss.ws.core.soap.SOAPMessageImpl;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -25,7 +25,6 @@
import java.lang.reflect.Proxy;
import java.net.URL;
-import java.net.URLClassLoader;
import java.rmi.Remote;
import java.util.ArrayList;
import java.util.Iterator;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -26,7 +26,12 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.rmi.RemoteException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ResponseImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,8 +23,6 @@
// $Id$
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
@@ -32,6 +30,9 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceException;
+
/**
* The Response interface provides methods used to obtain the payload and context of a
* message sent in response to an operation invocation.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -39,8 +39,6 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.ws.core.CommonMessageContext;
-
/**
* The interface SOAPMessageContext provides access to the SOAP message for either RPC request or response.
* The javax.xml.soap.SOAPMessage specifies the standard Java API for the representation of a SOAP 1.1 message with attachments.
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBDeserializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.binding.BindingException;
-import org.jboss.ws.common.binding.SerializationContext;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.core.binding.ComplexTypeDeserializer;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-
-/**
- * A Deserializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBDeserializer extends ComplexTypeDeserializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBDeserializer.class);
-
- private JBossXBUnmarshaller unmarshaller;
-
- public JBossXBDeserializer() throws BindingException
- {
- // Get the JAXB marshaller for complex objects
- unmarshaller = new JBossXBUnmarshallerImpl();
- }
-
- /**
- * For unmarshalling the WS layer passes to the JAXB layer
- *
- * - required self contained xml content
- * - required map of packaged or generated XSDSchema
- * - optional QName of the root complex type
- * - optional instance of JavaWsdlMapping
- *
- * The xmlType is redundant if the root element name corresponds to a global element definition in schema.
- * If the java mapping is null, default mapping rules apply.
- *
- * The result is an object instance or null.
- * In case of an unmarshalling problem a descriptive exception is thrown.
- */
- public Object deserialize(QName xmlName, QName xmlType, String val, SerializationContext serContext) throws BindingException
- {
- log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
-
- // Expect the specific JAXRPC serialization context
- SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
-
- Object value = null;
- String typeName = xmlType.getLocalPart();
-
- try
- {
- // Get the parsed model
- XSModel model = jaxrpcContext.getXsModel();
-
- // Get the jaxrpc-mapping.xml meta data
- JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
-
- unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
- unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
- unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
- unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
-
- ByteArrayInputStream ins = new ByteArrayInputStream(val.getBytes("UTF-8"));
- value = unmarshaller.unmarshal(ins);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException(ex);
- }
-
- log.debug("deserialized: " + (value != null ? value.getClass().getName() : null));
- return value;
-
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshaller.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,12 +21,12 @@
*/
package org.jboss.ws.core.jbossxb;
+import java.io.OutputStream;
+import java.io.Writer;
+
+import org.w3c.dom.Node;
import org.xml.sax.ContentHandler;
-import org.w3c.dom.Node;
-import java.io.Writer;
-import java.io.OutputStream;
-
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBMarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,13 @@
// $Id$
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.WSException;
@@ -32,18 +39,11 @@
import org.jboss.ws.common.utils.JavaUtils;
import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.xb.binding.Constants;
-
import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.w3c.dom.Node;
import org.xml.sax.ContentHandler;
-import javax.xml.namespace.QName;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-
/**
* An implementation of a JAXB Marshaller that uses the JBossXB schema binding marshaller.
*
Deleted: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBSerializer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jbossxb;
-
-// $Id$
-
-import org.apache.xerces.xs.XSModel;
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.binding.BindingException;
-import org.jboss.ws.common.binding.SerializationContext;
-import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.core.binding.ComplexTypeSerializer;
-import org.jboss.ws.core.jaxrpc.SerializationContextJAXRPC;
-import org.w3c.dom.NamedNodeMap;
-
-import javax.xml.namespace.QName;
-import java.io.StringWriter;
-
-/**
- * A Serializer that can handle complex types by delegating to JAXB.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Dec-2004
- */
-public class JBossXBSerializer extends ComplexTypeSerializer
-{
- // provide logging
- private static final Logger log = Logger.getLogger(JBossXBSerializer.class);
-
- private JBossXBMarshaller marshaller;
-
- public JBossXBSerializer() throws BindingException
- {
- // Get the JAXB marshaller for complex objects
- marshaller = new JBossXBMarshallerImpl();
- }
-
- /**
- * For marshalling the WS layer passes to the JAXB layer
- *
- * - optional java object instance
- * - required map of packaged or generated XSDSchema
- * - required QName of the root element
- * - optional QName of the root complex type
- * - optional instance of JavaWsdlMapping
- *
- * If the object value is null, the corresponding XML representation of the nillable element should be marshalled.
- * The xmlType is redundant if the xmlName corresponds to a global element definition in schema.
- * If the java mapping is null, default mapping rules apply.
- *
- * The result is a self contained (i.e. contains all namespace definitions) XML document without the XML declaration.
- * In case of an marshalling problem a descriptive exception is thrown.
- */
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
- {
- log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
-
- // Expect the specific JAXRPC serialization context
- SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;
-
- try
- {
- // Get the parsed model
- XSModel model = jaxrpcContext.getXsModel();
-
- // Get the jaxrpc-mapping.xml object graph
- JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();
-
- // schemabinding marshaller is the default delegate
- JBossXBMarshaller delegate = marshaller;
-
- if(value instanceof Exception)
- {
- // todo: CTS workaround for custom exceptions, clarify when Alexey is back
- // causes NPE in MarshallerImpl:458
- delegate = new XercesXSMarshallerImpl();
- }
-
- // marshalling context
- delegate.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
- delegate.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
- delegate.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);
- delegate.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, jaxrpcMapping);
-
- // marshall
- StringWriter strwr = new StringWriter();
- delegate.marshal(value, strwr);
- String xmlFragment = strwr.toString();
-
- log.debug("serialized: " + xmlFragment);
- return xmlFragment;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BindingException(ex);
- }
- }
-}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,13 +23,14 @@
// $Id$
+import java.io.InputStream;
+import java.util.HashMap;
+
import org.jboss.ws.common.WSException;
import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import java.io.InputStream;
-import java.util.HashMap;
/**
* An implementation of a JAXB Unmarshaller.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/SchemaBindingBuilder.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,32 +23,49 @@
// $Id$
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.util.xml.JBossEntityResolver;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.metadata.jaxrpcmapping.*;
+import org.jboss.ws.common.metadata.jaxrpcmapping.ExceptionMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.JavaXmlTypeMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.PackageMapping;
+import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.jboss.ws.extras.xop.jaxrpc.JBossXBContentAdapter;
import org.jboss.xb.binding.metadata.ClassMetaData;
import org.jboss.xb.binding.metadata.PackageMetaData;
import org.jboss.xb.binding.metadata.PropertyMetaData;
import org.jboss.xb.binding.metadata.ValueMetaData;
-import org.jboss.xb.binding.sunday.unmarshalling.*;
+import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.SimpleTypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
import org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtElementHandler;
import org.w3c.dom.Element;
import org.w3c.dom.Text;
import org.xml.sax.Attributes;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-import java.util.ArrayList;
-import java.util.Iterator;
-
/**
* Create SchemaBinding from XSModel and jaxrpc-mapping.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jbossxb/XercesXSMarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,13 @@
// $Id$
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
@@ -37,12 +44,6 @@
import org.w3c.dom.Node;
import org.xml.sax.ContentHandler;
-import javax.xml.namespace.QName;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-
/**
* An implementation of a JAXB Marshaller that user XercesXSMarshaller impl.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientDeployment.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -22,7 +22,6 @@
package org.jboss.ws.core.metadata.builder.jaxrpc;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
// $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -25,8 +25,6 @@
import java.io.IOException;
import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
import java.util.Set;
import javax.xml.namespace.QName;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCDeployment.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -27,7 +27,6 @@
import org.jboss.ws.common.metadata.webservices.WebservicesFactory;
import org.jboss.ws.common.metadata.webservices.WebservicesMetaData;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -22,9 +22,6 @@
// $Id$
package org.jboss.ws.core.metadata.builder.jaxrpc;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
import java.util.Set;
import javax.management.ObjectName;
@@ -39,7 +36,6 @@
import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
-import org.jboss.ws.common.umdm.EndpointMetaData;
import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
@@ -51,10 +47,7 @@
import org.jboss.ws.core.metadata.j2ee.UnifiedEjbPortComponentMetaData;
import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.core.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData;
-import org.jboss.ws.core.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.core.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
* A server side meta data builder that is based on webservices.xml.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -24,15 +24,11 @@
import java.util.Iterator;
-import javax.jws.WebService;
-
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -32,7 +32,6 @@
import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.core.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.core.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -26,9 +26,7 @@
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
-import org.jboss.logging.Logger;
import org.jboss.ws.common.umdm.UnifiedMetaData;
-import org.jboss.ws.core.server.JAXWSDeployment;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/** An abstract annotation meta data builder.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/WSConfigFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -27,12 +27,7 @@
import java.io.InputStream;
import java.net.URL;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.util.xml.JBossErrorHandler;
import org.jboss.ws.common.WSException;
import org.jboss.ws.common.utils.DOMUtils;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
@@ -43,7 +38,6 @@
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -27,7 +27,6 @@
import org.jboss.logging.Logger;
import org.jboss.ws.common.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,16 +21,8 @@
*/
package org.jboss.ws.core.metadata.config.jaxrpc;
-import java.util.ArrayList;
-import java.util.List;
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
// $Id$
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,15 +21,7 @@
*/
package org.jboss.ws.core.metadata.config.jaxws;
-import java.util.ArrayList;
-import java.util.List;
-import org.jboss.ws.common.umdm.EndpointMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
-
// $Id$
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.metadata.jsr181.HandlerChainMetaData;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/metadata/jsr181/HandlerChainMetaData.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -29,7 +29,6 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.common.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.core.metadata.j2ee.UnifiedHandlerMetaData;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/JAXWSDeployment.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,7 +21,6 @@
*/
package org.jboss.ws.core.server;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
// $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -36,7 +36,6 @@
import org.jboss.ws.core.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
import org.jboss.ws.core.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
import org.jboss.ws.core.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
/**
* The POJO deployer for web service endpoints. This Deployer is already decoupled from the target
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SAAJVisitor.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,7 +21,6 @@
*/
package org.jboss.ws.core.soap;
-import javax.xml.soap.SOAPElement;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,13 +21,14 @@
*/
package org.jboss.ws.core.soap;
-import org.jboss.ws.common.utils.DOMWriter;
+import java.io.Writer;
+import javax.xml.rpc.JAXRPCException;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
-import javax.xml.rpc.JAXRPCException;
-import java.io.Writer;
+import org.jboss.ws.common.utils.DOMWriter;
+
/**
* An abstract implemenation of the SOAPBodyElement
* <p/>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementRpc.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,15 +21,8 @@
*/
package org.jboss.ws.core.soap;
-import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.utils.DOMWriter;
-import org.w3c.dom.Element;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
-import javax.xml.rpc.JAXRPCException;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
/**
* An abstract implemenation of the SOAPBodyElement
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,21 @@
// $Id$
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
@@ -43,22 +58,14 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
import org.jboss.ws.extras.xop.XOPContext;
-import org.w3c.dom.*;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import java.io.IOException;
-import java.io.Writer;
-import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
/**
* A SOAPElement that gives access to its content as XML fragment or Java object.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,12 +23,9 @@
// $Id$
-import java.io.IOException;
-import java.io.Writer;
import java.util.Iterator;
import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.Name;
import javax.xml.soap.Node;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,13 +21,11 @@
*/
package org.jboss.ws.core.soap;
-import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
import java.util.Locale;
import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
import javax.xml.soap.Detail;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/ByteArrayContentHandler.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,19 +21,20 @@
*/
package org.jboss.ws.core.soap.attachment;
-import org.jboss.ws.common.utils.IOUtils;
-import org.jboss.ws.common.utils.MimeUtils;
-
-import javax.activation.ActivationDataFlavor;
-import javax.activation.DataContentHandler;
-import javax.activation.DataSource;
-import javax.activation.DataHandler;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;
+import javax.activation.ActivationDataFlavor;
+import javax.activation.DataContentHandler;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+
+import org.jboss.ws.common.utils.IOUtils;
+import org.jboss.ws.common.utils.MimeUtils;
+
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedDecoder.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -29,7 +29,6 @@
import java.util.Collection;
import java.util.Enumeration;
import java.util.LinkedList;
-import java.util.List;
import javax.activation.DataHandler;
import javax.mail.Header;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/AddressingPropertiesImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -28,10 +28,15 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
-import javax.xml.ws.addressing.*;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AddressingType;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.ReferenceParameters;
+import javax.xml.ws.addressing.Relationship;
-import org.jboss.ws.core.soap.NameImpl;
-
// $Id$
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/jaxws/WSAddressingServerHandler.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -22,17 +22,13 @@
package org.jboss.ws.extras.addressing.jaxws;
import java.net.URISyntaxException;
-import java.util.HashSet;
-import java.util.Set;
-import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -47,7 +47,6 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.ThreadLocalAssociation;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPElementImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpoint.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,13 +23,13 @@
// $Id$
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
import org.jboss.ws.extras.eventing.element.SubscribeResponse;
import org.jboss.ws.extras.eventing.element.SubscriptionEndRequest;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
/**
* Event source endpoint interface.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventSourceEndpointImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,12 @@
// $Id$
+import java.rmi.RemoteException;
+
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+
import org.jboss.logging.Logger;
import org.jboss.ws.extras.eventing.element.EndpointReference;
import org.jboss.ws.extras.eventing.element.SubscribeRequest;
@@ -33,11 +39,6 @@
import org.jboss.ws.extras.eventing.mgmt.SubscriptionManagerMBean;
import org.jboss.ws.extras.eventing.mgmt.SubscriptionTicket;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.AttributedURI;
-import java.rmi.RemoteException;
-
/**
* Event source endpoint implementation.<br>
* Delegates to {@link org.jboss.ws.extras.eventing.mgmt.SubscriptionManager}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/EventingConstants.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,15 +23,13 @@
// $Id$
-import org.jboss.ws.common.WSException;
+import java.net.URI;
+import java.net.URISyntaxException;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.AddressingConstants;
-import java.net.URI;
-import java.net.URISyntaxException;
+import org.jboss.ws.common.WSException;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/SubscriptionManagerEndpoint.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,11 +23,15 @@
// $Id$
-import org.jboss.ws.extras.eventing.element.*;
-
import java.rmi.Remote;
import java.rmi.RemoteException;
+import org.jboss.ws.extras.eventing.element.RenewRequest;
+import org.jboss.ws.extras.eventing.element.RenewResponse;
+import org.jboss.ws.extras.eventing.element.StatusRequest;
+import org.jboss.ws.extras.eventing.element.StatusResponse;
+import org.jboss.ws.extras.eventing.element.UnsubscribeRequest;
+
/**
* Subscription manager endpoint interface.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/deployment/EventingEndpointDI.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,10 +1,10 @@
package org.jboss.ws.extras.eventing.deployment;
+import java.io.IOException;
+
import org.jboss.ws.common.utils.DOMUtils;
import org.w3c.dom.Element;
-import java.io.IOException;
-
/**
* Eventsource endpoint deployment info.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/DeliveryType.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,9 +23,10 @@
// $Id$
-import javax.xml.soap.SOAPElement;
import java.net.URI;
+import javax.xml.soap.SOAPElement;
+
/**
* A delivery element states where and how to send notifications.
* It can contain an EPR where the notifications should be delivered to:
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/EndpointReference.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,16 +23,16 @@
// $Id$
-import org.w3c.dom.Element;
+import java.net.URI;
+
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
import org.jboss.ws.extras.eventing.EventingConstants;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.soap.SOAPException;
-import java.net.URI;
-
/**
* Simplified endpoint representation.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/FilterType.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,9 +23,10 @@
// $Id$
-import javax.xml.soap.SOAPElement;
import java.net.URI;
+import javax.xml.soap.SOAPElement;
+
/**
* A Boolean expression in some dialect,
* either as a string or as an XML fragment. If the expression evaluates to false
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/StatusRequest.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -22,7 +22,6 @@
package org.jboss.ws.extras.eventing.element;
import javax.xml.soap.SOAPElement;
-// $Id$
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscribeRequest.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,9 +23,10 @@
// $Id$
-import javax.xml.soap.SOAPElement;
import java.util.Date;
+import javax.xml.soap.SOAPElement;
+
/**
* @author Heiko Braun, <heiko(a)openj.net>
* @since 24-Nov-2005
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/SubscriptionEndRequest.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,10 +23,10 @@
// $Id$
+import java.net.URI;
+
import org.jboss.ws.extras.addressing.EndpointReferenceImpl;
-import java.net.URI;
-
/**
* @author Heiko Braun, <heiko(a)openj.net>
* @since 25-Nov-2005
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/element/UnsubscribeRequest.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,9 +23,10 @@
// $Id$
-import javax.xml.soap.SOAPElement;
import java.net.URI;
+import javax.xml.soap.SOAPElement;
+
/**
* @author Heiko Braun, <heiko(a)openj.net>
* @since 19-Dec-2005
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatchJob.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,12 +23,12 @@
// $Id$
-import org.w3c.dom.Element;
-
import java.net.URI;
import java.util.List;
import java.util.concurrent.ConcurrentMap;
+import org.w3c.dom.Element;
+
/**
* Event dispatch job implementation.
*/
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherDelegate.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -3,13 +3,18 @@
import java.net.URI;
import java.util.Properties;
-import javax.naming.*;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.MBeanServerConnection;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
+import org.jboss.ws.common.WSException;
import org.w3c.dom.Element;
-import org.jboss.ws.common.WSException;
/**
* Event dispatching delegate that will be bound to JNDI.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/DispatcherFactory.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,10 +1,11 @@
package org.jboss.ws.extras.eventing.mgmt;
+import java.util.Hashtable;
+
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
-import java.util.Hashtable;
/**
* Creates event dispatcher delegates.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventDispatcher.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,10 +23,10 @@
// $Id$
+import java.net.URI;
+
import org.w3c.dom.Element;
-import java.net.URI;
-
/**
* @author Heiko Braun, <heiko(a)openj.net>
* @since 07-Dec-2005
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/EventingBuilder.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,12 +1,12 @@
package org.jboss.ws.extras.eventing.mgmt;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import org.jboss.ws.common.WSException;
import org.jboss.ws.extras.eventing.EventingConstants;
import org.jboss.ws.extras.eventing.deployment.EventingEndpointDI;
-import java.net.URI;
-import java.net.URISyntaxException;
-
/**
* @author Heiko Braun, <heiko(a)openj.net>
* @since 24-Jan-2006
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/Subscription.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,6 +23,15 @@
// $Id$
+import java.io.ByteArrayInputStream;
+import java.net.URI;
+import java.net.URL;
+import java.util.Date;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.TransformerException;
+
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
import org.jboss.logging.Logger;
@@ -32,16 +41,6 @@
import org.jboss.ws.extras.eventing.element.EndpointReference;
import org.w3c.dom.Element;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPConnectionFactory;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.TransformerException;
-import java.io.ByteArrayInputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Date;
-
/**
* Represents a subscription.
*
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionManager.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -27,9 +27,9 @@
import java.io.StringWriter;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.ArrayList;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -38,9 +38,11 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import javax.management.*;
import org.jboss.logging.Logger;
import org.jboss.util.naming.Util;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/eventing/mgmt/SubscriptionTicket.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -23,11 +23,11 @@
// $Id$
-import org.jboss.ws.extras.eventing.element.EndpointReference;
-
import java.net.URI;
import java.util.Date;
+import org.jboss.ws.extras.eventing.element.EndpointReference;
+
/**
* @author Heiko Braun, <heiko(a)openj.net>
* @since 02-Dec-2005
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/CreateAttachmentVisitor.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,14 +21,14 @@
*/
package org.jboss.ws.extras.xop;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+
import org.jboss.ws.core.soap.SAAJVisitor;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
-import java.util.Iterator;
-import java.io.Writer;
-import java.io.IOException;
-
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id: CreateAttachmentVisitor.java 1408 2006-11-07 13:42:25Z heiko.braun(a)jboss.com $
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/DisableMTOMHandler.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,12 +21,12 @@
*/
package org.jboss.ws.extras.xop;
-import org.jboss.ws.core.jaxrpc.StubExt;
-
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.MessageContext;
+import org.jboss.ws.core.jaxrpc.StubExt;
+
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/RestoreXOPElementVisitor.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,12 +21,12 @@
*/
package org.jboss.ws.extras.xop;
+import java.util.Iterator;
+
import org.jboss.ws.core.soap.SAAJVisitor;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
-import java.util.Iterator;
-
/**
* Visit soap object model and restore XOP contents.
* This visitor is invoked when:
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/XOPContext.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,6 +21,18 @@
*/
package org.jboss.ws.extras.xop;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Iterator;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
@@ -39,13 +51,6 @@
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.*;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Iterator;
-
/**
* XOP context associated with a message context.
* Acts as a facade to the current soap message and supports the various XOP transitions.<p>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/JBossXBContentAdapter.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,6 +21,15 @@
*/
package org.jboss.ws.extras.xop.jaxrpc;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
@@ -36,14 +45,6 @@
import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
import org.jboss.xb.binding.sunday.unmarshalling.UnmarshallingContext;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.namespace.QName;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
/**
* Adopts raw binary contents to java types.
* This class works in conjunction with the <code>XOPUnmarshallerImpl</code>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPMarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,6 +21,10 @@
*/
package org.jboss.ws.extras.xop.jaxrpc;
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.soap.AttachmentPart;
+
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.CommonMessageContext;
@@ -32,10 +36,6 @@
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-
/**
* The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
* soap processing components in order to optimize binary processing.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPScanner.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,11 +21,18 @@
*/
package org.jboss.ws.extras.xop.jaxrpc;
-import org.apache.xerces.xs.*;
-
import java.util.ArrayList;
import java.util.List;
+import org.apache.xerces.xs.XSComplexTypeDefinition;
+import org.apache.xerces.xs.XSElementDeclaration;
+import org.apache.xerces.xs.XSModelGroup;
+import org.apache.xerces.xs.XSObjectList;
+import org.apache.xerces.xs.XSParticle;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.apache.xerces.xs.XSTerm;
+import org.apache.xerces.xs.XSTypeDefinition;
+
/**
* Scans complex type definitions for nested XOP type declarations.
* A XOP type declaration is identified as a complex type
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxrpc/XOPUnmarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,6 +21,14 @@
*/
package org.jboss.ws.extras.xop.jaxrpc;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+
import org.jboss.logging.Logger;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
@@ -29,13 +37,6 @@
import org.jboss.xb.binding.sunday.xop.XOPObject;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
/**
* The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
* soap processing components in order to optimize binary processing.
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,14 +1,14 @@
package org.jboss.ws.extras.xop.jaxws;
+import javax.activation.DataHandler;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+
import org.jboss.ws.common.WSException;
import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.extras.xop.jaxrpc.XOPMarshallerImpl;
+import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
-import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.activation.DataHandler;
-
/**
* Created by IntelliJ IDEA.
* User: hbraun
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -1,13 +1,13 @@
package org.jboss.ws.extras.xop.jaxws;
+import javax.activation.DataHandler;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+
import org.jboss.ws.extras.xop.XOPContext;
import org.jboss.ws.extras.xop.jaxrpc.XOPUnmarshallerImpl;
+import org.jboss.xb.binding.sunday.xop.XOPObject;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-import javax.activation.DataHandler;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-
/**
* Created by IntelliJ IDEA.
* User: hbraun
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/extras/xop/jaxws/ReflectiveXOPScanner.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,10 +21,11 @@
*/
package org.jboss.ws.extras.xop.jaxws;
-import javax.xml.bind.annotation.XmlMimeType;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import javax.xml.bind.annotation.XmlMimeType;
+
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -31,7 +31,6 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.common.umdm.UnifiedMetaData;
import org.jboss.ws.core.server.KernelLocator;
import org.jboss.ws.core.server.ServiceEndpointDeployer;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -35,7 +35,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
* Publish the HTTP service endpoint to Tomcat
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefHandler.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -37,7 +37,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.naming.Util;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.jboss.ws.WSException;
+import org.jboss.ws.common.WSException;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.common.metadata.wsdl.WSDL11DefinitionFactory;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceRefMetaDataAdaptor.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -24,7 +24,6 @@
// $Id$
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.LinkedHashMap;
import javax.xml.namespace.QName;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatContextServlet.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -24,21 +24,11 @@
// $Id$
import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
import java.net.URL;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
import org.jboss.logging.Logger;
import org.jboss.ws.common.WSException;
import org.jboss.ws.core.CommonContextServlet;
-import org.jboss.ws.core.server.ServiceEndpointManager;
import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
/**
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/ToolsUtils.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -32,11 +32,8 @@
import java.math.BigInteger;
import java.net.URI;
import java.rmi.Remote;
-import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
-import java.util.List;
-import java.util.StringTokenizer;
import javax.xml.namespace.QName;
import javax.xml.rpc.holders.ByteArrayHolder;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -22,7 +22,6 @@
package org.jboss.ws.tools.helpers;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -32,15 +31,12 @@
import java.util.Set;
import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.rpc.holders.ByteArrayHolder;
import javax.xml.rpc.holders.Holder;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.WSException;
-import org.jboss.ws.common.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.common.jaxrpc.Style;
import org.jboss.ws.common.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.JavaWsdlMapping;
@@ -54,21 +50,8 @@
import org.jboss.ws.common.metadata.jaxrpcmapping.VariableMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.WsdlMessageMapping;
import org.jboss.ws.common.metadata.jaxrpcmapping.WsdlReturnValueMapping;
-import org.jboss.ws.common.metadata.wsdl.NCName;
import org.jboss.ws.common.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingFault;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationInput;
-import org.jboss.ws.common.metadata.wsdl.WSDLBindingOperationOutput;
-import org.jboss.ws.common.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.common.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.common.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceFault;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperation;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationInput;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutfault;
-import org.jboss.ws.common.metadata.wsdl.WSDLInterfaceOperationOutput;
-import org.jboss.ws.common.metadata.wsdl.WSDLProperty;
import org.jboss.ws.common.metadata.wsdl.WSDLService;
import org.jboss.ws.common.metadata.wsdl.WSDLTypes;
import org.jboss.ws.common.metadata.wsdl.WSDLUtils;
@@ -81,10 +64,8 @@
import org.jboss.ws.common.umdm.FaultMetaData;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.ParameterMetaData;
-import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.WrappedParameter;
import org.jboss.ws.common.utils.JavaUtils;
-import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.tools.JavaToXSD;
import org.jboss.ws.tools.interfaces.JavaToXSDIntf;
import org.jboss.ws.tools.interfaces.SchemaCreatorIntf;
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/helpers/ReformatXML.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -21,15 +21,15 @@
*/
package org.jboss.ws.tools.helpers;
-import org.w3c.dom.Element;
-import org.jboss.ws.common.utils.DOMUtils;
-import org.jboss.ws.common.utils.DOMWriter;
-
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+import org.jboss.ws.common.utils.DOMUtils;
+import org.jboss.ws.common.utils.DOMWriter;
+import org.w3c.dom.Element;
+
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06 10:17:42 UTC (rev 1569)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-06 10:29:48 UTC (rev 1570)
@@ -52,7 +52,6 @@
import org.jboss.ws.common.umdm.FaultMetaData;
import org.jboss.ws.common.umdm.OperationMetaData;
import org.jboss.ws.common.umdm.ParameterMetaData;
-import org.jboss.ws.common.umdm.ServerEndpointMetaData;
import org.jboss.ws.common.umdm.ServiceMetaData;
19 years, 5 months