You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/06/09 15:24:21 UTC

svn commit: r413043 - in /incubator/servicemix/trunk/samples: ./ wsdl-first/ wsdl-first/src/ wsdl-first/src/main/ wsdl-first/src/main/assembly/ wsdl-first/src/main/java/ wsdl-first/src/main/java/org/ wsdl-first/src/main/java/org/apache/ wsdl-first/src/...

Author: gnodet
Date: Fri Jun  9 06:24:20 2006
New Revision: 413043

URL: http://svn.apache.org/viewvc?rev=413043&view=rev
Log:
Example of wsdl-first design with jsr181 component

Added:
    incubator/servicemix/trunk/samples/
    incubator/servicemix/trunk/samples/pom.xml
    incubator/servicemix/trunk/samples/wsdl-first/   (with props)
    incubator/servicemix/trunk/samples/wsdl-first/pom.xml
    incubator/servicemix/trunk/samples/wsdl-first/src/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/assembly/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/assembly/sa.xml
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/wsdl_first/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java
    incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/person.wsdl
    incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/xbean.xml
    incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/META-INF/
    incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/META-INF/jbi.xml

Added: incubator/servicemix/trunk/samples/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/pom.xml?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/pom.xml (added)
+++ incubator/servicemix/trunk/samples/pom.xml Fri Jun  9 06:24:20 2006
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<!-- $Rev: 356052 $ $Date: 2005-12-11 14:41:20 -0800 (dim., 11 déc. 2005) $ -->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>servicemix</artifactId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+  
+  <groupId>org.apache.servicemix.samples</groupId>
+  <artifactId>samples</artifactId>
+  <version>3.0-SNAPSHOT</version>
+  <name>ServiceMix :: Samples</name>
+  <url>http://servicemix.org</url>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>wsdl-first</module>
+  </modules>
+</project>

