Agregar Código de Barra desde DI API (Add-ON)

Hola a todos.
Estoy desarrollando un ADD-On para la versión 9 y estoy teniendo un problema para agregar el código de barras de un producto.
En esta nueva versión el código de barras tiene que estar creado previamente en la tabla OBCD ANTES de asignarlo a un artículo, a diferencia de la 8 en la que este campo era uno de texto y se le podía colocar lo que quisieras.
Mi problema radica en que tengo un procedimiento dentro de mi add-on que se encarga de generar un código de barras automático cuando el usuario ingresa un nuevo artículo, pero no puedo directamente asignarlo al item como se hacía antes (Item.BarCode = XXXXX) por lo que expliqué previamente. Además, si lo hago d esta manera salta una nueva ventana para definir códigos de barra y es lo que no quiero.
He revisado el SDK y habla de dos clases: SAPbobsCOM.BarCodesService y SAPbobsCOM.BarCode.
El problema está en que cuando trato de instanciarlas, me da error.
                                Dim BarCodeService As New SAPbobsCOM.BarCodesService
                                Dim BarCode As New SAPbobsCOM.BarCode
                                BarCode.ItemNo = Codigo
                                BarCode.BarCode = Generar_Codigo_Barras(Codigo)
                                BarCodeService.Add(BarCode)
No puedo pasar siquiera del primer NEW. Alguién tendrá idea de cómo hacerlo o saber porqué generar error al hacer el new?
También he visto que existe una clase llamada SAPbobsCOM.ItemsBarCodes pero no consigo tampoco instanciarla
Muchas Gracias
Saludos.

Hola
en la nota 1856704 aparece:
Symptom
You cannot add, update or delete a bar code when you use the Items object to add or update an item. You must use the BarCodeService object to do that.
Solution
The ItemBarCodes object is exposed as a sub object of the Items object in DI API. You can now add, update and delete a bar code when you add or update an item.
Other terms
SDK, OBCD, Bar Code, ItemBarCodes
Hace referencia a la versión 9.0 PL05 y es un error con prioridad media.
Un saludo
Agustín Marcos Cividanes

