فهرست منبع

修改了项目信息更新方法

verguenza 4 سال پیش
والد
کامیت
b52fbfb4f9

+ 1 - 0
pom.xml

@@ -155,6 +155,7 @@
                     </execution>
                 </executions>
                 <configuration>
+                    <clearOutputDir>false</clearOutputDir>
                     <sources>
                         <source>${project.basedir}/src/main/resources/countries.xsd</source>
                     </sources>

+ 4 - 4
src/main/java/com/galaxis/manatee/configuration/WebServiceConfig.java

@@ -23,18 +23,18 @@ public class WebServiceConfig extends WsConfigurerAdapter {
 		return new ServletRegistrationBean(servlet, "/ws/*");
 	}
 
-	@Bean(name = "countries")
+	@Bean(name = "chuanyun")
 	public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema countriesSchema) {
 		DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
-		wsdl11Definition.setPortTypeName("CountriesPort");
+		wsdl11Definition.setPortTypeName("chuanyun");
 		wsdl11Definition.setLocationUri("/ws");
-		wsdl11Definition.setTargetNamespace("http://spring.io/guides/gs-producing-web-service");
+		wsdl11Definition.setTargetNamespace("http://galaxis.com/manatee/chuanyun-web-service");
 		wsdl11Definition.setSchema(countriesSchema);
 		return wsdl11Definition;
 	}
 
 	@Bean
 	public XsdSchema countriesSchema() {
-		return new SimpleXsdSchema(new ClassPathResource("countries.xsd"));
+		return new SimpleXsdSchema(new ClassPathResource("chuanyun.xsd"));
 	}
 }

+ 24 - 32
src/main/java/com/galaxis/manatee/webservice/CountryEndpoint.java

@@ -1,59 +1,51 @@
 package com.galaxis.manatee.webservice;
 
 
-import io.spring.guides.gs_producing_web_service.*;
+import io.spring.guides.gs_producing_web_service.GetList;
+import io.spring.guides.gs_producing_web_service.GetSchema;
+import io.spring.guides.gs_producing_web_service.GetSchemaList;
+import io.spring.guides.gs_producing_web_service.Invoke;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.ws.server.endpoint.annotation.Endpoint;
 import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
 import org.springframework.ws.server.endpoint.annotation.RequestPayload;
 import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
 
+/**
+ * @author kxuan
+ * @version 1.0
+ */
 @Endpoint
 public class CountryEndpoint {
-	private static final String NAMESPACE_URI = "http://spring.io/guides/gs-producing-web-service";
+	private static final String NAMESPACE_URI = "http://galaxis.com/manatee/chuanyun-web-service";
 
-	private CountryRepository countryRepository;
-
-	@Autowired
-	public CountryEndpoint(CountryRepository countryRepository) {
-		this.countryRepository = countryRepository;
-	}
-//
-//	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getCountryRequest")
-//	@ResponsePayload
-//	public GetCountryResponse getCountry(@RequestPayload GetCountryRequest request) {
-//		GetCountryResponse response = new GetCountryResponse();
-//		response.setCountry(countryRepository.findCountry(request.getName()));
-//		return response;
-//	}
-
-	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getSchema")
+	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "GetSchema")
 	@ResponsePayload
-	public String GetSchema(@RequestPayload GetSchema getSchema)
+	public String getSchema(@RequestPayload GetSchema request)
 	{
-		return null;
+		return "";
 	}
 
-	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "")
+	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "GetSchemaList")
 	@ResponsePayload
-	public String GetSchemaList()
+	public String getSchemaList(@RequestPayload GetSchemaList request)
 	{
-		return null;
+		return "";
 	}
 
-	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getList")
+	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "GetList")
 	@ResponsePayload
-	public String GetList(@RequestPayload GetList getList)
-	{
-		return null;
+	public String getList(@RequestPayload GetList request) {
+		return "";
 	}
 
-    //氚云后端调用的方法名
-	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "invoke")
+	/**
+	 * 氚云后端调用的方法名
+	 */
+	@PayloadRoot(namespace = NAMESPACE_URI, localPart = "Invoke")
 	@ResponsePayload