Propchange: incubator/servicemix/trunk/samples/wsdl-first/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jun  9 06:24:20 2006
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: incubator/servicemix/trunk/samples/wsdl-first/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/wsdl-first/pom.xml?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/wsdl-first/pom.xml (added)
+++ incubator/servicemix/trunk/samples/wsdl-first/pom.xml Fri Jun  9 06:24:20 2006
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    
+    Copyright 2005 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<!-- $Rev: 356052 $ $Date: 2005-12-11 14:41:20 -0800 (dim., 11 déc. 2005) $ -->
+<project
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns="http://maven.apache.org/POM/4.0.0">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.servicemix.samples</groupId>
+        <artifactId>samples</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.saples</groupId>
+    <artifactId>wsdl-first</artifactId>
+    <version>3.0-SNAPSHOT</version>
+
+    <name>ServiceMix :: Samples :: WSDL first</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.sun.xml</groupId>
+            <artifactId>jaxws-rt</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.jws</groupId>
+                    <artifactId>jsr181-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>xfire</groupId>
+            <artifactId>xfire-jsr181-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>jaxws-maven-plugin</artifactId>
+                <version>1.0-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>wsimport</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <wsdlDirectory>
+                        ${basedir}/src/main/resources
+                    </wsdlDirectory>
+                    <wsdlFiles>person.wsdl</wsdlFiles>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptor>src/main/assembly/sa.xml</descriptor>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: incubator/servicemix/trunk/samples/wsdl-first/src/main/assembly/sa.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/wsdl-first/src/main/assembly/sa.xml?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/wsdl-first/src/main/assembly/sa.xml (added)
+++ incubator/servicemix/trunk/samples/wsdl-first/src/main/assembly/sa.xml Fri Jun  9 06:24:20 2006
@@ -0,0 +1,23 @@
+<assembly>
+    <id>sa</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>src/main/sa</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>**/*</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>target</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>*.jar</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+</assembly>
\ No newline at end of file

Added: incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java (added)
+++ incubator/servicemix/trunk/samples/wsdl-first/src/main/java/org/apache/servicemix/samples/wsdl_first/PersonImpl.java Fri Jun  9 06:24:20 2006
@@ -0,0 +1,22 @@
+package org.apache.servicemix.samples.wsdl_first;
+
+import org.apache.servicemix.samples.wsdl_first.types.GetPersonRequest;
+import org.apache.servicemix.samples.wsdl_first.types.GetPersonResponse;
+
+public class PersonImpl implements Person {
+
+    public GetPersonResponse getPerson(GetPersonRequest payload) throws UnknownPersonFault {
+        String personId = payload.getPersonId();
+        if (personId == null || personId.length() == 0) {
+            org.apache.servicemix.samples.wsdl_first.types.UnknownPersonFault fault = new org.apache.servicemix.samples.wsdl_first.types.UnknownPersonFault();
+            fault.setPersonId(personId);
+            throw new UnknownPersonFault(null, fault);
+        }
+        GetPersonResponse response = new GetPersonResponse();
+        response.setPersonId(payload.getPersonId());
+        response.setName("Guillaume");
+        response.setSsn("000-000-0000");
+        return null;
+    }
+
+}

Added: incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/person.wsdl
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/person.wsdl?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/person.wsdl (added)
+++ incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/person.wsdl Fri Jun  9 06:24:20 2006
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions name="wsdl-first"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:tns="http://servicemix.apache.org/samples/wsdl-first"
+	xmlns:typens="http://servicemix.apache.org/samples/wsdl-first/types"
+	targetNamespace="http://servicemix.apache.org/samples/wsdl-first">
+
+	<wsdl:types>
+		<xsd:schema targetNamespace="http://servicemix.apache.org/samples/wsdl-first/types">
+			<xsd:element name="getPersonRequest">
+			    <xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="personId" type="xsd:string"/>
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="getPersonResponse">
+			    <xsd:complexType>
+					<xsd:sequence>
+					    <xsd:element name="personId" type="xsd:string"/>
+						<xsd:element name="ssn" type="xsd:string"/>
+						<xsd:element name="name" type="xsd:string"/>
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="unknownPersonFault">
+			    <xsd:complexType>
+					<xsd:sequence>
+					    <xsd:element name="personId" type="xsd:string"/>
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+		</xsd:schema>
+        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+        targetNamespace="http://servicemix.apache.org/samples/wsdl-first">
+        <xsd:element name="getPersonRequest" type="xsd:string"></xsd:element></xsd:schema>
+    </wsdl:types>
+	
+	<wsdl:message name="getPersonRequest">
+		<wsdl:part name="payload" element="typens:getPersonRequest"/>
+	</wsdl:message>
+	<wsdl:message name="getPersonResponse">
+		<wsdl:part name="payload" element="typens:getPersonResponse"/>
+	</wsdl:message>
+	<wsdl:message name="unknownPersonFault">
+		<wsdl:part name="payload" element="typens:unknownPersonFault"/>
+	</wsdl:message>
+
+    <wsdl:portType name="Person">
+		<wsdl:operation name="getPerson">
+			<wsdl:input message="tns:getPersonRequest"/>
+			<wsdl:output message="tns:getPersonResponse"/>
+			<wsdl:fault name="UnknownPerson" message="tns:unknownPersonFault"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	
+    <wsdl:binding name="PersonSOAPBinding" type="tns:Person">
+    	<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+		<wsdl:operation name="getPerson">
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+			<wsdl:fault name="UnknownPerson">
+				<soap:fault use="literal" name="UnknownPerson" />
+			</wsdl:fault>
+       </wsdl:operation>
+   </wsdl:binding>
+
+	<wsdl:service name="PersonService">
+    	<wsdl:port binding="tns:PersonSOAPBinding" name="soap">
+           <soap:address location="http://www.example.org/" />
+       </wsdl:port>
+   </wsdl:service>
+
+</wsdl:definitions>

Added: incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/xbean.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/xbean.xml?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/xbean.xml (added)
+++ incubator/servicemix/trunk/samples/wsdl-first/src/main/resources/xbean.xml Fri Jun  9 06:24:20 2006
@@ -0,0 +1,10 @@
+<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
+
+    <classpath>
+        <location>.</location>
+    </classpath>
+  
+    <jsr181:endpoint pojoClass="org.apache.servicemix.samples.wsdl_first.PersonImpl"
+                     wsdlResource="classpath:person.wsdl" />
+
+</beans>
\ No newline at end of file

Added: incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/META-INF/jbi.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/META-INF/jbi.xml?rev=413043&view=auto
==============================================================================
--- incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/META-INF/jbi.xml (added)
+++ incubator/servicemix/trunk/samples/wsdl-first/src/main/sa/META-INF/jbi.xml Fri Jun  9 06:24:20 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
+     
+   <service-assembly>
+     <identification>
+       <name>wsdl-first</name>
+       <description>WSDL First</description>
+     </identification>
+     <service-unit>
+       <identification>
+         <name>wsdl-first-su</name>
+         <description>Contains the service</description>
+       </identification>
+       <target>
+         <artifacts-zip>wsdl-first-3.0-SNAPSHOT.jar</artifacts-zip>
+         <component-name>servicemix-jsr181</component-name>
+       </target>
+     </service-unit>
+   </service-assembly>
+    
+</jbi>