From 0a58e131ce0d96ecd60c4daf2c41821a625d689b Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 20 Jan 2022 10:43:22 +0100 Subject: wsdl: add examples --- Year_3/TSDWL/WSDL/BankClient/build.xml | 71 + Year_3/TSDWL/WSDL/BankClient/catalog.xml | 5 + .../TSDWL/WSDL/BankClient/nbproject/ant-deploy.xml | 76 ++ .../TSDWL/WSDL/BankClient/nbproject/build-impl.xml | 1442 ++++++++++++++++++++ .../WSDL/BankClient/nbproject/genfiles.properties | 8 + Year_3/TSDWL/WSDL/BankClient/nbproject/jax-ws.xml | 42 + .../WSDL/BankClient/nbproject/jaxws-build.xml | 46 + .../WSDL/BankClient/nbproject/project.properties | 84 ++ Year_3/TSDWL/WSDL/BankClient/nbproject/project.xml | 23 + Year_3/TSDWL/WSDL/BankClient/src/conf/MANIFEST.MF | 2 + .../wsdl/localhost_8080/WsBank/BankOperations.wsdl | 74 + .../localhost_8080/WsBank/BankOperations.xsd_1.xsd | 52 + .../src/java/it/dmi/exam/servlet/BankServlet.java | 130 ++ .../TSDWL/WSDL/BankClient/web/META-INF/context.xml | 2 + .../WSDL/BankClient/web/WEB-INF/jax-ws-catalog.xml | 5 + .../wsdl/localhost_8080/WsBank/BankOperations.wsdl | 74 + .../localhost_8080/WsBank/BankOperations.xsd_1.xsd | 52 + Year_3/TSDWL/WSDL/BankClient/web/index.html | 16 + Year_3/TSDWL/WSDL/BankClient/web/index.jsp | 30 + Year_3/TSDWL/WSDL/WsBank/build.xml | 71 + Year_3/TSDWL/WSDL/WsBank/nbproject/ant-deploy.xml | 150 ++ Year_3/TSDWL/WSDL/WsBank/nbproject/build-impl.xml | 1442 ++++++++++++++++++++ .../WSDL/WsBank/nbproject/genfiles.properties | 8 + Year_3/TSDWL/WSDL/WsBank/nbproject/jax-ws.xml | 9 + Year_3/TSDWL/WSDL/WsBank/nbproject/jaxws-build.xml | 35 + .../TSDWL/WSDL/WsBank/nbproject/project.properties | 89 ++ Year_3/TSDWL/WSDL/WsBank/nbproject/project.xml | 21 + Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF | 2 + .../src/java/it/dmi/exam/bank/BankOperations.java | 48 + Year_3/TSDWL/WSDL/WsBank/web/WEB-INF/web.xml | 12 + Year_3/TSDWL/WSDL/WsBank/web/index.html | 16 + 31 files changed, 4137 insertions(+) create mode 100644 Year_3/TSDWL/WSDL/BankClient/build.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/catalog.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/ant-deploy.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/build-impl.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/genfiles.properties create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/jax-ws.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/jaxws-build.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/project.properties create mode 100644 Year_3/TSDWL/WSDL/BankClient/nbproject/project.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/src/conf/MANIFEST.MF create mode 100644 Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.wsdl create mode 100644 Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd create mode 100644 Year_3/TSDWL/WSDL/BankClient/src/java/it/dmi/exam/servlet/BankServlet.java create mode 100644 Year_3/TSDWL/WSDL/BankClient/web/META-INF/context.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/jax-ws-catalog.xml create mode 100644 Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.wsdl create mode 100644 Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd create mode 100644 Year_3/TSDWL/WSDL/BankClient/web/index.html create mode 100644 Year_3/TSDWL/WSDL/BankClient/web/index.jsp create mode 100644 Year_3/TSDWL/WSDL/WsBank/build.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/ant-deploy.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/build-impl.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/genfiles.properties create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/jax-ws.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/jaxws-build.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/project.properties create mode 100644 Year_3/TSDWL/WSDL/WsBank/nbproject/project.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF create mode 100644 Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java create mode 100644 Year_3/TSDWL/WSDL/WsBank/web/WEB-INF/web.xml create mode 100644 Year_3/TSDWL/WSDL/WsBank/web/index.html (limited to 'Year_3/TSDWL') diff --git a/Year_3/TSDWL/WSDL/BankClient/build.xml b/Year_3/TSDWL/WSDL/BankClient/build.xml new file mode 100644 index 0000000..054694f --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project BankClient. + + + diff --git a/Year_3/TSDWL/WSDL/BankClient/catalog.xml b/Year_3/TSDWL/WSDL/BankClient/catalog.xml new file mode 100644 index 0000000..6b593c9 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/catalog.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/ant-deploy.xml b/Year_3/TSDWL/WSDL/BankClient/nbproject/ant-deploy.xml new file mode 100644 index 0000000..55566c8 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/ant-deploy.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/build-impl.xml b/Year_3/TSDWL/WSDL/BankClient/nbproject/build-impl.xml new file mode 100644 index 0000000..cde7609 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/build-impl.xml @@ -0,0 +1,1442 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/genfiles.properties b/Year_3/TSDWL/WSDL/BankClient/nbproject/genfiles.properties new file mode 100644 index 0000000..31a63aa --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=9ac50c92 +build.xml.script.CRC32=7a85da43 +build.xml.stylesheet.CRC32=651128d4@1.77.1.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=9ac50c92 +nbproject/build-impl.xml.script.CRC32=1bfa7a0d +nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/jax-ws.xml b/Year_3/TSDWL/WSDL/BankClient/nbproject/jax-ws.xml new file mode 100644 index 0000000..2adf664 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/jax-ws.xml @@ -0,0 +1,42 @@ + + + + + + http://localhost:8080/WsBank/BankOperations?wsdl + localhost_8080/WsBank/BankOperations.wsdl + it.dmi.exams.client.bank + catalog.xml + + + extension + true + + + verbose + true + + + fork + false + + + wsdlLocation + http://localhost:8080/WsBank/BankOperations?wsdl + + + xnocompile + true + + + xendorsed + true + + + package + it.dmi.exams.client.bank + + + + + diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/jaxws-build.xml b/Year_3/TSDWL/WSDL/BankClient/nbproject/jaxws-build.xml new file mode 100644 index 0000000..0ea369e --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/jaxws-build.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/project.properties b/Year_3/TSDWL/WSDL/BankClient/nbproject/project.properties new file mode 100644 index 0000000..ea50b70 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/project.properties @@ -0,0 +1,84 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +# Files to be excluded from distribution war +dist.archive.excludes= +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-7.0.classpath} +excludes= +includes=** +j2ee.compile.on.save=true +j2ee.copy.static.files.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.7-web +j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.4.2.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar +j2ee.server.type=Tomcat +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +no.dependencies=false +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=BankClient.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/Year_3/TSDWL/WSDL/BankClient/nbproject/project.xml b/Year_3/TSDWL/WSDL/BankClient/nbproject/project.xml new file mode 100644 index 0000000..efa11c3 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/nbproject/project.xml @@ -0,0 +1,23 @@ + + + org.netbeans.modules.web.project + + + + + + + + BankClient + 1.6.5 + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/BankClient/src/conf/MANIFEST.MF b/Year_3/TSDWL/WSDL/BankClient/src/conf/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.wsdl b/Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.wsdl new file mode 100644 index 0000000..5227e27 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.wsdl @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd b/Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd new file mode 100644 index 0000000..cf469e6 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/src/conf/xml-resources/web-service-references/BankOperations/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Year_3/TSDWL/WSDL/BankClient/src/java/it/dmi/exam/servlet/BankServlet.java b/Year_3/TSDWL/WSDL/BankClient/src/java/it/dmi/exam/servlet/BankServlet.java new file mode 100644 index 0000000..a8a397d --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/src/java/it/dmi/exam/servlet/BankServlet.java @@ -0,0 +1,130 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.dmi.exam.servlet; + +import it.dmi.exams.client.bank.BankOperations_Type; +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author dcariotti + */ +@WebServlet(name = "BankServlet", urlPatterns = {"/BankServlet"}) +public class BankServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST + * methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + /* TODO output your page here. You may use following sample code. */ + out.println(""); + out.println(""); + out.println(""); + out.println("Servlet BankServlet"); + out.println(""); + out.println(""); + out.println("

