SOAP-Webservice, der Messstellenpunkte im Index aktualisiert

Beschreibung

MeLo´s und MaLo´s werden durch diesen SOAP-Webservice im Meldepunktindex aktualisiert. Es wird ein MeLo oder eine MaLo übermittelt und ein Update (auf letzte geschriebene/written) ausgeführt , sollte dieser bereits vorhanden sein. Es wird Service_Ended angepasst und der neue Index-Eintrag addiert. Beispiel Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="http://nextlevel.com/webservices/systemsplit">
	<soapenv:Header/>
	<soapenv:Body>
		<sys:addMeteringlocationList>
			<sys:meteringLocationList>
				<sys:minimalMeteringLocation>
					<sys:meteringLocationNr>12345678911</sys:meteringLocationNr>
					<sys:mandant>MAN4</sys:mandant>
					<sys:system>SYS4</sys:system>
					<sys:startTime>2022-08-15T00:00:00Z</sys:startTime>
					<sys:endTime>2099-12-31T00:00:00Z</sys:endTime>
				</sys:minimalMeteringLocation>
			</sys:meteringLocationList>
		</sys:addMeteringlocationList>
	</soapenv:Body>
</soapenv:Envelope>

in MP-index existierende, gleiche ext_ui

davor:

ext_ui mandant system service_started service_ended wtritten  
12345678911 MAN SYS 20220515000000 20990515000000 20220525133541 -
12345678911 MAN1 SYS1 20220615000000 20990515000000 20220625133541 -
12345678911 MAN2 SYS2 20220715000000 20990515000000 20220725133541 <- aktuelste, letzt geschriebene

danach:

ext_ui mandant system service_started service_ended wtritten  
12345678911 MAN2 SYS2 20220715000000 20220814000000 20220727133541 -> Zeit würde updated
12345678911 MAN4 SYS4 20220815000000 20991231000000 20220727133541 -> neu Eintrag

Ist der Eintrag nicht im Meldepunktindex vorhanden, so wird dieser hinzugefügt (vergleichbar mit ADD).

Bitte wenden Sie sich an unser Support- oder Beratungsteam, falls Sie Interesse(Erweiterung) an diesem Tool haben.

Technical documentation

Der externe Webservice wird über einen SOAP-Request mit Basic-Authentication kontaktiert. Die Antwort wird in eine Erweiterung geschrieben. Microservice funktioniert vollstendig erst ab B2B-Version ab 2022.06.15 (SNAPSHOT)

Configuration

Die Konfiguration für Datenbank und Authentifizierung erfolgt in einer YAML-Datei. Bitte speichern Sie die Datei sicher.

Example:

server.port: 9000
server.address: 127.0.0.1

b2b:
  api-url-get: http://localhost:8080/b2bbp-engine/api/reporting-points
  api-url-get-size: 100
  user: admin
  password: b2bbp

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/postgres
    username: postgres
    password: postgres
  main:
    banner-mode: off
    allow-circular-references: true
  client.user: admin
  client.password: admin
  jpa:
    hibernate:
      ddl-auto: update

Indizierung der übergebenen Daten

Zur tatsächlichen Indizierung ist ein Index Service notwendig.

Index Service

Property:

B3P_ENABLE_UPDATE_BEFORE_ADD_IN_INDEX true

Running

Diese Anwendung erfordert Java 11 oder eine neuere Version .

Die Anwendung kann auf verschiedene Arten ausgeführt werden. Es muss jedoch immer Datenbanktreiber und application.yml abgelegt werden. Zum Beispiel:

bin
    start.bat
conf
    application.yml
lib
    Datenbanktreiber.jar
    application.jar

Ordner “bin”, “conf” und “lib” erstellen Inhalt von “bin”: start.bat -> bat-Datei enthält den Befehl zur Ausführung der Anwendung(Windows):

java -cp ../lib/nli-b2b-meteringpoints-to-index-wsdl-0.0.1-SNAPSHOT.jar -Dloader.path="<path>/lib" org.springframework.boot.loader.PropertiesLauncher --spring.config.location="<path>/conf/application.yml

Inhalt von “conf” -> application.yml (im Befehl beim Start der Anwendung setzen, um die Basis application.yml zu überschreiben) Inhalt von “lib” -> Datenbanktreiber.jar, application.jar

WSDL File

