{"id":18645928,"url":"https://github.com/giosil/wservices","last_synced_at":"2025-11-05T04:30:34.026Z","repository":{"id":46942344,"uuid":"253741521","full_name":"giosil/wservices","owner":"giosil","description":"Boilerplate for web services implementation with security handler chain example.","archived":false,"fork":false,"pushed_at":"2023-10-20T23:00:25.000Z","size":143,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T11:44:31.920Z","etag":null,"topics":["java","javaee","soap","soap-web-services","soap-webservice"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giosil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-07T09:04:49.000Z","updated_at":"2022-05-25T12:24:24.000Z","dependencies_parsed_at":"2023-02-18T09:15:47.065Z","dependency_job_id":null,"html_url":"https://github.com/giosil/wservices","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giosil%2Fwservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giosil","download_url":"https://codeload.github.com/giosil/wservices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239449594,"owners_count":19640535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","javaee","soap","soap-web-services","soap-webservice"],"created_at":"2024-11-07T06:17:42.528Z","updated_at":"2025-11-05T04:30:33.983Z","avatar_url":"https://github.com/giosil.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WServices\n\nBoilerplate for web services implementation with security handler chain example.\n\n## Build\n\n- `git clone https://github.com/giosil/wservices.git`\n- `mvn clean install`\n\n## Test Client\n\nFor more details see src/test/java.\n\n```java\nboolean traceEnabled = true;\n\nHello_Service service = new Hello_Service();\n\nIHelloService hello = service.getHelloServicesPort();\n\nif(hello instanceof BindingProvider) {\n  \n  BindingProvider bindingProvider = (BindingProvider) hello;\n  \n  Map\u003cString, Object\u003e requestContext = bindingProvider.getRequestContext();\n  \n  requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, \"http://localhost:8080/wservices/hello/HelloServices?g=Ciao\");\n  // Basic Auth\n  requestContext.put(BindingProvider.USERNAME_PROPERTY, \"admin\");\n  requestContext.put(BindingProvider.PASSWORD_PROPERTY, \"admin\");\n  \n  // Add handler chain programmatically\n  Binding binding = bindingProvider.getBinding();\n  \n  @SuppressWarnings(\"rawtypes\")\n  List\u003cHandler\u003e handlerChain = binding.getHandlerChain();\n  \n  handlerChain.add(new WSSecurityHandler(traceEnabled));\n  \n  // ... If the returned chain is modified a call to setHandlerChainis \n  // required to configure the binding instance with the new chain.\n  binding.setHandlerChain(handlerChain);\n}\n\nString result = hello.hello(\"World\");\n```\n\n## Generate Client\n\n`wsimport -s src -d out -p org.dew.hello.client http://localhost:8080/wservices/hello/HelloServices?wsdl`\n\n## Notice\n\nIf you use **org.jcp.xml.dsig.internal.dom.XMLDSigRI** in **org.dew.test.WSSecurityHandler** you have to disable restrictions of javac adding *-XDignore.symbol.file* in compiler arguments.\n\n```xml\n...\n\u003cplugins\u003e\n  \u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e3.3\u003c/version\u003e\n    \u003cconfiguration\u003e\n      \u003csource\u003e1.8\u003c/source\u003e \n      \u003ctarget\u003e1.8\u003c/target\u003e \n      \u003cfork\u003etrue\u003c/fork\u003e\n      \u003ccompilerArgs\u003e\n        \u003carg\u003e-XDignore.symbol.file\u003c/arg\u003e\n      \u003c/compilerArgs\u003e\n    \u003c/configuration\u003e\n  \u003c/plugin\u003e\n\u003c/plugins\u003e\n...\n```\n\nAlternatively it is recommended to use **org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI** of Apache Santuario\u0026trade; (https://santuario.apache.org/).\n\n```xml\n...\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecommons-logging\u003c/groupId\u003e\n      \u003cartifactId\u003ecommons-logging\u003c/artifactId\u003e\n      \u003cversion\u003e1.1.1\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.apache.santuario\u003c/groupId\u003e\n      \u003cartifactId\u003exmlsec\u003c/artifactId\u003e\n      \u003cversion\u003e1.5.7\u003c/version\u003e\n    \u003c/dependency\u003e\n...\n```\n\n## Enabling SSL/TLS Mutual Authentication in JBoss / Wildfly\n\nEdit standalone.xml:\n\n- Copy application.keystore (optional if self signed) and client.keystore in $JBOSS_HOME/standalone/configuration folder;\n- Modify keystore configuration;\n- Add truststore configuration in authentication;\n- Add verify-client=\"REQUIRED\" attribute in https-listener tag.\n\n```xml\n...\n        \u003csecurity-realms\u003e\n            ...\n            \u003csecurity-realm name=\"ApplicationRealm\"\u003e\n                \u003cserver-identities\u003e\n                    \u003cssl\u003e\n                        \u003ckeystore path=\"application.keystore\" relative-to=\"jboss.server.config.dir\" keystore-password=\"password\" alias=\"server\" key-password=\"password\" generate-self-signed-certificate-host=\"localhost\"/\u003e\n                    \u003c/ssl\u003e\n                \u003c/server-identities\u003e\n                \u003cauthentication\u003e\n                    \u003ctruststore path=\"client.keystore\" relative-to=\"jboss.server.config.dir\" keystore-password=\"password\"/\u003e\n                    ...\n                \u003c/authentication\u003e\n                ...\n            \u003c/security-realm\u003e\n        \u003c/security-realms\u003e\n...\n        \u003csubsystem xmlns=\"urn:jboss:domain:undertow:12.0\" ... \u003e\n            ...\n            \u003cserver name=\"default-server\"\u003e\n                ...\n                \u003chttps-listener name=\"https\" socket-binding=\"https\" security-realm=\"ApplicationRealm\" verify-client=\"REQUIRED\" enable-http2=\"true\"/\u003e\n                ...\n            \u003c/server\u003e\n            ...\n        \u003c/subsystem\u003e\n...\n```\n\nGet client certificate from HttpServletRequest\n\n```java\n  ...\n  @Resource\n  protected WebServiceContext webServiceContext;\n  ...\n  \n  // Method implementation\n  MessageContext messageContext = webServiceContext.getMessageContext();\n  \n  HttpServletRequest servletRequest = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST);\n  \n  X509Certificate[] certificates = (X509Certificate[]) httpServletRequest.getAttribute(\"javax.servlet.request.X509Certificate\");\n```\n\n## Enabling SSL/TLS debugging\n\n`mvn test -DargLine=\"-Ddew.test.op=hello_s -Djavax.net.debug=all\"`\n\n`mvn test -DargLine=\"-Ddew.test.op=hello_s -Djavax.net.debug=ssl,handshake\"`\n\n`mvn test -DargLine=\"-Ddew.test.op=hello_s -Djavax.net.debug=ssl:handshake:verbose:keymanager:trustmanager -Djava.security.debug=access:stack\"`\n\n`mvn test -DargLine=\"-Ddew.test.op=hello_s -Djavax.net.debug=ssl:record:plaintext\"`\n\n## Apache CXF Logging configuration in JBoss / Wildfly\n\nTo enable logging in standalone.xml:\n\n```xml\n...\n    \u003c/extensions\u003e\n    \u003csystem-properties\u003e\n        \u003cproperty name=\"org.apache.cxf.logging.enabled\" value=\"true\"/\u003e\n    \u003c/system-properties\u003e\n    \u003cmanagement\u003e\n...\n```\n\nTo disable printing Fault stacktrace in standalone.xml:\n\n```xml\n...\n        \u003csubsystem xmlns=\"urn:jboss:domain:logging:8.0\"\u003e\n...\n            \u003clogger category=\"org.apache.cxf.phase.PhaseInterceptorChain\"\u003e\n                \u003clevel name=\"ERROR\"/\u003e\n            \u003c/logger\u003e\n...\n        \u003c/subsystem\u003e\n...\n```\n\nTo disable printing INFO service client creation in standalone.xml:\n\n```xml\n...\n        \u003csubsystem xmlns=\"urn:jboss:domain:logging:8.0\"\u003e\n...\n            \u003clogger category=\"org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean\"\u003e\n                \u003clevel name=\"ERROR\"/\u003e\n            \u003c/logger\u003e\n...\n        \u003c/subsystem\u003e\n...\n```\n\n## Contributors\n\n* [Giorgio Silvestris](https://github.com/giosil)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiosil%2Fwservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiosil%2Fwservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiosil%2Fwservices/lists"}