38
38
# easily write a short script that connects to the web service properly.
39
39
# This WSDL file ends up in $(VBOXWEB_OUT_DIR)/vboxweb.wsdl.
41
# 2) We use xsltproc and websrv-gsoapH.xsl to generate a so-called
42
# "gSoap header file": $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h.
41
# 2) We use xsltproc and websrv-wsdl2gsoapH.xsl to generate a so-called
42
# "gSoap header file": $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h from
43
# the WSDL previously generated.
43
44
# This file looks like a C header file, but really isn't meant
44
45
# to be included by a C compiler. Instead, it just happens to be the
45
46
# format that gSOAP uses to specify SOAP interfaces instead of WSDL.
61
62
# implementations with useful code that does something. This is where more
62
63
# code generation via XSLT comes in:
64
# 4) We use xsltproc to generate tons of c++ code directly from the XIDL that
65
# 4) We use xsltproc to generate tons of C++ code directly from the XIDL that
65
66
# maps each SOAP method to our COM methods. This large C++ file is
66
67
# $(VBOXWEB_OUT_DIR)/methodmaps.cpp. The actual webservice executable (vboxwebsrv,
67
68
# which acts as an HTTP server) is composed of this file, plus hard-coded
153
154
PATH_TARGET_SOAPDEMONSMAPS := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
154
155
PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest
157
# platform-specific XIDL file generated from $(VBOXWEB_IDL_SRC):
156
158
VBOXWEB_IDL_SRC_ORIG := $(VBOX_XIDL_FILE)
159
# the original XIDL file:
157
160
VBOXWEB_IDL_SRC := $(VBOXWEB_OUT_DIR)/VirtualBox.xidl
162
VBOXWEB_WSDL = $(VBOX_PATH_SDK)/bindings/webservice/vboxweb.wsdl
163
VBOXWEBSERVICE_WSDL = $(VBOX_PATH_SDK)/bindings/webservice/vboxwebService.wsdl
159
165
VBOXWEB_TYPEMAP := $(VBOXWEB_OUT_DIR)/typemap.dat
161
167
VBOXWEB_GSOAPH_FROM_XSLT := $(VBOXWEB_OUT_DIR)/gsoapH_from_xslt.h
283
290
$(VBOXWEB_OUT_DIR)/methodmaps.cpp \
284
291
$(VBOXWEB_OUT_DIR)/soapServer.cpp
294
VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
295
$(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
286
297
vboxwebsrv_ORDERDEPS = $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
287
298
endif # !VBOX_ONLY_SDK
301
INSTALLS += VBoxJWs-inst-jar
304
# Java glue JAR files
306
VBOX_JWS_JAR = $(VBoxJWs-inst-jar_0_OUTDIR)/vboxjws.jar
307
VBOX_JWS_TARGET := $(PATH_TARGET)/vboxjws-gen
308
VBOX_JWS_GEN = $(VBOX_JWS_TARGET)/jwsgen
309
VBOX_JWS_JDEST := $(VBOX_JWS_TARGET)/jdest
310
VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
311
VBOX_JAXLIB_DIR := $(PATH_ROOT)/src/VBox/Main/webservice/jaxlibs
313
VBoxJWs-inst-jar_INST = $(INST_SDK)bindings/webservice/java/jax-ws
314
VBoxJWs-inst-jar_SOURCES = \
316
VBoxJWs-inst-jar_CLEAN = \
318
$(VBOX_JWS_GEN)/jwsglue.list \
320
$(VBOX_JWS_GEN)/java/*.java \
321
$(VBOX_JWS_GEN)/java/jws/*/*/*/*.java \
322
$(VBOX_JWS_JDEST)/*.class \
323
$(VBOX_JWS_JDEST)/*/*.class \
324
$(VBOX_JWS_JDEST)/*/*/*.class \
325
$(VBOX_JWS_JDEST)/*/*/*/*.class \
327
VBoxJWs-inst-jar_BLDDIRS += $(VBOX_JWS_GEN)/java $(VBOX_JWS_GEN)/java/jws
329
$(VBOX_JWS_GEN)/jwsglue.list: \
331
$(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
333
$(VBOXWEBSERVICE_WSDL) \
334
| $(VBOX_JWS_GEN)/java/jws/
335
$(call MSG_L1,Generating JAX-WS Java glue files from XIDL)
336
$(RM) -f $(wildcard $(VBOX_JWS_GEN)/java/*.java) $(wildcard $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java)
337
$(QUIET)$(VBOX_XSLTPROC) \
338
--stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
339
--stringparam G_vboxGlueStyle jaxws \
340
-o $(VBOX_JWS_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
341
$(QUIET)$(VBOX_FILESPLIT) $(VBOX_JWS_GEN)/java/merged.file $(VBOX_JWS_GEN)/java
342
$(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL))
343
$(VBOX_WSIMPORT) -Xnocompile -p $(VBOX_JAVA_PACKAGE).jaxws -d $(VBOX_JWS_GEN)/java/jws $(VBOXWEBSERVICE_WSDL)
344
$(QUIET)echo $(VBOX_JWS_GEN)/java/*.java > $@
345
$(QUIET)echo $(VBOX_JWS_GEN)/java/jws/*/*/*/*.java >> $@
347
$$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglue.list $(VBOXWEB_WSDL) $(VBOXWEBSERVICE_WSDL) | $$(dir $$@)
348
$(call MSG_TOOL,javac,$(notdir $@),jwsgen.list,)
349
$(QUIET)$(RM) -Rf $(VBOX_JWS_JDEST)
350
$(QUIET)$(MKDIR) -p $(VBOX_JWS_JDEST)
351
$(call MSG_L1,Compiling bridge code)
352
$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
353
@$(VBOX_JWS_GEN)/jwsglue.list \
354
-d $(VBOX_JWS_JDEST) -classpath $(VBOX_JWS_JDEST)
355
$(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" < $(VBOXWEBSERVICE_WSDL) > $(VBOX_JWS_JDEST)/vboxwebService$(VBOX_API_SUFFIX).wsdl
356
$(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOX_JWS_JDEST)/vboxweb$(VBOX_API_SUFFIX).wsdl
357
$(call MSG_LINK,$(notdir $@),$@)
358
$(VBOX_JAR) cf $@ -C $(VBOX_JWS_JDEST) .
360
endif # VBOX_WITH_JWS
290
362
ifndef VBOX_ONLY_SDK
382
454
/usr/jdk/jdk1.6*/bin/wsimport \
383
455
/usr/bin/wsimport \
384
456
/opt/sun-jdk-1.6*/bin/wsimport))
385
ifndef VBOX_WSIMPORT16
457
ifeq ($(strip $(VBOX_WSIMPORT16)),)
386
458
$(error Failed to autodetect VBOX_WSIMPORT16, please set it manually)
390
461
VBOXWEB_OTHERS += \
391
$(VBOXWEB_GLUE_JAVA_TMP) \
392
$(VBOXWEB_GLUE_PYTHON) \
393
$(VBOXWEB_WS_PYTHON) \
396
$(VBOXWEB_PYTHONWSSAMPLE)\
397
$(VBOXWEB_JAXWSSAMPLE) \
398
$(VBOXWEB_METRICSAMPLE) \
399
$(VBOXWEB_JAVA15_JAR) \
462
$(VBOXWEB_GLUE_PYTHON) \
463
$(VBOXWEB_WS_PYTHON) \
466
$(VBOXWEB_PYTHONWSSAMPLE)
468
ifdef VBOX_WITH_OLD_JWS
470
$(VBOXWEB_GLUE_JAVA_TMP) \
471
$(VBOXWEB_JAXWSSAMPLE) \
472
$(VBOXWEB_METRICSAMPLE) \
473
$(VBOXWEB_JAVA15_JAR) \
400
474
$(VBOXWEB_JAVA16_JAR)
403
478
# Install sample code.
489
560
$(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $<
491
562
# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
492
# $(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
493
# $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-gsoapH.xsl)
494
# $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-gsoapH.xsl $<
495
563
$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
496
564
$(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
497
565
$(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $<
502
570
$(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
503
571
$(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $<
507
573
ifdef VBOX_GSOAP_INSTALLED
508
574
# ... and once with the gSOAP tool (just for comparison, we don't use it for licensing reasons)
509
575
$(VBOXWEB_GSOAPH_FROM_GSOAP): $(VBOXWEB_WSDL) $(VBOXWEB_TYPEMAP) | $$(dir $$@)
510
576
$(call MSG_GENERATE,,$@,)
511
577
$(VBOX_WSDL2H) $(VBOXWEB_WSDL_VERBOSE) -t$(VBOXWEB_TYPEMAP) -nvbox -o $@ $<
579
# this sets the gsoap header that we use for further compilation; if stuff works, then the
580
# one we generate via XSLT produces the same end result as the one from the gSOAP tool;
581
# with this variable we can swap for testing, but shipped code must use VBOXWEB_GSOAPH_FROM_XSLT
513
582
GSOAPH_RELEVANT = $(VBOXWEB_GSOAPH_FROM_XSLT)
515
584
# wsdl2h -v: verbose
528
597
: $(VBOXWEB_GSOAPH_FROM_GSOAP) $(VBOXWEB_GSOAPH_FROM_XSLT) $(NSMAP) $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
529
598
$(call MSG_GENERATE,,lots of files,$(GSOAPH_RELEVANT))
531
$(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
600
$(REDIRECT) -C $(VBOXWEB_OUT_DIR) -- $(VBOX_SOAPCPP2) $(VBOXWEB_SOAPCPP2_SKIP_FILES) -L -2 -w -I$(VBOX_PATH_GSOAP_IMPORT) $(GSOAPH_RELEVANT)
532
601
$(APPEND) $@ done
534
# copy the generated headers and stuff. This has to be a seperate rule if we
603
# copy the generated headers and stuff. This has to be a separate rule if we
535
604
# want to use wildcard (all commands are expaned when the rule is evaluated).
536
605
$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
578
647
+ $(VBOXWEB_OUT_DIR)/soapC-18.cpp \
579
648
+ $(VBOXWEB_OUT_DIR)/soapC-19.cpp \
580
649
+ $(VBOXWEB_OUT_DIR)/soapC-20.cpp \
581
: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(TARGET_split-soapC) | $$(dir $$@)
650
: $(VBOXWEB_OUT_DIR)/soapC.cpp $$(split-soapC_1_TARGET) | $$(dir $$@)
582
651
$(RM) -f $(wildcard $(VBOXWEB_OUT_DIR)/soapC-?.cpp $(VBOXWEB_OUT_DIR)/soapC-??.cpp)
583
$(TARGET_split-soapC) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 20
652
$(split-soapC_1_TARGET) $(VBOXWEB_OUT_DIR)/soapC.cpp $(VBOXWEB_OUT_DIR) 20
584
653
endif # !VBOX_WITHOUT_SPLIT_SOAPC
586
655
endif # VBOX_GSOAP_INSTALLED
608
677
$(VBOXWEB_IDL_SRC) \
609
678
$(VBOX_PATH_WEBSERVICE)/glue-jaxws.xsl \
610
679
$(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl \
612
$(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
680
$(RECOMPILE_ON_MAKEFILE_CURRENT) \
613
683
$(QUIET)$(MKDIR) -p $(@D)
614
684
$(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using glue-jaxws.xsl)
615
685
$(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) \