Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - HendersonS

#1
Hi,
Jeff and Stéphane, thank you for your help, I was finally able to find the solution with the help you gave me.

the line looked like this:
Content-Disposition: form-data; name="xml"; filename="xmlsing.xml"
#2
jeff,

I tested both ways that you showed me and I still get the same "invalid file" response, I will continue trying...
#3
jeff, this is what it returns:

1>print mid(body$,1,300)
------PxPlusFormDataBoundary_zNYKbtQdhRIYGlYIDBoKNPAdi7un9gGR
Content-Disposition: form-data; name="xmlsing"; filename="xmlsing.xml"
Content-Type: text/xml

<?xml version="1.0" encoding="utf-8"?>
<SemillaModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="h
ttp://www.w3.
1>
#4
Jeff thanks for your help,

I have something very similar to what you showed, I also added Stephane's program to calculate the boundaries but when I send it with pxplus the API returns an "invalid file" error, I tried it with CURL and the api receives the file correctly, does it work? How could I replicate it? in Pxplus?

Example with CURL: curl -X 'POST' \
  'https://url/api' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'xml=@xmldata.xml;type=text/xml'

#5
Hi Jeff, I'm stuck in the same place trying to send a file via API, could you post the final solution? Maybe it can help me too!
#6
Programming / Re: *web\request
April 01, 2024, 09:57:37 PM
Jeffrey Ferreira,
I'm working on something similar, how did you create the boundary?
#7
Loren, thanks for your demonstration,

so far I have not been able to install xmlsec on Windows, and I have not been able to find a solution with pxplus either, so I will have to make some program in C# or another language to invoke it from pxplus, since I do not see a solution with pxplus.
#8
Thanks Mike for your instructions.

If I understood correctly, you mean that I can invoke this tool from pxplus? And just in case I take another route to do it with pxplus, is there any utility to extract the private key from a .pem?
#9
Loren thanks for yor reply

Below is the structure that the signature node should have within the xml, I have no experience in building these signatures. Maybe you can show me some example code to do it.

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/RECxml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsigmore#rsa-sha256" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#envelope d-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>Atr9H7DiGlxrQOFII/hFihsL6ACiwe47Oo93tgtuera=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>gQyXO0FFDGIITESTpP5xZjLIRtv/Q7/ixe1lNDLDA5aw...</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>DGIITESTBFagAwIBAgIIInYGQUX9q0IwDQYJKoZIhvcNAQ...</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
#10
Programming / Sign XML Documents with Digital Signatures
February 18, 2024, 04:05:16 PM
Hello everyone,
recently we are working on web services that use digitally signed xml files for validation, these xml files must be signed with digital certificates (.P12 files), does anyone have experience doing this? Or can you guide us how to do this in Pvx Plus? Any idea is welcome, thank you very much in advance.

Below is some example code in VB.NET. Any idea how we can replicate it in pxplus?


''' <summary>
''' Method for signing XML with digital certificate (*.p12)
''' </summary>
''' <param name="xmlDoc"> document to sign </param>
''' <param name="pathCert">location of certificate to use for signing </param>
''' <param name="passCert">digital certificate password</param>
''' <returns>Digitally signed XML</returns>
Private Function Signed (ByVal xmlDoc As XmlDocument, ByVal pathCert As String, ByVal
passCert As String) As XmlDocument
Try
If Not File.Exists(pathCert) Then Throw New Exception("The signing certificate does not exist")
Dim cert = New X509Certificate2(pathCert, passCert, X509KeyStorageFlags.Exportable)
Dim exportedKeyMaterial = cert.PrivateKey.ToXmlString(True)
Dim key = New RSACryptoServiceProvider(New CspParameters(24))
key.PersistKeyInCsp = False
key.FromXmlString(exportedKeyMaterial)
Dim signedXml As SignedXml = New SignedXml(xmlDoc)
  signedXml.SigningKey = key
  signedXml.SignedInfo.SignatureMethod =
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
  Dim reference As Reference = New Reference()
  reference.AddTransform(New XmlDsigEnvelopedSignatureTransform())
  reference.DigestMethod = "http://www.w3.org/2001/04/xmlenc#sha256"
  reference.Uri = ""
  signedXml.AddReference(reference)
  Dim keyInfo As KeyInfo = New KeyInfo()
  keyInfo.AddClause(New KeyInfoX509Data(cert))
  signedXml.KeyInfo = keyInfo
  signedXml.ComputeSignature()
  Dim xmlDigitalSignature As XmlElement = signedXml.GetXml()
  xmlDoc.DocumentElement.AppendChild(xmlDoc.ImportNode(xmlDigitalSignature, True))
  Return xmlDoc
  Catch ex As Exception
  Throw ex
  End Try
End Function
#11
ODBC / Re: ODBC Views Issue
May 02, 2023, 07:46:30 AM
devon, Thanks for your answer, I was able to get it working.
#12
ODBC / Re: ODBC Views Issue
April 28, 2023, 11:41:39 AM
hi devon,

If I have the sql odbc driver installed as a client, in the options tab I can include an address of a network shared folder, for example: \\12.8.1.54\PXPlus19\Pxplus, this being the directory where the pvxwin32.dll is located? With that configuration, would it show the views?
#13
ODBC / Re: ODBC Views Issue
April 26, 2023, 11:42:49 AM
thanks, i'll check it out
#14
ODBC / Re: ODBC Views Issue
April 26, 2023, 08:33:33 AM
Hi devon,

thanks for your answer, we did that setup, in fact we have other views that work without errors, but this one has that error.
#15
ODBC / ODBC Views Issue
April 25, 2023, 07:52:48 PM
hello All,

we are trying to query data from a view in excel and we are getting this error (attached in the screenshot).

The thing is that when we try the query from Excel to the same file from which the view was created, we can access the data.

What could be happening?

we are using a Pxplus Sql ODBC Driver Version 7 and Pxplus Version 19.1