Commit 66eccf86 authored by Quxl's avatar Quxl

x

parent 889bc525
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<groupId>dom4j</groupId> <groupId>dom4j</groupId>
<artifactId>dom4j</artifactId> <artifactId>dom4j</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -18,7 +18,8 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -18,7 +18,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.egolm.sso.material_master.TestMaterialMaster; import com.egolm.sso.services.material_master.TestMaterialMaster;
import com.egolm.sso.services.price_list.PriceListService;
@Configuration @Configuration
...@@ -29,17 +30,23 @@ public class WsConfig { ...@@ -29,17 +30,23 @@ public class WsConfig {
@Autowired @Autowired
WSS4JInInterceptor authInterceptor; WSS4JInInterceptor authInterceptor;
@Autowired @Autowired
TestMaterialMaster materialMasterService; TestMaterialMaster testMaterialMaster;
@Bean @Bean
public Endpoint endpoint() { public Endpoint getMaterialMasterPoint() {
EndpointImpl endpoint = new EndpointImpl(bus, materialMasterService); EndpointImpl endpoint = new EndpointImpl(bus, testMaterialMaster);
//endpoint.setInInterceptors(Arrays.asList(authInterceptor));
endpoint.publish("/material_master"); endpoint.publish("/material_master");
return endpoint; return endpoint;
} }
@Bean
public Endpoint getPriceListPoint(PriceListService service) {
EndpointImpl endpoint = new EndpointImpl(bus, service);
endpoint.publish("/price_list");
return endpoint;
}
@Value("${wsUsername}") @Value("${wsUsername}")
private String wsUername; private String wsUername;
......
package com.egolm.sso.material_master; package com.egolm.sso.services.material_master;
import javax.jws.WebMethod; import javax.jws.WebMethod;
import javax.jws.WebService; import javax.jws.WebService;
......
package com.egolm.sso.material_master; package com.egolm.sso.services.material_master;
import javax.jws.WebService; import javax.jws.WebService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON; import com.google.gson.Gson;
@Component @Component
@WebService(serviceName = "TestMaterialMaster", targetNamespace = "http://material_master.sso.egolm.com", endpointInterface = "com.egolm.sso.material_master.TestMaterialMaster") @WebService(serviceName = "TestMaterialMaster", targetNamespace = "http://material_master.sso.egolm.com", endpointInterface = "com.egolm.sso.services.material_master.TestMaterialMaster")
public class TestMaterialMasterImpl implements TestMaterialMaster { public class TestMaterialMasterImpl implements TestMaterialMaster {
@Override @Override
public void execute(Z_MI_SD_001_MATERIAL_MASTER Z_MI_SD_001_MATERIAL_MASTER) { public void execute(Z_MI_SD_001_MATERIAL_MASTER Z_MI_SD_001_MATERIAL_MASTER) {
System.out.println(JSON.toJSON(Z_MI_SD_001_MATERIAL_MASTER)); System.out.println(new Gson().toJson(Z_MI_SD_001_MATERIAL_MASTER));
} }
} }
package com.egolm.sso.material_master; package com.egolm.sso.services.material_master;
import java.util.List; import java.util.List;
......
package com.egolm.sso.services.price_list;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://price_list.sso.egolm.com")
public interface PriceListService {
@WebMethod
public void execute(Z_MI_SD_002_PRICE_LIST Z_MI_SD_002_PRICE_LIST);
}
package com.egolm.sso.services.price_list;
import javax.jws.WebService;
import org.springframework.stereotype.Component;
import com.google.gson.Gson;
@Component
@WebService(serviceName = "PriceListService", targetNamespace = "http://price_list.sso.egolm.com", endpointInterface = "com.egolm.sso.services.price_list.PriceListService")
public class PriceListServiceImpl implements PriceListService {
@Override
public void execute(Z_MI_SD_002_PRICE_LIST Z_MI_SD_002_PRICE_LIST) {
System.out.println(new Gson().toJson(Z_MI_SD_002_PRICE_LIST));
}
}
package com.egolm.sso.services.price_list;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Z_MI_SD_002_PRICE_LIST", propOrder = { "RECORD" })
public class Z_MI_SD_002_PRICE_LIST {
@XmlElement(name = "RECORD", required = true)
protected Z_MI_SD_002_PRICE_LIST.RECORD RECORD;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "HEADER_SENDING", "ITEM" })
public static class RECORD {
@XmlElement(name = "HEADER_SENDING", required = true)
protected Z_MI_SD_002_PRICE_LIST.RECORD.HEADER_SENDING HEADER_SENDING;
@XmlElement(name = "ITEM", required = true)
protected List<Z_MI_SD_002_PRICE_LIST.RECORD.ITEM> ITEM;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "KUNNR", "DATUM", "UZEIT" })
public static class HEADER_SENDING {
@XmlElement(name = "KUNNR")
protected String KUNNR;
@XmlElement(name = "DATUM")
protected String DATUM;
@XmlElement(name = "UZEIT")
protected String UZEIT;
public String getKUNNR() {
return KUNNR;
}
public void setKUNNR(String kUNNR) {
KUNNR = kUNNR;
}
public String getDATUM() {
return DATUM;
}
public void setDATUM(String dATUM) {
DATUM = dATUM;
}
public String getUZEIT() {
return UZEIT;
}
public void setUZEIT(String uZEIT) {
UZEIT = uZEIT;
}
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "MATNR", "KBETR", "KONWA", "KPEIN", "KMEIN", "UMREZ", "MAKTX", "PRSCH", "DATAM", "DATBI", "PLINE", "PRSCH_1" })
public static class ITEM {
@XmlElement(name = "MATNR")
protected String MATNR;
@XmlElement(name = "KBETR")
protected String KBETR;
@XmlElement(name = "KONWA")
protected String KONWA;
@XmlElement(name = "KPEIN")
protected String KPEIN;
@XmlElement(name = "KMEIN")
protected String KMEIN;
@XmlElement(name = "UMREZ")
protected String UMREZ;
@XmlElement(name = "MAKTX")
protected String MAKTX;
@XmlElement(name = "PRSCH")
protected String PRSCH;
@XmlElement(name = "DATAM")
protected String DATAM;
@XmlElement(name = "DATBI")
protected String DATBI;
@XmlElement(name = "PLINE")
protected String PLINE;
@XmlElement(name = "PRSCH_1")
protected String PRSCH_1;
public String getMATNR() {
return MATNR;
}
public void setMATNR(String mATNR) {
MATNR = mATNR;
}
public String getKBETR() {
return KBETR;
}
public void setKBETR(String kBETR) {
KBETR = kBETR;
}
public String getKONWA() {
return KONWA;
}
public void setKONWA(String kONWA) {
KONWA = kONWA;
}
public String getKPEIN() {
return KPEIN;
}
public void setKPEIN(String kPEIN) {
KPEIN = kPEIN;
}
public String getKMEIN() {
return KMEIN;
}
public void setKMEIN(String kMEIN) {
KMEIN = kMEIN;
}
public String getUMREZ() {
return UMREZ;
}
public void setUMREZ(String uMREZ) {
UMREZ = uMREZ;
}
public String getMAKTX() {
return MAKTX;
}
public void setMAKTX(String mAKTX) {
MAKTX = mAKTX;
}
public String getPRSCH() {
return PRSCH;
}
public void setPRSCH(String pRSCH) {
PRSCH = pRSCH;
}
public String getDATAM() {
return DATAM;
}
public void setDATAM(String dATAM) {
DATAM = dATAM;
}
public String getDATBI() {
return DATBI;
}
public void setDATBI(String dATBI) {
DATBI = dATBI;
}
public String getPLINE() {
return PLINE;
}
public void setPLINE(String pLINE) {
PLINE = pLINE;
}
public String getPRSCH_1() {
return PRSCH_1;
}
public void setPRSCH_1(String pRSCH_1) {
PRSCH_1 = pRSCH_1;
}
}
public Z_MI_SD_002_PRICE_LIST.RECORD.HEADER_SENDING getHEADER_SENDING() {
return HEADER_SENDING;
}
public void setHEADER_SENDING(Z_MI_SD_002_PRICE_LIST.RECORD.HEADER_SENDING hEADER_SENDING) {
HEADER_SENDING = hEADER_SENDING;
}
public List<Z_MI_SD_002_PRICE_LIST.RECORD.ITEM> getITEM() {
return ITEM;
}
public void setITEM(List<Z_MI_SD_002_PRICE_LIST.RECORD.ITEM> iTEM) {
ITEM = iTEM;
}
}
public Z_MI_SD_002_PRICE_LIST.RECORD getRECORD() {
return RECORD;
}
public void setRECORD(Z_MI_SD_002_PRICE_LIST.RECORD rECORD) {
RECORD = rECORD;
}
}
package com.egolm.sso.material_master;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>execute complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* &lt;complexType name="execute"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="arg0" type="{http://material_master.sso.egolm.com}Z_MI_SD_001_MATERIAL_MASTER" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "execute", propOrder = {
"arg0"
})
public class Execute {
protected ZMISD001MATERIALMASTER arg0;
/**
* 获取arg0属性的值。
*
* @return
* possible object is
* {@link ZMISD001MATERIALMASTER }
*
*/
public ZMISD001MATERIALMASTER getArg0() {
return arg0;
}
/**
* 设置arg0属性的值。
*
* @param value
* allowed object is
* {@link ZMISD001MATERIALMASTER }
*
*/
public void setArg0(ZMISD001MATERIALMASTER value) {
this.arg0 = value;
}
}
package com.egolm.sso.material_master;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>executeResponse complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* &lt;complexType name="executeResponse"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "executeResponse")
public class ExecuteResponse {
}
package com.egolm.sso.material_master;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.egolm.sso.material_master package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _Execute_QNAME = new QName("http://material_master.sso.egolm.com", "execute");
private final static QName _ExecuteResponse_QNAME = new QName("http://material_master.sso.egolm.com", "executeResponse");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.egolm.sso.material_master
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link ZMISD001MATERIALMASTER }
*
*/
public ZMISD001MATERIALMASTER createZMISD001MATERIALMASTER() {
return new ZMISD001MATERIALMASTER();
}
/**
* Create an instance of {@link ZMISD001MATERIALMASTER.RECORD }
*
*/
public ZMISD001MATERIALMASTER.RECORD createZMISD001MATERIALMASTERRECORD() {
return new ZMISD001MATERIALMASTER.RECORD();
}
/**
* Create an instance of {@link Execute }
*
*/
public Execute createExecute() {
return new Execute();
}
/**
* Create an instance of {@link ExecuteResponse }
*
*/
public ExecuteResponse createExecuteResponse() {
return new ExecuteResponse();
}
/**
* Create an instance of {@link ZMISD001MATERIALMASTER.RECORD.HEADERSENDING }
*
*/
public ZMISD001MATERIALMASTER.RECORD.HEADERSENDING createZMISD001MATERIALMASTERRECORDHEADERSENDING() {
return new ZMISD001MATERIALMASTER.RECORD.HEADERSENDING();
}
/**
* Create an instance of {@link ZMISD001MATERIALMASTER.RECORD.ITEM }
*
*/
public ZMISD001MATERIALMASTER.RECORD.ITEM createZMISD001MATERIALMASTERRECORDITEM() {
return new ZMISD001MATERIALMASTER.RECORD.ITEM();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Execute }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://material_master.sso.egolm.com", name = "execute")
public JAXBElement<Execute> createExecute(Execute value) {
return new JAXBElement<Execute>(_Execute_QNAME, Execute.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ExecuteResponse }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://material_master.sso.egolm.com", name = "executeResponse")
public JAXBElement<ExecuteResponse> createExecuteResponse(ExecuteResponse value) {
return new JAXBElement<ExecuteResponse>(_ExecuteResponse_QNAME, ExecuteResponse.class, null, value);
}
}
package com.egolm.sso.material_master;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
/**
* This class was generated by Apache CXF 3.2.9
* 2019-07-05T15:19:41.150+08:00
* Generated source version: 3.2.9
*
*/
@WebService(targetNamespace = "http://material_master.sso.egolm.com", name = "TestMaterialMaster")
@XmlSeeAlso({ObjectFactory.class})
public interface TestMaterialMaster {
@WebMethod
@RequestWrapper(localName = "execute", targetNamespace = "http://material_master.sso.egolm.com", className = "com.egolm.sso.material_master.Execute")
@ResponseWrapper(localName = "executeResponse", targetNamespace = "http://material_master.sso.egolm.com", className = "com.egolm.sso.material_master.ExecuteResponse")
public void execute(
@WebParam(name = "arg0", targetNamespace = "")
com.egolm.sso.material_master.ZMISD001MATERIALMASTER arg0
);
}
package com.egolm.sso.material_master;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 3.2.9
* 2019-07-05T15:19:41.182+08:00
* Generated source version: 3.2.9
*
*/
@WebServiceClient(name = "TestMaterialMaster",
wsdlLocation = "http://localhost:8080/sso/services/material_master?wsdl",
targetNamespace = "http://material_master.sso.egolm.com")
public class TestMaterialMaster_Service extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://material_master.sso.egolm.com", "TestMaterialMaster");
public final static QName TestMaterialMasterImplPort = new QName("http://material_master.sso.egolm.com", "TestMaterialMasterImplPort");
static {
URL url = null;
try {
url = new URL("http://localhost:8080/sso/services/material_master?wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(TestMaterialMaster_Service.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "http://localhost:8080/sso/services/material_master?wsdl");
}
WSDL_LOCATION = url;
}
public TestMaterialMaster_Service(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public TestMaterialMaster_Service(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public TestMaterialMaster_Service() {
super(WSDL_LOCATION, SERVICE);
}
public TestMaterialMaster_Service(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
public TestMaterialMaster_Service(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
public TestMaterialMaster_Service(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns TestMaterialMaster
*/
@WebEndpoint(name = "TestMaterialMasterImplPort")
public TestMaterialMaster getTestMaterialMasterImplPort() {
return super.getPort(TestMaterialMasterImplPort, TestMaterialMaster.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns TestMaterialMaster
*/
@WebEndpoint(name = "TestMaterialMasterImplPort")
public TestMaterialMaster getTestMaterialMasterImplPort(WebServiceFeature... features) {
return super.getPort(TestMaterialMasterImplPort, TestMaterialMaster.class, features);
}
}
@javax.xml.bind.annotation.XmlSchema(namespace = "http://material_master.sso.egolm.com")
package com.egolm.sso.material_master;
package com.egolm.sso.price_list;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>execute complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* &lt;complexType name="execute"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="arg0" type="{http://price_list.sso.egolm.com}Z_MI_SD_002_PRICE_LIST" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "execute", propOrder = {
"arg0"
})
public class Execute {
protected ZMISD002PRICELIST arg0;
/**
* 获取arg0属性的值。
*
* @return
* possible object is
* {@link ZMISD002PRICELIST }
*
*/
public ZMISD002PRICELIST getArg0() {
return arg0;
}
/**
* 设置arg0属性的值。
*
* @param value
* allowed object is
* {@link ZMISD002PRICELIST }
*
*/
public void setArg0(ZMISD002PRICELIST value) {
this.arg0 = value;
}
}
package com.egolm.sso.price_list;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>executeResponse complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* &lt;complexType name="executeResponse"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "executeResponse")
public class ExecuteResponse {
}
package com.egolm.sso.price_list;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.egolm.sso.price_list package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _Execute_QNAME = new QName("http://price_list.sso.egolm.com", "execute");
private final static QName _ExecuteResponse_QNAME = new QName("http://price_list.sso.egolm.com", "executeResponse");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.egolm.sso.price_list
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link ZMISD002PRICELIST }
*
*/
public ZMISD002PRICELIST createZMISD002PRICELIST() {
return new ZMISD002PRICELIST();
}
/**
* Create an instance of {@link ZMISD002PRICELIST.RECORD }
*
*/
public ZMISD002PRICELIST.RECORD createZMISD002PRICELISTRECORD() {
return new ZMISD002PRICELIST.RECORD();
}
/**
* Create an instance of {@link Execute }
*
*/
public Execute createExecute() {
return new Execute();
}
/**
* Create an instance of {@link ExecuteResponse }
*
*/
public ExecuteResponse createExecuteResponse() {
return new ExecuteResponse();
}
/**
* Create an instance of {@link ZMISD002PRICELIST.RECORD.HEADERSENDING }
*
*/
public ZMISD002PRICELIST.RECORD.HEADERSENDING createZMISD002PRICELISTRECORDHEADERSENDING() {
return new ZMISD002PRICELIST.RECORD.HEADERSENDING();
}
/**
* Create an instance of {@link ZMISD002PRICELIST.RECORD.ITEM }
*
*/
public ZMISD002PRICELIST.RECORD.ITEM createZMISD002PRICELISTRECORDITEM() {
return new ZMISD002PRICELIST.RECORD.ITEM();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Execute }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://price_list.sso.egolm.com", name = "execute")
public JAXBElement<Execute> createExecute(Execute value) {
return new JAXBElement<Execute>(_Execute_QNAME, Execute.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ExecuteResponse }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://price_list.sso.egolm.com", name = "executeResponse")
public JAXBElement<ExecuteResponse> createExecuteResponse(ExecuteResponse value) {
return new JAXBElement<ExecuteResponse>(_ExecuteResponse_QNAME, ExecuteResponse.class, null, value);
}
}
package com.egolm.sso.price_list;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
/**
* This class was generated by Apache CXF 3.2.9
* 2019-07-05T17:27:12.453+08:00
* Generated source version: 3.2.9
*
*/
@WebService(targetNamespace = "http://price_list.sso.egolm.com", name = "PriceListService")
@XmlSeeAlso({ObjectFactory.class})
public interface PriceListService {
@WebMethod
@RequestWrapper(localName = "execute", targetNamespace = "http://price_list.sso.egolm.com", className = "com.egolm.sso.price_list.Execute")
@ResponseWrapper(localName = "executeResponse", targetNamespace = "http://price_list.sso.egolm.com", className = "com.egolm.sso.price_list.ExecuteResponse")
public void execute(
@WebParam(name = "arg0", targetNamespace = "")
com.egolm.sso.price_list.ZMISD002PRICELIST arg0
);
}
package com.egolm.sso.price_list;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 3.2.9
* 2019-07-05T17:27:12.484+08:00
* Generated source version: 3.2.9
*
*/
@WebServiceClient(name = "PriceListService",
wsdlLocation = "http://localhost:8080/sso/services/price_list?wsdl",
targetNamespace = "http://price_list.sso.egolm.com")
public class PriceListService_Service extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://price_list.sso.egolm.com", "PriceListService");
public final static QName PriceListServiceImplPort = new QName("http://price_list.sso.egolm.com", "PriceListServiceImplPort");
static {
URL url = null;
try {
url = new URL("http://localhost:8080/sso/services/price_list?wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(PriceListService_Service.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "http://localhost:8080/sso/services/price_list?wsdl");
}
WSDL_LOCATION = url;
}
public PriceListService_Service(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public PriceListService_Service(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public PriceListService_Service() {
super(WSDL_LOCATION, SERVICE);
}
public PriceListService_Service(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
public PriceListService_Service(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
public PriceListService_Service(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns PriceListService
*/
@WebEndpoint(name = "PriceListServiceImplPort")
public PriceListService getPriceListServiceImplPort() {
return super.getPort(PriceListServiceImplPort, PriceListService.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns PriceListService
*/
@WebEndpoint(name = "PriceListServiceImplPort")
public PriceListService getPriceListServiceImplPort(WebServiceFeature... features) {
return super.getPort(PriceListServiceImplPort, PriceListService.class, features);
}
}
This diff is collapsed.
@javax.xml.bind.annotation.XmlSchema(namespace = "http://price_list.sso.egolm.com")
package com.egolm.sso.price_list;
package com.schneider_distributor;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.schneider_distributor package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _ZMTSD009SOCREATION_QNAME = new QName("http://schneider-distributor.com/", "Z_MT_SD_009_SO_CREATION");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.schneider_distributor
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link ZDTSD009SOCREATION }
*
*/
public ZDTSD009SOCREATION createZDTSD009SOCREATION() {
return new ZDTSD009SOCREATION();
}
/**
* Create an instance of {@link ZDTSD009SOCREATION.Header }
*
*/
public ZDTSD009SOCREATION.Header createZDTSD009SOCREATIONHeader() {
return new ZDTSD009SOCREATION.Header();
}
/**
* Create an instance of {@link ZDTSD009SOCREATION.ITEM }
*
*/
public ZDTSD009SOCREATION.ITEM createZDTSD009SOCREATIONITEM() {
return new ZDTSD009SOCREATION.ITEM();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ZDTSD009SOCREATION }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://schneider-distributor.com/", name = "Z_MT_SD_009_SO_CREATION")
public JAXBElement<ZDTSD009SOCREATION> createZMTSD009SOCREATION(ZDTSD009SOCREATION value) {
return new JAXBElement<ZDTSD009SOCREATION>(_ZMTSD009SOCREATION_QNAME, ZDTSD009SOCREATION.class, null, value);
}
}
package com.schneider_distributor;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;
/**
* This class was generated by Apache CXF 3.2.9
* 2019-07-05T14:08:11.116+08:00
* Generated source version: 3.2.9
*
*/
@WebService(targetNamespace = "http://schneider-distributor.com/", name = "Z_MI_SD_009_SO_CREATION")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface ZMISD009SOCREATION {
@WebMethod(operationName = "Z_MI_SD_009_SO_CREATION", action = "http://sap.com/xi/WebService/soap1.1")
@Oneway
public void zMISD009SOCREATION(
@WebParam(partName = "Z_MT_SD_009_SO_CREATION", name = "Z_MT_SD_009_SO_CREATION", targetNamespace = "http://schneider-distributor.com/")
ZDTSD009SOCREATION zMTSD009SOCREATION
);
}
package com.schneider_distributor;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 3.2.9
* 2019-07-05T14:08:11.147+08:00
* Generated source version: 3.2.9
*
*/
@WebServiceClient(name = "Z_MI_SD_009_SO_CREATIONService",
wsdlLocation = "file:/C:/Users/Quxl/Desktop/Z_MI_SD_009_SO_CREATION.wsdl",
targetNamespace = "http://schneider-distributor.com/")
public class ZMISD009SOCREATIONService extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://schneider-distributor.com/", "Z_MI_SD_009_SO_CREATIONService");
public final static QName ZMISD009SOCREATIONPort = new QName("http://schneider-distributor.com/", "Z_MI_SD_009_SO_CREATIONPort");
static {
URL url = null;
try {
url = new URL("file:/C:/Users/Quxl/Desktop/Z_MI_SD_009_SO_CREATION.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(ZMISD009SOCREATIONService.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "file:/C:/Users/Quxl/Desktop/Z_MI_SD_009_SO_CREATION.wsdl");
}
WSDL_LOCATION = url;
}
public ZMISD009SOCREATIONService(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public ZMISD009SOCREATIONService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public ZMISD009SOCREATIONService() {
super(WSDL_LOCATION, SERVICE);
}
public ZMISD009SOCREATIONService(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
public ZMISD009SOCREATIONService(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
public ZMISD009SOCREATIONService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns ZMISD009SOCREATION
*/
@WebEndpoint(name = "Z_MI_SD_009_SO_CREATIONPort")
public ZMISD009SOCREATION getZMISD009SOCREATIONPort() {
return super.getPort(ZMISD009SOCREATIONPort, ZMISD009SOCREATION.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns ZMISD009SOCREATION
*/
@WebEndpoint(name = "Z_MI_SD_009_SO_CREATIONPort")
public ZMISD009SOCREATION getZMISD009SOCREATIONPort(WebServiceFeature... features) {
return super.getPort(ZMISD009SOCREATIONPort, ZMISD009SOCREATION.class, features);
}
}
@javax.xml.bind.annotation.XmlSchema(namespace = "http://schneider-distributor.com/")
package com.schneider_distributor;
package test;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.handler.WSHandlerConstants;
import org.apache.wss4j.common.ext.WSPasswordCallback;
import com.alibaba.fastjson.JSON;
public class JaxWsDynamicClientTest {
private static final String username = "test";
private static final String password = "78258c537d6e4d5fb210a57d05619fb6";
public static void main(String[] args) throws Exception {
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
ClientImpl client = (ClientImpl) factory.createClient("http://localhost:8080/sso/services/material_master?wsdl");
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
properties.put(WSHandlerConstants.USER, username);
properties.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
properties.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
public void handle(Callback[] callbacks) {
for (int i = 0; i < callbacks.length; i++) {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
pc.setPassword(password);
}
}
});
WSS4JOutInterceptor interceptor = new WSS4JOutInterceptor();
interceptor.setProperties(properties);
client.setOutInterceptors(Arrays.asList(interceptor));
String xml = readText("D:/data/sso/001.XML");
System.out.println(JSON.toJSONString(client.invoke("execute", xml)));
}
private static String readText(String path) throws IOException {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(path)));
String line = null;
StringBuffer sb = new StringBuffer();
while ((line = br.readLine()) != null) {
sb.append(line);
}
return sb.toString();
} finally {
br.close();
}
}
}
package test;
import java.util.List;
import com.egolm.sso.material_master.TestMaterialMaster;
import com.egolm.sso.material_master.TestMaterialMaster_Service;
import com.egolm.sso.material_master.ZMISD001MATERIALMASTER;
public class MaterialMasterServiceTest {
public static void main(String[] args) {
TestMaterialMaster_Service service = new TestMaterialMaster_Service();
TestMaterialMaster testMaterialMaster = service.getTestMaterialMasterImplPort();
testMaterialMaster.execute(getZMISD001MATERIALMASTER());
}
private static ZMISD001MATERIALMASTER getZMISD001MATERIALMASTER() {
ZMISD001MATERIALMASTER ZMISD001MATERIALMASTER = new ZMISD001MATERIALMASTER();
ZMISD001MATERIALMASTER.RECORD RECORD = new ZMISD001MATERIALMASTER.RECORD();
ZMISD001MATERIALMASTER.RECORD.HEADERSENDING HEADERSENDING = new ZMISD001MATERIALMASTER.RECORD.HEADERSENDING();
HEADERSENDING.setDATUM("DATUM");
HEADERSENDING.setKUNNR("KUNNR");
HEADERSENDING.setUZEIT("SUEIT");
RECORD.setHEADERSENDING(HEADERSENDING);
List<ZMISD001MATERIALMASTER.RECORD.ITEM> ITEMLIST = RECORD.getITEM();
ZMISD001MATERIALMASTER.RECORD.ITEM ITEM = new ZMISD001MATERIALMASTER.RECORD.ITEM();
ITEM.setBRGEW("BRGEW");
ITEMLIST.add(ITEM);
RECORD.setHEADERSENDING(HEADERSENDING);
ZMISD001MATERIALMASTER.setRECORD(RECORD);
return ZMISD001MATERIALMASTER;
}
}
package test;
import com.schneider_distributor.ZDTSD009SOCREATION;
import com.schneider_distributor.ZMISD009SOCREATION;
import com.schneider_distributor.ZMISD009SOCREATIONService;
public class OSCreationServiceTest {
public static void main(String[] args) {
ZMISD009SOCREATIONService service = new ZMISD009SOCREATIONService();
ZMISD009SOCREATION ZMISD009SOCREATION = service.getZMISD009SOCREATIONPort();
ZMISD009SOCREATION.zMISD009SOCREATION(getZMTSD009SOCREATION());
}
private static ZDTSD009SOCREATION getZMTSD009SOCREATION() {
return null;
}
}
package test;
import java.util.List;
import com.egolm.sso.price_list.PriceListService;
import com.egolm.sso.price_list.PriceListService_Service;
import com.egolm.sso.price_list.ZMISD002PRICELIST;
public class PriceListServiceTest {
public static void main(String[] args) {
PriceListService_Service service = new PriceListService_Service();
PriceListService priceListService = service.getPriceListServiceImplPort();
priceListService.execute(getZMISD002PRICELIST());
}
private static ZMISD002PRICELIST getZMISD002PRICELIST() {
ZMISD002PRICELIST ZMISD002PRICELIST = new ZMISD002PRICELIST();
ZMISD002PRICELIST.RECORD RECORD = new ZMISD002PRICELIST.RECORD();
ZMISD002PRICELIST.RECORD.HEADERSENDING HEADERSENDING = new ZMISD002PRICELIST.RECORD.HEADERSENDING();
HEADERSENDING.setDATUM("DATUM");
HEADERSENDING.setKUNNR("KUNNR");
HEADERSENDING.setUZEIT("SUEIT");
RECORD.setHEADERSENDING(HEADERSENDING);
List<ZMISD002PRICELIST.RECORD.ITEM> ITEMLIST = RECORD.getITEM();
ZMISD002PRICELIST.RECORD.ITEM ITEM = new ZMISD002PRICELIST.RECORD.ITEM();
ITEM.setDATAM("DATAM");
ITEMLIST.add(ITEM);
RECORD.setHEADERSENDING(HEADERSENDING);
ZMISD002PRICELIST.setRECORD(RECORD);
return ZMISD002PRICELIST;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment