Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

infrastructure for services and client

  • Loading branch information...
commit cdcf1a6b10779e1f4d95ec4dbeb94cf6c91964dc 1 parent 0f39a2a
@SoFabian SoFabian authored
Showing with 862 additions and 0 deletions.
  1. +121 −0 .gitignore
  2. +85 −0 ass1/bankclerk-client/pom.xml
  3. +31 −0 ass1/bankclerk-client/src/main/java/at/ac/tuwien/infosys/aic11/HelloBean.java
  4. +17 −0 ass1/bankclerk-client/src/main/java/at/ac/tuwien/infosys/aic11/ServiceUtil.java
  5. +11 −0 ass1/bankclerk-client/src/main/resources/META-INF/beans.xml
  6. +1 −0  ass1/bankclerk-client/src/main/resources/MessageResources.properties
  7. +8 −0 ass1/bankclerk-client/src/main/webapp/META-INF/context.xml
  8. +16 −0 ass1/bankclerk-client/src/main/webapp/WEB-INF/faces-config.xml
  9. +21 −0 ass1/bankclerk-client/src/main/webapp/WEB-INF/jetty-env.xml
  10. +28 −0 ass1/bankclerk-client/src/main/webapp/WEB-INF/templates/template.xhtml
  11. +39 −0 ass1/bankclerk-client/src/main/webapp/WEB-INF/web.xml
  12. +11 −0 ass1/bankclerk-client/src/main/webapp/home.xhtml
  13. +5 −0 ass1/bankclerk-client/src/main/webapp/index.html
  14. +133 −0 ass1/bankclerk-client/src/main/webapp/resources/css/screen.css
  15. +71 −0 ass1/pom.xml
  16. +81 −0 ass1/services/pom.xml
  17. +8 −0 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/main/AllMain.java
  18. +17 −0 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/main/MainUtils.java
  19. +27 −0 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/main/ShippingMain.java
  20. +9 −0 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/services/Shipping.java
  21. +13 −0 ...rc/main/java/at/ac/tuwien/infosys/aic11/services/at/ac/tuwien/infosys/aic11/services/impl/ShippingImpl.java
  22. +109 −0 ass1/services/src/main/resources/registry_service.wsdl
