1 ################################################################################
2 # Configuration section
3 ################################################################################
5 ## Webservice address information
7 # Information about the location of the webservice. It will be used when
8 # generating the client stubs from the WSDL files.
10 SERVICEHOST
= amigos30.diku.dk
12 SERVICEPATH
= axis
/services
14 SERVICELOCATION
= http
://$(SERVICEHOST
):$(SERVICEPORT
)/$(SERVICEPATH
)
16 ## Webservice admin service information
18 # Information about the location and credentials for accessing the
19 # webservice framework with the AdminClient. Test the information using
20 # the deploy-test rule, which will try to contact the server and list
21 # the available webservices.
23 # To use the AdminClient program's default values, leave the variables
26 ADMINHOST
= amigos30.diku.dk
31 ## Location of the server class files
33 # The host and path specifying where the web service application
34 # infrastructure classes should be deployed. Note, that scp is used for
35 # this, so the DEPLOYLOCATION variable should hold a valid scp location.
37 # Leave DEPLOYHOST empty to deploy files locally.
39 DEPLOYHOST
= remote-server
40 DEPLOYPATH
= /opt
/apache-tomcat-5.5
.12/webapps
/axis
/WEB-INF
/classes
/
43 DEPLOYLOCATION
= $(DEPLOYHOST
)$(if
$(DEPLOYHOST
),:)$(DEPLOYPATH
)
45 ################################################################################
47 ################################################################################
58 CLIENTSRCDIR
= $(BUILDDIR
)/src
59 SERVERBINDIR
= $(BUILDDIR
)/server
60 CLIENTBINDIR
= $(BUILDDIR
)/client
61 WSDLDIR
= $(BUILDDIR
)/wsdl
63 CLASSPATH
= $(shell find
$(PWD
)/$(LIBDIR
) -name
"*.jar" | tr
'\n' ':')$(PWD
)/$(SERVERJAR
)
66 JAVA2WSDL
= $(JAVA
) org.apache.axis.wsdl.Java2WSDL
67 WSDL2JAVA
= $(JAVA
) org.apache.axis.wsdl.WSDL2Java
68 ADMINCLIENT
= $(JAVA
) org.apache.axis.client.AdminClient
70 SERVERSRC
= $(shell find
$(SERVERSRCDIR
) -name
"*.java")
71 SERVERJAR
= $(LIBDIR
)/remote-ws-server.jar
73 WSDDFILES
= $(shell find
$(WSDDDIR
) -name
"*.wsdd")
74 SERVICES
= $(patsubst $(WSDDDIR
)/%.wsdd
,%,$(WSDDFILES
))
76 WSDLFILES
= $(patsubst %,$(WSDLDIR
)/%.wsdl
,$(SERVICES
))
77 CLIENTSRC
= $(patsubst %,$(CLIENTSRCDIR
)/%-stamp
,$(SERVICES
))
78 CLIENTJAR
= $(LIBDIR
)/remote-ws-client.jar
85 $(RM
) -r
$(BUILDDIR
) $(SERVERJAR
) $(CLIENTJAR
)
87 ## Rules for building the server and client class files
89 # This requires the immediate step of building WSDL files from the
90 # server Java classes. The client Java classes is then generated from
94 client-src
: $(CLIENTSRC
)
98 $(SERVERJAR
): $(SERVERSRC
)
99 @
$(RM
) -r
$(SERVERBINDIR
)
100 @mkdir
-p
$(SERVERBINDIR
)
101 $(COMPILE
) -d
$(SERVERBINDIR
) $(SERVERSRC
)
102 $(JAR
) cf
$@
-C
$(SERVERBINDIR
) .
104 $(CLIENTJAR
): $(CLIENTSRC
)
105 @
$(RM
) -r
$(CLIENTBINDIR
)
106 @mkdir
-p
$(CLIENTBINDIR
)
107 $(COMPILE
) -d
$(CLIENTBINDIR
) $(shell find
$(CLIENTSRCDIR
) -name
"*.java")
108 $(JAR
) cf
$@
-C
$(CLIENTBINDIR
) .
110 $(CLIENTSRCDIR
)/%-stamp
: $(WSDLDIR
)/%.wsdl
111 $(WSDL2JAVA
) -o
$(CLIENTSRCDIR
) -pdiku.distlab.remote.
$(*F
) $<
114 $(WSDLDIR
)/%.wsdl
: $(WSDDDIR
)/%.wsdd
$(SERVERJAR
)
116 $(JAVA2WSDL
) -l
$(SERVICELOCATION
)/$(*F
) -o
$(WSDLDIR
)/$(*F
).wsdl \
117 -p
"$(*F)=$(*F).remote.distlab.diku" \
118 "$(*F).$$(sed -n 's/.*className.*value="[^.
]*\.\
(.
*\
)".*/\1/p' < $<)"
120 $(BUILDDIR
)/undeploy.wsdd
:
121 @mkdir
-p
$(CLIENTBINDIR
)
122 { echo
'<undeployment xmlns="http://xml.apache.org/axis/wsdd/">'; \
123 for i in
$(SERVICES
); do echo
"<service name=\"$$i\"/>"; done
; \
124 echo
'</undeployment>'; } > $@
128 # Rules for deploying the Re-Mote webservices and for testing the setup.
130 RUNADMINCLIENT
= $(ADMINCLIENT
) \
131 $(if
$(ADMINHOST
),-h
$(ADMINHOST
)) \
132 $(if
$(ADMINPORT
),-p
$(ADMINPORT
)) \
133 $(if
$(ADMINUSER
),-u
$(ADMINUSER
)) \
134 $(if
$(ADMINPASS
),-w
$(ADMINPASS
))
137 $(RUNADMINCLIENT
) list
140 $(RUNADMINCLIENT
) $(WSDDFILES
)
142 deploy-jar
: $(SERVERJAR
)
143 $(SCP
) $< $(DEPLOYLOCATION
)
145 deploy
: deploy-jar deploy-wsdd
147 undeploy
: $(BUILDDIR
)/undeploy.wsdd