Skip to content

Commit 66ac3b5

Browse files
committed
Refactored the long package names
1 parent 303679c commit 66ac3b5

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

examples/java-soap/run_service.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
mkdir -p "build" && \
33
echo "Building services..." && \
4-
javac -d "build" -classpath "build" $(echo `pwd`)/src/org/cackharot/services/HelloService.java && \
5-
javac -d "build" -classpath "build" $(echo `pwd`)/src/org/cackharot/services/publisher/HelloServicePublisher.java && \
6-
java -classpath "build" org.cackharot.services.publisher.HelloServicePublisher
4+
javac -d "build" -classpath "build" $(echo `pwd`)/src/org/HelloService.java && \
5+
javac -d "build" -classpath "build" $(echo `pwd`)/src/org/HelloServicePublisher.java && \
6+
java -classpath "build" org.HelloServicePublisher

examples/java-soap/src/org/cackharot/services/HelloService.java renamed to examples/java-soap/src/org/HelloService.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
package org.cackharot.services;
1+
package org;
22

33
import javax.jws.WebMethod;
44
import javax.jws.WebService;
55

66
@WebService
77
public class HelloService {
8-
private String message = new String("Hello, ");
9-
10-
public void Hello() {}
11-
128
@WebMethod
139
public String sayHello(String name) {
14-
return message + name + ".";
10+
return String.format("Hello, %s!", name);
1511
}
1612

1713
@WebMethod
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
package org.cackharot.services.publisher;
1+
package org;
2+
3+
import org.HelloService;
24

35
import com.sun.net.httpserver.BasicAuthenticator;
46
import com.sun.net.httpserver.HttpContext;
57
import com.sun.net.httpserver.HttpServer;
6-
import org.cackharot.services.HelloService;
78

8-
import javax.xml.ws.Binding;
99
import javax.xml.ws.Endpoint;
10-
import javax.xml.ws.handler.Handler;
11-
import javax.xml.ws.handler.MessageContext;
1210
import java.io.IOException;
1311
import java.net.InetSocketAddress;
14-
import java.util.ArrayList;
15-
import java.util.List;
1612

1713
public class HelloServicePublisher {
1814
public static void main(String[] args) throws IOException {
@@ -39,5 +35,4 @@ private static void printInfo(String url) {
3935
System.out.println(String.format("Starting the service at %s", url));
4036
System.out.println(String.format("See WSDL at %s?wsdl", url));
4137
}
42-
4338
}

0 commit comments

Comments
 (0)