From 4fb466ee906d7442b059bc62fde13463ca6c4173 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Tue, 19 Mar 2019 08:58:58 +0100 Subject: Add App2MzsService Stub - Try it out with mvn spring-boot:run --- .../at/gv/egiz/moazs/App2MzsEndpointConfig.java | 24 ++++++++++++++++ .../egiz/moazs/App2MzsPortTypeImplementation.java | 32 ++++++++++++++++++++++ src/main/java/at/gv/egiz/moazs/MzsApp.java | 13 +++++++++ 3 files changed, 69 insertions(+) create mode 100644 src/main/java/at/gv/egiz/moazs/App2MzsEndpointConfig.java create mode 100644 src/main/java/at/gv/egiz/moazs/App2MzsPortTypeImplementation.java create mode 100644 src/main/java/at/gv/egiz/moazs/MzsApp.java (limited to 'src/main/java') diff --git a/src/main/java/at/gv/egiz/moazs/App2MzsEndpointConfig.java b/src/main/java/at/gv/egiz/moazs/App2MzsEndpointConfig.java new file mode 100644 index 0000000..2d524df --- /dev/null +++ b/src/main/java/at/gv/egiz/moazs/App2MzsEndpointConfig.java @@ -0,0 +1,24 @@ +package at.gv.egiz.moazs; + +import org.apache.cxf.Bus; +import org.apache.cxf.jaxws.EndpointImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.xml.ws.Endpoint; + +@Configuration +public class App2MzsEndpointConfig { + + @Autowired + private Bus bus; + + @Bean + public Endpoint endpoint() { + EndpointImpl endpoint = new EndpointImpl(bus, new App2MzsPortTypeImplementation()); + endpoint.publish(); + return endpoint; + } + +} diff --git a/src/main/java/at/gv/egiz/moazs/App2MzsPortTypeImplementation.java b/src/main/java/at/gv/egiz/moazs/App2MzsPortTypeImplementation.java new file mode 100644 index 0000000..244cf4d --- /dev/null +++ b/src/main/java/at/gv/egiz/moazs/App2MzsPortTypeImplementation.java @@ -0,0 +1,32 @@ +package at.gv.egiz.moazs; + +import at.gv.e_government.reference.namespace.app2mzs.App2MzsPortType; +import at.gv.e_government.reference.namespace.moazs10.app2mzs_.DeliveryRequestType; +import at.gv.e_government.reference.namespace.moazs10.app2mzs_.DeliveryResponseType; +import at.gv.e_government.reference.namespace.moazs10.app2mzs_.ObjectFactory; +import at.gv.e_government.reference.namespace.moazs10.app2mzs_.SuccessType; + +import javax.jws.WebParam; + +public class App2MzsPortTypeImplementation implements App2MzsPortType { + + @Override + public DeliveryResponseType app2Mzs( + @WebParam(partName = "DeliveryRequest", + name = "DeliveryRequest", + targetNamespace = "http://reference.e-government.gv.at/namespace/moazs10/app2mzs#") + DeliveryRequestType deliveryRequest) { + System.out.println("app2mzs got called"); + + ObjectFactory factory = new ObjectFactory(); + DeliveryResponseType response = factory.createDeliveryResponseType(); + + SuccessType success = factory.createSuccessType(); + success.setAppDeliveryID("12345"); + success.setMZSDeliveryID("12345"); + response.setSuccess(success); + + return response; + } + +} \ No newline at end of file diff --git a/src/main/java/at/gv/egiz/moazs/MzsApp.java b/src/main/java/at/gv/egiz/moazs/MzsApp.java new file mode 100644 index 0000000..6b4e34b --- /dev/null +++ b/src/main/java/at/gv/egiz/moazs/MzsApp.java @@ -0,0 +1,13 @@ +package at.gv.egiz.moazs; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MzsApp { + + public static void main(String[] args) { + SpringApplication.run(MzsApp.class, args); + } +} -- cgit v1.2.3