Diese WSDL-Datei kann verwendet werden, um den Soap-Update-Request zu erzeugen.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://nextlevel.com/webservices/systemsplit"
			 xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://nextlevel.com/webservices/systemsplit"
			 name="SystemsplitService"
			 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

	<types>
		<xsd:schema xmlns:tns="http://nextlevel.com/webservices/systemsplit" targetNamespace="http://nextlevel.com/webservices/systemsplit"
					attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0">

			<xsd:complexType name="MeteringLocationNr">
				<xsd:simpleContent>
					<xsd:extension base="xsd:string"></xsd:extension>
				</xsd:simpleContent>
			</xsd:complexType>

			<xsd:complexType name="MeteringLocationNrList">
				<xsd:sequence maxOccurs="unbounded" minOccurs="0">
					<xsd:element name="minimalMeteringLocation" type="tns:MinimalMeteringLocation">
						<xsd:annotation>
							<xsd:documentation>List of MinimalMeteringLocation, may be empty.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:complexType name="MinimalMeteringLocation">
				<xsd:sequence maxOccurs="1" minOccurs="1">
					<xsd:element name="meteringLocationNr" type="tns:MeteringLocationNr"></xsd:element>
					<xsd:element name="mandant" type="xsd:string"></xsd:element>
					<xsd:element name="system" type="xsd:string"></xsd:element>
					<xsd:element name="startTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive start time of the time range for which
								to meteringlocation holds.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="endTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive end time for the meteringlocation to hold.
								Must be larger or equal to startTime!
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:element name="addMeteringlocationRequest">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="minimalMeteringLocation" type="tns:MinimalMeteringLocation"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="addMeteringlocationList">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="meteringLocationNrList" type="tns:MeteringLocationNrList"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="updateMeteringlocationRequest">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="minimalMeteringLocation" type="tns:MinimalMeteringLocation"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:complexType name="AddressLocation">
				<xsd:sequence maxOccurs="1" minOccurs="1">
					<xsd:element name="address" type="xsd:string"></xsd:element>
					<xsd:element name="mandant" type="xsd:string"></xsd:element>
					<xsd:element name="system" type="xsd:string"></xsd:element>
					<xsd:element name="startTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive start time of the time range for which
								to addresslocation holds.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="endTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive end time for the addresslocation to hold.
								Must be larger or equal to startTime!
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:element name="addAddressLocationRequest">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="addressLocation" type="tns:AddressLocation"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:complexType name="BalanceDistrict">
				<xsd:sequence maxOccurs="1" minOccurs="1">
					<xsd:element name="balanceDistrict" type="xsd:string"></xsd:element>
					<xsd:element name="mandant" type="xsd:string"></xsd:element>
					<xsd:element name="system" type="xsd:string"></xsd:element>
					<xsd:element name="startTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive start time of the time range for
								the validity of the balance district.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="endTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive end time for the balance district.
								Must be larger or equal to startTime!
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:complexType name="BalancedMeteringLocationNrList">
				<xsd:sequence maxOccurs="unbounded" minOccurs="0">
					<xsd:element name="balanceMeteringLocation" type="tns:BalancedMeteringLocation">
						<xsd:annotation>
							<xsd:documentation>List of BalanceMeteringLocation, may be empty.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:complexType name="BalancedMeteringLocation">
				<xsd:sequence maxOccurs="1" minOccurs="1">
					<xsd:element name="meteringLocationNr" type="tns:MeteringLocationNr"></xsd:element>
					<xsd:element name="mandant" type="xsd:string"></xsd:element>
					<xsd:element name="system" type="xsd:string"></xsd:element>

					<xsd:element name="startBalanceTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive start time of the time range for which
								to meteringlocation holds.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="endBalanceTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive end time for the meteringlocation to hold.
								Must be larger or equal to startTime!
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="startTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive start time of the time range for which
								to meteringlocation holds.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="endTime" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>The inclusive end time for the meteringlocation to hold.
								Must be larger or equal to startTime!
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:element name="addBalanceDistrictRequest">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="balanceDistrict" type="tns:BalanceDistrict"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="addBalancedMeteringLocationRequest">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="balancedMeteringLocation" type="tns:BalancedMeteringLocation"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="SystemsplitServiceFault" type="xsd:string"/>

		</xsd:schema>
	</types>

	<message name="addAddressLocationRequestMsg">
		<part name="params" element="tns:addAddressLocationRequest">
			<documentation></documentation>
		</part>
	</message>
	<message name="addAddressLocationResponseMsg">
		<part name="params" element="xsd:string">
			<documentation></documentation>
		</part>
	</message>

	<message name="addBalanceDistrictRequestMsg">
		<part name="params" element="tns:addBalanceDistrictRequest">
			<documentation></documentation>
		</part>
	</message>
	<message name="addBalanceDistrictResponseMsg">
		<part name="params" element="xsd:string">
			<documentation></documentation>
		</part>
	</message>

	<message name="addMeteringlocationRequestMsg">
		<part name="params" element="tns:addMeteringlocationRequest">
			<documentation></documentation>
		</part>
	</message>
	<message name="addMeteringlocationResponseMsg">
		<part name="params" element="xsd:string">
			<documentation></documentation>
		</part>
	</message>

	<message name="updateMeteringlocationRequestMsg">
		<part name="params" element="tns:updateMeteringlocationRequest">
			<documentation></documentation>
		</part>
	</message>
	<message name="updateMeteringlocationResponseMsg">
		<part name="params" element="xsd:string">
			<documentation></documentation>
		</part>
	</message>

	<message name="addMeteringlocationListRequest">
		<part name="params" element="tns:addMeteringlocationList">
			<documentation></documentation>
		</part>
	</message>
	<message name="addMeteringlocationListResponse">
		<part name="params" element="xsd:string">
			<documentation></documentation>
		</part>
	</message>

	<message name="addBalancedMeteringLocationRequestMsg">
		<part name="params" element="tns:addBalancedMeteringLocationRequest">
			<documentation></documentation>
		</part>
	</message>
	<message name="addBalancedMeteringLocationResponseMsg">
		<part name="params" element="xsd:string">
			<documentation></documentation>
		</part>
	</message>
	<message name="getMeteringPointFromIndexRequest">
		<part name="meteringPointId" type="xsd:string">
			<documentation></documentation>
		</part>
	</message>
	<message name="getMeteringPointFromIndexResponse">
		<part name="messageResponse" type="tns:BalancedMeteringLocation">
			<documentation></documentation>
		</part>
	</message>
	<message name="getMeteringPointsFromIndexRequest">
		<part name="meteringPointId" type="xsd:string">
			<documentation></documentation>
		</part>
	</message>
	<message name="getMeteringPointsFromIndexResponse">
		<part name="messageResponse" type="tns:BalancedMeteringLocationNrList">
			<documentation></documentation>
		</part>
	</message>

	<message name="SystemsplitServiceException">
		<part name="message" element="tns:SystemsplitServiceFault">
			<documentation>An internal exception of the b2bbp engine occurred.
			</documentation>
		</part>
	</message>

	<portType name="SystemsplitService">
		<documentation>This message service provides an interface to the NLI-Systemsplit-Component.
			Specifically it provides methods to modify the systemsplit-index.
		</documentation>
		<operation name="updateMeteringlocation">
			<documentation>Method to update a meteringlocation from the meteringpoint-index.</documentation>
			<input message="tns:updateMeteringlocationRequestMsg"></input>
			<output message="tns:updateMeteringlocationResponseMsg"></output>
			<fault name="SystemsplitServiceFault" message="tns:SystemsplitServiceException">
				<documentation></documentation>
			</fault>
		</operation>
		<operation name="addMeteringlocation">
			<documentation>Method to add a meteringlocation to the meteringpoint-index.</documentation>
			<input message="tns:addMeteringlocationRequestMsg"></input>
			<output message="tns:addMeteringlocationResponseMsg"></output>
			<fault name="SystemsplitServiceFault" message="tns:SystemsplitServiceException">
				<documentation></documentation>
			</fault>
		</operation>
		<operation name="addMeteringlocationList">
			<documentation>Method to add a List of meteringlocation to the meteringpoint-index.</documentation>
			<input message="tns:addMeteringlocationListRequest"></input>
			<output message="tns:addMeteringlocationListResponse"></output>
			<fault name="SystemsplitServiceFault" message="tns:SystemsplitServiceException">
				<documentation></documentation>
			</fault>
		</operation>
		<operation name="getMeteringPointsFromIndex">
			<documentation>Method to get information of meteringpoint if it exists in the meteringpoint index</documentation>
			<input message="tns:getMeteringPointsFromIndexRequest"></input>
			<output message="tns:getMeteringPointsFromIndexResponse"></output>
			<fault name="SystemsplitServiceFault" message="tns:SystemsplitServiceException">
				<documentation></documentation>
			</fault>
		</operation>
	</portType>


	<binding name="SystemsplitServiceBinding" type="tns:SystemsplitService">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="updateMeteringlocation">
			<soap:operation soapAction="updateMeteringlocation"/>
			<input>
				<soap:body use="literal"/>
			</input>
			<output>
				<soap:body use="literal"/>
			</output>
			<fault name="SystemsplitServiceFault">
				<soap:fault use="literal" name="SystemsplitServiceFault"/>
			</fault>
		</operation>
		<operation name="addMeteringlocation">
			<soap:operation soapAction="http://nextlevel.com/webservices/systemsplit/addMeteringlocation"/>
			<input>
				<soap:body use="literal" namespace="http://nextlevel.com/webservices/systemsplit"/>
			</input>
			<output>
				<soap:body use="literal" namespace="http://nextlevel.com/webservices/systemsplit"/>
			</output>
			<fault name="SystemsplitServiceFault">
				<soap:fault use="literal" name="SystemsplitServiceFault"/>
			</fault>
		</operation>
		<operation name="addMeteringlocationList">
			<soap:operation soapAction="http://nextlevel.com/webservices/systemsplit/addMeteringlocationList"/>
			<input>
				<soap:body use="literal" namespace="http://nextlevel.com/webservices/systemsplit"/>
			</input>
			<output>
				<soap:body use="literal" namespace="http://nextlevel.com/webservices/systemsplit"/>
			</output>
			<fault name="SystemsplitServiceFault">
				<soap:fault use="literal" name="SystemsplitServiceFault"/>
			</fault>
		</operation>
		<operation name="getMeteringPointsFromIndex">
			<soap:operation soapAction="http://nextlevel.com/webservices/systemsplit/getMeteringPointsFromIndex"/>
			<input>
				<soap:body use="literal" namespace="http://nextlevel.com/webservices/systemsplit"/>
			</input>
			<output>
				<soap:body use="literal" namespace="http://nextlevel.com/webservices/systemsplit"/>
			</output>
			<fault name="SystemsplitServiceFault">
				<soap:fault use="literal" name="SystemsplitServiceFault"/>
			</fault>
		</operation>
	</binding>

	<service name="SystemsplitService">
		<port name="SystemsplitServicePort" binding="tns:SystemsplitServiceBinding">
			<soap:address location="http://localhost:9000/webservices/systemsplit"/>
		</port>
	</service>