Similar Messages

  • Danfe - Impressão de Código de Barras

    Bom Dia pessoal.
    Estou com um problema na configuração do DANFE da Nota Fiscal Eletrônica. Nele existe um campo de código de barras que utiliza o padrão 128-C. Como a fonte não existe no PLD, instalamos a fonte code128 no windows, e mandamos imprimir no sap B1 com ela, mas na hora de testar num leitor de código de barras, ele simplesmente não lê a informação.
    Alguém já passou por isso?
    Obrigado,
    Diogo Conte
    Edited by: Rui Pereira on Apr 15, 2009 9:57 AM

    Diogo, infelizmente nós não nos acertamos com a Danfe em PLD.
    Partimos para uma solução em Crystal que implantamos em alguns clientes e está atendendo bem. Temos inclusive alguns parceiros usando essa solução.
    De repente esse desenvolvimento pode ser uma saída pra vocês também.
    Um abraço,
    Danilo Souza - EasyOne Consultoria

  • Crystal Reports - Problema ao gerar código de barras de boleto

    Boa tarde a todos! Preciso de um help.
    Desenvolvi o boleto de um cliente em Crystal Reports, mas estou encontrando um pequeno problema ao gerar determinados códigos. O número de código de barras é gerado corretamente pela DLL do BankSync. Até aí tudo bem.
    Eu tenho a fonte Interleaved 2 of 5 - Regular, que é composta por 3 aquivos .ttf, e duas DLLs (que são responsáveis por converter o número gerado pelo BS em símbolos, para que a fonte traga corretamente a seqüência de barras).
    Se eu tentar pegar o campo do B1 onde é gravado o número do código de barras (BarCodeNum) e colocar diretamente a fonte, naturalmente ele vai me trazer um código de barras errado, pois antes eu devo converter essa sequência numérica! Isso eu sei.
    Estou utilizando a seguinte fórmula para a conversão no Crystal (que fica disponível depois que eu instalo as DLLs):  BarcodeI2of5 (BarCodeNum) . Ela me traz como resultado uma seqüência de símbolos, que, ao colocá-la no corpo do documento e selecionar a fonte Interleaved 2 of 5 - Regular, ele me traz a sequência correta de barras!
    Exemplo:
    Número do código de barras: 03396517100000100009415546700000000002050005
    O que a DLL da fonte retorna com a fórmula: «$Hb2!!!*JXOg!!!!#&!&¬
    O código de barras sai perfeito e é lido por qualquer leitor ótico!
    MAS AFINAL, QUAL O PROBLEMA?
    Alguns caracteres provavelmente não estão disponíveis na fonte, ou a fórmula está gerando algum caractere que não deveria, que são:
    Ç   e   ¶    (por enquanto só identifiquei esses)
    E quando o resultado da fórmula traz esses caracteres em específico em alguma posição dela, o local onde ele deveria aparecer uma sequência de 5 barras, aparece aquele retângulo característico de quando a fonte não suporta algum acento ou caractere.
    Agora eu não sei o que está errado:
    - Ou a fórmula não deveria trazer de jeito nenhum os caracteres Ç e ¶ como resultado, e obviamente minha fonte não deveria suportá-los.
    - Ou a fórmula está correta e deve realmente trazer os caracteres Ç e ¶ como resultado e o problema está na minha fonte, que deveria suportá-los.
    Alguém já passou por este problema e pode me ajudar?
    Qual das duas possibilidades é o que está acontecendo comigo?
    Já tentei instalar outras DLLs e utilizar outras fontes, mas o problema persiste.
    Preciso saber se o erro está na conversão que a DLL faz ou se está na fonte.
    Quero deixar claro que isso não acontece em todos os boletos. É somente naqueles que a fórmula retorna os caracteres citados.
    Muito obrigada!
    Aline Garroux.

    Prezada Aline, boa tarde.
         Baixa a fonte disponível neste link: http://www.netfontes.com.br/dow.php?cod=3of9_barcode, após coloque o arquivo "3OF9_NEW" na pasta "C:\Windows\Fonts" a qual será instalada automaticamente.
    Espero ter auxiliado.

  • Gerar PDF com código de barras a partir de um SAPScript

    Bom Dia Senhores!
    Estou tendo problemas na geração de um arquivo PDF a partir de um SAPScript com código de barras.
    Tenho um formulário SAPScript que contém código de barras, este, é gerado pela F110.
    O programa precisa que este arquivo PDF gerado seja enviado por email, porém ao gerarmos um arquivo PDF deste SAPScript, o código de barras contido nele é meramente ilustrativo, ou seja, não sai com as informações certas do boleto, sai como imagem.
    É de meu conhecimento que se este formulário fosse um SmartForm sairia tudo perfeito já que a transformação do SmartForm em PDF mantém o código de barras de forma correta.
    Porém, se formos na SP01 e mandamos imprimir este SAPScript com a saída 'PDF Creator' ele gera o código de barras corretamente.
    Minha pergunta é se alguem conhece alguma função de transformação de SAPScript para PDF que funcione corretamente, algo similar ao funcionamento do PDFCreator.
    Obrigado;
    Daniel Salerno de Arruda

    Boa Tarde Daniel Salerno,
    Tenho o mesmo problema que você tinha.
    Gero um arquivo em PDF com Boleto de pagamento para enviar mas o código de barras neste arquivo é meramente ilustrativo e não consigo enviar o código para leitura.
    Este formulário está em SAPScript,
    Será que você pode me ajudar ?
    Obrigada.
    Solange Guimarães.

  • Add CodeBar to an Item using DI API (Add-On)

    Hi you all.
    I am developing a ADD -On for version 9 and I am having a problem to add the barcode of a item.
    In this new version the barcode must already be created on the table obcd BEFORE assign it to an item, as opposed to 8 in which this was a text field and you could put anything you wanted .
    My problem is that I have a method in my add-on that is responsible for generating an automatic bar code when the user creates a new item, but I can not directly assign this barcode to the item as before ( Item.BarCode = XXXXX ) as I explained previously . Also, if I do it this way a new window pops up to define barcodes and is not what I want.
    I've checked the SDK and mention two objects: SAPbobsCOM.BarCodesService and SAPbobsCOM.BarCode .
    The problem is that when I try to instantiate them, an error come up .
                                    Dim As New SAPbobsCOM.BarCodesService BarCodeService
                                    BarCode Dim As New SAPbobsCOM.BarCode
                                    BarCode.ItemNo = Code
                                    BarCode.BarCode = Generar_Codigo_Barras (Code)
                                    BarCodeService.Add ( BarCode )
    Someone have idea why this is happenning?
    I have also seen that there is a class called SAPbobsCOM.ItemsBarCodes but I can not not instantiate eather
    Thanks in advance
    Greetings.

    Try this:
    * Crea o actualiza un código de barras para un artículo en el formato correspondiente
    void LOG_Util::creaActualizaEANSBO(const string &asItemCode, const string &asEAN, const string &asForm, const string &asDForm)
        SAPbobsCOM::ICompanyServicePtr lpCmpSer;
        SAPbobsCOM::IBarCodesServicePtr lpBCSer;
        SAPbobsCOM::IBarCodeParamsPtr lpBCPar;
        SAPbobsCOM::IBarCodePtr lpBC;
        SAPbobsCOM::IRecordsetPtr lRS;
        ostringstream sql;
        long lUomEntry, lBcdEntry;
        lRS = g->GetCmp()->GetBusinessObject(SAPbobsCOM::BoRecordset);
        lUomEntry = dameUomEntry(asForm);
        // Verificamos la existencia del EAN en la ficha del artículo de SBO
        sql << "SELECT BcdEntry";
        sql << " FROM OBCD";
        sql << " WHERE ItemCode = '" << asItemCode << "'";
        sql <<    " And Bcdcode = '" << asEAN << "'";
        lRS->DoQuery(sql.str().c_str());
        lpCmpSer = g->GetCmp()->GetCompanyService();
        lpBCSer = lpCmpSer->GetBusinessService(SAPbobsCOM::BarCodesService);
        if (lRS->GetEoF() == VARIANT_TRUE)
            // Tenemos que crear el EAN
            lpBC = lpBCSer->GetDataInterface(SAPbobsCOM::bsBarCode);
            lpBC->PutItemNo(asItemCode.c_str());
            lpBC->PutUoMEntry(lUomEntry);
            lpBC->PutBarCode(asEAN.c_str());
            lpBC->PutFreeText(asDForm.c_str());
            lpBCSer->Add(lpBC);
            lpBC.Release();
        else
            // Tenemos que actualizar el EAN
            lBcdEntry = lRS->GetFields()->Item("BcdEntry")->GetValue();
            lpBCPar = lpBCSer->GetDataInterface(SAPbobsCOM::bsBarCodeParams);
            lpBCPar->PutAbsEntry(lBcdEntry);
            lpBC = lpBCSer->Get(lpBCPar);
            lpBC->PutUoMEntry(lUomEntry);
            lpBC->PutFreeText(asDForm.c_str());
            lpBCSer->Update(lpBC);
            lpBC.Release();
            lpBCPar.Release();
        lpBCSer.Release();
        lRS.Release();

  • Agregar direcciones a la libreta desde mensajes

    Hola, buenos días.
    Contacto para saber si habría algún modo de agregar contactos a la libreta de direcciones directamente desde los mensajes. La razón es porque hemos migrado una cuenta de equipo, hemos exportado correos pero las libretas no, y no podemos volver para exportarlas. Es decir, exportamos todos los mensajes con el complemento ImportExportTools, pero el perfil entero no.
    Como los correos si que están, era saber si desde los correos se puede recuperar los contactos a la libreta de direcciones para que al escribir uno nuevo se auto-complete los campos.
    Gracias.

    Hola esmarsan,
    Me alegra que tengas interés en trabajar en un sistemas basado en GNU/Linux, con respecto a tu pregunta, si existe una posibilidad de importar la libreta de direcciones desde outlook a thunderbird, te adjunto un enlace donde te indican paso a paso cómo hacerlo:
    https://support.mozilla.org/es/kb/cambiar-thunderbird-desde-windows-o-desde-aplicaci#w_importar-los-contactos-de-la-libreta-de-direcciones-de-microsoft-outlook-2007
    Espero que te sirva y bienvenido al mundo Linuxero.
    Saludos!
    Galoget
    Líder de la Comunidad de Software Libre y Seguridad Informática Hackem
    OWASP Ecuador Student Chapter Leader
    Mozillian & FSA
    Fedora Ambassador for Ecuador
    OpenStreetMap Ecuador Leader

  • ACM12c Upload Document API adds characters to documentName

    Hi,
    I managed to create a service to upload documents to ACM. This allows me to upload email attachments and body to ACM.
    This works pretty much, using the following code:
            ICaseStreamService caseStreamService = getCaseStreamService();
            caseStreamService.uploadDocument(context, caseIdentifier, docName, mimeType, inputStream, comments,
                                             permissionTag);
    However, it turns out that when I give in a docName as string like '2015-01-06-14:27:16-Mail:FW: Iets simpeler mailtje voor case  [168,1].html' somewhere in the API a character is added to the front and sometimes to the end of the document name: 'J2015-01-06-14:27:16-Mail:FW: Iets simpeler mailtje voor case [168,1].html' (note the 'J' added to the front). Every time it is a different character.
    And although I upload the message body with content/Mime-type 'text/html', when I try to download it from the case-documents, it is handled as a TXT file. When it is saved, a .txt extension is added, it should be .html.
    Anyone any ideas?
    Regards,
    Martien

    It turns out that when you use a long document name, espesially with spaces and special characters, it can happen that the documentname is prefixed.
    If you use just a relatively small document name, without spaces these characters does not show up.
    Also I found that I prefixed my document-names with a date-timestamp, with (shame) colon's (":") in the time-stamp... I removed the dashes from the date and the colons from the time.
    I used to use the email-subject from the incoming email as part of the document name. But that can contain special characters as well. Now I use a generic documentname for the emailbodies, and put the subject into the comment field.
    Now it works.

  • Jazn api add user?

    I have a simple requirement for a registration page on my web app. The user enters their email address to register. On registration the app needs to create a new user (in jazn-data.xml) assign the correct role and send the information to the new user in an email. I think I need to authenticate temporarily as the 'admin' user and then use the UserManager and RoleManager apis to create the new user. Is this the right approach? If so how do I authenticate as the 'admin' user programatically?
    Thanks
    Matthew

    I have successfully managed to create a new account in jazn-data.xml using the following code, without any authentication. The user appears in the global ocj4 jazn-data.xml.
    Realm realm = null;
    try {
    JAZNConfig jc = JAZNConfig.getJAZNConfig();
    RealmManager crm = jc.getRealmManager();
    realm = crm.getRealm("jazn.com");
    UserManager userManager = realm.getUserManager();
    RoleManager roleManager = realm.getRoleManager();
    RealmRole userRole = roleManager.getRole("users");
    RealmUser user = userManager.getUser(userName);
    if (user == null) {
    user = userManager.createUser(userName, password);
    roleManager.grantRole(user, userRole);
    success = true;
    My problem now is that the new user is not available for authentication purposes until oc4j is restarted. I'll raise this on a new thread.

  • TO THE JSF CREATORS : JSF API Add : NavigationRules

    Hello,
    I'm creating my own NavigationHandler, and I'll need the NavigationRules. But, as I can see, it's impossible to get them in the API. I will have many solutions :
    - create a NavigationHandler specific to the implementation chosen
    - customize ApplicationFactory, Application, etc. to load my NavigationRules.
    As you can note, I should make a lot of work just for one thing: get the NavigationRules of the current webapp.
    So, when I take a look at the implementations of Sun and of myFaces, I note that it would be perfect if the following method was added to the NavigationHandler API class:
    getNavigationRules();So, this method would be accessible to the custom NavigationHandler, without having to create many ones depending on the implementations (Sun, myFaces, IBM, Oracle, etc.).
    I can even spend some time to give the code necessary for this add-on.
    What do you think about that ?
    Thanks in advance.
    bgOnline

    PLZZZZZZZZZzzzzzzzzzzz HELP ! ! !

  • Restful API add role not working - receve 202 accepted but not VM was created

    Hi.
    I am using the Windows azure restful api to add a new role to my vm deployment.
    I have already added a cloud service and a deployment, I can list the deployments fine with the  https://msdn.microsoft.com/en-us/library/azure/ee460804.aspx and is all OK , but when I want to add a new VM to this deployment and I call the api using https://msdn.microsoft.com/en-us/library/azure/jj157186.aspx
    I get a 202 Accepted, but nothing happens, no VM was created , I dont know what I am missing .
    This is the XML that I am sending together with the add role api
    <PersistentVMRole xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                      <RoleName>vm-azure-lti3</RoleName>
                      <RoleType>PersistentVMRole</RoleType>                  
                          <ConfigurationSets>
                            <ConfigurationSet i:type="LinuxProvisioningConfigurationSet">
                              <ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType>
                              <HostName>vm-linux-3</HostName>
                              <UserName>xxx</UserName>
                              <UserPassword>xxx</UserPassword>                                    
                            </ConfigurationSet>
                          </ConfigurationSets>   
                          <OSVirtualHardDisk>
                            <MediaLink>https://xxxx.blob.core.windows.net/vhds/communityimages2.vhd</MediaLink>
                            <SourceImageName>xxxx</SourceImageName>
                            <OS>Linux</OS>
                          </OSVirtualHardDisk>                  
                    </PersistentVMRole>
    Hope someone can give me some litght into this as I am kind of lost now.
    thanks

    Hi Victor,
    For called the REST API, I suggest you can use
    Fiddler to catch and monitor your error message. If you got 404 error, it is possible that your authentication has something wrong. I suggest you can try to use fiddler to troubleshooting.
    Any results, please feel free to let me know.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Prime Infrastructure API add device

    I've been looking at the Prime Infrastructure 2.1 API at /webacs/api/v1/ on my PI instance but I can't seem to find a way to add devices using the API? Looking to write a script for our techs to run after the provisioning of a new device and would love a way to get it added to Prime. Any ideas?

    It isn't possible in Prime Infrastructure 2.1 to add devices via API, however, it now is possible with version 2.2. I've used it myself and I can confirm that it works.

  • Criação de código de serviço

    Boa tarde,
    Preciso fazer a criação de código de serviço no SAP e estou em dúvida de qual transação utilizar.
    Não sei se a melhor opção seria a MM01, opção DIEN, ou a AC01.
    Preciso fazer a vinculação da Lei Complementar 116, com as alíquotas de ISS.
    Como consigo vincular esta tabela do governo no código de serviço? Qual a transação ideal para utilizar?
    Obrigada,
    Mariana

    Quanto ao desenvolvimento feito pela Embratel eu não sei detalhes mas lembro de ter ouvido algo onde os fornecedores simplesmente fazem um upload da nota fiscal (na época não existia nf-e) no portal ou via EDI. Estes arquivos são carregados para dentro do sap via IDoc e então processadas as consistências/regras de negócio. Uma vez que o documento estivesse de acordo com as regras definidas disparava a MIGO/MIRO/NF.
    Outro projeto interessante é o da Gerdau no qual eles digitalizam (através scanner) todas as notas e por OCR identificam remetente, valores, produtos, etc.) e então processam o recebimento.
    E, ainda existem empresas que fazem através de código de barras bidimensional. O fornecedor envia a nota com uma etiqueta colocada no verso com os dados da nota informados no código de barras bidimensional.
    Abraço
    Eduardo

  • SharePoint 2010 Rest API: How to add attachment to a list item via ListData.svc

    Hi
    I have set up a project using the REST API in c# Visual Studio 2010.
    I have added a service reference to the URL //site/_vti_bin/listdata.svc/
    I can query the list and get back data, but I can't retrieve the attachments.
    I can write data to the list, but I can't add attachments.
    Are there any examples of how to add or retrieve attachments using the REST API services.
    Thanks
    Mike

    Hi,                                                             
    If you want to work with list attachments using REST API, here are some links will show how to do this using Javascript:
    http://msdn.microsoft.com/en-us/library/office/dn292553.aspx#FileAttachments
    http://chuvash.eu/2013/02/20/rest-api-add-a-plain-text-file-as-an-attachment-to-a-list-item/
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/06/27/how-to-get-list-item-attachments-using-rest-and-javascript-in-sharepoint-2013.aspx
    Best regards
    Patrick Liang
    TechNet Community Support

  • Query on standard API's

    Hi,
    I am working for a project NuclearPPR, a java based tool for project accounting is being developed to support an ERP (implementation:Oracle Apps PA module).
    We are facing following issues for executing update_budget and add_budget_line APIs.
    1. PA_BUDGET_PUB.UPDATE_BUDGET()
    Reason to Use API: Need to update the Budget Change Reason in table PA_BUDGET_VERSIONS for a budget (Column: Change_reason_code)
    Issue: Getting API Error Message on execution "Err:>ORA-06502: PL/SQL: numeric or value error: character to number conversion error in Package PA_BUDGET_PVT Procedure VALIDATE_HEADER_INFO
    Err:>ORA-06502: PL/SQL: numeric or value error: character to number conversion error in Package PA_BUDGET_PUB Procedure update_budget."
    Method call is as below
    APPS.PA_BUDGET_PUB.UPDATE_BUDGET(P_API_VERSION_NUMBER => 1.0,
    P_COMMIT => 'F',
    P_INIT_MSG_LIST => 'F',
    P_MSG_COUNT => O_MSG_COUNT,
    P_MSG_DATA => O_MSG_DATA,
    P_RETURN_STATUS => V_A_RETURN_STATUS,
    P_PM_PRODUCT_CODE => 'PPR',
    P_PA_PROJECT_ID => I_PROJECT_ID,
    P_BUDGET_TYPE_CODE => I_BUDGET_TYPE_CODE,
    P_CHANGE_REASON_CODE => I_CHANGE_REASON_CODE,
    P_DESCRIPTION => I_CHANGE_REASON_COMMENTS,
    P_BUDGET_LINES_IN => A_BUDGET_LINES_IN,
    P_BUDGET_LINES_OUT => A_BUDGET_LINES_OUT);
    Help Needed: Need to execute the update budget API to change the budget change reason code for a budget.
    2. PA_BUDGET_PUB.ADD_BUDGET_LINE()
    Reason to use API: Add budget line for a budget
    Issue: API is executing properly, But it is not updating the Version Name Field (Version Name field on Oracle Apps PA Budget screen)
    Help Needed: Need to update the version name field when we add a budget line.
    Please help us to resolve these 2 issues.

    Hi
    Try checking the length of the value being passed to the parameter p_description.

  • Java XML Digital Signature API, how to sign different files

    Hello,
    I need to sign several files: binary and/or xml (in some cases just part of xml), and to implement digitla signatures in xAdes standard. So I'm looking to use Java XML Digital signature API, but can't find any examples, that would cover issues I encountered:
    How to sign binary file?
    Just to sign some simple "aaa.png" file and have it's signature in XML. How in right way to create referece?
    (should it be something like: Reference ref = fac.newReference("aaa.png", fac.newDigestMethod(DigestMethod.SHA1, null), null, null, null); )
    And how to pass file for signing? what to add/change to this code:
    Document doc = dbf.newDocumentBuilder().parse(new FileInputStream("aaa.png"));
    DOMSignContext dsc = new DOMSignContext(keyEntry.getPrivateKey(), doc.getDocumentElement());
    (I have only found some information about needing to "dereference" or so - but no examples, how to make things work.)
    How to sing several different files?
    As I wrote before, several files needs to be signed, but in all examples, it's only one Document object (and only one file), how/where to add more files and if API will be capable to deal with such thing?
    In one of examples what I have to achive was such code:
    <Reference URI="aaa.png" xmlns="http://www.w3.org/2000/09/xmldsig#">
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
    <DigestValue>8rl/xzjAnE4yQQ2LTBvFTU2JH+c=</DigestValue>
    </Reference>
    If I do write code like: "fac.newReference("aaa.png", <...> );
    I'll get an error during signing: signature.sign(dsc);
    *"java.net.MalformedURLException: no protocol: aaa.png"*
    How to avoid this?
    Also, from exmaple (what to reach) above:
    <Reference URI="aaa.png" xmlns="http://www.w3.org/2000/09/xmldsig#">
    There is additional attribute "xmlns=<...>" - the question is if it is possible to add it by XMLSignatureFactory.newReference ?
    Java API adds a lot of prefixes "ds:" , like:
    <...>
    <ds:Reference URI="file:/D:/try5/SignableMetadata0.xml">
    <ds:Transforms>
    <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
    </ds:Transforms>
    <...>
    Is it possible to avoid them?
    Any help on any of these questions would be very appreciated

    Hi,
    I would like to sign a specific part of a xml message [Only the contents under the <Buyer> tag]. I have also pasted the code which i used to do this. I am getting an output xml after the xml is signed, but when I validate the xml , the xml is valid even after I change the xml contents. Could you pls tell me what I am doing wrong here. I want to know whether the xpath implementation which I have done is correct.
    <?xml version="1.0" encoding="UTF-8"?>
    <PurchaseOrder>
    <Item number="130046593231">
    <Description>Video Game</Description>
    <Price>10.29</Price>
    </Item>
    *<Buyer id="8492340">*
    *<Name>My Name</Name>*
    *<Address>*
    *<Street>One Network Drive</Street>*
    *<Town>Burlington</Town>*
    *<State>MA</State>*
    *<Country>United States</Country>*
    *<PostalCode>01803</PostalCode>*
    *</Address>*
    *</Buyer>*</PurchaseOrder>
    // The code which i have used to perform the xpath transformation.
              XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
         XPathFilterParameterSpec xpathFilter = new XPathFilterParameterSpec("PurchaseOrder/Buyer");
              javax.xml.crypto.dsig.Reference ref = fac.newReference
              ("", fac.newDigestMethod(DigestMethod.SHA1, null),
              Collections.singletonList
              (fac.newTransform
              (Transform.XPATH, xpathFilter)),
              null, null);
              SignedInfo si = fac.newSignedInfo
              (fac.newCanonicalizationMethod
              (CanonicalizationMethod.INCLUSIVE,
              (C14NMethodParameterSpec) null),
              fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
    Collections.singletonList(ref));
    // Load the KeyStore and get the signing key and certificate.
         KeyStore ks = KeyStore.getInstance("JKS");
         char[] password = "changeme".toCharArray();
         ks.load(new FileInputStream("c:\\KeyStore"), password);
         KeyStore.PrivateKeyEntry keyEntry =
         (KeyStore.PrivateKeyEntry) ks.getEntry
         ("EISKeys", new KeyStore.PasswordProtection(password));
         X509Certificate cert = (X509Certificate) keyEntry.getCertificate();
         // System.out.println("X509Certificate:"+cert);
         // Create the KeyInfo containing the X509Data.
         KeyInfoFactory kif = fac.getKeyInfoFactory();
         List x509Content = new ArrayList();
         x509Content.add(cert.getSubjectX500Principal().getName());
         x509Content.add(cert);
         X509Data xd = kif.newX509Data(x509Content);
         KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));
         // Instantiate the document to be signed.
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         Document doc = dbf.newDocumentBuilder().parse
         (new FileInputStream("C:\\Life2012\\DigSign\\ACORD_Request.xml"));
         NodeList rootChildList = doc.getDocumentElement().getChildNodes();
         Node bodyNode = null;
         for(int i=0;i<rootChildList.getLength();i++){
              if("Buyer".equalsIgnoreCase(rootChildList.item(i).getLocalName())){
                   bodyNode = rootChildList.item(i);
                   System.out.println("Body Node is obtained"+bodyNode);
                   break;
         // Create a DOMSignContext and specify the RSA PrivateKey and
         // location of the resulting XMLSignature's parent element.
         //DOMSignContext dsc = new DOMSignContext
         // (keyEntry.getPrivateKey(), doc.getDocumentElement());
              // Sign only the body node
         DOMSignContext dsc = new DOMSignContext
         (keyEntry.getPrivateKey(), bodyNode);
         // Create the XMLSignature, but don't sign it yet.
         XMLSignature signature = fac.newXMLSignature(si, ki);
         // Marshal, generate, and sign the enveloped signature.
         signature.sign(dsc);

Maybe you are looking for

  • Xcelsius integration in Web Dynpro ABAP

    Hi experts, I am trying to develop a chip page with Xcelsius; but, when I try to put my Xcelsius, not appear nothin. I do some test, and I check: Problem with the file GenericXcelsiusIsland_2008_30.swf; I can not find it, but I download the file Gene

  • Adapter Module in EHP1

    hi All, I had deployed one custom module in EHP1 and had used NWDS 7.1 to create it, now at runtime i am getting below exception as in NWA: Caused by: java.lang.ClassNotFoundException: com.sap.aii.af.lib.mp.module.ModuleLocal      Loader Info -      

  • Function module for creation of Installed base along with product

    Hi,         Function module for creation of installed based with product for the business partner.

  • Problems accessing the parallel port

    Dear All, I'm having problems to access to the parallel port using the VI write / read to the serial port, it returns the error code 37. As far as I've seen in the documentation this error code is for UNIX systems and we're using Windows 95. Anybody

  • Oracle Java proc ORA-04045: errors during recompilation/revalidation

    hi, I have Oracle Java stored proc called MERGE_ENTITY_AND_EVENT invoked by a trigger. It was working fine for a couple of weeks. Today it throws this generic exception. I'm not sure what changed. Caused by: java.sql.SQLSyntaxErrorException: ORA-0404