PEM to DER decoding using JCE API

Hi,
I need to convert PEM files to DER format within my
Java code (each PEM file is coming in as a String object).
Does anyone know of a way to do this using the Sun JCE
(or IBM provider)?
Thanks much

I figured out how to do this. In case someone else runs into
this problem in the future, here's one solution.
1. Strip the delimiters , i.e "-----BEGIN PRIVATE KEY-----"
and "-----END PRIVATE KEY-----" from the PEM file. You
will be left with the Base64 encode text.
2. Use a Base64 decoder class (e.g com.ibm.misc.BASE64Decoder)
to decode the Base64 back to the original DER bytes.
For example:
//privateKeyStr String contains the PEM data
int pemStartIndex = privateKeyStr.indexOf("\n") + 1;
int pemEndIndex = privateKeyStr.indexOf("-----END");
String pemStr = privateKeyStr.substring(pemStartIndex, pemEndIndex);
byte[] keyData = null;
com.ibm.misc.BASE64Decoder base64 = new com.ibm.misc.BASE64Decoder();
keyData = base64.decodeBuffer(pemStr); //keyData now contains DER data
That's it.

Similar Messages

  • Add user to sharepoint group using REST API

    I am trying to add a user to sharepoint group with following code
    serviceUrl= Appweb + "/_api/SP.AppContextSite(@target)/web/sitegroups("+GroupId+")/users?@target='host web'";
        $.ajax({
            url: serviceUrl,
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: 'json',
            body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|'+email }",
      headers: {"accept":"application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest":$("#__REQUESTDIGEST").val()
        async: false,
      success: function (data) {
               alert('success');
      error: function (data) {
                 alert('fail');
    The request goes to error function. Response of the request is Microsoft.SharePoint.Client.InvalidClientQueryException and message is A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was
    expected
    I tried the sample from following link but fail it
    https://msdn.microsoft.com/en-us/library/office/dn531432.aspx

    Hi,
    Per my understanding, you might want to add an user to a SharePoint group in host web from a SharePoint Hosted App using REST API.
    Here is a working demo for your reference:
    var hostweburl;
    var appweburl;
    $(document).ready(function () {
    //Get the URI decoded URLs.
    hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
    // Resources are in URLs in the form:
    // web_url/_layouts/15/resource
    var scriptbase = hostweburl + "/_layouts/15/";
    // SP.RequestExecutor.js to make cross-domain requests
    $.getScript(scriptbase + "SP.RequestExecutor.js", loadPage);
    // Utilities
    // Retrieve a query string value.
    // For production purposes you may want to use a library to handle the query string.
    function getQueryStringParameter(paramToRetrieve)
    var params = document.URL.split("?")[1].split("&");
    for (var i = 0; i < params.length; i = i + 1)
    var singleParam = params[i].split("=");
    if (singleParam[0] == paramToRetrieve) return singleParam[1];
    function addUsersInGroup() {
    var executor;
    // Initialize the RequestExecutor with the app web URL.
    executor = new SP.RequestExecutor(appweburl);
    executor.executeAsync({
    url: appweburl + "/_api/SP.AppContextSite(@target)/web/sitegroups(8)/users?@target='" + hostweburl + "'",
    method: "POST",
    contentType: "application/json; charset=utf-8",
    dataType: 'json',
    body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|[email protected]'}",
    headers: {
    "Accept": "application/json; odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest":$("#__REQUESTDIGEST").val()
    success: addUsersInGroupSuccessHandler,
    error: addUsersInGroupErrorHandler
    function addUsersInGroupSuccessHandler(data)
    console.log(data);
    var jsonObject = JSON.parse(data.body);
    console.log(jsonObject);
    function addUsersInGroupErrorHandler(data)
    console.log(data);
    var jsonObject = JSON.parse(data.body);
    console.log(jsonObject);
    Thanks 
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected].

  • How to create a p7c format from a pem or der or cer

    Hi,
    Anybody knows how to create a p7c format from a pem or der or cer.
    I have checked the URL http://edocs.bea.com/wlibc/docs70/admin/cvcerts.html and
    other sites but didn't find anything useful.
    Thanks & Regards,
    Subodh

    On Windows double click the der or cer certificate. This should open it in the
    Certificate viewer.
    Open the Details tab, click on the Copy to File button and select pkcs #7 format.
    Pavel.
    "Subodh" <[email protected]> wrote:
    >
    Hi,
    Anybody knows how to create a p7c format from a pem or der or cer.
    I have checked the URL http://edocs.bea.com/wlibc/docs70/admin/cvcerts.html
    and
    other sites but didn't find anything useful.
    Thanks & Regards,
    Subodh

  • PEM or DER Format certificate chain

    I have installe an ISE 1.2.0.899. It is used for Guest Services only, the customer require all its employees be able to access the sponsor portal and validated their credentials using LDAPS. Not LDAP, not AD feature in ISE. The problem is because in order to enable LDAPS I must upload to ISE the root CA certificate, the customer is not providing the root CA certificate for security reasons (?); they said the certificate chain should be enough. Even the ISE user guide indicates root CA or certificate chain. So, the customer downloaded the certificate chain from its PKI (Microsoft 2008) and give it to me, but it is in .p7b (PKCS#7) format (they said there is no choice to select another format). This format is not supported by ISE, so I needed to use third party tools to convert the file (www.sslshopper.com and openssl). It appears the convertion is successfull but when I try to upload on ISE Certificate Store always I get the same errror: "Unable to read certificate file - please be sure file is in PEM or DER format".
    So the questions are:
    1. Is the file provided by the PKI in p7b format always?
    2. What should be the most proper way to convert the file to something the ISE can understand?
    3. Should be the root CA certificate a vey best option?
    Even the conversion problems indicated above, I tried to open and convert the file using the mmc. I know the certificate chain has three files, I recovered them and uploaded to ISE. Whit two of these three files selected on LDAPS security configuration I can run the "Test bind to Server" successfully but everytime an user try with its own credentials always the access is denied with "invalid username or password" error.
    Locking in the ISE log I found this messages:
    ERROR,0x2b263618c940,LdapSslConnectionContext::checkCryptoResult(id = 634): error message = SSL alert: code=0x230=560 ; source=local ; type=fatal ; message="Unknown CA - error unable to get issuer certificate locally",LdapSslConnectionContext.cpp:226
    ERROR,0x2b263618c940,LdapConnectionBindingState::onInput(id = 634): bind ended with an error: 117,LdapConnectionStates.cpp:396
    631,WARN ,0x2b263618c940,NIL-CONTEXT,Crypto::Result=1, Crypto.SSLConnection.pvClientInfoCB - Alert raised: code=0x230=560, where=0x4008=16392, source=local,SSLConnection.cpp:2765
    WARN ,0x2b263618c940,NIL-CONTEXT,Crypto::Result=102, Crypto.SSLConnection.writeData - failed write the data,SSLConnection.cpp:970
    ERROR,0x2b263618c940,LdapSslConnectionContext::checkCryptoResult(id = 634): crypto result = 102,LdapSslConnectionContext.cpp:202
    ERROR,0x2b263618c940,cntx=0000005789,user=tmxedscalcan,LdapServer::onAcquireConnectionResponse: failed to acquire connection,LdapServer.cpp:461
    ERROR,0x2b263436e940,NIL-CONTEXT,[ActiveDirectoryClient::openCdcConnection] Can't open CDC session due to error 32: ADClient is not running,ActiveDirectoryClient.cpp:1328
    ERROR,0x2b263436e940,NIL-CONTEXT,[ActiveDirectoryClient::connectClient] AD CDC client connection failed!,ActiveDirectoryClient.cpp:117
    ERROR,0x2b263436e940,NIL-CONTEXT,ActiveDirectoryIDStore::performConnection - Connecting client failed,ActiveDirectoryIDStore.cpp:608
    I don't have idea what do they mean.
    Someone told me the convertion made with mmc on my pc was an error and I need to repeat the same process using administrative tools on a server
    I'm really confused and I don't know how continue with a troubleshoot process.
    How can I know the original file is correct?
    How can I know the conversion is correct?
    As the original chain includes three certificates, I should upload them to ISE separately or as one file?
    Attached is the Sponsor policy screenshoot. I have two rules with the same conditions one por AD (just for test), one for LDAPS.
    I will appreciate your help
    Regards.
    Daniel Escalante

    Hi,
    If you open the .p7b file on a Windows machine. (Open not install)
    Go to the Certification Path and click on the root certificate, click View Certificate.
    Now you have the root certificate.
    Go to Details and click Copy to File. This give you the option to exprot the root cert.
    Click next, here you can select to save as Base-64 encoded (DER) that you can import in ISE.
    Click next and save. Then try to import under Server certifiactes on ISE
    You can do this for sub-CA cert in the chain as well.
    HTH

  • Unable to use JCE providers with OC4J server

    I am trying to use a JCE encryption provider. I am able to execute the following code inside a standard class just fine. But when I move it into a jsp and run it on the OC4J server the getInstance() line throws the following exception.
    java.lang.SecurityException: The JCE framework is invalid.
    Security.addProvider(new com.sun.crypto.provider.SunJCE());
    ObjectInputStream in = new ObjectInputStream(new FileInputStream("C:\\Key\\EIKey.ser"));
    key = (Key)in.readObject();
    in.close();
    cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");

    Hi Rozek,
    See CRM Modules and OA Framework for alternative encryption methods on Oracle, but this does not help me because my code is not written for Oracle only.
    It seems to me that I can't use Oracle Application Server for this project. This is a big flaw in the OC4J not to be able to use standard api from Sun!!!!. I think Oracle staff has to do some refactoring of its code, because it Stinks.
    I am looking for alternative Application Server, Iam trying out BEA Weblogic now.
    See my question also @ (http://forums.oracle.com/forums/message.jsp?id=864619)
    -Bjorn Brynjar Jonsson
    Software Engineer @ Calidris Ltd
    email: [email protected]

  • How to strore keys in KeyStores..of JCE Api..

    Hi ,
    i'm trying to implement a program mySignature that creates and verifies digital signatures using Java Cryptography Extension.
    I am using the DSA Algorithm for encryption.
    Now the problem is once i create the private keys and public keys i am not able to store them to the KeyStore.
    here is the code I wrote
    package my.security.test;
    import java.io.BufferedInputStream;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.security.Certificate;
    import java.security.InvalidAlgorithmParameterException;
    import java.security.InvalidKeyException;
    import java.security.KeyPair;
    import java.security.KeyPairGenerator;
    import java.security.KeyStore;
    import java.security.KeyStoreException;
    import java.security.NoSuchAlgorithmException;
    import java.security.NoSuchProviderException;
    import java.security.PrivateKey;
    import java.security.PublicKey;
    import java.security.SecureRandom;
    import java.security.Signature;
    import java.security.SignatureException;
    import java.security.cert.CertificateException;
    import java.security.cert.CertificateFactory;
    import java.security.interfaces.RSAPrivateKey;
    import java.security.interfaces.RSAPublicKey;
    import java.security.spec.RSAKeyGenParameterSpec;
    * @author sandeepk
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class MySignature {
         public static void main(String[] args) {
              KeyPairGenerator keyGen = null;
              FileOutputStream sigfos = null;
              try {
                   Signature signature = Signature.getInstance("SHA1withDSA", "SUN");
                   keyGen = KeyPairGenerator.getInstance("DSA", "SUN");
                   keyGen.initialize(1024);
                   KeyPair keyPair = keyGen.generateKeyPair();
                   PrivateKey privateKey = keyPair.getPrivate();
                   PublicKey publicKey = keyPair.getPublic();
                   KeyStore ks = KeyStore.getInstance("JKS", "SUN");
                   System.out.println("Here1");
                   ks.setKeyEntry("privkey", privateKey, "pass".toCharArray(), null);
                   System.out.println("Here2");
                   ks.setKeyEntry("pubkey", publicKey, "pass".toCharArray(), null);
                   System.out.println("Here3");
                   sigfos = new FileOutputStream("C:\\keystore");
                   ks.store(sigfos, "pass".toCharArray());
                   signature.initSign(privateKey);
                   // Reading the contents of them message file               
                   FileInputStream fis = new FileInputStream("C:\\message.txt");
                   BufferedInputStream bufin = new BufferedInputStream(fis);
                   byte[] buffer = new byte[1024];
                   int len;
                   while (bufin.available() != 0) {
                        len = bufin.read(buffer);
                        signature.update(buffer, 0, len);
                   bufin.close();
                   // Writng the signature to a file
                   byte[] realSig = signature.sign();
                   sigfos = new FileOutputStream("C:\\sig.txt");
                   sigfos.write(realSig);
                   sigfos.close();
              } catch (InvalidKeyException e) {
                   e.printStackTrace();
              } catch (NoSuchAlgorithmException e) {
                   e.printStackTrace();
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              } catch (SignatureException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (NoSuchProviderException e) {
                   e.printStackTrace();
              } catch (KeyStoreException e) {
                   e.printStackTrace();
              }catch(CertificateException e){
                   e.printStackTrace();
    I get an error while i try to store the key on to the KeyStore, if I comment out these lines of code the program runs without any probs.
    Can any one help me with this issue, i'ld be thank full to them
    -Chau
    Sandy

    We use 'PDDocCreateWordFinder' , 'PDWordFinderEnumWords' to extract the text from Adobe Reader document through Code, Not tool.
    But, by using these APIs, I can't see any difference in 'new line/row' or 'paragraph' if exists in PDF doc.
    I need such API which can give the exact format of Adobe Reader doc according to the content exists in that PDF doc.
    Thanks!

  • Unable to display double values in Excel sheet using JExcel API

    Hi
    I am writing code to generate report in the form of Excel Sheet using JExcel API.
    Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
    Any kind of reply might help me lot.
    Thank U.

    If you enable the submit zero option, it still happens? This is a new feature on the display tabl
    #NumericZero Enhancements
    To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
    · Excel formatting for the cell is retained.
    · All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
    · This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
    You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
    Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
    1. (Highest) Metadata errors
    2. #No access
    3. #Invalid/Meaningless
    4. #No data\Missing

  • How Do I Use the API to Abbreviate?

    How do I use the ACE API to limit the output field length and properly abbreviate the output field?
    Using the pwace command-line application, I get abbreviated output that looks like this for a 30 byte field:
    nnnnn GEORGE WASHNGTN MMRL HWY
    However, when using the API, I end up with a truncated field:
    nnnnn GEORGE WASHINGTON MEMORI
    This is from the PRIM_ADDR field.
    How do I use the API to get the same field value as the command-line application?
    Thanks,
    Rob
    Edited by: rriggs on Jun 30, 2010 11:36 PM

    Rob,
    The jobfile product has intelligent truncation built into the product.  However, with the API this would be up for the user to code around. 
    Thanks,
    Brandon

  • Cross Reference within external Database using XREF API

    Hi Experts,
       Can we do Cross Reference within external Database using  XREF API uses JDBC to access the Oracle Database Stored Procedures in SAP PI? How to use a JNDI Data source to access the DB and how to do the Connection Pooling will be done by the SAP J2EE server? Kindly let me know step by step proceedings.
    Regards
    Archana

    Hello Archana,
    It can be done with a Lookup call in a mapping.
    Here's a little article about the topic in the SAP wiki:
    http://wiki.sdn.sap.com/wiki/display/XI/HowtouseCrossReferencewithinexternal+Database
    With kind regards
                     Sebastian

  • Problem Sending mails in a loop using JavaMail API

    Hello All,
    I am sending emails in a loop(one after the other) using JavaMail API,but the problem is, if the first two,three email addresses in the loop are Valid it sends the Email Properly, but if the Fourth or so is Invalid Address it throws an Exception....
    "javax.mail.SendFailedException: Sending failed;"
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 450 <[email protected]>:Recipient address rejected: Domain not found......
    So if i want to send hundereds of emails and if one of the Emails inbetween is Invalid the process Stops at that point and i could not send the other emails in the Loop......
    How Could i Trap the exception thrown and handle it in such a way, so that the loops continues ..
    Is there something with the SMTP Server....?
    The code which i am using is as follows....
    <Code>...
    try {
    InitialContext ic = new InitialContext();
    Session session = (Session) ic.lookup(JNDINames.MAIL_SESSION);
    if (Debug.debuggingOn)
    session.setDebug(true);
    // construct the message
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(eMess.getEmailSender()));
    String to = "";
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(to, false));
    msg.setRecipients(Message.RecipientType.BCC,
    InternetAddress.parse(eMess.getEmailReceiver(), false));
    msg.setSubject(eMess.getSubject());
    msg.setContent(eMess.getHtmlContents(),"text/plain");
    msg.saveChanges();                
    Transport.send(msg);
    } catch (Exception e) {
    Debug.print("createAndSendMail exception : " + e);
    throw new MailerAppException("Failure while sending mail");
    </Code>....
    Please give me any suggestions regarding it....and guide me accordingly..
    Thanks a million in advance...
    Regards
    Sam

    How about something like the code attached here. Be aware it is lifted and edited out of an app we have here so it may require changing to get it to work. If it don't work - don't come asking for help as this is only a rough example of one way of doing it. RTFM - that's how we worked it out!
    SH
    try {
    Transport.send(msg);
    // If we get to here then the mail went OK so update all the records in the email as sent
    System.out.println("Email sent OK");
    catch (MessagingException mex) {
    System.out.println("Message error");
    Exception ex = mex;
    do {
    if (ex instanceof SendFailedException) {
    if (ex.getMessage().startsWith("Sending failed")) {
    // Ignore this message as we want to know the real reason for failure
    // If we get an Invalid Address error or a Message partially delivered message process the message
    if (ex.getMessage().startsWith("Message partially delivered")
    || ex.getMessage().startsWith("Invalid Addresses")) {
    // This message is of interest as we need to process the actual individual addresses
    System.out.println(ex.getMessage().substring(0, ex.getMessage().indexOf(";")));
    // Now get the addresses from the SendFailedException
    SendFailedException sfex = (SendFailedException) ex;
    Address[] invalid = sfex.getInvalidAddresses();
    if (invalid != null) {
    System.out.println("Invalid Addresse(s) found -");
    if (invalid.length > 0) {
    for (int x = 0; x < invalid.length; x++) {
    System.out.println(invalid[x].toString().trim());
    Address[] validUnsent = sfex.getValidUnsentAddresses();
    if (validUnsent != null) {
    System.out.println("Valid Unsent Addresses found -");
    if (validUnsent.length > 0) {
    for (int x = 0; x < validUnsent.length; x++) {
    System.out.println(validUnsent[x].toString().trim());
    Address[] validSent = sfex.getValidSentAddresses();
    if (validSent != null) {
    System.out.println("Valid Sent Addresses found -");
    if (validSent.length > 0) {
    for (int x = 0; x < validSent.length; x++) {
    System.out.println(validSent[x].toString().trim());
    if (ex instanceof MessagingException)
    ex = ((MessagingException) ex).getNextException();
    else {
    // This is a general catch all and we should assume that no messages went and should stop
    System.out.println(ex.toString());
    throw ex;
    } while (ex != null);

  • How to use excel api in java?

    I need to use excel api in Java to generate data in excel format. Can any one tell any of the use ful Excel api that we can down load from net? i have read about Apache's POi-hssf-Java api. But the jar i downloaaded from Apache site is not working ? Can anybody please send me the jar for taht Api ?

    Hi,
    In fact i was not clear about whcih jar file to download from the apache site. i found one folder structure like this
    -parent
    -bin
    -src
    All these folders contained some zip files. i took the zip files and extracted them. And i set teh class path also . But when i tried to import in java programs ,these jar files are giving compilation errors

  • Get all the field's value of addressbook entry using c++ api

    How can i get all the field values of address book entry in groupwise using c++ api.

    You should be able to do that via the Token API. There is an AddressBookGetEntry method. You could createsome sort of AddressbookEntry class that fetches (via iteration over the defined ABFields) all the innformation.

  • Can I use external APIs to authenticate users?

    I have been asked to develop a lightswitch application either as desktop client or HTML client. Now I am confused about the authentication
    mechanism in LightSwitch, and it leads a question: Can I authenticate my users from an external website or application?  
    For the HTML client, I have been thinking that whether I could use external APIs like Facebook Login API to authenticate my users? If I could, the code should be JavaScript, then where should I put it, and how can I configure my LS application?
    For the desktop client, same question, if I could identify my users by pulling some user information from an external website, what kind of code/Programming Language shall I use? 

    Hey ConnorTx!
    This is not supported out of the box.
    For in-browser desktop applications, you can hack around this by setting up the social media credentials, then redirecting to your desktop application while passing the self-encrypted credentials.  I explained this workaround in
    this article.
    I don't have enough production experience with HTML apps yet.  However when you use Forms authentication, I suspect you can simply fill in the IPrincipal on the HttpContext.Current, then redirect to your HTML app, and the LightSwitch Forms Auth mechanism
    would pick up your principal as valid credentials.  I wish I had time to show you some code for this, would make a great blog post :/
    Keep rocking LS!
    Jan
    It's your story - time to switch on the innovation.||About me||LightSwitch blog

  • font color=red Create/Modify forms and triggers through C++ using OPEN API

    <font color=red>
    Dear brothers/sisters<font color=darkblue>
    <br><br>
    Please help us to find the linking problem.
    <br>
    We have to add PRE-FORM trigger to many FMBies. We have thousants of FMBies. So opening one by one is difficult. For this we are using OPEN API and BORLAND C++. We have coppied all header files from D:\orant\FORMS60\API.
    But there is a link error. Here is the snippet.
    <br>
    <font color=red>
    <br>#include <stdio.h>
    <br>#include <stdlib.h>
    <br>#include <malloc.h>
    <br>#include <d2fctx.h> /* Forms API context */
    <br>#include <d2ffmd.h> /* Form module header file */
    <br>int main (int argc, char *argv[])
    <br>{
    <br>d2fctxa ctx_attr;
    <br>d2fctx *ctx;
    <br>d2ffmd *form;
    <br>text *form_name;
    <br>/* Check arguments */
    <br>if ( argc != 2 )
    <br>{
    <br>fprintf(stderr, "USAGE: %s <filename>\n", argv[0]);
    <br>exit(1);
    <br>}
    <br>/* Create Forms API context */
    <br>ctx_attr.mask_d2fctxa = (ub4)0;
    <br>if ( d2fctxcr_Create(&ctx, &ctx_attr) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error creating Forms API context\n");
    <br>exit(1);
    <br>}
    <br>/* Load the form module into memory */
    <br>if ( d2ffmdld_Load(ctx, &form, argv[1], FALSE) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Failed to load form module: %s\n", argv[1]);
    <br>exit(1);
    <br>}
    <br>/* Get the name of the form module */
    <br>if ( d2ffmdg_name(ctx, form, &form_name) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error getting the name of the form module\n");
    <br>}
    <br>else
    <br>{
    <br>/* Print the name of the form, then free it */
    <br>printf ("The name of the form is %s\n", form_name);
    <br>free(form_name);
    <br>}
    <br>/* Destroy the in-memory form */
    <br>if ( d2ffmdde_Destroy(ctx, form) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error destroying form module\n");
    <br>}
    <br>/* Close the API and destroy context */
    <br>d2fctxde_Destroy(ctx);
    <br>return 0;
    <br>}
    <br>
    <font color=darkblue>
    <br>
    The compilation is success. But there is a link error. Please help us to find the problem.
    <br><br>
    Here is the error Message.
    <br>
    <font color=red>
    <br>Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    <br>FIRST.CPP:
    <br>Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    <br>Error: Unresolved external '_d2fctxcr_Create' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdld_Load' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdgt_GetTextProp' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2fctxde_Destroy' referenced from D:\API\FIRST.OBJ
    <br><br>
    <font color=darkblue size=4>Could you please help us.......<br>

    <font color=red>
    Dear brothers/sisters<font color=darkblue>
    <br><br>
    Please help us to find the linking problem.
    <br>
    We have to add PRE-FORM trigger to many FMBies. We have thousants of FMBies. So opening one by one is difficult. For this we are using OPEN API and BORLAND C++. We have coppied all header files from D:\orant\FORMS60\API.
    But there is a link error. Here is the snippet.
    <br>
    <font color=red>
    <br>#include <stdio.h>
    <br>#include <stdlib.h>
    <br>#include <malloc.h>
    <br>#include <d2fctx.h> /* Forms API context */
    <br>#include <d2ffmd.h> /* Form module header file */
    <br>int main (int argc, char *argv[])
    <br>{
    <br>d2fctxa ctx_attr;
    <br>d2fctx *ctx;
    <br>d2ffmd *form;
    <br>text *form_name;
    <br>/* Check arguments */
    <br>if ( argc != 2 )
    <br>{
    <br>fprintf(stderr, "USAGE: %s <filename>\n", argv[0]);
    <br>exit(1);
    <br>}
    <br>/* Create Forms API context */
    <br>ctx_attr.mask_d2fctxa = (ub4)0;
    <br>if ( d2fctxcr_Create(&ctx, &ctx_attr) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error creating Forms API context\n");
    <br>exit(1);
    <br>}
    <br>/* Load the form module into memory */
    <br>if ( d2ffmdld_Load(ctx, &form, argv[1], FALSE) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Failed to load form module: %s\n", argv[1]);
    <br>exit(1);
    <br>}
    <br>/* Get the name of the form module */
    <br>if ( d2ffmdg_name(ctx, form, &form_name) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error getting the name of the form module\n");
    <br>}
    <br>else
    <br>{
    <br>/* Print the name of the form, then free it */
    <br>printf ("The name of the form is %s\n", form_name);
    <br>free(form_name);
    <br>}
    <br>/* Destroy the in-memory form */
    <br>if ( d2ffmdde_Destroy(ctx, form) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error destroying form module\n");
    <br>}
    <br>/* Close the API and destroy context */
    <br>d2fctxde_Destroy(ctx);
    <br>return 0;
    <br>}
    <br>
    <font color=darkblue>
    <br>
    The compilation is success. But there is a link error. Please help us to find the problem.
    <br><br>
    Here is the error Message.
    <br>
    <font color=red>
    <br>Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    <br>FIRST.CPP:
    <br>Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    <br>Error: Unresolved external '_d2fctxcr_Create' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdld_Load' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdgt_GetTextProp' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2fctxde_Destroy' referenced from D:\API\FIRST.OBJ
    <br><br>
    <font color=darkblue size=4>Could you please help us.......<br>

  • Need help in developing a webdynpro application using UWL API

    Hi developers,
    Iam developing a new WebDynpro application for UWL using UWL API.the functionality is to dispaly the summary of UWL like number of unread items, total items.
    Iam getting the problem while deploying the application, iam getting warning while deployed the application.
    I have given all possible ways mentioned in the below forum link
    Re: Accessing PortalRuntime at runtime?
    The exact problem is coming at reference file.
    Please giude me how to move forward.
    1. Below is the error when given "tckmcbc.uwl~api" in the service entry
    deployed with warning :
    Finished with warnings: development
    Caught exception during application startup from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Error occurred while starting application local/UWLCountDemo and wait. Reason: Clusterwide exception: server ID 21763550:com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to prepare application local/UWLCountDemo for startup. Reason=Clusterwide exception: Failed to start dependent service ''tckmcbc.uwl~api'' of application ''local/UWLCountDemo''. Status of dependent component: STATUS_MISSING. Hint: Is the component deployed correctly on the engine?
    2.Below is the error  when i gave PORTAL:sap.com/tckmcbc.uwl~api in the sharing refernce entry
    Finished with warnings: development
    Caught exception during application startup from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Error occurred while starting application local/UWLCountDemo and wait. Reason: Clusterwide exception: server ID 21763550:com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Application local/UWLCountDemo cannot be started. Reason: it has hard reference to resource tckmcbc.uwl~api with type application, which is not active on the server.
    Thanks in Advance
    Sekhar.
    Edited by: sekhar c on Mar 21, 2009 11:24 AM

    Please see Kenichi Unnai in his blog "How to use UWL API for NetWeaver BPM Tasks"
    How to use UWL API for NetWeaver BPM Tasks
    The .sca-file can be found on the sap service marketplace, afterwards you need to import the .sca-file, add the SC to your "MyComponents" and then you can select your necessary DC's.

Maybe you are looking for

  • HT1296 red dot events in iphone calendar do not sync to outlook, only blue dot events

    In first calendar sync with outlook after setting up iCloud account, there are numerous double entries for events on iPhone calendar, one with red dot and the other with blue dot. Also, some of red dot events on iPhone calendar do not sync to Outlook

  • Where's can i Buy any Professional Authoring DVD for IMAC, did you know about Studio DVD pro ?

    I need help, i need buy or dowload some Professional Authoring DVD for IMAC, I editing in my Final Cut Pro X and need a DVD authoring after installing the Mavericks, my IDVD don't work, can someone help about this ? also, did you know if DVD studio p

  • Copy and Paste Object Changes Properties

    I'm trying to create a watermark of my stationary. Ultimately, I want all the pages of my resume to have this background. The stationary is built of three separate objects: a logo in the upper left hand corner, my contact information (created as a pn

  • Internet Sales 4.0 Monitoring

    Hi! I'm trying to monitor ISA availability using GRMG. I've create GRMG scenario in our development system but it doesn't work because link [http://localhost:50000/b2b/ccms] doesn't exist. We are using SAP ISA for R/3 4.0, see details below... Applic

  • Overlay visible in "normal" state only

    I created an overlay TIFF in Photoshop - I placed an mpeg2 video (which I created with FCP and Motion and then compressed in Compressor) as the background and I drug my TIFF in as the overlay. I go into Menu view in DVDSP and the only version of my o