</definitions>

SOAP-Request and Authentication

Die SOAP-Anfragen können in der SOAP-UI generiert werden, wenn die WSDL-Datei dem Soap-Projekt hinzugefügt wird.

Gerade wird es wss-password-type nicht unterschtutzt!!! nur Basic Security

Der konfigurierte Benutzer und das Passwort in der application.yml können in den Properties der Anfragen gesetzt werden:

Die Authentifizierungsdaten können aber auch im Header der Anfrage gesetzt werden. Dies kann ebenfalls in der SOAP-UI erfolgen:

Eine Anfrage (ohne Authentifizierungs-Header, Daten werden in Property gesetzt) ist wie folgt aufgebaut:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="http://nextlevel.com/webservices/systemsplit">
	<soapenv:Header/>
	<soapenv:Body>
		<sys:addMeteringlocationList>
			<sys:meteringLocationList>
				<sys:minimalMeteringLocation>
					<sys:meteringLocationNr>12345678911</sys:meteringLocationNr>
					<sys:mandant>MAN</sys:mandant>
					<sys:system>SYS</sys:system>
					<sys:startTime>2019-08-15T00:00:00Z</sys:startTime>
					<sys:endTime>2023-07-15T00:00:00Z</sys:endTime>
				</sys:minimalMeteringLocation>
			</sys:meteringLocationList>
		</sys:addMeteringlocationList>
	</soapenv:Body>
</soapenv:Envelope>

Anzeigefehler der Dokumentensuche im Indexmanagement nach Durchführung des Updates (nur alte UI)

Es gibt nach durchführen des Updates einen Anzeigefehler in der Dokumentensuche im Indexmanagement, was jedoch keinen Einfluss auf die Verarbeitung hat. Workaround: Nach dem Update könnte man eine Optimierung vornehmen: http://b2bbp.next-level-help.org/b2b_cust_DeleteIndexJob.html

Alte Implementierung in b2b

Alte Implementierung in b2b (teilweise) webservice

Tags:
View Me   Edit Me