Difference between revisions of "Examples using the GV Console"
Line 1: | Line 1: | ||
+ | ==Description== | ||
+ | |||
This section shows how to deploy and test a new service using the {{L_GVCONSOLE}} using the ValidateXMLFiles and ValidateSingleXMLFile services, presented in the section [[First_GVESB_Projects]]. | This section shows how to deploy and test a new service using the {{L_GVCONSOLE}} using the ValidateXMLFiles and ValidateSingleXMLFile services, presented in the section [[First_GVESB_Projects]]. | ||
+ | |||
+ | ValidateXMLFiles and ValidateSingleXMLFile example scopes are: | ||
+ | * Reading XML files from a directory of inputs: <br/> We have into the directory <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/input the following files: | ||
+ | :* XML1.xml | ||
+ | <syntaxhighlight lang="XML"> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
+ | xsi:noNamespaceSchemaLocation="ValidateXML.xsd"> | ||
+ | <element> | ||
+ | <child1>string 1</child1> | ||
+ | <child2>string 2</child2> | ||
+ | <child3>string 3</child3> | ||
+ | </element> | ||
+ | </list> | ||
+ | </syntaxhighlight> | ||
+ | :* XML2.xml | ||
+ | <syntaxhighlight lang="XML"> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
+ | xsi:noNamespaceSchemaLocation="ValidateXML.xsd"> | ||
+ | <element> | ||
+ | <child1>string 1</child1> | ||
+ | <child2>string 2</child2> | ||
+ | <child4>BAD string 4</child4> | ||
+ | </element> | ||
+ | </list> | ||
+ | </syntaxhighlight> | ||
+ | :* XML3.xml. | ||
+ | <syntaxhighlight lang="XML"> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
+ | xsi:noNamespaceSchemaLocation="ValidateXML.xsd"> | ||
+ | <element> | ||
+ | <child1>string 1</child1> | ||
+ | <child2>string 2</child2> | ||
+ | <child3>string 3</child3> | ||
+ | </element> | ||
+ | </list> | ||
+ | </syntaxhighlight> | ||
+ | * Validating the read files using a predefined schema: <br/> Files XML1.xml, XML2.xml and XML3.xml will be validated using the schema "ValidateXML.xsd" present in <nowiki>${{gv.app.home}}</nowiki>/xmlconfig/xsds directory. | ||
+ | :* ValidateXML.xsd | ||
+ | <syntaxhighlight lang="XML"> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | ||
+ | <xs:element name="list"> | ||
+ | <xs:complexType> | ||
+ | <xs:sequence> | ||
+ | <xs:element name="element" type="element" minOccurs="0" maxOccurs="5"/> | ||
+ | </xs:sequence> | ||
+ | </xs:complexType> | ||
+ | </xs:element> | ||
+ | |||
+ | <xs:complexType name="element"> | ||
+ | <xs:sequence> | ||
+ | <xs:element name="child1" type="xs:string"/> | ||
+ | <xs:element name="child2" type="xs:string"/> | ||
+ | <xs:element name="child3" type="xs:string" minOccurs="0" maxOccurs="2"/> | ||
+ | </xs:sequence> | ||
+ | </xs:complexType> | ||
+ | </xs:schema> | ||
+ | </syntaxhighlight> | ||
+ | * Coping valid and invalid files in two separated directories | ||
+ | * Saving a file <filename>.result with the <filename> validation error message | ||
[[File:GVCONSOLEDeploy.jpg|thumb|Deploy new Service]]Suppose you have saved the {{VULCON}} Configuration file as <nowiki>"${{gv.app.home}}/TEST/REPG1.zip"</nowiki>. To deploy the new Services follow this steps: | [[File:GVCONSOLEDeploy.jpg|thumb|Deploy new Service]]Suppose you have saved the {{VULCON}} Configuration file as <nowiki>"${{gv.app.home}}/TEST/REPG1.zip"</nowiki>. To deploy the new Services follow this steps: | ||
Line 13: | Line 78: | ||
# Save the Document. Saving you return to the [[Deploy Service]] section. | # Save the Document. Saving you return to the [[Deploy Service]] section. | ||
# Repeat operations 1, 2 and 3, now with the service ValidateSingleXMLFile | # Repeat operations 1, 2 and 3, now with the service ValidateSingleXMLFile | ||
+ | |||
[[File:GVConsoleUtilityReload1.jpg|thumb|{{GVCONSOLE}} Utility section]]Now pass to the {{GVCONSOLE}} section [[Utility]]. | [[File:GVConsoleUtilityReload1.jpg|thumb|{{GVCONSOLE}} Utility section]]Now pass to the {{GVCONSOLE}} section [[Utility]]. | ||
Line 19: | Line 85: | ||
# Select GVCore.xml and then Reload. A new windows will be open to confirm the operation | # Select GVCore.xml and then Reload. A new windows will be open to confirm the operation | ||
# Click OK. | # Click OK. | ||
+ | |||
[[File:GVConsoleTesting.jpg|thumb|{{GVCONSOLE}} Testing section]]Go to the {{GVCONSOLE}} section [[Testing]]. In this section you can finally test your new services: | [[File:GVConsoleTesting.jpg|thumb|{{GVCONSOLE}} Testing section]]Go to the {{GVCONSOLE}} section [[Testing]]. In this section you can finally test your new services: | ||
Line 25: | Line 92: | ||
# Click RequestReply | # Click RequestReply | ||
− | As you see, the Test View was expanded and it is also possible to view the [[Test output]] where there are present some properties, among those the GVFSM_EXISTING_FILES property setted to 3. But let us see what happened in our File System: | + | |
+ | As you see, the Test View was expanded and it is also possible to view the [[Testing_output|Test output]] where there are present some properties, among those the GVFSM_EXISTING_FILES property setted to 3. But let us see what happened in our File System: | ||
# In <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/input there are no files. | # In <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/input there are no files. | ||
# In <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/validated files XML1.xml and XML3.xml were moved into. | # In <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/validated files XML1.xml and XML3.xml were moved into. | ||
− | # In <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/discarded file XML2.xml were moved into and a report file named XML2.xml.result was created. | + | # In <nowiki>${{gv.app.home}}</nowiki>/TEST/TESTFS/TestXML/discarded file XML2.xml were moved into and a report file named XML2.xml.result was created: |
+ | it.greenvulcano.gvesb.core.exc.GVCoreOutputServiceException: | ||
+ | GVCORE_OUTPUT_SERVICE_ERROR [it.greenvulcano.gvesb.core.exc.GVCoreOutputServiceException]: | ||
+ | id=read_validate_file, service=ValidateXML, | ||
+ | exception=GVCORE_VCL_OPERATION_ERROR [it.greenvulcano.gvesb.core.exc.GVCoreException]: | ||
+ | id=read_validate_file, exception=GV_CALL_SERVICE_ERROR [it.greenvulcano.gvesb.virtual.CallException]: | ||
+ | service=ValidateSingleXMLFile, system=GVESB, id=7F0001014F37C2F400021D84, | ||
+ | message=cvc-complex-type.2.4.a: Invalid content was found starting with element 'child4'. One of '{child3}' is expected. |
Revision as of 14:37, 12 February 2012
Description
This section shows how to deploy and test a new service using the GV Console® using the ValidateXMLFiles and ValidateSingleXMLFile services, presented in the section First_GVESB_Projects.
ValidateXMLFiles and ValidateSingleXMLFile example scopes are:
- Reading XML files from a directory of inputs:
We have into the directory ${{gv.app.home}}/TEST/TESTFS/TestXML/input the following files:
- XML1.xml
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ValidateXML.xsd">
<element>
<child1>string 1</child1>
<child2>string 2</child2>
<child3>string 3</child3>
</element>
</list>
- XML2.xml
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ValidateXML.xsd">
<element>
<child1>string 1</child1>
<child2>string 2</child2>
<child4>BAD string 4</child4>
</element>
</list>
- XML3.xml.
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ValidateXML.xsd">
<element>
<child1>string 1</child1>
<child2>string 2</child2>
<child3>string 3</child3>
</element>
</list>
- Validating the read files using a predefined schema:
Files XML1.xml, XML2.xml and XML3.xml will be validated using the schema "ValidateXML.xsd" present in ${{gv.app.home}}/xmlconfig/xsds directory.
- ValidateXML.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element name="element" type="element" minOccurs="0" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="element">
<xs:sequence>
<xs:element name="child1" type="xs:string"/>
<xs:element name="child2" type="xs:string"/>
<xs:element name="child3" type="xs:string" minOccurs="0" maxOccurs="2"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
- Coping valid and invalid files in two separated directories
- Saving a file <filename>.result with the <filename> validation error message
Suppose you have saved the VulCon Configuration file as "${{gv.app.home}}/TEST/REPG1.zip". To deploy the new Services follow this steps:
- Start GreenVulcano® ESB
- Access to the GV Console.
- In the Deploy New Service section click Sfoglia... (Browse) and select the file where you have saved the VulCon configuration.
- `Click Submit.
The section Deploy Services will be open. In this section you can select the services you want to deploy.
- Clicking on service ValidateXMLFiles a new view will be open containing the files GVCore.xml present in local and in server.
- Click Deploy. Now you can save the document and write some notes about it.
- Save the Document. Saving you return to the Deploy Service section.
- Repeat operations 1, 2 and 3, now with the service ValidateSingleXMLFile
Now pass to the GV Console section Utility.
- Click on Reload configuration
- Select GVCore.xml and then Reload. A new windows will be open to confirm the operation
- Click OK.
Go to the GV Console section Testing. In this section you can finally test your new services:
- Into the Service voice select ValidateXMLFiles
- Into the System voice select GVESB
- Click RequestReply
As you see, the Test View was expanded and it is also possible to view the Test output where there are present some properties, among those the GVFSM_EXISTING_FILES property setted to 3. But let us see what happened in our File System:
- In ${{gv.app.home}}/TEST/TESTFS/TestXML/input there are no files.
- In ${{gv.app.home}}/TEST/TESTFS/TestXML/validated files XML1.xml and XML3.xml were moved into.
- In ${{gv.app.home}}/TEST/TESTFS/TestXML/discarded file XML2.xml were moved into and a report file named XML2.xml.result was created:
it.greenvulcano.gvesb.core.exc.GVCoreOutputServiceException: GVCORE_OUTPUT_SERVICE_ERROR [it.greenvulcano.gvesb.core.exc.GVCoreOutputServiceException]: id=read_validate_file, service=ValidateXML, exception=GVCORE_VCL_OPERATION_ERROR [it.greenvulcano.gvesb.core.exc.GVCoreException]: id=read_validate_file, exception=GV_CALL_SERVICE_ERROR [it.greenvulcano.gvesb.virtual.CallException]: service=ValidateSingleXMLFile, system=GVESB, id=7F0001014F37C2F400021D84, message=cvc-complex-type.2.4.a: Invalid content was found starting with element 'child4'. One of '{child3}' is expected.