Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用spring boot ws为XML创建XSD?_Java_Spring_Spring Boot_Web Services - Fatal编程技术网

Java 如何使用spring boot ws为XML创建XSD?

Java 如何使用spring boot ws为XML创建XSD?,java,spring,spring-boot,web-services,Java,Spring,Spring Boot,Web Services,我创建XSD来为我的服务创建域(方法和参数)。这是我的XSD <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.baeldung.com/springsoap/gen" xmlns:imp="http:

我创建XSD来为我的服务创建域(方法和参数)。这是我的XSD

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.baeldung.com/springsoap/gen"
    xmlns:imp="http://www.baeldung.com/springsoap/gen"
               targetNamespace="http://www.baeldung.com/springsoap/gen" elementFormDefault="qualified">
    <xs:element name="reqCountry">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="name" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="resCountry">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="name" type="xs:string"/>
                 <xs:element name="population" type="xs:int"/>
                 <xs:element name="capital" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
@Endpoint
public class CountryEndpoint {
    
    @PayloadRoot(namespace = "http://www.baeldung.com/springsoap/gen", localPart = "reqCountry")
    @ResponsePayload
    public ResCountry getCountry(@RequestPayload ReqCountry request) {
        ResCountry response = new ResCountry();
        response.setCapital("ESpain");
        return response;
    }

}