Detecting language please wait for.......
Dear Developer Community,
I am fairly new to working with the SOAP API of WorldServer as I am rather used to work with the REST API.However, some functionalities are still not yet provided via REST API which is why I would like to further explore the functionalities of the SOAP API.
I was able to sucessfully work with the SOAP services using a client like Postman, sending direct XML requests to receive the information I needed. However, I saw in the SDK that SDL provides sample client applications that should make the process far easier e. g. terminology lookup via SOAP (tools_samples.jar contains webservices directory). The one I tried to execute was the SearchTDWildcard sample. However, I still was not able to sucessfully execute it (error states that the main class/methode cannot be found).
What I have tried: I extracted the toolkit.jar as here the webservice client example class files should be available.
From the directory where the toolkit has been extracted, as now the path to the class files needed should be available, I executed the command given in the sample file itself for searching the WS TD (command is provided as a commend in the source code and documentation, actual information regarding WS URL and TDs have been anonymised for this post):
TD "Test TD"
target French-France > search-results.csv
As far as I understand this, I should be able to execute this via CMD or Powershell e. g. on the application server and via the directory in which the path to the class file "SearchTDWildCard" exists.
It his correct? As this is a client application? Or am I completely wrong on this?
Are there any other dependencies necessary? Do I need to compile or execute the files/samples with additional libraries? Is the sample able to make the SOAP request or is this rather something that is used for sample servlets to be executed in the UI of WS somewhere?
I thought the sample file would work as a webservice client application (e.g. like Postman), create the XML SOAP requests (as I secify the parameters), send it to the respective SOAP endpoints of Worldserver (as I provide the services URL and a path), receive the response, parse the response and push the results to a csv file in the same directory where the command has been executed.
Has anyone of you experiences using the samples provided in the SDK and might be able to give me some tipps on how to work with them?
SDL Support has suggested that I could ask the questions here in the community as some of you might have worked with the SOAP API as well and the answer could also might be interesting for the community.
Please let me know if you have any questions.
Thank you in advance.
Thank you for your question, please find below additional details regarding the way the tools sample can be used.
Please keep in mind that the tools should be used only for testing purposes…
thanks for the question, we are looking into this and will come back here with a full response, as timing allows.
please excuse my late reply. Thank you very much for your exhaustive answer. This did indeed the trick and I was able to successfully query the TD.
I will now have a look at how to customise…
Please keep in mind that the tools should be used only for testing purposes and to help understanding how the World Server API can be further used and customized.
You are right, the tools can be executed using a CMD or Powershell, but there are a few references that need to be included.
Using CMD or Powershell, please follow the next steps:
1. Go to dist folder: cd [path_to_samples]\dist
2. Using Java classpath, we'll need to reference the dependencies:
- From dist folder, we'll need tools_samples.jar.
- From the lib folder, situated at the same level as samples folder, we'll need all the jars under client.
- We will also need the ws-legacy-core.jar, I referenced this one from my local Tomcat solution: C:\Tomcat\webapps\ws-legacy\WEB-INF\lib\ws-legacy-core-75.jar (the patch number might be different in your case).
3. This is the way your call should look like:
java -cp "tools_samples.jar;[path to SDK samples]\lib\client\*;C:\Tomcat\webapps\ws-legacy\WEB-INF\lib\ws-legacy-core-220.127.116.11.jar" -Dws.url=http[s]://[host]:[port]/ws-legacy com.idiominc.wssdk.samples.tools.webservices.SearchTDWildcard username admin password wsadmin TD "TD_Regression" text "Botswana" source "English (United States)" target "German (Germany)" > search-results.csv
This should do the trick and you should be able to make a successful TD search.
I will now have a look at how to customise these samples.
Thank you very much for your help.
Really glad this worked for you, hope this will make the customization easier.