-	public String Invoke(@RequestPayload Invoke invoke)
-	{
+	public String invoke(@RequestPayload Invoke request) {
         //书写调用第三方接口方法
-		return null;
+		return "";
 	}
 }

+ 0 - 47
src/main/java/com/galaxis/manatee/webservice/CountryRepository.java

@@ -1,47 +0,0 @@
-package com.galaxis.manatee.webservice;
-
-import javax.annotation.PostConstruct;
-import java.util.HashMap;
-import java.util.Map;
-
-import io.spring.guides.gs_producing_web_service.Country;
-import io.spring.guides.gs_producing_web_service.Currency;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-
-@Component
-public class CountryRepository {
-	private static final Map<String, Country> countries = new HashMap<>();
-
-	@PostConstruct
-	public void initData() {
-		Country spain = new Country();
-		spain.setName("Spain");
-		spain.setCapital("Madrid");
-		spain.setCurrency(Currency.EUR);
-		spain.setPopulation(46704314);
-
-		countries.put(spain.getName(), spain);
-
-		Country poland = new Country();
-		poland.setName("Poland");
-		poland.setCapital("Warsaw");
-		poland.setCurrency(Currency.PLN);
-		poland.setPopulation(38186860);
-
-		countries.put(poland.getName(), poland);
-
-		Country uk = new Country();
-		uk.setName("United Kingdom");
-		uk.setCapital("London");
-		uk.setCurrency(Currency.GBP);
-		uk.setPopulation(63705000);
-
-		countries.put(uk.getName(), uk);
-	}
-
-	public Country findCountry(String name) {
-		Assert.notNull(name, "The country's name must not be null");
-		return countries.get(name);
-	}
-}

+ 11 - 27
src/main/resources/countries.xsd

@@ -1,23 +1,24 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://spring.io/guides/gs-producing-web-service"
-           targetNamespace="http://spring.io/guides/gs-producing-web-service" elementFormDefault="qualified">
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://galaxis.com/manatee/chuanyun-web-service" elementFormDefault="qualified">
 
-    <xs:element name="getCountryRequest">
+    <xs:element name="GetSchema">
         <xs:complexType>
             <xs:sequence>
-                <xs:element name="name" type="xs:string"/>
+                <xs:element name="schemaCode" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
 
-    <xs:element name="getSchema">
+
+    <xs:element name="GetSchemaList">
         <xs:complexType>
             <xs:sequence>
-                <xs:element name="schemaCode" type="xs:string"/>
+                <xs:element name="name" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
 
-    <xs:element name="getList">
+    <xs:element name="GetList">
         <xs:complexType>
             <xs:sequence>
                 <xs:element name="schemaCode" type="xs:string"/>
@@ -27,7 +28,7 @@
         </xs:complexType>
     </xs:element>
 
-    <xs:element name="invoke">
+    <xs:element name="Invoke">
         <xs:complexType>
             <xs:sequence>
                 <xs:element name="schemaCode" type="xs:string"/>
@@ -38,28 +39,11 @@
         </xs:complexType>
     </xs:element>
 
-    <xs:element name="getCountryResponse">
+    <xs:element name="response">
         <xs:complexType>
             <xs:sequence>
-                <xs:element name="country" type="tns:country"/>
+                <xs:element name="response" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
-
-    <xs:complexType name="country">
-        <xs:sequence>
-            <xs:element name="name" type="xs:string"/>
-            <xs:element name="population" type="xs:int"/>
-            <xs:element name="capital" type="xs:string"/>
-            <xs:element name="currency" type="tns:currency"/>
-        </xs:sequence>
-    </xs:complexType>
-
-    <xs:simpleType name="currency">
-        <xs:restriction base="xs:string">
-            <xs:enumeration value="GBP"/>
-            <xs:enumeration value="EUR"/>
-            <xs:enumeration value="PLN"/>
-        </xs:restriction>
-    </xs:simpleType>
 </xs:schema>