Quantcast
Channel: Net Express / Server Express - Forum - Recent Threads
Viewing all 375 articles
Browse latest View live

RE: Assinar XML (sign XML)

$
0
0

There is no facility in Net Express 3.1 to do signing of XML files. You would have to use a 3rd party tool.

This can be done in Visual COBOL using the .NET Security classes.

Here is an example in case anyone is interested:

      $set ilusing"System.Security.Cryptography"
      $set ilusing"System.Security.Cryptography.Xml"
      $set ilusing"System.Xml"
       class-id xmlsigning.SignXML.
       method-id main static.
       procedure division.

           try
              *> Create a new CspParameters object to specify
              *> a key container.
              declare cspParams as type CspParameters = new CspParameters
              set cspParams::KeyContainerName = "XML_DSIG_RSA_KEY"

              *> Create a new RSA signing key and save it in the container. 
              declare rsaKey as type RSACryptoServiceProvider = new RSACryptoServiceProvider(cspParams)

              *> Create a new XML document.
              declare xmlDoc as type XmlDocument = new XmlDocument

              *> Load an XML file into the XmlDocument object.
              set xmlDoc::PreserveWhitespace = true
              invoke xmlDoc::Load("test.xml")

              *> Sign the XML document. 
              invoke SignXml(xmlDoc, rsaKey)

              display "XML file signed."

              *> Save the document.
              invoke xmlDoc::Save("test.xml")
           catch e as type Exception
              display e::Message
           end-try
    
           goback.
       end method.
        *> Sign an XML file. 
        *> This document cannot be verified unless the verifying 
        *> code has the key with which it was signed.
        *> Need to add a reference to System.Security.dll
       method-id SignXml public static (xmlDoc as type XmlDocument, #Key as type RSA).
.          *> Check arguments.
           if xmlDoc = null
              raise new ArgumentException("xmlDoc")
           end-if
           if #Key = null
              raise new ArgumentException("Key")
           end-if

           *> Create a SignedXml object.
           declare signedXml as type SignedXml = new SignedXml(xmlDoc)

           *> Add the key to the SignedXml document.
           set signedXml::SigningKey = #Key

           *> Create a reference to be signed.
           declare #reference as type Reference = new Reference
           set #reference::Uri = ""

           *> Add an enveloped transformation to the reference.
           declare env as type XmlDsigEnvelopedSignatureTransform = new XmlDsigEnvelopedSignatureTransform
           invoke #reference::AddTransform(env)

           *> Add the reference to the SignedXml object.
           invoke signedXml::AddReference(#reference)

           *> Compute the signature.
           invoke signedXml::ComputeSignature

           *> Get the XML representation of the signature and save
           *> it to an XmlElement object.
           declare xmlDigitalSignature as type XmlElement = signedXml::GetXml

           *> Append the element to the XML document.
           invoke xmlDoc::DocumentElement::AppendChild(xmlDoc::ImportNode(xmlDigitalSignature, true))
           goback.
       end method.
           
       end class.

RE: nonexistant files in project

$
0
0

Hi Lars,

Sorry, the project file FD is not something that is available.

RE: Fileshare Username

$
0
0

No, it was not possible for us to let  FILESHARE.  Any demo?

We tryed with the command

openfiles /query /V /s servidor >archivo.txt

If it works, we get a file that we can Analyse.

But this command works only if the user is an Administrator, otherwise he receives an error.

Making a BAT it is the same the user must be an administrator

Including the Contents of the BAT in a NETEXPRESS program

002841     STRING "OPENFILES /query /v /s servidor >OCUPADO.txt"

002844         x"00" DELIMITED BY SIZE

002845         INTO CmdLine,

002852    call winapi "WinExec"

002853        using by reference CmdLine

002854              by value     CmdShow

002855        returning          CmdStatus.

it works only with WINDOW Vista an beeing an Administrator.

Is it possible to chage the attributes to Administrator only within a NETEXPRESS program?

Can I detect if I am working with 32 or 64 Bits from within the program and run different commands depending on the result?

Fileshare Username

$
0
0

We use Windows Small Bussiness Server 2003 and Netexpress 5.1.   The FILESHARE works perfect as described in the documentation. If a file/record is locked I receive the file Status 9/65 or 9/68 indicating this Situation.  But besides this Status, is there any way or API to know Information about who has the lock?  I Need the Name of the terminal or user in order to inform who is locking the file or record.

RE: Assinar XML (sign XML)

$
0
0

boa tarde Chris Glazier, peguei o programa, mas não consigo compilar, não sei o que estou fazendo de errado, esta dando esses erros:

Severity Code Description Project File Line Suppression State

Warning Nonnumeric literal has length of zero. One SPACE assumed. D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 58

Error Operand SignXml is not declared D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 25

Error Operand xmlDoc is not declared D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 30

Error Operand e is not declared D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 32

Error Unknown IDENTIFICATION DIVISION paragraph D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 41

Error Operand xmlDoc is not declared D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 22

Error Operand xmlDoc is not declared D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 21

Error Operand cspParams is not declared D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 12

Error '.' missing following procedure name declaration, or unrecognized verb D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 8

Error Unknown IDENTIFICATION DIVISION paragraph D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 5

Error '.' in source filename or PROGRAM-ID in native code D:\LOCAL\TRABALHO\ASSINATURA\RTP-SGN3.CBL 4

obrigado

Renato Soares Vieira

RE: Assinar XML (sign XML)

$
0
0

This sample cannot be compiled as native code. It was written as a managed .NET program using Visual COBOL 2.3 update 2. You would have to compile this in a Visual COBOL managed code project in order for it to compile successfully.

RE: Assinar XML (sign XML)

$
0
0

Descupa Chris Glazier, mas não estou encontrando em a template/cobol/managed o .net, é que somos novo em visual cobol for studio, estamos começando a utilizar agora.

RE: Assinar XML (sign XML)

$
0
0

When you create a new project you should be shown a list of project template categories. One of these is native and another is managed. Open up the managed category and select Console Application and copy the program into this.


RE: Assinar XML (sign XML)

$
0
0

Chris Glazier, fiz da forma que me explicou, e agora esta dando outros erros:

Severity Code Description Project File Line Suppression State

Error COBCH0063 : Cannot be used in nested program ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 5

Error COBCH1810 : Cannot specify a namespace in nested type names ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 5

Error COBCH0845 : Unknown type 'type SignedXml' ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 53

Error COBCH0845 : Unknown type 'type SignedXml' ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 53

Error COBCH0845 : Unknown type 'type Reference' ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 59

Error COBCH0845 : Unknown type 'type Reference' ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 59

Error COBCH0845 : Unknown type 'type XmlDsigEnvelopedSignatureTransform' ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 63

Error COBCH0845 : Unknown type 'type XmlDsigEnvelopedSignatureTransform' ConsoleApplication1 c:\users\renato soares vieira\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program1.cbl 63

RE: Assinar XML (sign XML)

$
0
0

I am attaching my project file to the post

RE: Assinar XML (sign XML)

RE: Assinar XML (sign XML)

$
0
0

bom dia Chris Glazier, fiz os testes e deu certo, porem não sei qual certificado ele pegou, como faço para ele pegar o certificado que eu preciso, não encontrei.

obrigado.

Renato

Dialog System dsrx-nt error

$
0
0

Hello.

One of our customers reported an error related to NetExpress 3.0.14 Dialog System. This error is a cblrtss.dll exception that appears in the MFDEBUG.LOG file. In this file, the call stack shows: our application --> DSRUN --> dsgrun --> dsrx-nt. There is no more information.

I searched the dsrx-nt file and only found it into DSGRUN.DLL.

Can you tell me what is dsrx-nt and which can be the cause of that error?

Thanks beforehand.

RE: Dialog System dsrx-nt error

$
0
0

Hello,

DSRX-NT is a Dialog System runtime. It is hard to guess what the cause of the problem without seeing the exact error message.

The only suggestion I can give is to make sure to do the following:

  • Apply Service Pack 1 (svp00ne3.exe) and all of the subsequent FixPacks, (e.g. ogc03ne3.exe, ds04ne3.exe, etc.)
  • Run the application only on supported environments -- Net Express 3.0 is certified on Windows 95 (Windows 98 recommended), Windows NT V4.0 (Windows NT Service Pack #3 or later). Net Express 3.0 SP1 is certified on Windows 2000.

Regards

RE: Build Release Problem

$
0
0

Hello,

You might want to copy the CGI folder to a folder outside of "Program Files (x86)" as Windows protects this folder and its subfolders from writing and rewriting files.

Regards,


RE: Build Release Problem

$
0
0

Hello,

Thanks that problem solved, but I'm getting errors, I can't get that demo to work perfect, it could be problem with SOLO, I'm using Google chrome. the errors as below :

Not Found

HTTP Error 404. The requested resource is not found.

then :

SOLO : Fatal error initializing.

            Attempt to bind address Failed

RE: Build Release Problem

$
0
0

"Attempt to bind address Failed" likely means that something else - probably IIS - is using port 80. I don't remember if Solo can be configured to use a different port, so I suggest you shut down IIS or whatever other HTTP server is running on your machine before trying to start Solo.

RE: Build Release Problem

$
0
0

Net Express Toolbar Options->Project...  'Port Address to WebServer' field does allow you to set Solo port...

:) Yvon

RE: Build Release Problem

$
0
0

Thanks, Yvon - it's been many years since I used Solo.

Build Release Problem

$
0
0

Kindly anyone can help, I'm using Net Express 5.1 :

I was trying to build Cgiprg2 in build release (demo with Netexpress 5.1), but I'm always getting an error as bellow :

Starting rebuild
Rebuilding C:\Program Files (x86)\Micro Focus\Net Express 5.1\Examples\Net Express IDE\CGI\Cgiprg2.cbl
Rebuilding DEBUG\CGIPRG2.EXE
ERROR: (1) Cannot open file : cbllds000013E0.lnk
Rebuild complete with errors

Viewing all 375 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>