Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

HttpClientErrorException using Orchestrator Java REST API

$
0
0

Hi,

 

I'm trying to quickly come up to speed to use this API.  I am using version 5.1.0, configured with SSO.

 

I'm trying to execute a workflow, or just invoke anything really on the orchestrator that interacts also with vCenter.

 

I've gone through the sample code in rest-client-examples-test that comes with Orchestrator, and I keep getting an exception. My code is on a closed network so sorry I can't copy paste,

but here is the gist of the stack trace:

 

org.springframework.web.client.HttpClientErrorException: 400 <big long guid>-rest-false not bound caused by:<big long guid>-rest-false not bound

at.org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:76)

...some other spring classes

.

.

at com.vmware.o11n.sdk.rest.client.SsoAuthenticator.getVcoSolutionPrincipal(SSoAuthenticator.java:174)

at com.vmware.o11n.sdk.rest.client.SsoAuthenticator.getVcoSolutionPrincipal(SSoAuthenticator.java:155)

at com.vmware.o11n.sdk.rest.client.DefaultVcoSessionFactory.newSsoSession(DefaultVcoSessionFactory.java:89)

at com.vmware.o11n.sdk.rest.client.examples.tests.RestTest<init>(RestTest.java:93)

at com.vmware.o11n.sdk.rest.client.examples.tests.RestTest.main(RestTest.java:118)

 

It looks like it always fails when trying to get the solution principal???

 

I saw the post here: How to pass VM name to Workflow using JavaSDK?

and tried not using the newSsoSession() call as was suggested in the post, and creating my own SSOAuthenticator and passing it the session, but that resulted in the same exception.

Essentially this is what my code looks like:

public class RestTest

{

    public static void main(String args[])

    {

    try{

            VcoSession session = DefaultVcoSessionFactory.newSsoSession(new URI("https://hostname:8281/api/"), new URI("https://hostname:7444/ims/STSService"), 1234567,"user", "pass");

 

            WorkflowService wfService = new WorkflowService(session);

            InventoryItemQuerySpec filter = new InventoryItemQuerySpec();

            filter.setMaxResult(10);

            InventoryItemsList list = wfService.getAll(filter);

            System.out.println("Got list:" + (list==null));         

    }

    catch(Exception e)

    {

        System.out.println(e);

    }

   

}

}

 

As a side note: If I use DefaultVcoSessionFactory.newLdapSession() just for kicks and then tried to invoke UtilService.getSupportedApiVersion() and that does work, but I'm guessing that is because no interaction is needed with the vCenter server to call that method.

 

I'm stuck! Any ideas or leads would be greatly appreciated! Thx!


Viewing all articles
Browse latest Browse all 6251

Trending Articles