Clarity

  • 1.  SOAP request of CA PPM

    Posted 09-26-2017 07:12 AM

    CA PPM login request is not working from java code . I tried to execute below code from eclipse - 

    String url = "https://cppm8051-dev.ondemand.ca.com/niku/xog";

    AllObjectsService_ServiceLocator servicelocator= new AllObjectsService_ServiceLocator();
    AllObjectsSoapBindingStub stub = (AllObjectsSoapBindingStub)servicelocator.getAllObjectsService(new URL(url));
    String value = stub.login("xyz", "xxxxx", null);
    System.out.println("VALUEEE:::"+value);

     

    The login API should return value of sessionID but currently it is returning null.

     

    The same SOAP request works from SOAP UI. There are no headers configured from SOAP UI. 



  • 2.  Re: SOAP request of CA PPM

    Posted 09-26-2017 11:10 AM

    I looks right.  Here is some code that is working.  I use a string to set the endpoint and login with a Login object.

     

    WebServerInstance webServerInstance = configurationManager.getWebServerInstance("app");
    URL url = new URL( webServerInstance.getSslEntryUrl());
    String endPointAddress = String.format("https://%s:%s/niku/xog", url.getHost(), webServerInstance.getSslPort());

    // Set up our web service client
    GetUserIdByEmailQueryServiceLocator serviceLocator = new GetUserIdByEmailQueryServiceLocator();
    serviceLocator.setGetUserIdByEmailQueryServiceEndpointAddress(endPointAddress);
    GetUserIdByEmailQueryPort port = serviceLocator.getGetUserIdByEmailQueryService();

    // setup our login
    Logout logout = new Logout();
    Login login = new Login("xogadmin", password, null);
    String sessionId = port.login(login);
    if (sessionId == null) return "Unknown";

    // setup our auth
    Auth auth = new Auth();
    auth.setSessionID(sessionId);
    logout.setSessionID(sessionId);

    // setup our filter for the query
    GetUserIdByEmailFilter filter = new GetUserIdByEmailFilter();
    filter.setEmailaddress(emailAddress);
    GetUserIdByEmailQuery query = new GetUserIdByEmailQuery();
    query.setCode("GetUserIdByEmail");
    query.setFilter(filter);

     

    V/r,

    Gene