Author: dkulp
Date: Mon Aug 20 18:05:14 2012
New Revision: 1375152

URL: http://svn.apache.org/viewvc?rev=1375152&view=rev
Log:
Start work on a basic ws-discover sample

Added:
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/pom.xml
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/discovery/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/discovery/Client.java
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/pom.xml
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/discovery/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/discovery/hello_world.wsdl
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/pom.xml
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/pom.xml
    cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/GreeterImpl.java
    
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/Main.java

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/pom.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/pom.xml?rev=1375152&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/pom.xml 
(added)
+++ cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/pom.xml 
Mon Aug 20 18:05:14 2012
@@ -0,0 +1,54 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF 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.
+-->
+<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>org.apache.cxf.samples.wsdiscovery</groupId>
+    <artifactId>wsdiscovery-client</artifactId>
+    <packaging>jar</packaging>
+    <name>WS-Discovery Sample - Client</name>
+    <description>WS-Discovery Sample - Client</description>
+    <version>2.7.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.apache.cxf.samples.wsdiscovery</groupId>
+        <artifactId>cxf-samples-wsdiscovery</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+    </parent>
+    <properties>
+        <cxf.version>${project.version}</cxf.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.ws-discovery</groupId>
+            <artifactId>cxf-services-ws-discovery-api</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.samples.wsdiscovery</groupId>
+            <artifactId>wsdiscovery-common</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/discovery/Client.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/discovery/Client.java?rev=1375152&view=auto
==============================================================================
--- 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/discovery/Client.java
 (added)
+++ 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/client/src/main/java/org/apache/cxf/samples/discovery/Client.java
 Mon Aug 20 18:05:14 2012
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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.
+ */
+
+package org.apache.cxf.samples.discovery;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.EndpointReference;
+
+import org.apache.cxf.hello_world.discovery.Greeter;
+import org.apache.cxf.hello_world.discovery.GreeterService;
+import org.apache.cxf.ws.discovery.WSDiscoveryClient;
+
+/**
+ * 
+ */
+public final class Client {
+
+    /**
+     * 
+     */
+    public Client() {
+        // TODO Auto-generated constructor stub
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) throws Exception {
+        
+        WSDiscoveryClient client = new WSDiscoveryClient();
+        List<EndpointReference> references = client.probe(new 
QName("http://cxf.apache.org/hello_world/discovery";, "Greeter", "tp"));
+        client.close();
+        
+        GreeterService service = new GreeterService();
+        for (EndpointReference ref : references) {
+            Greeter g = service.getPort(ref, Greeter.class);
+            System.out.println(g.greetMe("World"));
+        }       
+    }
+
+}

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/pom.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/pom.xml?rev=1375152&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/pom.xml 
(added)
+++ cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/pom.xml 
Mon Aug 20 18:05:14 2012
@@ -0,0 +1,83 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF 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.
+-->
+<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>org.apache.cxf.samples.wsdiscovery</groupId>
+    <artifactId>wsdiscovery-common</artifactId>
+    <packaging>jar</packaging>
+    <name>WS-Discovery Sample - Common Stuff</name>
+    <description>WS-Discovery Sample - Common Stuff</description>
+    <version>2.7.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.apache.cxf.samples.wsdiscovery</groupId>
+        <artifactId>cxf-samples-wsdiscovery</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+    </parent>
+    <properties>
+        <cxf.version>${project.version}</cxf.version>
+        <cxf.xjc-utils.version>2.6.0</cxf.xjc-utils.version>
+        <cxf.release.base>${basedir}/../..</cxf.release.base>
+    </properties>
+    <build>
+        <defaultGoal>install</defaultGoal>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <configuration>
+                        <source>1.6</source>
+                        <target>1.6</target>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-codegen-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <id>generate-sources</id>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <wsdlOptions>
+                                <wsdlOption>
+                                    
<wsdl>src/main/resources/org/apache/cxf/hello_world/discovery/hello_world.wsdl</wsdl>
+                                </wsdlOption>
+                            </wsdlOptions>
+                        </configuration>
+                        <goals>
+                            <goal>wsdl2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/discovery/hello_world.wsdl
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/discovery/hello_world.wsdl?rev=1375152&view=auto
==============================================================================
--- 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/discovery/hello_world.wsdl
 (added)
