Mercurial > hg > digilibservice
changeset 0:6a163b1bcd4d
first checkin
author | casties |
---|---|
date | Thu, 05 May 2011 16:19:03 +0200 |
parents | |
children | 8f5216c9d623 |
files | .hgignore pom.xml src/main/java/info/textgrid/rest.java src/main/webapp/WEB-INF/DigilibService.wsdl src/main/webapp/WEB-INF/beans.xml src/main/webapp/WEB-INF/web.xml src/main/webapp/index.jsp |
diffstat | 7 files changed, 239 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Thu May 05 16:19:03 2011 +0200 @@ -0,0 +1,7 @@ + +syntax: regexp +^target$ +syntax: regexp +^\.classpath$ +syntax: regexp +^\.project$ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pom.xml Thu May 05 16:19:03 2011 +0200 @@ -0,0 +1,70 @@ +<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"> + <modelVersion>4.0.0</modelVersion> + <groupId>info.textgrid</groupId> + <artifactId>digilibservice</artifactId> + <packaging>war</packaging> + <version>1.0-SNAPSHOT</version> + <name>digilibservice Maven Webapp</name> + <url>http://maven.apache.org</url> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <cxf.version>2.3.3</cxf.version> +<jetty.version>6.1.15</jetty.version> + </properties> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf</artifactId> + <version>${cxf.version}</version> + <type>pom</type> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxrs</artifactId> + <version>${cxf.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxws</artifactId> + <version>${cxf.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http</artifactId> + <version>${cxf.version}</version> + </dependency> + </dependencies> + <build> + <finalName>digilibservice</finalName> + <plugins> + <plugin> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-codegen-plugin</artifactId> + <version>${cxf.version}</version> + <executions> + <execution> + <id>generate-digilibservice-sources</id> + <phase>generate-sources</phase> + <configuration> + <wsdlOptions> + <wsdlOption> + <wsdl>src/main/webapp/WEB-INF/DigilibService.wsdl</wsdl> + </wsdlOption> + </wsdlOptions> + </configuration> + <goals> + <goal>wsdl2java</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/info/textgrid/rest.java Thu May 05 16:19:03 2011 +0200 @@ -0,0 +1,33 @@ +package info.textgrid; + +import info.textgrid.namespaces.middleware.digilib.services.digilibservice.DigilibService; + +import javax.jws.WebService; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.xml.ws.Holder; + +@WebService(targetNamespace = "http://textgrid.info/namespaces/middleware/digilib/services/DigilibService", + serviceName="DigilibService", portName="DigilibServiceSOAP", + endpointInterface="info.textgrid.namespaces.middleware.digilib.services.digilibservice.DigilibService") +public class rest implements DigilibService { + + + + @GET + @Path("/hello") + @Produces("text/plain") + public String getVersion() { + return "hello"; + } + + @Override + public void getScaledImage(String sessionId, String uri, + String logParameter, Holder<String> mimeType, + Holder<byte[]> imageData) { + // TODO Auto-generated method stub + + } + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/WEB-INF/DigilibService.wsdl Thu May 05 16:19:03 2011 +0200 @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://textgrid.info/namespaces/middleware/digilib/services/DigilibService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DigilibService" targetNamespace="http://textgrid.info/namespaces/middleware/digilib/services/DigilibService"> + <wsdl:types> + <xsd:schema targetNamespace="http://textgrid.info/namespaces/middleware/digilib/services/DigilibService"> + <xsd:element name="getScaledImage"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="sessionId" type="xsd:string" /> + <xsd:element name="uri" type="xsd:anyURI"></xsd:element> + <xsd:element name="logParameter" type="xsd:string"></xsd:element> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getScaledImageResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="mimeType" type="xsd:string" /> + <xsd:element name="imageData" type="xsd:base64Binary"></xsd:element> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="getScaledImageRequest"> + <wsdl:part element="tns:getScaledImage" name="parameters"/> + </wsdl:message> + <wsdl:message name="getScaledImageResponse"> + <wsdl:part element="tns:getScaledImageResponse" name="parameters"/> + </wsdl:message> + <wsdl:portType name="DigilibService"> + <wsdl:operation name="getScaledImage"> + <wsdl:input message="tns:getScaledImageRequest"/> + <wsdl:output message="tns:getScaledImageResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="DigilibServiceSOAP" type="tns:DigilibService"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="getScaledImage"> + <soap:operation soapAction="http://textgrid.info/namespaces/middleware/digilib/services/DigilibService/NewOperation"/> + <wsdl:input> + <soap:body use="literal"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="DigilibService"> + <wsdl:port binding="tns:DigilibServiceSOAP" name="DigilibServiceSOAP"> + <soap:address location="http://localhost:8080/digilib_service/DigilibService"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/WEB-INF/beans.xml Thu May 05 16:19:03 2011 +0200 @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:jaxws="http://cxf.apache.org/jaxws" + xmlns:jaxrs="http://cxf.apache.org/jaxrs" + xsi:schemaLocation=" +http://www.springframework.org/schema/beans +http://www.springframework.org/schema/beans/spring-beans.xsd +http://cxf.apache.org/jaxws +http://cxf.apache.org/schemas/jaxws.xsd +http://cxf.apache.org/jaxrs +http://cxf.apache.org/schemas/jaxrs.xsd +"> + + <description> + Configuration digilibservice + </description> + + <import resource="classpath:META-INF/cxf/cxf.xml"/> + <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /> + <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/> + <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> + + <!-- Here the REST-Service Endpoint Beans --> + <bean id="rest" class="info.textgrid.rest"> + </bean> + + <jaxws:endpoint id="digilibservice" wsdlLocation="/WEB-INF/DigilibService.wsdl" + implementor="#rest" address="/service"> + </jaxws:endpoint> + + <!-- Rest-Endpoint Configuration --> + <jaxrs:server id="root" address="/rest"> + <jaxrs:serviceBeans> + <ref bean="rest" /> + </jaxrs:serviceBeans> + </jaxrs:server> + +</beans>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/WEB-INF/web.xml Thu May 05 16:19:03 2011 +0200 @@ -0,0 +1,32 @@ +<!DOCTYPE web-app PUBLIC + "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd" > + +<web-app> + + <display-name>TGSearch Webservice - public instance</display-name> + + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value>WEB-INF/beans.xml</param-value> + </context-param> + <listener> + <listener-class> + org.springframework.web.context.ContextLoaderListener + </listener-class> + </listener> + + <servlet> + <servlet-name>CXFServlet</servlet-name> + <display-name>CXF Servlet</display-name> + <servlet-class> + org.apache.cxf.transport.servlet.CXFServlet + </servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>CXFServlet</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> +</web-app>