OSGP / Documentation

This repository contains documentation for the Open Smart Grid Platform project. This repository is built as a GitBook, therefore all content has to be written using markdown syntax. See the latest GitBook:
https://documentation.gxf.lfenergy.org/
Apache License 2.0
24 stars 15 forks source link

SoapUI test validation not working #185

Closed Karlheinzniebuhr closed 6 years ago

Karlheinzniebuhr commented 6 years ago

Having followed the Testing Instructions and executed the AddManufacturer Soap test, I'm getting the following validation error.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Client</faultcode>
         <faultstring xml:lang="en">Validation error</faultstring>
         <detail>
            <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-complex-type.2.4.a: Invalid content was found starting with element 'ns1:Name'. One of '{"http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10":Id}' is expected.</spring-ws:ValidationError>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Karlheinzniebuhr commented 6 years ago

The link of the error message is also broken http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10

Karlheinzniebuhr commented 6 years ago

other errors I'm getting

Tue Mar 13 09:07:14 PYST 2018:ERROR:Could not load keystore/truststore
Tue Mar 13 09:07:14 PYST 2018:ERROR:java.io.FileNotFoundException: /home/dev/Sources/OSGP/Integration-Tests/platform-tests/certificates/test-org.pfx (No such file or directory)

I've tried it both ways, by adding the project files of the documentation and by creating a new project from scratch and adding the test-org.pfx certificate. Getting errors either way

ElkanRoelen commented 6 years ago

Did you install the VM by following the documentation?: http://documentation.opensmartgridplatform.org/Userguide/Installation/Setup-VM-Vagrant.html

The application is looking for files in: /home/dev/Sources/OSGP/Integration-Tests/platform-tests/certificates/test-org.pfx

Does that file exist? Have you cloned all the sources from git?

Karlheinzniebuhr commented 6 years ago

Yes I used vagrant to install the VM. There is no such directory, the directory containing the test-org.pfx file as specified in the documentation is: /home/dev/Sources/OSGP/Config/certificates/osgp-ca/certs/test-org.pfx I'm wondering why the app is trying to access the wrong location? Should I update the code and make a pull request?

ElkanRoelen commented 6 years ago

Hmm.. https://github.com/OSGP/Config should be cloned into /home/dev/Sources/OSGP

cd /home/dev/Sources/OSGP git clone https://github.com/OSGP/Config.git

This should do the trick.

ElkanRoelen commented 6 years ago

I think the puppet scripts did not finished successfully. As I can see in the source: https://github.com/OSGP/Config/blob/development/puppet/manifests/clone-repositories.pp

All repositories should be cloned on VM installation.

Karlheinzniebuhr commented 6 years ago

I just cloned Integration-Tests.git because it was missing. But still I get the error and I can see why. The directory where the file is located is /home/dev/Sources/OSGP/Integration-Tests/certificates/test-org.pfx not /home/dev/Sources/OSGP/Integration-Tests/platform-tests/certificates/test-org.pfx Ok so I created a folder named platform-tests and put in the certificates folder to match the location url. That solved the issue but I'm still getting this error:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Client</faultcode>
         <faultstring xml:lang="en">Validation error</faultstring>
         <detail>
            <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-complex-type.2.4.a: Invalid content was found starting with element 'ns1:Name'. One of '{"http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10":Id}' is expected.</spring-ws:ValidationError>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I feel like something is terribly wrong as nothing seems to work like intended. Maybe there is another respository which vagrant didn't clone, let me check

Karlheinzniebuhr commented 6 years ago

All the other repositories are present.

kevinsmeets commented 6 years ago

@Karlheinzniebuhr the SOAP validation error you encountered is caused by a missing element. I can reproduce the error using:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alliander.com/schemas/osgp/common/2014/10" xmlns:ns1="http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10">
   <soapenv:Header>
      <ns:ApplicationName>SoapUI</ns:ApplicationName>
      <ns:UserName>Kevin</ns:UserName>
      <ns:OrganisationIdentification>LianderNetManagement</ns:OrganisationIdentification>
   </soapenv:Header>
   <soapenv:Body>
      <ns1:AddManufacturerRequest>
         <ns1:Manufacturer>
            <!--<ns1:Id>0</ns1:Id>-->
            <ns1:Code>MID</ns1:Code>
            <ns1:Name>Manufacturer Name</ns1:Name>
            <ns1:UsePrefix>true</ns1:UsePrefix>
         </ns1:Manufacturer>
      </ns1:AddManufacturerRequest>
   </soapenv:Body>
</soapenv:Envelope>

Your error:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Client</faultcode>
         <faultstring xml:lang="en">Validation error</faultstring>
         <detail>
            <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-complex-type.2.4.a: Invalid content was found starting with element 'ns1:Name'. One of '{"http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10":Id}' is expected.</spring-ws:ValidationError>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Example of complete SOAP message (set the value of ID to 0 for example, when the data is saved an ID will be generated):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alliander.com/schemas/osgp/common/2014/10" xmlns:ns1="http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10">
   <soapenv:Header>
      <ns:ApplicationName>SoapUI</ns:ApplicationName>
      <ns:UserName>Kevin</ns:UserName>
      <ns:OrganisationIdentification>LianderNetManagement</ns:OrganisationIdentification>
   </soapenv:Header>
   <soapenv:Body>
      <ns1:AddManufacturerRequest>
         <ns1:Manufacturer>
            <ns1:Id>0</ns1:Id>
            <ns1:Code>MID</ns1:Code>
            <ns1:Name>Manufacturer Name</ns1:Name>
            <ns1:UsePrefix>true</ns1:UsePrefix>
         </ns1:Manufacturer>
      </ns1:AddManufacturerRequest>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <ns2:AddManufacturerResponse xmlns:ns2="http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10" xmlns:ns3="http://www.alliander.com/schemas/osgp/common/2014/10">
         <ns2:Result>NOT</ns2:Result>
      </ns2:AddManufacturerResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

See the documentation which contains a similar example SOAP message: http://documentation.opensmartgridplatform.org/Userguide/Installation/testOSGP.html

kevinsmeets commented 6 years ago

The link of the error message is also broken http://www.alliander.com/schemas/osgp/common/firmwaremanagement/2014/10

Thank you for reporting this, however, the URL is only used as a namespace. We don't actually own the domain and we don't host the XSDs.