Package org.wijiscommons.ssaf.search

Examples of org.wijiscommons.ssaf.search.SearchService


                e.printStackTrace();
            }
        }
     
        SearchService_Service ss = new SearchService_Service(wsdlURL, SERVICE_NAME);
        SearchService port = ss.getSearch()
       
        // Configure Turststore and KeyStore for SSL Client Authentication.

        Client client = ClientProxy.getClient(port);
        HTTPConduit conduit = (HTTPConduit) client.getConduit();

        TLSClientParameters tlsParams = new TLSClientParameters();
       
        /*Set whether or not JSEE should omit checking if the host name
        specified in the URL matches that of the Common Name (CN)
        on the server's certificate. Default is false; this attribute
        should not be set to true during production use*/
        //tlsParams.setDisableCNCheck(true);
       
        //CXF 2.1.3 will give IllegalExpection if you set portocal to SSL.
        tlsParams.setSecureSocketProtocol("SSLv3");
       
        //provide trust password
        KeyStore keyStore = KeyStore.getInstance("JKS");
        String trustpass = "REDACTED";
       
        // provide your truststore file path
        File truststore = new File(
                "/usr/local/jdk1.5.0_06/jre/lib/security/cacerts");
       
        keyStore.load(new FileInputStream(truststore), trustpass.toCharArray());
        TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        trustFactory.init(keyStore);
        TrustManager[] tm = trustFactory.getTrustManagers();
        tlsParams.setTrustManagers(tm);

        // LabDc certs
        //truststore = new File("/home/lakshmi/x509CRLLocation/LabDctestCert/untrusted.key");  // LabDc-untrusted
        //truststore = new File("/home/lakshmi/x509CRLLocation/LabDctestCert/wrongcn.key");  //LabDc-wrongcn
        //truststore = new File("/home/lakshmi/x509CRLLocation/LabDctestCert/expired.key");  //LabDc-expired
       
        // provide your client store file path
        truststore = new File("/home/lakshmi/x509CRLLocation/WijisServices.key");
        keyStore.load(new FileInputStream(truststore), trustpass.toCharArray());
        KeyManagerFactory keyFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
        keyFactory.init(keyStore, trustpass.toCharArray());
        KeyManager[] km = keyFactory.getKeyManagers();
        tlsParams.setKeyManagers(km);

        /*FiltersType filter = new FiltersType();
        filter.getInclude().add(".*_EXPORT_.*");
        filter.getInclude().add(".*_EXPORT1024_.*");
        filter.getInclude().add(".*_WITH_DES_.*");
        filter.getInclude().add(".*_WITH_NULL_.*");
        filter.getExclude().add(".*_DH_anon_.*");
        tlsParams.setCipherSuitesFilter(filter);//set all the needed include and exclude filters.*/       
        
        conduit.setTlsClientParameters(tlsParams);
       
        {
          System.out.println("Invoking recordRetrieval webservice...");
          File retrieveRequestFile = new File(
          "request-files/javaClient-requestFiles/recordRetrieval_request.xml");
         
      Document retrieveRequestDocument = ClientDomUtils
          .getDocumentFromFile(retrieveRequestFile);
     
      RecordRetrieval recordRetrieval = new RecordRetrieval();
      recordRetrieval.setAny(retrieveRequestDocument.getDocumentElement());

      try
      {
        RecordRetrievalResponse recordRetrievalResponse = port
            .recordRetrieval(recordRetrieval);
        if(recordRetrievalResponse != null)
        {
          Element retrieveReponseElement = (Element) recordRetrievalResponse.getAny();
          System.out.println("RecordRetrieval result : "
                  + ClientDomUtils
                      .getStringFromDocument(retrieveReponseElement
                  .getOwnerDocument()));
        }
        else
        {
          System.out.println("RecordRetrievalResponse returned is null");
        }
      }
      catch (FatalRecordRetrievalFault e)
      {
        System.out.println("FatalFault exception: FatalFault has occurred.");
        System.out.println(e.toString());
      }
        }
       
        {
      System.out.println("Invoking search webservice...");
     
      File searchRequestFile = new File(
          "request-files/javaClient-requestFiles/search_invocation.xml");
     
      Document searchRequestDocument = ClientDomUtils
          .getDocumentFromFile(searchRequestFile);
     
      Search search = new Search();
      search.setAny(searchRequestDocument.getDocumentElement());

      try
      {
        SearchResponse searchReponse = port.search(search);
        if (searchReponse != null)
        {
          Element searchReponseElement = (Element) searchReponse.getAny();
          System.out.println("Search result  : "
              + ClientDomUtils
View Full Code Here


     */
    public SearchResponse search(Element searchRequestDocumentElement) throws FatalSearchFault
    {
      log.info("Invoking search web service...");
      SearchResponse searchReponse = null;
      SearchService port = sendCertAlong();
      Search search = new Search();
      search.setAny(searchRequestDocumentElement)

      if(port != null)
    {
      searchReponse = port.search(search);
    }
    else
    {
      log.error("Search service port is null");
    }
View Full Code Here

    {
      log.info("Invoking recordRetrieval web service...");
      RecordRetrievalResponse recordRetrievalResponse = null;
      RecordRetrieval recordRetrievalRequest = new RecordRetrieval();
      recordRetrievalRequest.setAny(recordRetrievalRequestDocElement);
    SearchService port = sendCertAlong();
   
    if(port != null)
    {
      recordRetrievalResponse = port.recordRetrieval(recordRetrievalRequest);
    }
    else
    {
      log.error("Retrieve service port is null");
    }
View Full Code Here

                e.printStackTrace();
            }
        }
     
        SearchService_Service ss = new SearchService_Service(wsdlURL, SERVICE_NAME);
        SearchService port = ss.getSearch()
       
        // Configure Turststore and KeyStore for SSL Client Authentication.

        Client client = ClientProxy.getClient(port);
        HTTPConduit conduit = (HTTPConduit) client.getConduit();

        TLSClientParameters tlsParams = new TLSClientParameters();
       
        /*Set whether or not JSEE should omit checking if the host name
        specified in the URL matches that of the Common Name (CN)
        on the server's certificate. Default is false; this attribute
        should not be set to true during production use*/
        //tlsParams.setDisableCNCheck(true);
       
        //CXF 2.1.3 will give IllegalExpection if you set portocal to SSL.
        tlsParams.setSecureSocketProtocol("SSLv3");
       
        //provide trust password
        KeyStore keyStore = KeyStore.getInstance("JKS");
        String trustpass = "REDACTED";
       
        // provide your truststore file path
        File truststore = new File(
                "/usr/local/jdk1.5.0_06/jre/lib/security/cacerts");
       
        keyStore.load(new FileInputStream(truststore), trustpass.toCharArray());
        TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        trustFactory.init(keyStore);
        TrustManager[] tm = trustFactory.getTrustManagers();
        tlsParams.setTrustManagers(tm);

        // LabDc certs
        //truststore = new File("/home/lakshmi/x509CRLLocation/LabDctestCert/untrusted.key");  // LabDc-untrusted
        //truststore = new File("/home/lakshmi/x509CRLLocation/LabDctestCert/wrongcn.key");  //LabDc-wrongcn
        //truststore = new File("/home/lakshmi/x509CRLLocation/LabDctestCert/expired.key");  //LabDc-expired
       
        // provide your client store file path
        truststore = new File("/home/lakshmi/x509CRLLocation/WijisServices.key");
        keyStore.load(new FileInputStream(truststore), trustpass.toCharArray());
        KeyManagerFactory keyFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
        keyFactory.init(keyStore, trustpass.toCharArray());
        KeyManager[] km = keyFactory.getKeyManagers();
        tlsParams.setKeyManagers(km);

        /*FiltersType filter = new FiltersType();
        filter.getInclude().add(".*_EXPORT_.*");
        filter.getInclude().add(".*_EXPORT1024_.*");
        filter.getInclude().add(".*_WITH_DES_.*");
        filter.getInclude().add(".*_WITH_NULL_.*");
        filter.getExclude().add(".*_DH_anon_.*");
        tlsParams.setCipherSuitesFilter(filter);//set all the needed include and exclude filters.*/       
        
        conduit.setTlsClientParameters(tlsParams);
       
        {
          System.out.println("Invoking recordRetrieval webservice...");
          File retrieveRequestFile = new File(
          "request-files/javaClient-requestFiles/recordRetrieval_request.xml");
         
      Document retrieveRequestDocument = DomUtils
          .getDocumentFromFile(retrieveRequestFile);
     
      RecordRetrieval recordRetrieval = new RecordRetrieval();
      recordRetrieval.setAny(retrieveRequestDocument.getDocumentElement());

      try
      {
        RecordRetrievalResponse recordRetrievalResponse = port
            .recordRetrieval(recordRetrieval);
        if(recordRetrievalResponse != null)
        {
          Element retrieveReponseElement = (Element) recordRetrievalResponse.getAny();
          System.out.println("RecordRetrieval result : "
                  + DomUtils.getStringFromDocument(retrieveReponseElement
                  .getOwnerDocument()));
        }
        else
        {
          System.out.println("RecordRetrievalResponse returned is null");
        }
      }
      catch (FatalRecordRetrievalFault e)
      {
        System.out.println("FatalFault exception: FatalFault has occurred.");
        System.out.println(e.toString());
      }
        }
       
        {
      System.out.println("Invoking search webservice...");
     
      File searchRequestFile = new File(
          "request-files/javaClient-requestFiles/search_invocation.xml");
     
      Document searchRequestDocument = DomUtils
          .getDocumentFromFile(searchRequestFile);
     
      Search search = new Search();
      search.setAny(searchRequestDocument.getDocumentElement());

      try
      {
        SearchResponse searchReponse = port.search(search);
        if (searchReponse != null)
        {
          Element searchReponseElement = (Element) searchReponse.getAny();
          System.out.println("Search result  : "
              + DomUtils.getStringFromDocument(searchReponseElement
View Full Code Here

   */
    public SearchResponse search(Element searchRequestDocumentElement) throws FatalSearchFault
    {
      log.info("Invoking search web service...");
      SearchResponse searchReponse = null;
      SearchService port = sendCertAlong();
      Search search = new Search();
      search.setAny(searchRequestDocumentElement)

      if(port != null)
    {
      searchReponse = port.search(search);
    }
    else
    {
      log.error("Search service port is null");
    }
View Full Code Here

    {
      log.info("Invoking recordRetrieval web service...");
      RecordRetrievalResponse recordRetrievalResponse = null;
      RecordRetrieval recordRetrievalRequest = new RecordRetrieval();
      recordRetrievalRequest.setAny(recordRetrievalRequestDocElement);
    SearchService port = sendCertAlong();
   
    if(port != null)
    {
      recordRetrievalResponse = port.recordRetrieval(recordRetrievalRequest);
    }
    else
    {
      log.error("Retrieve service port is null");
    }
View Full Code Here

TOP

Related Classes of org.wijiscommons.ssaf.search.SearchService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.