Servlet BankServlet at " + request.getContextPath() + "

"); + out.println(""); + out.println(""); + } + } + + /** + * Handles the HTTP GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + double amount = this.getAmount(); + request.setAttribute("amount", amount); + RequestDispatcher view = request.getRequestDispatcher("index.jsp"); + view.forward(request, response); + } + + /** + * Handles the HTTP POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + double moneyToGet = 0.0; + double moneyToDeposit = 0.0; + + String form_deposit = request.getParameter("deposit"); + String form_get = request.getParameter("get"); + + if (form_deposit.length() > 0) { + moneyToDeposit = Double.parseDouble(form_deposit); + } + + if (form_get.length() > 0) { + moneyToGet = Double.parseDouble(form_get); + } + + PrintWriter out = response.getWriter(); + + out.println("Deposit " + moneyToDeposit + "€"); + out.println("Get " + moneyToGet + "€"); + + this.deposit(moneyToDeposit); + this.get(moneyToGet); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Make bank operations"; + } + + private static BankOperations_Type deposit(double amount) { + it.dmi.exams.client.bank.BankOperations_Service service = new it.dmi.exams.client.bank.BankOperations_Service(); + it.dmi.exams.client.bank.BankOperations port = service.getBankOperationsPort(); + return port.deposit(amount); + } + + private static BankOperations_Type get(double amount) { + it.dmi.exams.client.bank.BankOperations_Service service = new it.dmi.exams.client.bank.BankOperations_Service(); + it.dmi.exams.client.bank.BankOperations port = service.getBankOperationsPort(); + return port.get(amount); + } + + private static double getAmount() { + it.dmi.exams.client.bank.BankOperations_Service service = new it.dmi.exams.client.bank.BankOperations_Service(); + it.dmi.exams.client.bank.BankOperations port = service.getBankOperationsPort(); + return port.getAmount(); + } + +} diff --git a/Year_3/TSDWL/WSDL/BankClient/web/META-INF/context.xml b/Year_3/TSDWL/WSDL/BankClient/web/META-INF/context.xml new file mode 100644 index 0000000..d7ce63a --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/jax-ws-catalog.xml b/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/jax-ws-catalog.xml new file mode 100644 index 0000000..21387ad --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/jax-ws-catalog.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.wsdl b/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.wsdl new file mode 100644 index 0000000..5227e27 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.wsdl @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd b/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd new file mode 100644 index 0000000..cf469e6 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/web/WEB-INF/wsdl/localhost_8080/WsBank/BankOperations.xsd_1.xsd @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Year_3/TSDWL/WSDL/BankClient/web/index.html b/Year_3/TSDWL/WSDL/BankClient/web/index.html new file mode 100644 index 0000000..b7f08ef --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/web/index.html @@ -0,0 +1,16 @@ + + + + + TODO supply a title + + + + + Go to the servlet + + diff --git a/Year_3/TSDWL/WSDL/BankClient/web/index.jsp b/Year_3/TSDWL/WSDL/BankClient/web/index.jsp new file mode 100644 index 0000000..33763d4 --- /dev/null +++ b/Year_3/TSDWL/WSDL/BankClient/web/index.jsp @@ -0,0 +1,30 @@ +<%-- + Document : index + Created on : Jan 20, 2022, 10:23:24 AM + Author : dcariotti +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Bank operations + + + <% double amount = (double) request.getAttribute("amount"); %> +

