From bcb50da2b740da9122ae5ca6366582e0efa096bb Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 20 Jan 2009 14:16:18 +0000 Subject: prepare for stal service extension git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@263 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../egiz/stal/service/GetHashDataInputFault.java | 2 +- .../java/at/gv/egiz/stal/service/STALPortType.java | 7 +- .../java/at/gv/egiz/stal/service/STALService.java | 35 +++- .../service/types/GetNextRequestResponseType.java | 30 ++-- .../stal/service/types/GetNextRequestType.java | 29 ++-- .../gv/egiz/stal/service/types/ObjectFactory.java | 184 +++++++++++++++------ .../at/gv/egiz/stal/service/types/RequestType.java | 8 + .../gv/egiz/stal/service/types/ResponseType.java | 7 + .../java/at/gv/egiz/stal/util/STALTranslator.java | 33 ++-- 9 files changed, 242 insertions(+), 93 deletions(-) (limited to 'STALService/src/main/java/at') diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java index df42ab47..2f08350c 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java @@ -8,7 +8,7 @@ import at.gv.egiz.stal.service.types.GetHashDataInputFaultType; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.3-b02- - * Generated source version: 2.0 + * Generated source version: 2.1 * */ @WebFault(name = "GetHashDataInputFault", targetNamespace = "http://www.egiz.gv.at/stal") diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java b/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java index 6ac6b10a..436ee7f1 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java @@ -6,6 +6,7 @@ import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; +import javax.xml.bind.annotation.XmlSeeAlso; import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; import at.gv.egiz.stal.service.types.GetHashDataInputType; import at.gv.egiz.stal.service.types.GetNextRequestResponseType; @@ -15,11 +16,15 @@ import at.gv.egiz.stal.service.types.GetNextRequestType; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.3-b02- - * Generated source version: 2.0 + * Generated source version: 2.1 * */ @WebService(name = "STALPortType", targetNamespace = "http://www.egiz.gv.at/wsdl/stal") @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) +@XmlSeeAlso({ + at.gv.egiz.stal.service.types.ObjectFactory.class +// at.buergerkarte.namespaces.cardchannel.ObjectFactory.class +}) public interface STALPortType { diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java b/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java index d4b58af9..ba4b541e 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java @@ -1,31 +1,52 @@ package at.gv.egiz.stal.service; +import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Logger; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.3-b02- - * Generated source version: 2.0 + * Generated source version: 2.1 * */ @WebServiceClient(name = "STALService", targetNamespace = "http://www.egiz.gv.at/wsdl/stal") +//, wsdlLocation = "file:/home/clemens/workspace/mocca/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal-service.wsdl") public class STALService extends Service { +// private final static URL STALSERVICE_WSDL_LOCATION; private final static Logger logger = Logger.getLogger(at.gv.egiz.stal.service.STALService.class.getName()); +// static { +// URL url = null; +// try { +// URL baseUrl; +// baseUrl = at.gv.egiz.stal.service.STALService.class.getResource("."); +// url = new URL(baseUrl, "file:/home/clemens/workspace/mocca/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal-service.wsdl"); +// } catch (MalformedURLException e) { +// logger.warning("Failed to create URL for the wsdl Location: 'file:/home/clemens/workspace/mocca/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal-service.wsdl', retrying as a local file"); +// logger.warning(e.getMessage()); +// } +// STALSERVICE_WSDL_LOCATION = url; +// } + public STALService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } +// public STALService() { +// super(STALSERVICE_WSDL_LOCATION, new QName("http://www.egiz.gv.at/wsdl/stal", "STALService")); +// } + /** * * @return @@ -36,4 +57,16 @@ public class STALService return super.getPort(new QName("http://www.egiz.gv.at/wsdl/stal", "STALPort"), STALPortType.class); } + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns STALPortType + */ +// @WebEndpoint(name = "STALPort") +// public STALPortType getSTALPort(WebServiceFeature... features) { +// return super.getPort(new QName("http://www.egiz.gv.at/wsdl/stal", "STALPort"), STALPortType.class, features); +// } + } diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java index 6f8204cc..0f56c3ce 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java @@ -3,12 +3,14 @@ package at.gv.egiz.stal.service.types; import java.util.ArrayList; import java.util.List; +import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; import javax.xml.bind.annotation.XmlType; +//import at.buergerkarte.namespaces.cardchannel.ScriptType; /** @@ -24,6 +26,7 @@ import javax.xml.bind.annotation.XmlType; * <element name="InfoboxReadRequest" type="{http://www.egiz.gv.at/stal}InfoboxReadRequestType"/> * <element name="SignRequest" type="{http://www.egiz.gv.at/stal}SignRequestType"/> * <element name="QuitRequest" type="{http://www.egiz.gv.at/stal}QuitRequestType"/> + * <element ref="{http://www.egiz.gv.at/stal}OtherRequest"/> * </choice> * <attribute name="SessionId" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> @@ -39,12 +42,13 @@ import javax.xml.bind.annotation.XmlType; }) public class GetNextRequestResponseType { - @XmlElements({ - @XmlElement(name = "InfoboxReadRequest", type = InfoboxReadRequestType.class), - @XmlElement(name = "QuitRequest", type = QuitRequestType.class), - @XmlElement(name = "SignRequest", type = SignRequestType.class) + @XmlElementRefs({ + @XmlElementRef(name = "SignRequest", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class), + @XmlElementRef(name = "QuitRequest", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class), + @XmlElementRef(name = "OtherRequest", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class), + @XmlElementRef(name = "InfoboxReadRequest", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class) }) - protected List infoboxReadRequestOrSignRequestOrQuitRequest; + protected List> infoboxReadRequestOrSignRequestOrQuitRequest; @XmlAttribute(name = "SessionId") protected String sessionId; @@ -66,15 +70,17 @@ public class GetNextRequestResponseType { * *

* Objects of the following type(s) are allowed in the list - * {@link InfoboxReadRequestType } - * {@link QuitRequestType } - * {@link SignRequestType } + * {@link JAXBElement }{@code <}{@link QuitRequestType }{@code >} + * {@link JAXBElement }{@code <}{@link RequestType }{@code >} + * {@link JAXBElement }{@code <}{@link ScriptType }{@code >} + * {@link JAXBElement }{@code <}{@link InfoboxReadRequestType }{@code >} + * {@link JAXBElement }{@code <}{@link SignRequestType }{@code >} * * */ - public List getInfoboxReadRequestOrSignRequestOrQuitRequest() { + public List> getInfoboxReadRequestOrSignRequestOrQuitRequest() { if (infoboxReadRequestOrSignRequestOrQuitRequest == null) { - infoboxReadRequestOrSignRequestOrQuitRequest = new ArrayList(); + infoboxReadRequestOrSignRequestOrQuitRequest = new ArrayList>(); } return this.infoboxReadRequestOrSignRequestOrQuitRequest; } diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java index eab3d40b..320d9136 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java @@ -3,11 +3,12 @@ package at.gv.egiz.stal.service.types; import java.util.ArrayList; import java.util.List; +import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; import javax.xml.bind.annotation.XmlType; @@ -24,6 +25,7 @@ import javax.xml.bind.annotation.XmlType; * <element name="InfoboxReadResponse" type="{http://www.egiz.gv.at/stal}InfoboxReadResponseType"/> * <element name="SignResponse" type="{http://www.egiz.gv.at/stal}SignResponseType"/> * <element name="ErrorResponse" type="{http://www.egiz.gv.at/stal}ErrorResponseType"/> + * <element ref="{http://www.egiz.gv.at/stal}OtherResponse"/> * </choice> * <attribute name="SessionId" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> @@ -39,12 +41,13 @@ import javax.xml.bind.annotation.XmlType; }) public class GetNextRequestType { - @XmlElements({ - @XmlElement(name = "SignResponse", type = SignResponseType.class), - @XmlElement(name = "InfoboxReadResponse", type = InfoboxReadResponseType.class), - @XmlElement(name = "ErrorResponse", type = ErrorResponseType.class) + @XmlElementRefs({ + @XmlElementRef(name = "ErrorResponse", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class), + @XmlElementRef(name = "SignResponse", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class), + @XmlElementRef(name = "OtherResponse", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class), + @XmlElementRef(name = "InfoboxReadResponse", namespace = "http://www.egiz.gv.at/stal", type = JAXBElement.class) }) - protected List infoboxReadResponseOrSignResponseOrErrorResponse; + protected List> infoboxReadResponseOrSignResponseOrErrorResponse; @XmlAttribute(name = "SessionId") protected String sessionId; @@ -66,15 +69,17 @@ public class GetNextRequestType { * *

* Objects of the following type(s) are allowed in the list - * {@link SignResponseType } - * {@link InfoboxReadResponseType } - * {@link ErrorResponseType } + * {@link JAXBElement }{@code <}{@link SignResponseType }{@code >} + * {@link JAXBElement }{@code <}{@link at.buergerkarte.namespaces.cardchannel.ResponseType }{@code >} + * {@link JAXBElement }{@code <}{@link ErrorResponseType }{@code >} + * {@link JAXBElement }{@code <}{@link at.gv.egiz.stal.service.types.ResponseType }{@code >} + * {@link JAXBElement }{@code <}{@link InfoboxReadResponseType }{@code >} * * */ - public List getInfoboxReadResponseOrSignResponseOrErrorResponse() { + public List> getInfoboxReadResponseOrSignResponseOrErrorResponse() { if (infoboxReadResponseOrSignResponseOrErrorResponse == null) { - infoboxReadResponseOrSignResponseOrErrorResponse = new ArrayList(); + infoboxReadResponseOrSignResponseOrErrorResponse = new ArrayList>(); } return this.infoboxReadResponseOrSignResponseOrErrorResponse; } diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java index d485f1e1..8b6fb76a 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java @@ -24,12 +24,20 @@ import javax.xml.namespace.QName; @XmlRegistry public class ObjectFactory { - private final static QName _GetHashDataInputFault_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputFault"); private final static QName _GetHashDataInput_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInput"); - private final static QName _GetNextRequestResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequestResponse"); private final static QName _GetHashDataInputResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputResponse"); + private final static QName _OtherRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "OtherRequest"); private final static QName _GetNextRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequest"); + private final static QName _OtherResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "OtherResponse"); private final static QName _SessionId_QNAME = new QName("http://www.egiz.gv.at/stal", "SessionId"); + private final static QName _GetHashDataInputFault_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputFault"); + private final static QName _GetNextRequestResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequestResponse"); + private final static QName _GetNextRequestResponseTypeQuitRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "QuitRequest"); + private final static QName _GetNextRequestResponseTypeInfoboxReadRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "InfoboxReadRequest"); + private final static QName _GetNextRequestResponseTypeSignRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "SignRequest"); + private final static QName _GetNextRequestTypeErrorResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "ErrorResponse"); + private final static QName _GetNextRequestTypeSignResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "SignResponse"); + private final static QName _GetNextRequestTypeInfoboxReadResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "InfoboxReadResponse"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.gv.egiz.stal.service.types @@ -38,6 +46,22 @@ public class ObjectFactory { public ObjectFactory() { } + /** + * Create an instance of {@link GetHashDataInputType } + * + */ + public GetHashDataInputType createGetHashDataInputType() { + return new GetHashDataInputType(); + } + + /** + * Create an instance of {@link GetHashDataInputResponseType.Reference } + * + */ + public GetHashDataInputResponseType.Reference createGetHashDataInputResponseTypeReference() { + return new GetHashDataInputResponseType.Reference(); + } + /** * Create an instance of {@link GetNextRequestType } * @@ -47,19 +71,19 @@ public class ObjectFactory { } /** - * Create an instance of {@link InfoboxReadRequestType } + * Create an instance of {@link SignRequestType } * */ - public InfoboxReadRequestType createInfoboxReadRequestType() { - return new InfoboxReadRequestType(); + public SignRequestType createSignRequestType() { + return new SignRequestType(); } /** - * Create an instance of {@link GetHashDataInputResponseType.Reference } + * Create an instance of {@link GetHashDataInputType.Reference } * */ - public GetHashDataInputResponseType.Reference createGetHashDataInputResponseTypeReference() { - return new GetHashDataInputResponseType.Reference(); + public GetHashDataInputType.Reference createGetHashDataInputTypeReference() { + return new GetHashDataInputType.Reference(); } /** @@ -71,27 +95,43 @@ public class ObjectFactory { } /** - * Create an instance of {@link GetHashDataInputType } + * Create an instance of {@link QuitRequestType } * */ - public GetHashDataInputType createGetHashDataInputType() { - return new GetHashDataInputType(); + public QuitRequestType createQuitRequestType() { + return new QuitRequestType(); } /** - * Create an instance of {@link SignRequestType } + * Create an instance of {@link InfoboxReadResponseType } * */ - public SignRequestType createSignRequestType() { - return new SignRequestType(); + public InfoboxReadResponseType createInfoboxReadResponseType() { + return new InfoboxReadResponseType(); } /** - * Create an instance of {@link GetHashDataInputFaultType } + * Create an instance of {@link InfoboxReadRequestType } * */ - public GetHashDataInputFaultType createGetHashDataInputFaultType() { - return new GetHashDataInputFaultType(); + public InfoboxReadRequestType createInfoboxReadRequestType() { + return new InfoboxReadRequestType(); + } + + /** + * Create an instance of {@link GetNextRequestResponseType } + * + */ + public GetNextRequestResponseType createGetNextRequestResponseType() { + return new GetNextRequestResponseType(); + } + + /** + * Create an instance of {@link GetHashDataInputResponseType } + * + */ + public GetHashDataInputResponseType createGetHashDataInputResponseType() { + return new GetHashDataInputResponseType(); } /** @@ -103,61 +143,74 @@ public class ObjectFactory { } /** - * Create an instance of {@link GetHashDataInputType.Reference } + * Create an instance of {@link GetHashDataInputFaultType } * */ - public GetHashDataInputType.Reference createGetHashDataInputTypeReference() { - return new GetHashDataInputType.Reference(); + public GetHashDataInputFaultType createGetHashDataInputFaultType() { + return new GetHashDataInputFaultType(); } /** - * Create an instance of {@link GetHashDataInputResponseType } + * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputType }{@code >}} * */ - public GetHashDataInputResponseType createGetHashDataInputResponseType() { - return new GetHashDataInputResponseType(); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInput") + public JAXBElement createGetHashDataInput(GetHashDataInputType value) { + return new JAXBElement(_GetHashDataInput_QNAME, GetHashDataInputType.class, null, value); } /** - * Create an instance of {@link InfoboxReadResponseType } + * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputResponseType }{@code >}} * */ - public InfoboxReadResponseType createInfoboxReadResponseType() { - return new InfoboxReadResponseType(); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputResponse") + public JAXBElement createGetHashDataInputResponse(GetHashDataInputResponseType value) { + return new JAXBElement(_GetHashDataInputResponse_QNAME, GetHashDataInputResponseType.class, null, value); } /** - * Create an instance of {@link QuitRequestType } + * Create an instance of {@link JAXBElement }{@code <}{@link RequestType }{@code >}} * */ - public QuitRequestType createQuitRequestType() { - return new QuitRequestType(); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "OtherRequest") + public JAXBElement createOtherRequest(RequestType value) { + return new JAXBElement(_OtherRequest_QNAME, RequestType.class, null, value); } /** - * Create an instance of {@link GetNextRequestResponseType } + * Create an instance of {@link JAXBElement }{@code <}{@link GetNextRequestType }{@code >}} * */ - public GetNextRequestResponseType createGetNextRequestResponseType() { - return new GetNextRequestResponseType(); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetNextRequest") + public JAXBElement createGetNextRequest(GetNextRequestType value) { + return new JAXBElement(_GetNextRequest_QNAME, GetNextRequestType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputFaultType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link ResponseType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputFault") - public JAXBElement createGetHashDataInputFault(GetHashDataInputFaultType value) { - return new JAXBElement(_GetHashDataInputFault_QNAME, GetHashDataInputFaultType.class, null, value); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "OtherResponse") + public JAXBElement createOtherResponse(ResponseType value) { + return new JAXBElement(_OtherResponse_QNAME, ResponseType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInput") - public JAXBElement createGetHashDataInput(GetHashDataInputType value) { - return new JAXBElement(_GetHashDataInput_QNAME, GetHashDataInputType.class, null, value); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "SessionId") + public JAXBElement createSessionId(String value) { + return new JAXBElement(_SessionId_QNAME, String.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputFaultType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputFault") + public JAXBElement createGetHashDataInputFault(GetHashDataInputFaultType value) { + return new JAXBElement(_GetHashDataInputFault_QNAME, GetHashDataInputFaultType.class, null, value); } /** @@ -170,30 +223,57 @@ public class ObjectFactory { } /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputResponseType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link QuitRequestType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputResponse") - public JAXBElement createGetHashDataInputResponse(GetHashDataInputResponseType value) { - return new JAXBElement(_GetHashDataInputResponse_QNAME, GetHashDataInputResponseType.class, null, value); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "QuitRequest", scope = GetNextRequestResponseType.class) + public JAXBElement createGetNextRequestResponseTypeQuitRequest(QuitRequestType value) { + return new JAXBElement(_GetNextRequestResponseTypeQuitRequest_QNAME, QuitRequestType.class, GetNextRequestResponseType.class, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetNextRequestType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link InfoboxReadRequestType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetNextRequest") - public JAXBElement createGetNextRequest(GetNextRequestType value) { - return new JAXBElement(_GetNextRequest_QNAME, GetNextRequestType.class, null, value); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "InfoboxReadRequest", scope = GetNextRequestResponseType.class) + public JAXBElement createGetNextRequestResponseTypeInfoboxReadRequest(InfoboxReadRequestType value) { + return new JAXBElement(_GetNextRequestResponseTypeInfoboxReadRequest_QNAME, InfoboxReadRequestType.class, GetNextRequestResponseType.class, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link SignRequestType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "SessionId") - public JAXBElement createSessionId(String value) { - return new JAXBElement(_SessionId_QNAME, String.class, null, value); + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "SignRequest", scope = GetNextRequestResponseType.class) + public JAXBElement createGetNextRequestResponseTypeSignRequest(SignRequestType value) { + return new JAXBElement(_GetNextRequestResponseTypeSignRequest_QNAME, SignRequestType.class, GetNextRequestResponseType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ErrorResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "ErrorResponse", scope = GetNextRequestType.class) + public JAXBElement createGetNextRequestTypeErrorResponse(ErrorResponseType value) { + return new JAXBElement(_GetNextRequestTypeErrorResponse_QNAME, ErrorResponseType.class, GetNextRequestType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SignResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "SignResponse", scope = GetNextRequestType.class) + public JAXBElement createGetNextRequestTypeSignResponse(SignResponseType value) { + return new JAXBElement(_GetNextRequestTypeSignResponse_QNAME, SignResponseType.class, GetNextRequestType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InfoboxReadResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "InfoboxReadResponse", scope = GetNextRequestType.class) + public JAXBElement createGetNextRequestTypeInfoboxReadResponse(InfoboxReadResponseType value) { + return new JAXBElement(_GetNextRequestTypeInfoboxReadResponse_QNAME, InfoboxReadResponseType.class, GetNextRequestType.class, value); } } diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java index 32b7894f..9e5ebf59 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java @@ -3,7 +3,9 @@ package at.gv.egiz.stal.service.types; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; +//import at.buergerkarte.namespaces.cardchannel.ScriptType; /** @@ -24,6 +26,12 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RequestType") +@XmlSeeAlso({ + SignRequestType.class, + InfoboxReadRequestType.class, + QuitRequestType.class +// ScriptType.class +}) public abstract class RequestType { diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java index c94bcbe8..e9b732fe 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java @@ -3,6 +3,7 @@ package at.gv.egiz.stal.service.types; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; @@ -24,6 +25,12 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ResponseType") +@XmlSeeAlso({ + ErrorResponseType.class, + InfoboxReadResponseType.class, + SignResponseType.class +// at.buergerkarte.namespaces.cardchannel.ResponseType.class +}) public abstract class ResponseType { diff --git a/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java b/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java index b8681084..6bbd7301 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java +++ b/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java @@ -16,6 +16,7 @@ import at.gv.egiz.stal.service.types.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import javax.xml.bind.JAXBElement; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -27,9 +28,10 @@ public class STALTranslator { protected static final Log log = LogFactory.getLog(STALTranslator.class); - public static List translateRequests(List requests) { + public static List translateRequests(List> requests) { List stalRequests = new ArrayList(requests.size()); - for (RequestType request : requests) { + for (JAXBElement requestElt : requests) { + RequestType request = requestElt.getValue(); if (request instanceof InfoboxReadRequestType) { InfoboxReadRequest stalReq = new InfoboxReadRequest(); stalReq.setDomainIdentifier(((InfoboxReadRequestType) request).getDomainIdentifier()); @@ -51,37 +53,40 @@ public class STALTranslator { return stalRequests; } - public static List fromSTAL(List stalResponses) { - List responses = new ArrayList(stalResponses.size()); + public static List> fromSTAL(List stalResponses) { + ObjectFactory stalObjFactory = new ObjectFactory(); + List> responses = new ArrayList>(stalResponses.size()); for (STALResponse stalResp : stalResponses) { if (stalResp instanceof InfoboxReadResponse) { - InfoboxReadResponseType resp = new InfoboxReadResponseType(); + InfoboxReadResponseType resp = stalObjFactory.createInfoboxReadResponseType(); resp.setInfoboxValue(((InfoboxReadResponse) stalResp).getInfoboxValue()); - responses.add(resp); + responses.add(stalObjFactory.createGetNextRequestTypeInfoboxReadResponse(resp)); } else if (stalResp instanceof SignResponse) { - SignResponseType resp = new SignResponseType(); + SignResponseType resp = stalObjFactory.createSignResponseType(); resp.setSignatureValue(((SignResponse) stalResp).getSignatureValue()); - responses.add(resp); + responses.add(stalObjFactory.createGetNextRequestTypeSignResponse(resp)); } else if (stalResp instanceof ErrorResponse) { - ErrorResponseType resp = new ErrorResponseType(); + ErrorResponseType resp = stalObjFactory.createErrorResponseType(); resp.setErrorCode(((ErrorResponse) stalResp).getErrorCode()); resp.setErrorMessage(((ErrorResponse) stalResp).getErrorMessage()); - responses.add(resp); + responses.add(stalObjFactory.createGetNextRequestTypeErrorResponse(resp)); } else { log.error("unknown STAL response type: " + stalResp.getClass()); - ErrorResponseType resp = new ErrorResponseType(); + ErrorResponseType resp = stalObjFactory.createErrorResponseType(); resp.setErrorCode(4000); resp.setErrorMessage("unknown STAL response type: " + stalResp.getClass()); - responses = Collections.singletonList((ResponseType) resp); + responses.clear(); + responses.add(stalObjFactory.createGetNextRequestTypeErrorResponse(resp)); break; } } return responses; } - public static List toSTAL(List responses) { + public static List toSTAL(List> responses) { List stalResponses = new ArrayList(responses.size()); - for (ResponseType resp : responses) { + for (JAXBElement respElt : responses) { + ResponseType resp = respElt.getValue(); if (resp instanceof InfoboxReadResponseType) { InfoboxReadResponse stalResp = new InfoboxReadResponse(); stalResp.setInfoboxValue(((InfoboxReadResponseType) resp).getInfoboxValue()); -- cgit v1.2.3