+++ 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/common/src/main/resources/org/apache/cxf/hello_world/discovery/hello_world.wsdl
 Mon Aug 20 18:05:14 2012
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF 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.
+-->
+
+<definitions name="HelloWorld"
+            xmlns="http://schemas.xmlsoap.org/wsdl/";
+            xmlns:tns="http://cxf.apache.org/hello_world/discovery";
+            xmlns:x1="http://cxf.apache.org/hello_world/discovery/types";
+            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+            targetNamespace="http://cxf.apache.org/hello_world/discovery";
+            xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";>
+    <wsdl:types>
+       <schema 
targetNamespace="http://cxf.apache.org/hello_world/discovery/types"; 
+               xmlns="http://www.w3.org/2001/XMLSchema"; 
+               xmlns:x1="http://cxf.apache.org/hello_world/discovery/types"; 
+               elementFormDefault="qualified">
+           <simpleType name="MyStringType">
+               <restriction base="string">
+                   <maxLength value="30" />
+               </restriction>
+           </simpleType>
+
+           <element name="sayHi">
+               <complexType/>
+           </element>
+           <element name="sayHiResponse">
+               <complexType>
+                   <sequence>
+                       <element name="responseType" type="string"/>
+                   </sequence>
+               </complexType>
+           </element>
+            <element name="greetMe">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="x1:MyStringType"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeOneWay">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+           <element name="pingMe">
+               <complexType/>
+           </element>
+           <element name="pingMeResponse">
+               <complexType/>
+           </element>
+           <element name="faultDetail">
+               <complexType>
+                   <sequence>
+                       <element name="minor" type="short"/>
+                       <element name="major" type="short"/>
+                   </sequence>
+                </complexType>
+           </element>
+        </schema>
+    </wsdl:types>
+
+    <wsdl:message name="sayHiRequest">
+        <wsdl:part name="in" element="x1:sayHi"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part name="out" element="x1:sayHiResponse"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeRequest">
+        <wsdl:part element="x1:greetMe" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeResponse">
+        <wsdl:part element="x1:greetMeResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeOneWayRequest">
+        <wsdl:part element="x1:greetMeOneWay" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeRequest">
+       <wsdl:part name="in" element="x1:pingMe"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeResponse">
+        <wsdl:part name="out" element="x1:pingMeResponse"/>
+    </wsdl:message>            
+    <wsdl:message name="pingMeFault">
+       <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+    </wsdl:message>
+
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="sayHi">
+            <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+            <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+        </wsdl:operation>
+        <wsdl:operation name="greetMe">
+            <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+            <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <wsdl:input message="tns:greetMeOneWayRequest" 
name="greetMeOneWayRequest"/>
+        </wsdl:operation>
+       <wsdl:operation name="pingMe">
+           <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+           <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+           <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+        </wsdl:operation> 
+    </wsdl:portType>
+
+    <wsdl:binding name="GreeterBinding" type="tns:Greeter">
+       <soap12:binding 
transport="http://www.w3.org/2003/05/soap/bindings/HTTP/"; style="document" />
+       <operation name="sayHi">
+           <soap12:operation style="document" soapAction=""/>
+           <input>
+               <soap12:body use="literal" />
+           </input>
+           <output>
+               <soap12:body use="literal" />
+           </output>
+       </operation>
+        <wsdl:operation name="greetMe">
+            <soap12:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeRequest">
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="greetMeResponse">
+                <soap12:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <soap12:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeOneWayRequest">
+                <soap12:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+       <operation name="pingMe">
+           <soap12:operation style="document"/>
+           <input>
+                <soap12:body use="literal"/>
+            </input>
+            <output>
+                <soap12:body use="literal"/>
+            </output>
+            <fault name="pingMeFault">
+                <soap12:fault name="pingMeFault" use="literal"/>
+            </fault>
+        </operation>
+    </wsdl:binding>
+
+    <wsdl:service name="GreeterService">
+        <wsdl:port name="GreeterPort" binding="tns:GreeterBinding">
+            <soap12:address location="http://localhost:9000/GreeterURL"/>
+        </wsdl:port>
+    </wsdl:service>
+</definitions>