Your deposit is: <%= amount %>

+

Operations:

+
+
+ + +
+
+ + +
+ +
+ + diff --git a/Year_3/TSDWL/WSDL/WsBank/build.xml b/Year_3/TSDWL/WSDL/WsBank/build.xml new file mode 100644 index 0000000..b12e6e0 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project WsBank. + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/ant-deploy.xml b/Year_3/TSDWL/WSDL/WsBank/nbproject/ant-deploy.xml new file mode 100644 index 0000000..5d33e0d --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/ant-deploy.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/build-impl.xml b/Year_3/TSDWL/WSDL/WsBank/nbproject/build-impl.xml new file mode 100644 index 0000000..e05cd1a --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/build-impl.xml @@ -0,0 +1,1442 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/genfiles.properties b/Year_3/TSDWL/WSDL/WsBank/nbproject/genfiles.properties new file mode 100644 index 0000000..d46fb59 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c9014e6a +build.xml.script.CRC32=afd6ce83 +build.xml.stylesheet.CRC32=651128d4@1.77.1.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=c9014e6a +nbproject/build-impl.xml.script.CRC32=b4f96da5 +nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/jax-ws.xml b/Year_3/TSDWL/WSDL/WsBank/nbproject/jax-ws.xml new file mode 100644 index 0000000..6ea55d7 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/jax-ws.xml @@ -0,0 +1,9 @@ + + + + + it.dmi.exam.bank.BankOperations + + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/jaxws-build.xml b/Year_3/TSDWL/WSDL/WsBank/nbproject/jaxws-build.xml new file mode 100644 index 0000000..e279b7b --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/jaxws-build.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/project.properties b/Year_3/TSDWL/WSDL/WsBank/nbproject/project.properties new file mode 100644 index 0000000..039da86 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/project.properties @@ -0,0 +1,89 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +# Files to be excluded from distribution war +dist.archive.excludes= +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-7.0.classpath} +excludes= +includes=** +j2ee.compile.on.save=true +j2ee.copy.static.files.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.7-web +j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv3ee6 +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +no.dependencies=false +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=WsBank.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/Year_3/TSDWL/WSDL/WsBank/nbproject/project.xml b/Year_3/TSDWL/WSDL/WsBank/nbproject/project.xml new file mode 100644 index 0000000..ba3be22 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/nbproject/project.xml @@ -0,0 +1,21 @@ + + + org.netbeans.modules.web.project + + + + + + WsBank + 1.6.5 + + + + + + + + + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF b/Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java b/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java new file mode 100644 index 0000000..4a64a43 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/src/java/it/dmi/exam/bank/BankOperations.java @@ -0,0 +1,48 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package it.dmi.exam.bank; + +import javax.jws.WebService; +import javax.jws.WebMethod; +import javax.jws.WebParam; + +/** + * + * @author dcariotti + */ +@WebService(serviceName = "BankOperations") +public class BankOperations { + private double amount = 0.0; + + /** + * Web service operation + */ + @WebMethod(operationName = "deposit") + public BankOperations deposit(@WebParam(name = "amount") final double amount) { + this.amount += amount; + + return this; + } + + /** + * Web service operation + */ + @WebMethod(operationName = "getAmount") + public double getAmount() { + return this.amount; + } + + /** + * Web service operation + */ + @WebMethod(operationName = "get") + public BankOperations get(@WebParam(name = "amount") final double amount) { + this.amount -= amount; + + return this; + } + +} diff --git a/Year_3/TSDWL/WSDL/WsBank/web/WEB-INF/web.xml b/Year_3/TSDWL/WSDL/WsBank/web/WEB-INF/web.xml new file mode 100644 index 0000000..6058a36 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/web/WEB-INF/web.xml @@ -0,0 +1,12 @@ + + + + + + 30 + + + diff --git a/Year_3/TSDWL/WSDL/WsBank/web/index.html b/Year_3/TSDWL/WSDL/WsBank/web/index.html new file mode 100644 index 0000000..0936ce4 --- /dev/null +++ b/Year_3/TSDWL/WSDL/WsBank/web/index.html @@ -0,0 +1,16 @@ + + + + + WsBank + + + + + Go to the operations + + -- cgit v1.2.3-18-g5258