parasoft jump start project query

RajeshURajeshU Posts: 18

Im creating test scripts using the java code through the parasoft jum start project and i was able to create a rest client with Input Mode as literal and pass the payload directly as a string but i need to pass the input payload from a File for which i dont see the option in the availble code.

i have the following code to set the input mode

payload.setInputMode(InputMode.Literal);
payload.setContentType("text/xml");
literal.setText("payload"); // able to pass the payload as string, need the code which would
accept the payload from external file.

Comments

  • jakubiakjakubiak Posts: 722 admin

    You can use Java code to read the contents from the File and pass it as a string to the payload. Here is a link that shows some ways to do this in Java: https://techblogstation.com/java/read-text-file-in-java/

  • RajeshURajeshU Posts: 18
    edited September 2020

    Thanks jakubiak , I'm also not able to see the code to setup the client side SSL in Security class for both http10 and http11.

    1. The security class only has the "setHttpAuthentication" method and there is
      not option to set the ClientSideSSL through the parasoft code.

    2. Also is there a package in the project that would add the global property ->
      Global Key store through the code ?

  • jakubiakjakubiak Posts: 722 admin

    The REST API does not have the ability to set Client Side SSL options. An option for this would be to manually create a client in the SOAtest UI that has the Client Side SSL options configured, and upload that to your SOAtest server. Then when you want to create a new client from the REST API, instead of creating a new one from scratch, you create a copy of the pre-configured client and then use the REST API to set the other fields.

    Regarding global key store, you will need to configure those settings manually in the SOAtest server. The SOAtest REST API does not have an API for setting Global key store.

  • benken_parasoftbenken_parasoft Posts: 973 ✭✭✭

    As an aside, the "jump start" java project was incomplete and later removed at least a couple releases ago. A newer java client is available. See
    Connecting to the API Using the Java Client

  • RajeshURajeshU Posts: 18

    @benken_parasoft Where can i find the java documentation on the classes and functions to be called for creation tst files and rest clients through java. In the API documentation i find only resources related to Rest API calls , i need the details of java functions.

  • benken_parasoftbenken_parasoft Posts: 973 ✭✭✭
    edited January 27

    The java classes map 1-to-1 with the resources in the REST API. The methods in each class map 1-to-1 with the operations for that resource in the REST API. The same descriptions you see the API docs are the same descriptions you see in the javadocs for each class and method in the java API. The javadocs are published with the main jar (look here).

  • RajeshURajeshU Posts: 18

    I keep getting authentication error when trying to run the Rest API from the tool (HTTP/1.1 407 Proxy Authentication Required) .

    When i run the same request from the try it out section of the REST API docs the response is successful.

  • jakubiakjakubiak Posts: 722 admin

    Is your browser configured to go through a proxy before it reaches your SOAtest server? If so, it sounds like you need to configure Java proxy settings before you use the Java API to connect to the server.

Sign In or Register to comment.