View
121 .gitignore
@@ -0,0 +1,121 @@
+#
+# Licensed to the Austrian Association for Software Tool Integration (AASTI)
+# under one or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information regarding copyright
+# ownership. The AASTI licenses this file to you under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#=================
+#eclipse-workspace
+#=================
+eclipse-workspace
+
+#=================
+#eclipse-project
+#=================
+*.project
+*.classpath
+*.settings
+*bin
+*.springBeans
+*.checkstyle
+.checkstyleCheckerConfig
+*.local.properties
+
+#=================
+#intellij-project
+#=================
+*.iml
+*.ipr
+*.iws
+*classes
+*.idea
+
+#=================
+#netbeans-project
+#=================
+core/workflow/data
+nb-configuration.xml
+nbactions.xml
+
+#=================
+#maven-files
+#=================
+*target
+
+#================
+#log files
+#================
+*engsb.log*
+*velocity.log*
+
+#================
+#runtime productions
+#================
+*activemq-data
+core/config/ui/data
+engsb-edb-core/dump
+package/embedded/*.log
+package/embedded/data/
+
+#================
+#Mac OS X hidden files/folders
+#================
+.DS_Store
+
+#================
+#WinXP hidden files/folders
+#================
+*Thumbs.db
+
+#================
+#Documentation artifacts
+#================
+*.dia~
+
+#================
+#Assembly artifacts
+#================
+*.zip
+
+#================
+#Easy2Find
+#================
+easy2find
+
+#================
+#pver ignores
+#================
+pconf.pyc
+
+#================
+#pax-provision
+#================
+*runner
+
+#================
+#wicket generated files
+#================
+*.tmp_*
+velocity.log*
+
+#================
+#vi tmp files
+#================
+*.swp
+*~
+
+#================
+#clover files
+#================
+.clover
View
85 ass1/bankclerk-client/pom.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>ass1-parent</artifactId>
+ <groupId>at.ac.tuwien.infosys.aic11</groupId>
+ <version>1.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>bankclerk-client</artifactId>
+ <packaging>war</packaging>
+ <name>bankclerk-client</name>
+
+ <properties>
+ <jetty.version>6.1.4</jetty.version>
+ </properties>
+
+ <dependencies>
+
+ <!-- JSF Dependencies -->
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.0.2-b10</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- CDI Dependencies -->
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <version>1.0.1-Final</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Web Services Dependencies -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>at.ac.tuwien.infosys.aic11</groupId>
+ <artifactId>services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+
+ <repositories>
+ <!-- JBoss Repository used for Java EE 6 pieces-->
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
+ </repository>
+ </repositories>
+
+
+ <build>
+ <finalName>bankclerk-client</finalName>
+ <plugins>
+ <!-- Plugin to run and test through maven: mvn jetty:run -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.26</version>
+ <configuration>
+ <!-- automatic redeploy if a file gets changed -->
+ <scanIntervalSeconds>3</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
31 ass1/bankclerk-client/src/main/java/at/ac/tuwien/infosys/aic11/HelloBean.java
@@ -0,0 +1,31 @@
+package at.ac.tuwien.infosys.aic11;
+
+import at.ac.tuwien.infosys.aic11.services.Shipping;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+import javax.xml.ws.WebServiceException;
+
+
+@Named
+@RequestScoped
+public class HelloBean {
+
+ private Shipping shipping;
+
+ @PostConstruct
+ public void lookUpShippingService() {
+ shipping = ServiceUtil.createService("shipping", Shipping.class);
+ }
+
+ public String getMessage() {
+ try {
+ return shipping.sayHi("JSF");
+ } catch (WebServiceException e) {
+ return "WebService not available";
+ }
+ }
+
+
+}
View
17 ass1/bankclerk-client/src/main/java/at/ac/tuwien/infosys/aic11/ServiceUtil.java
@@ -0,0 +1,17 @@
+package at.ac.tuwien.infosys.aic11;
+
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+
+public class ServiceUtil {
+ private ServiceUtil() { }
+
+ public static <S> S createService(String relServicePath, Class<S> serviceType) {
+ JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
+ factory.getInInterceptors().add(new LoggingInInterceptor());
+ factory.getOutInterceptors().add(new LoggingOutInterceptor());
+ factory.setAddress("http://localhost:9000/" + relServicePath);
+ return factory.create(serviceType);
+ }
+}
View
11 ass1/bankclerk-client/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The contents of this file is permitted to be empty.
+ The schema definition is provided for your convenience.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
View
1  ass1/bankclerk-client/src/main/resources/MessageResources.properties
@@ -0,0 +1 @@
+footerText=This text is defined in the MessageResource.properties file
View
8 ass1/bankclerk-client/src/main/webapp/META-INF/context.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- disable storage of sessions across restarts -->
+ <Manager pathname=""/>
+ <Resource name="BeanManager" auth="Container" type="javax.enterprise.inject.spi.BeanManager" factory="org.jboss.weld.resources.ManagerObjectFactory"/>
+ <!-- Uncomment to enable injection into Servlets, Servlet Listeners and Filters in Tomcat -->
+ <!-- <Listener className="org.jboss.weld.environment.tomcat.WeldLifecycleListener"/> -->
+</Context>
View
16 ass1/bankclerk-client/src/main/webapp/WEB-INF/faces-config.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+ <application>
+ <locale-config>
+ </locale-config>
+ <resource-bundle>
+ <base-name>MessageResources</base-name>
+ <var>messages</var>
+ </resource-bundle>
+ </application>
+</faces-config>
View
21 ass1/bankclerk-client/src/main/webapp/WEB-INF/jetty-env.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
+ <New id="beanManager" class="org.mortbay.jetty.plus.naming.Resource">
+ <Arg>
+ <Ref id="webAppCtx" />
+ </Arg>
+ <Arg>BeanManager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.enterprise.inject.spi.BeanManager</Arg>
+ <Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
+ <Arg />
+ </New>
+ </Arg>
+ </New>
+
+</Configure>
+
+
+
View
28 ass1/bankclerk-client/src/main/webapp/WEB-INF/templates/template.xhtml
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<h:head>
+ <title>${project.artifactId} Application</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <h:outputStylesheet name="css/screen.css" />
+</h:head>
+<h:body>
+ <h:panelGroup id="page" layout="block">
+ <h:panelGroup id="header" layout="block">
+ <h1><a href="home.jsf">bankclerk-client</a></h1>
+ </h:panelGroup>
+ <h:panelGroup id="container" layout="block">
+ <h:panelGroup id="sidebar" layout="block">
+ <h1>Sidebar</h1> Content for the sidebar goes here
+ </h:panelGroup>
+ <h:panelGroup id="content" layout="block">
+ <ui:insert name="content">Main Content</ui:insert>
+ </h:panelGroup>
+ </h:panelGroup>
+ <h:panelGroup id="footer" layout="block">#{messages.footerText}<br/>Generated using the Knappsack Java EE Maven Archetypes from <a href="http://www.AndyGibson.net">www.AndyGibson.net</a></h:panelGroup>
+ </h:panelGroup>
+
+</h:body>
+</html>
View
39 ass1/bankclerk-client/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Use this definition if using a Java EE 6 container This also stops
+ Eclipse from complaining that 3.0 is not a valid version <web-app
+ version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ -->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <listener>
+ <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+ </listener>
+ <resource-env-ref>
+ <description>Object factory for the CDI Bean Manager</description>
+ <resource-env-ref-name>BeanManager</resource-env-ref-name>
+ <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
+ </resource-env-ref>
+
+</web-app>
View
11 ass1/bankclerk-client/src/main/webapp/home.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ template="/WEB-INF/templates/template.xhtml">
+ <ui:define name="content">
+ <h1><h:outputText value="Message : #{helloBean.message}" /></h1>
+ <h2>test</h2>
+ </ui:define>
+</ui:composition>
View
5 ass1/bankclerk-client/src/main/webapp/index.html
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.jsf">
+</head>
+</html>
View
133 ass1/bankclerk-client/src/main/webapp/resources/css/screen.css
@@ -0,0 +1,133 @@
+body {
+ margin: 0;
+ padding: 0;
+ background-color: #EAECEE;
+ font-family: Verdana, sans-serif;
+ font-size: 10px;
+}
+
+#header {
+ height: 120px;
+ border-bottom: 3px solid #c0c0c0;
+ background: #204080;
+ text-align: center;
+ color: #f0f0f0;
+ margin: 0;
+ padding: 0;
+}
+
+#header h1 {
+ padding-top: 24px;
+ font-size: 250%;
+}
+
+#header a {
+ color : #f0f0f0;
+}
+
+#page {
+ background: #ffffff;
+ width: 960px;
+ margin-left: auto;
+ margin-right: auto;
+ border-right: solid 2px #a0a0a0;
+ border-bottom: solid 2px #a0a0a0;
+}
+
+#sidebar {
+ float: right;
+ width: 200px;
+ border: 1px solid #d0d0d0;
+ min-height: 240px;
+ padding: 4px;
+}
+
+#sidebar h1 {
+ display: block;
+ font-size: 120%;
+ border-bottom: 1px solid #d0d0d0;
+}
+
+#container {
+ padding: 8px;
+}
+
+#content {
+ min-height: 320px;
+ font-size: 120%;
+ width: 720px;
+}
+
+#footer {
+ text-align: center;
+ padding: 8px;
+ margin: 8px;
+ border-top: 1px solid #c0c0c0;
+ clear : both;
+}
+
+.panel {
+ border: 1px solid #d0d0d0;
+ padding: 8px;
+ margin: 8px 4px 16px 4px;
+ background: #fafafa;
+}
+
+.panel h1 {
+ font-size: 120%;
+ display: block;
+ background: #f0f0f0;
+ padding: 6px;
+ margin: -8px;
+ border-bottom: 1px solid #d0d0d0;
+ margin-bottom: 8px;
+}
+
+.odd {
+ background: #f0f0f0;
+}
+
+.even {
+ background: #ffffff;
+}
+
+.dataTable {
+ border-collapse: collapse;;
+ width: 100%;
+}
+
+.dataTable th {
+ background: #204080;
+ color: #f0f0f0;
+ padding: 6px;
+ border: 1px solid #f0f0f0;
+}
+
+.dataTable td {
+ border: 1px solid #d0d0d0;
+ padding: 4px;
+}
+
+.caption {
+ float: left;
+ width: 100px;
+}
+
+.formCaption {
+ float: left;
+ width: 100px;
+ padding-top: 4px;
+}
+
+.value {
+ margin-right: 8px;
+}
+
+.errorMessage {
+ color: #ff0000;
+ font-weight: bold;
+}
+
+.property {
+ margin-bottom: 12px;
+}
View
71 ass1/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>at.ac.tuwien.infosys.aic11</groupId>
+ <artifactId>ass1-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0</version>
+ <modules>
+ <module>services</module>
+ <module>bankclerk-client</module>
+ </modules>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <cxf.version>2.4.3</cxf.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- maybe we need some dependency from there -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-parent</artifactId>
+ <version>${cxf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <wtpversion>2.0</wtpversion>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
View
81 ass1/services/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <relativePath>..</relativePath>
+ <artifactId>ass1-parent</artifactId>
+ <groupId>at.ac.tuwien.infosys.aic11</groupId>
+ <version>1.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>services</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ <!-- Jetty is needed if you're using the CXFServlet -->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http-jetty</artifactId>
+ <version>${cxf.version}</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>shipping</id>
+ <build>
+ <defaultGoal>test</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>at.ac.tuwien.infosys.aic11.main.ShippingMain</mainClass>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>all</id>
+ <build>
+ <defaultGoal>test</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>at.ac.tuwien.infosys.aic11.main.AllMain</mainClass>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
View
8 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/main/AllMain.java
@@ -0,0 +1,8 @@
+package at.ac.tuwien.infosys.aic11.main;
+
+public class AllMain {
+ public static void main(String[] args) {
+ ShippingMain.startShippingService();
+ MainUtils.exitOnUserInput();
+ }
+}
View
17 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/main/MainUtils.java
@@ -0,0 +1,17 @@
+package at.ac.tuwien.infosys.aic11.main;
+
+import java.io.IOException;
+
+public class MainUtils {
+ private MainUtils() { }
+
+ public static void exitOnUserInput() {
+ System.out.println("Press any button to exit...");
+ try {
+ System.in.read();
+ } catch (IOException e) {
+ }
+ System.out.println("Closing service");
+ System.exit(0);
+ }
+}
View
27 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/main/ShippingMain.java
@@ -0,0 +1,27 @@
+package at.ac.tuwien.infosys.aic11.main;
+
+import at.ac.tuwien.infosys.aic11.services.Shipping;
+import at.ac.tuwien.infosys.aic11.services.at.ac.tuwien.infosys.aic11.services.impl.ShippingImpl;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+
+public class ShippingMain {
+ public static void main(String[] args) {
+ startShippingService();
+ MainUtils.exitOnUserInput();
+ }
+
+ public static void startShippingService() {
+ System.out.println("Starting Shipping Service...");
+ ShippingImpl shippingImpl = new ShippingImpl();
+ JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
+ svrFactory.setServiceClass(Shipping.class);
+ svrFactory.setAddress("http://localhost:9000/shipping");
+ svrFactory.setServiceBean(shippingImpl);
+ svrFactory.getInInterceptors().add(new LoggingInInterceptor());
+ svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
+ svrFactory.create();
+ System.out.println("Shipping Service created.");
+ }
+}
View
9 ass1/services/src/main/java/at/ac/tuwien/infosys/aic11/services/Shipping.java
@@ -0,0 +1,9 @@
+package at.ac.tuwien.infosys.aic11.services;
+
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+@WebService
+public interface Shipping {
+ String sayHi(@WebParam(name = "text") String text);
+}
View
13 .../tuwien/infosys/aic11/services/at/ac/tuwien/infosys/aic11/services/impl/ShippingImpl.java
@@ -0,0 +1,13 @@
+package at.ac.tuwien.infosys.aic11.services.at.ac.tuwien.infosys.aic11.services.impl;
+
+import at.ac.tuwien.infosys.aic11.services.Shipping;
+
+import javax.jws.WebParam;
+
+public class ShippingImpl implements Shipping {
+
+ @Override
+ public String sayHi(String text) {
+ return "Hi, " + text;
+ }
+}
View
109 ass1/services/src/main/resources/registry_service.wsdl
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<wsdl:definitions name="Registry_Service" targetNamespace="http://services.aic11.infosys.tuwien.ac.at/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://services.aic11.infosys.tuwien.ac.at/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<wsdl:types>
+ <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://services.aic11.infosys.tuwien.ac.at/" xmlns:tns="http://services.aic11.infosys.tuwien.ac.at/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="bank_transfer" type="tns:bankTransfer"/>
+ <xs:element name="cheque" type="tns:cheque"/>
+ <xs:element name="disbursement_preference" type="tns:disbursementPreference"/>
+ <xs:element name="query" type="tns:query"/>
+ <xs:element name="queryResponse" type="tns:queryResponse"/>
+ <xs:element name="wsdl_endpoint" type="tns:wsdlEndpoint"/>
+
+ <xs:complexType name="query">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="tns:disbursementPreference"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType abstract="true" name="disbursementPreference">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="bankTransfer">
+ <xs:complexContent>
+ <xs:extension base="tns:disbursementPreference">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="bankName" type="xs:string"/>
+ <xs:element minOccurs="0" name="bic" type="xs:string"/>
+ <xs:element minOccurs="0" name="iban" type="xs:string"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="cheque">
+ <xs:complexContent>
+ <xs:extension base="tns:disbursementPreference">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="name" type="xs:string"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="queryResponse">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="tns:wsdlEndpoint"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="wsdlEndpoint">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="location" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="invalid_parameter">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:element name="invalid_parameter" type="tns:invalid_parameter"/>
+ </xs:schema>
+</wsdl:types>
+
+<wsdl:message name="InvalidParameterException">
+ <wsdl:part element="tns:invalid_parameter" name="InvalidParameterException">
+ </wsdl:part>
+</wsdl:message>
+<wsdl:message name="query">
+ <wsdl:part element="tns:query" name="parameters">
+ </wsdl:part>
+</wsdl:message>
+<wsdl:message name="queryResponse">
+ <wsdl:part element="tns:queryResponse" name="parameters">
+ </wsdl:part>
+</wsdl:message>
+
+<wsdl:portType name="IRegistryService">
+ <wsdl:operation name="query">
+ <wsdl:input message="tns:query" name="query">
+ </wsdl:input>
+ <wsdl:output message="tns:queryResponse" name="queryResponse">
+ </wsdl:output>
+ <wsdl:fault message="tns:InvalidParameterException" name="InvalidParameterException">
+ </wsdl:fault>
+ </wsdl:operation>
+</wsdl:portType>
+
+<wsdl:binding name="Registry_ServiceSoapBinding" type="tns:IRegistryService">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="query">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="query">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="queryResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="InvalidParameterException">
+ <soap:fault name="InvalidParameterException" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+</wsdl:binding>
+
+<wsdl:service name="Registry_Service">
+ <wsdl:port binding="tns:Registry_ServiceSoapBinding" name="Registry_Service">
+ <soap:address location="http://vc.infosys.tuwien.ac.at:8092/registry"/>
+ </wsdl:port>
+</wsdl:service>
+</wsdl:definitions>
Please sign in to comment.
Something went wrong with that request. Please try again.