lizw 2 years ago
parent
commit
974dc7cb2a

+ 1 - 0
settings.gradle

@@ -1,4 +1,5 @@
 rootProject.name = 'yxt-api-gateway'
 include 'gateway-server'
 include 'soap-gateway'
+include 'test'
 

+ 13 - 0
test/build.gradle

@@ -0,0 +1,13 @@
+apply plugin: 'org.springframework.boot'
+
+dependencies {
+    api 'org.springframework.boot:spring-boot-starter'
+    api 'org.apache.commons:commons-lang3'
+    api 'commons-io:commons-io'
+}
+
+bootJar {
+    enabled = true
+}
+
+

+ 28 - 0
test/src/main/java/com/galaxis/wms/ScjndStdService.java

@@ -0,0 +1,28 @@
+
+package com.galaxis.wms;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2.9-b130926.1035
+ * Generated source version: 2.2
+ */
+@WebService(name = "ScjndStdService", targetNamespace = "http://scjndstd.crdxp.crtech.cn")
+public interface ScjndStdService {
+    @WebMethod
+    @WebResult(targetNamespace = "")
+    @RequestWrapper(localName = "webServiceMain", targetNamespace = "http://scjndstd.crdxp.crtech.cn", className = "com.galaxis.wms.api.erp.wms2erp.client.generate.WebServiceMain")
+    @ResponseWrapper(localName = "webServiceMainResponse", targetNamespace = "http://scjndstd.crdxp.crtech.cn", className = "com.galaxis.wms.api.erp.wms2erp.client.generate.WebServiceMainResponse")
+    String webServiceMain(
+            @WebParam(name = "method", targetNamespace = "")
+            String method,
+            @WebParam(name = "message", targetNamespace = "")
+            String message);
+}

+ 71 - 0
test/src/main/java/com/galaxis/wms/ScjndStdServiceTest.java

@@ -0,0 +1,71 @@
+package com.galaxis.wms;
+
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+
+/**
+ * 作者:lizw <br/>
+ * 创建时间:2023/01/13 17:15 <br/>
+ */
+@Slf4j
+public class ScjndStdServiceTest {
+    public static void main(String[] args) {
+        try {
+            ScjndStdServiceTest aa = new ScjndStdServiceTest();
+            aa.t01();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @SneakyThrows
+    public void t01() {
+        QName qName = new QName("http://scjndstd.crdxp.crtech.cn", "ScjndStdServiceService");
+        Service service = Service.create(new URL("http://10.10.1.15:9094/crdxp/server/SScjndStd_1/ws?wsdl"), qName);
+        ScjndStdService stdService = service.getPort(ScjndStdService.class);
+        String aa = "{\n" +
+                "    \"djbh\": \"273151131113227375\",\n" +
+                "    \"ckphddid\": \"1000000002\",\n" +
+                "    \"djbs\": \"XHC\",\n" +
+                "    \"djlx\": \"X40\",\n" +
+                "    \"mx_count\": 1,\n" +
+                "    \"rq\": \"2023-01-13\",\n" +
+                "    \"ontime\": \"13:55:00\",\n" +
+                "    \"wldwid\": \"WLD00000250\",\n" +
+                "    \"hzid\": \"HZZ00000001\",\n" +
+                "    \"username\": \"欧艳华\",\n" +
+                "    \"transportType\": 7,\n" +
+                "    \"logisticsNo\": \"\",\n" +
+                "    \"logisticsAllNo\": \"\",\n" +
+                "    \"sourceSoCode\": \"XHB000001128591\",\n" +
+                "    \"fahr\": \"欧艳华\",\n" +
+                "    \"fuhr\": \"尹文宝\",\n" +
+                "    \"fuhr1\": \"尹文宝\",\n" +
+                "    \"item\": [\n" +
+                "        {\n" +
+                "            \"dddjbh\": \"XHB000001128591\",\n" +
+                "            \"dj_sort\": 1,\n" +
+                "            \"spid\": \"SPZ00004515\",\n" +
+                "            \"pihaoxs\": \"20230001\",\n" +
+                "            \"sxrq\": \"2024-01-01\",\n" +
+                "            \"baozhiqi\": \"2023-01-11\",\n" +
+                "            \"shl\": 10,\n" +
+                "            \"baozhshl\": 10,\n" +
+                "            \"lingsshl\": 10,\n" +
+                "            \"jlgg\": 200,\n" +
+                "            \"hshj\": 35,\n" +
+                "            \"hsje\": 350,\n" +
+                "            \"cksx\": \"1\",\n" +
+                "            \"sourceSoNo\": 1\n" +
+                "        }\n" +
+                "    ]\n" +
+                "}";
+        String res = stdService.webServiceMain("ProductDelivery", aa);
+        log.info("--> {}", res);
+        System.out.println("@@@@: " + res);
+    }
+}

+ 57 - 0
test/src/main/resources/ws.xml

@@ -0,0 +1,57 @@
+<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://scjndstd.crdxp.crtech.cn" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ScjndStdServiceService" targetNamespace="http://scjndstd.crdxp.crtech.cn">
+  <wsdl:types>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://scjndstd.crdxp.crtech.cn" elementFormDefault="unqualified" targetNamespace="http://scjndstd.crdxp.crtech.cn" version="1.0">
+
+  <xs:element name="webServiceMain" type="tns:webServiceMain"/>
+
+  <xs:element name="webServiceMainResponse" type="tns:webServiceMainResponse"/>
+
+  <xs:complexType name="webServiceMain">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="method" type="xs:string"/>
+      <xs:element minOccurs="0" name="message" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="webServiceMainResponse">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="return" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+
+</xs:schema>
+  </wsdl:types>
+  <wsdl:message name="webServiceMainResponse">
+    <wsdl:part element="tns:webServiceMainResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="webServiceMain">
+    <wsdl:part element="tns:webServiceMain" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="ScjndStdService">
+    <wsdl:operation name="webServiceMain">
+      <wsdl:input message="tns:webServiceMain" name="webServiceMain">
+    </wsdl:input>
+      <wsdl:output message="tns:webServiceMainResponse" name="webServiceMainResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="ScjndStdServiceServiceSoapBinding" type="tns:ScjndStdService">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="webServiceMain">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="webServiceMain">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="webServiceMainResponse">
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="ScjndStdServiceService">
+    <wsdl:port binding="tns:ScjndStdServiceServiceSoapBinding" name="ScjndStdServicePort">
+      <soap:address location="http://10.10.1.17:8126/crdxp/server/SScjndStd_1/ws"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>