Home TOC |
![]() ![]() ![]() |
Using the Command Line Client Script with the Registry Server
You will find a shell script called
<JWSDP_HOME>
/samples/registry-server/registry-server-test.sh
(on UNIX systems) or<JWSDP_HOME>\samples\registry-server\registry-server-test.bat
(on Microsoft Windows systems).The script uses XML files in the
xml
subdirectory to send messages to the Registry Server.To use the script, go to the directory where the script resides. Make sure the script is executable (make it so if it is not).
You can use the script to perform the following tasks:
- Obtain authentication as a user of the Registry Server.
- To obtain authentication, you use the file Get
AuthToken.xml
in thexml
subdirectory. By default, the registry accepts a default user namedtestuser
with a password oftestuser
. To create other users, follow the instructions in Adding New Users to the Registry, then edit theGetAuthToken.xml
file to specify the user name and password you created.- To obtain authentication, enter the following command on one line:
- Windows:
registry-server-test run-cli-request -Drequest=xml\GetAuthToken
.xml- UNIX:
registry-server-test.sh run-cli-request -Drequest=xml/GetAuthToken
.xml- When the script runs, it returns an
<authToken>
tag that contains an<authInfo>
tag. You will use the value in this tag in the next step.- The value in this tag is valid for one hour. You can rerun the script after it expires.
- Save a business (that is, add a business).
- To save a business, you use the file
SaveBusiness.xml
in thexml
subdirectory. Before you run the script, edit the<authInfo>
tag in this file and replace the existing contents with the contents of the<authInfo>
tag returned in the previous step. Feel free to modify other values specified in the file.- To save the business, enter the following command on one line:
- Windows:
registry-server-test run-cli-request -Drequest=xml\SaveBusiness.xml- UNIX:
registry-server-test.sh run-cli-request -Drequest=xml/SaveBusiness.xml- Output appears in the terminal window in which you run the command.
- Find a business.
- To find a business by name, you use the file
FindBusiness.xml
in thexml
subdirectory.- Before you run the script this time, edit the file by changing the value in the
<name>
tag to the name you specified in theSaveBusiness.xml
file.- To find the business, use the following command:
- Windows:
registry-server-test run-cli-request -Drequest=xml\FindBusiness.xml- UNIX:
registry-server-test.sh run-cli-request -Drequest=xml/FindBusiness.xml- Output appears in the terminal window. Notice the
businessKey
value returned in the<businessEntity>
tag. You will use it in the next step.- Obtain business details.
- To obtain details about a business, you use the file
GetBusinessDetail.xml
in thexml
subdirectory.- Before you run the script this time, edit this file by copying the
businessKey
value from the output of the command in the previous step into the<businessKey>
tag.- To obtain details about the business you saved, use the following command:
- Windows:
registry-server-test run-cli-request -Drequest=xml\GetBusinessDetail.xml- UNIX:
registry-server-test.sh run-cli-request -Drequest=xml/GetBusinessDetail.xml- Output appears in the terminal window.
- Delete a business.
- To delete a business you saved, you use the file
DeleteBusiness.xml
in thexml
subdirectory.- Before you run the script this time, edit the file as follows:
- Change the value of the
<authInfo>
tag to the value you used forSaveBusiness.xml
.- Change the value of the
<businessKey>
tag to the business key value of the business you want to delete.
- To delete the business, use the following command:
- Windows:
registry-server-test run-cli-request -Drequest=xml\DeleteBusiness.xml- UNIX:
registry-server-test.sh run-cli-request -Drequest=xml/DeleteBusiness.xml- Validate UDDI messages.
- To validate a UDDI message against the UDDI V2.0 XML schema before you send it, use the following command:
registry-server-test run-validate -Dinstance=XML_file_name
- If a file contains errors, the error messages have the following format:
file:line:column:message- Send any UDDI request message.
- To send a UDDI request to the server, use the following command:
registry-server-test run-cli-request -Drequest=name_of_file
- where
name_of_file
is an XML file containing a UDDI message. It is a good idea to validate the message before you send it. Thexml
subdirectory contains numerous messages you can edit and use in addition to those described here. You can also create your own messages.
Home TOC |
![]() ![]() ![]() |