28. Testimiseks päringud

Turvaserveri käsurealt, käivita käsk, päringu edastamiseks teie turvaserverist (TURVASERVER asendada):

curl -v -d @/tmp/request.xml -o /tmp/reply.xml -H "Content-type: text/xml; charset=UTF-8" http://TURVASERVER/cgi-bin/consumer_proxy


SOAP sõnum andmeteenuse pärimiseks, mida tuleb kopeerida request.xml-i :

NB! enne sõnumi kopeerimist:  
"xroad:client id" väärtused tuleb asendada:
Teie turvaserveris registreeritud liikme väärtustega (memberClass ja memberCode) ja tema alamsüsteemi väärtus (SubsystemCode).
veendu, et xRoadInstance on õige (ee-dev, ee-test ja EE)

        <xroad:client id:objectType="SUBSYSTEM">
            <id:xRoadInstance>ee-dev</id:xRoadInstance>
            <id:memberClass>GOV</id:memberClass>
            <id:memberCode>70006317</id:memberCode>
            <id:subsystemCode>generic-consumer</id:subsystemCode>
        </xroad:client>


Teenusepakkuja alamsüsteemi xroad-center  andmeteenuse nimekiri (listMethods päringu näide):

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xroad="http://x-road.eu/xsd/xroad.xsd"
        xmlns:id="http://x-road.eu/xsd/identifiers">
    <SOAP-ENV:Header>
        <xroad:client id:objectType="SUBSYSTEM">
            <id:xRoadInstance>ee-dev</id:xRoadInstance>
            <id:memberClass>GOV</id:memberClass>
            <id:memberCode>70006317</id:memberCode>
            <id:subsystemCode>generic-consumer</id:subsystemCode>
        </xroad:client>
        <xroad:service id:objectType="SERVICE">
         <id:xRoadInstance>ee-dev</id:xRoadInstance>
         <id:memberClass>GOV</id:memberClass>
         <id:memberCode>70006317</id:memberCode>
         <id:subsystemCode>xroad-center</id:subsystemCode>
         <id:serviceCode>listMethods</id:serviceCode>
        </xroad:service>
        <xroad:id>Sisesta_Siia_UUID</xroad:id>
        <xroad:protocolVersion>4.0</xroad:protocolVersion>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <xroad:listMethods/>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Õnnestunud päringu vastus sisaldab allolevaid kirjeid (reply.xml):

....

        <xroad:listMethodsResponse>
            <xroad:service id:objectType="SERVICE">

...

                <id:serviceCode>authCertDeletion</id:serviceCode>
            </xroad:service>
....
        </xroad:listMethodsResponse>


Kas alamsüsteemile generic-consumer on andmeteenuste kasutusõigus antud teenusepakkuja dhl poolt
(AllowedMethods päringu näide):

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:ns1="http://aar.x-road.ee/producer/"
        xmlns:xroad="http://x-road.eu/xsd/xroad.xsd"
        xmlns:id="http://x-road.eu/xsd/identifiers">
    <SOAP-ENV:Header>
        <xroad:client id:objectType="SUBSYSTEM">
            <id:xRoadInstance>ee-dev</id:xRoadInstance>
            <id:memberClass>GOV</id:memberClass>
            <id:memberCode>70006317</id:memberCode>
            <id:subsystemCode>generic-consumer</id:subsystemCode>
        </xroad:client>
        <xroad:service id:objectType="SERVICE">
            <id:xRoadInstance>ee-dev</id:xRoadInstance>
            <id:memberClass>GOV</id:memberClass>
            <id:memberCode>70006317</id:memberCode>
            <id:subsystemCode>dhl</id:subsystemCode>
            <id:serviceCode>allowedMethods</id:serviceCode>
        </xroad:service>
        <xroad:id>Sisesta_Siia_UUID</xroad:id>
        <xroad:protocolVersion>4.0</xroad:protocolVersion>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <xroad:allowedMethods/>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


kui teenuse kasutusõigus antud, siis vastus (reply.xml) sisaldab teenuseid:

...

    <SOAP-ENV:Body>
        <xroad:allowedMethodsResponse>
...
                <id:serviceCode>receiveDocuments</id:serviceCode>
            </xroad:service>
...

kui andmeteenuse kasutusõigusi pole antud, siis vastus (reply.xml) ei sisalda teenuste nimetusi (serviceCode):
...
    <SOAP-ENV:Body>
        <xroad:allowedMethodsResponse/>
    </SOAP-ENV:Body>
...

Teenuse WSDL-i pärimine:

NB! WSDLi päritakse andmeteenuse ja selle versiooni "pihta". Nõutud on parameetride väärtused serviceCode ja version

WSDLi pärimine SOAP sõnumina:

request.xml:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:id="http://x-road.eu/xsd/identifiers"
xmlns:xroad="http://x-road.eu/xsd/xroad.xsd">
    <SOAP-ENV:Header>
        <xroad:client id:objectType="SUBSYSTEM">
            <id:xRoadInstance>ee-dev</id:xRoadInstance>
            <id:memberClass>GOV</id:memberClass>
            <id:memberCode>70006317</id:memberCode>
            <id:subsystemCode>riha</id:subsystemCode>
        </xroad:client>
        <xroad:service id:objectType="SERVICE">
            <id:xRoadInstance>ee-dev</id:xRoadInstance>
            <id:memberClass>GOV</id:memberClass>
            <id:memberCode>70006317</id:memberCode>
            <id:subsystemCode>aar</id:subsystemCode>
            <id:serviceCode>getWsdl</id:serviceCode>
        </xroad:service>
        <xroad:id>Sisesta_Siia_UUID</xroad:id>
        <xroad:protocolVersion>4.0</xroad:protocolVersion>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <xroad:getWsdl>
            <xroad:serviceCode>oigused</xroad:serviceCode>
            <xroad:serviceVersion>v1</xroad:serviceVersion>
        </xroad:getWsdl>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


WSDLI-i küsimine HTTP GET:

curl -o /tmp/reply.wsdl "http://TURVASERVER/wsdl?xRoadInstance=ee-dev&memberClass=GOV&memberCode=70006317&subsystemCode=dhl&serviceCode=sendDocuments&version=v1"





Last modified: Wednesday, 31 January 2018, 6:46 PM