zoukankan      html  css  js  c++  java
  • Spring Boot Soap Webservice Example

    1. Technology stack

    • maven, eclipse,  JDK1.8 - Development enviroment
    • Springboot - Underlying application framework
    • wsdl4j - for publishing wsdl for our service
    • soapUI - for test our service
    • JAXB maven plugin - for code generation

    2. Create Spring Boot Project

    Create one spring boot project from SPRING INITIALIZR.

    3. Create Soap Domain Model And Generator Java Code

    student.xsd

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="https://www.howtodoinjava.com/xml/school"
    targetNamespace="https://www.howtodoinjava.com/xml/school" elementFormDefault="qualified">
     
        <xs:element name="StudentDetailsRequest">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="name" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
     
        <xs:element name="StudentDetailsResponse">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="Student" type="tns:Student"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
     
        <xs:complexType name="Student">
            <xs:sequence>
                <xs:element name="name" type="xs:string"/>
                <xs:element name="standard" type="xs:int"/>
                <xs:element name="address" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
         
    </xs:schema>

    place above file in resources folder of the project

    Add JAXB maven plugin for XSD to java object generation

    we will use jaxb2-maven-plugin to generate the domain classes efficiently.添加这个插件到pom.xml文件。

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>1.6</version>
        <executions>
            <execution>
                <id>xjc</id>
                <goals>
                    <goal>xjc</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
            <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
            <clearOutputDir>false</clearOutputDir>
        </configuration>
    </plugin>

     待补充...

    原文链接

  • 相关阅读:
    WLAN设备接入过程
    802.1帧格式、帧类型详解
    SSID、BSSID、BSS等区分
    802.11协议详解
    bit、Byte、Mbps、Mb/s区别
    WLAN认证技术
    freemarker的简单使用案例
    关于throw、throws、try--catch的问题
    String去重方法
    常用典型的sql语句
  • 原文地址:https://www.cnblogs.com/chenqr/p/11130031.html
Copyright © 2011-2022 走看看