Java Web services API examples

I all, I am new to SDL LiveContent and am trying to get some examples for JAVA web services API, the docs site lists a few docx and zip files which should be available on the install box tor samples, like SdlTrisoftClient_JavaWcfClient.docx. I am unable to find these, could someone point me in the right direction to get started.

Appreciate any assistance you may provide.

  • Hi Alex,
    After running the keytool command and running SSLPoke, I get the following error.
    sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
    certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
    at sun.security.ssl.Handshaker.processLoop(Unknown Source)
    at sun.security.ssl.Handshaker.process_record(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
    at sun.security.ssl.AppOutputStream.write(Unknown Source)
    at sun.security.ssl.AppOutputStream.write(Unknown Source)
    at SSLPoke.main(SSLPoke.java:31)
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 16 more
  • Most probably you have multiple java runtime environments. You always have to make sure that you are modifying the correct cacerts file.
    There is even an option to run java with a custom keystore attached.

    As i said, you need to make sure that your java (specific one or all jre) can connect to that https endpoint.
    This is a generic java problem.
  • Hi Alex,
    Thank you, that was the issue, I specified one version of java and now I can compile the Maven Project. Running the TestClient.java now yields the following error:
    WARNING: Interceptor for {docs.oasis-open.org/.../wsdl}SecurityTokenService has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>307 Temporary Redirect</title>
    </head><body>
    <h1>Temporary Redirect</h1>
    <p>The document has moved <a href="www.w3.org/.../p>
    </body></html>