Added: cxf/trunk/distribution/src/main/release/samples/ws-discovery/pom.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/pom.xml?rev=1375152&view=auto
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws-discovery/pom.xml (added)
+++ cxf/trunk/distribution/src/main/release/samples/ws-discovery/pom.xml Mon 
Aug 20 18:05:14 2012
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF 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.
+-->
+<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>org.apache.cxf.samples.wsdiscovery</groupId>
+    <artifactId>cxf-samples-wsdiscovery</artifactId>
+    <packaging>pom</packaging>
+    <name>WS-Discovery Sample</name>
+    <description>WS-Discovery Sample</description>
+    <version>2.7.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.apache.cxf.samples</groupId>
+        <artifactId>cxf-samples</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+    </parent>
+    <modules>
+        <module>common</module>
+        <module>service</module>
+        <module>client</module>
+    </modules>
+</project>

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/pom.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/pom.xml?rev=1375152&view=auto
==============================================================================
--- 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/pom.xml 
(added)
+++ 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/pom.xml 
Mon Aug 20 18:05:14 2012
@@ -0,0 +1,59 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF 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.
+-->
+<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>org.apache.cxf.samples.wsdiscovery</groupId>
+    <artifactId>wsdiscovery-service</artifactId>
+    <packaging>jar</packaging>
+    <name>WS-Discovery Sample - Service </name>
+    <description>WS-Discovery Sample - Service</description>
+    <version>2.7.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.apache.cxf.samples.wsdiscovery</groupId>
+        <artifactId>cxf-samples-wsdiscovery</artifactId>
+        <version>2.7.0-SNAPSHOT</version>
+    </parent>
+    <properties>
+        <cxf.version>${project.version}</cxf.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.ws-discovery</groupId>
+            <artifactId>cxf-services-ws-discovery-api</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.ws-discovery</groupId>
+            <artifactId>cxf-services-ws-discovery-service</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.samples.wsdiscovery</groupId>
+            <artifactId>wsdiscovery-common</artifactId>
+            <version>2.7.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/GreeterImpl.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/GreeterImpl.java?rev=1375152&view=auto
==============================================================================
--- 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/GreeterImpl.java
 (added)
+++ 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/GreeterImpl.java
 Mon Aug 20 18:05:14 2012
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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.
+ */
+
+package org.apache.cxf.samples.discovery;
+
+import javax.jws.WebService;
+
+
+import org.apache.cxf.hello_world.discovery.Greeter;
+import org.apache.cxf.hello_world.discovery.PingMeFault;
+
+/**
+ * 
+ */
+@WebService(endpointInterface = "org.apache.cxf.hello_world.discovery.Greeter",
+    wsdlLocation = 
"classpath:/org/apache/cxf/hello_world/discovery/hello_world.wsdl",
+    targetNamespace = "http://cxf.apache.org/hello_world/discovery";,
+    serviceName = "GreeterService",
+    portName = "GreeterPort",
+    name = "GreeterPort")
+public class GreeterImpl implements Greeter {
+    int port;
+    public GreeterImpl(int port) {
+        this.port = port;
+    }
+
+    public void pingMe() throws PingMeFault {
+
+    }
+
+    public String sayHi() {
+        return null;
+    }
+
+    public void greetMeOneWay(String requestType) {
+
+    }
+
+    public String greetMe(String requestType) {
+        return "Hello " + requestType + " from port " + port + "!";
+    }
+
+}

Added: 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/Main.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/Main.java?rev=1375152&view=auto
==============================================================================
--- 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/Main.java
 (added)
+++ 
cxf/trunk/distribution/src/main/release/samples/ws-discovery/service/src/main/java/org/apache/cxf/samples/discovery/Main.java
 Mon Aug 20 18:05:14 2012
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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.
+ */
+
+package org.apache.cxf.samples.discovery;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+
+import javax.xml.ws.Endpoint;
+
+/**
+ * 
+ */
+public class Main {
+
+    public Main() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public static void main(String[] args) throws Exception {
+        //find a randomish port to use
+        ServerSocket sock = new ServerSocket();
+        InetSocketAddress s = new 
InetSocketAddress(InetAddress.getLocalHost(), 0);
+        sock.bind(s);
+        int port = sock.getLocalPort();
+        sock.close();
+        
+        String address = "http://localhost:"; + port + "/Greeter";
+        System.out.println("Publishing on " + address);
+        Endpoint.publish(address, new GreeterImpl(port));
+    }
+}


Reply via email to