Forum - Leverage Data Management Web Services API to Export an IE

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #34447
    Anonymous
    Inactive

    Hello,

    I am trying to bypass the UI and export an IE through the Data Management Web Services API call using the exportIE method. Below is the code I have so far and I am able to pass in the pdsHandle, pid, and path. What is highlighted in bold is where I’m stuck. I need to leverage this wsdl to connect to my drps-ua environment somehow, but am not quite sure. There is an example of a getSipStatusInfo in the SDK which uses the wsdl to pull back a status that I am trying to take from, again that is only an example. I have pasted it at the very bottom of this thread.

    My main goal is to have you help me make a web service call to our UA environment using this wsdl: http://l7654:1801/dpsws/repository/DataManagerServicesWS?wsdl

    In the code you will see right after I receive my pdsHandle is where I am needing to make the call to exportIE. We cannot seem to find the class in the sdk that corresponds with this method.

    package com.exlibris.rosetta;

    import com.exlibris.core.sdk.exceptions.UserAuthorizeException;
    import com.exlibris.repository.procauto.ExportEntityInfo;
    import java.lang.String;
    import com.exlibris.dps.sdk.pds.PdsClient;
    import com.exlibris.repository.procauto.TaskInfo;
    import org.lds.dps.ingest.repo.rosetta.sip.SipServicePort;
    import org.springframework.beans.factory.annotation.Autowired;

    import javax.inject.Provider;
    import java.net.MalformedURLException;
    import java.net.URL;

    public class MyIEExport {

    @Autowired
    protected Provider<DataManagerServicePort> dmWS;

    private String path = null;
    private String pid = null;
    private String pdsHandle = null;
    private long processExectionID;

    public static void main(String args[]) throws UserAuthorizeException {

    final String WSDL_URL = “http://l7654:1801/dpsws/deposit/DepositWebServices?wsdl&#8221;;
    final String PDS_URL = “http://l7654:8991/pds&#8221;;

    String pdsHandle = null;
    String pid = “IE1113032”;
    final String path = “/Users/smurphy79”;

    String userName = “admin1”;
    String password = “a12345678A”;
    final String institution = “INS00”;

    try {
    PdsClient pds = PdsClient.getInstance();
    pds.init(PDS_URL, false);
    pdsHandle = pds.login(institution, userName, password);
    } catch (Exception e) {
    }
    ExportEntityInfo eei = dmWS.get().exportIE(pdsHandle,pid,path);
    iex.path;

    }

    }

    ***************** EXAMPLE BELOW OF getting a SIP STATUS back, this is similar to what I am trying to do ***********************

    package com.exlibris.dps.sdk.examples;

    import java.net.URL;

    import javax.xml.namespace.QName;

    import com.exlibris.dps.SipStatusInfo;
    import com.exlibris.dps.SipWebServices_Service;

    public class SipStatusTest {

    public static void main(String[] args) throws Exception {
    URL swsdlUrl = new URL(“http://localhost:1801/dpsws/repository/SipWebServices?wsdl&#8221;);
    SipStatusInfo sipStatus = new SipWebServices_Service(swsdlUrl,new QName(“http://dps.exlibris.com/&#8221;, “SipWebServices”)).getSipWebServicesPort().getSIPStatusInfo(“3”);
    System.out.println(sipStatus.getStatus());
    System.out.println(sipStatus.getModule());
    System.out.println(sipStatus.getStage());

    }
    }

    #36371
    Anonymous
    Inactive

    I haven’t actually tried it yet, but wsimport should yield you these classes:

    DataManagerServicesWS.class
    DataManagerServicesWS.java
    DataManagerServicesWS_Service.class
    DataManagerServicesWS_Service.java

    and it looks like it will work in a very similar fashion to your SipWebServices_Service example… (Or am I missing something and merely restating the obvious)?

    –Bill

    #36372
    Anonymous
    Inactive

    Tested and found to work! Note the slight difference with no pds…

    import java.net.URL;
    import javax.xml.namespace.QName;

    import com.exlibris.dps.sdk.pds.HeaderHandlerResolver;
    import com.exlibris.dps.DataManagerServicesWS_Service;
    import com.exlibris.dps.DataManagerServicesWS;
    import com.exlibris.dps.ExportEntityInfo;

    public class RosettaExport {

    static final String usr = “xxx”;
    static final String pwd = “xxx”;
    static final String inst = “xxx”;

    static final String app = “http://rosetta_host:1801&#8221;;
    static final String dpsws = app + “/dpsws”;
    static final String DATAMANAGERSERVICES_WSDL_URL = dpsws
    + “/repository/DataManagerServicesWS?wsdl”;

    static final String path = “/operational_shared/staff_work_area/bill/export/ies/”;
    static final String ie = “IE583120”;

    /**
    * main
    */
    public static void main ( String[] argv ) {

    org.apache.log4j.helpers.LogLog.setQuietMode ( false );
    try {
    DataManagerServicesWS_Service dataMgrWS_Service =
    new DataManagerServicesWS_Service (
    new URL(DATAMANAGERSERVICES_WSDL_URL),
    new QName(“http://dps.exlibris.com/&#8221;, “DataManagerServicesWS”)
    );
    dataMgrWS_Service.setHandlerResolver (
    new HeaderHandlerResolver(usr,pwd,inst) );
    DataManagerServicesWS dataMgrWS =
    dataMgrWS_Service.getDataManagerServicesWSPort();
    ExportEntityInfo eeInfo = dataMgrWS.exportIE ( null, ie, path );
    }
    catch ( java.lang.Exception excp ) {
    excp.printStackTrace();
    return;
    }
    }
    }

    #36373
    Anonymous
    Inactive

    Sorry, my formatting got borked — I don’t actually write code like that!

    #36375
    Anonymous
    Inactive

    Bill,

    Thanks a bunch for your reply. I’ll try things out as soon as I get a chance.

    Sure do appreciate the feedback!
    Steve

    #36867
    Anonymous
    Inactive

    Hello all,

    sorry to revive this thread, but since I’m sitting on the same problem I thought is better than to create a new thread.
    I tried to implement the solution bill posted but could not get it to work with the current dps-sdk-5.3.0.

    The issue is that the class com.exlibris.dps.DataManagerServicesWS doesn’t have a method exportIE(…). There is another interface com.exlibris.digitool.repository.ifc.DataManagerServicesWS which does. However I haven’t managed to find an implementation for that.
    Am I missing something or is this feature no longer supported in the dps-sdk?

    Is there another way to export the IE out of Rosetta programatically?

    #36868
    Anonymous
    Inactive

    The best way I can think of is to create an export process (via the backoffice), and invoke it using runProcessOnPids.

    Opher

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.