This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@javax.xml.bind.annotation.XmlSchema( | |
namespace = "http://ws.cdyne.com/WeatherWS/", | |
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED | |
package com.cdyne.ws.weatherws; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@javax.xml.bind.annotation.XmlSchema( | |
namespace = "http://ws.cdyne.com/WeatherWS/", | |
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED, | |
xmlns = { | |
@javax.xml.bind.annotation.XmlNs(namespaceURI = "http://ws.cdyne.com/WeatherWS/", prefix = "weather") | |
}) | |
package com.cdyne.ws.weatherws; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
public JAXBDataBinding jaxbDataBinding() { | |
JAXBDataBinding jaxbDataBinding = new JAXBDataBinding(); | |
Map<String,String> namespaceMap = new HashMap<String, String>(); | |
namespaceMap.put("http://ws.cdyne.com/WeatherWS/", "weather"); | |
jaxbDataBinding.setNamespaceMap(namespaceMap); | |
return jaxbDataBinding; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<!-- See https://jax-ws-commons.java.net/jaxws-maven-plugin/wsimport-mojo.html --> | |
<wsdlUrls> | |
<wsdlUrl>src/main/resources/Weather1.0.wsdl</wsdlUrl> | |
</wsdlUrls> | |
<sourceDestDir>target/generated-sources/wsdlimport/Weather1.0</sourceDestDir> | |
<!-- For accessing the imported schema, see https://netbeans.org/bugzilla/show_bug.cgi?id=241570 --> | |
<vmArgs> | |
<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> | |
</vmArgs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<jxb:bindings version="1.0" | |
xmlns:jxb="http://java.sun.com/xml/ns/jaxb" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd | |
http://jaxb2-commons.dev.java.net/namespace-prefix http://java.net/projects/jaxb2-commons/sources/svn/content/namespace-prefix/trunk/src/main/resources/prefix-namespace-schema.xsd"> | |
<jxb:bindings schemaLocation="Weather1.0.xsd"> | |
<jxb:schemaBindings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String requestFolder = "requests/"; | |
String file; | |
URI filepathUrl = this.getClass().getClassLoader().getResource(requestFolder + fileName).toURI(); | |
Path filepath = Paths.get(filepathUrl); | |
file = Files.lines(filepath).collect(Collectors.joining()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void printXML2Console(Node documentOrDocumentFragment) | |
throws TransformerFactoryConfigurationError, | |
TransformerConfigurationException, | |
TransformerException { | |
DOMSource domSource = new DOMSource(documentOrDocumentFragment); | |
StringWriter writer = new StringWriter(); | |
StreamResult result = new StreamResult(writer); | |
TransformerFactory tf = TransformerFactory.newInstance(); | |
Transformer transformer = tf.newTransformer(); | |
transformer.transform(domSource, result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Document you want 2 append | |
Document document = ...; | |
// Create the Document | |
DocumentBuilderFactory docBuilderfactory = DocumentBuilderFactory.newInstance(); | |
DocumentBuilder docBuilder = docBuilderfactory.newDocumentBuilder(); | |
Document document2Append2 = docBuilder.newDocument(); | |
// Copy the Document as ChildElement under a new Element | |
Element rootElement = document2Append2.createElement("root"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The inheritance of SpringBootServletInitializer is necessary for the war-Deployment-ability | |
@ComponentScan("de.codecentric.somepackage") | |
@EnableAutoConfiguration | |
@Configuration | |
public class Application extends SpringBootServletInitializer { | |
private static Class<Application> applicationClass = Application.class; | |
@Override | |
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<packaging>war</packaging> | |
... | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
<version>${spring-boot-version}</version> | |
<!-- war/Tomcat-Deployment - change deployment from pom to war --> | |
<scope>provided</scope> | |
</dependency> | |
... |
OlderNewer