71
Web Server - Ask For Help / Re: 2 way certificate authentication
« Last post by joep on December 21, 2024, 02:13:44 AM »Hi Bruce and Jane
This is indeed how I have to go on.
With the automatic Window procedure and the call from the NetWebServiceMethod server code I can do the second call.
And with a new key and crt file in place this one is secure too. (I will make the crt and key file with openssl from the pfx I got from the consumer)
Thanks both for your understanding and suggestions.
I wil let you know when or if this works.
Thanks Joep
This is indeed how I have to go on.
With the automatic Window procedure and the call from the NetWebServiceMethod server code I can do the second call.
And with a new key and crt file in place this one is secure too. (I will make the crt and key file with openssl from the pfx I got from the consumer)
Thanks both for your understanding and suggestions.
I wil let you know when or if this works.
Thanks Joep
72
Web Server - Ask For Help / Re: 2 way certificate authentication
« Last post by Bruce on December 20, 2024, 06:28:27 PM »>> What I also wanted to ask is how I can do the get from a netwebservice method?
you make an automatic Window procedure, and call it from your NetWebServiceMethod server code at the appropriate time.
See the NetTalk WebServer Email example that follows the same pattern - albeit with a NetEmail object, whereas you will use a NetWebClient object.
The NetWebClient method can use a private key, if that's a thing the other server requires of you.
Cheers
Bruce
you make an automatic Window procedure, and call it from your NetWebServiceMethod server code at the appropriate time.
See the NetTalk WebServer Email example that follows the same pattern - albeit with a NetEmail object, whereas you will use a NetWebClient object.
The NetWebClient method can use a private key, if that's a thing the other server requires of you.
Cheers
Bruce
73
Web Server - Ask For Help / Re: Sending mail using Postmark API
« Last post by Bruce on December 20, 2024, 06:24:23 PM »cid: is just a prefix to source names in the HTML which mean "find this in the attachment list".
so, for example;
<img src="c:\images\a.png"> becomes
<img src="cid:a.png">
and a.png is added as an attachment.
As you note the NetEmail class has methods to do this for you. But it's not hard for you to do it yourself.
Cheers
Bruce
so, for example;
<img src="c:\images\a.png"> becomes
<img src="cid:a.png">
and a.png is added as an attachment.
As you note the NetEmail class has methods to do this for you. But it's not hard for you to do it yourself.
Cheers
Bruce
74
Web Server - Ask For Help / Sending mail using Postmark API
« Last post by JohanR on December 20, 2024, 02:11:11 AM »Hi Bruce
Many thanks for your help last night in the NT user group, invaluable sessions,
I certainly learned a few things.
I had one other question about inline images for the HTML body, is using NetEmailSend the only way to do this?
If yes, then my plan was to create a dummy NetEmailSend object, load the HTML string, do the EmbedImages, and then move the HTML string out again with the images embedded.
Postmark has an alternative, in that if the CID is specified in the HTML and the image is on the attachment list,
then it would do the embedding of inline images when the Postmark server processes the email.
But not sure how to handle the CID creation
Any thoughts are appreciated.
thanks
Johan
{
"From": "sender@example.com",
"To": "receiver@example.com",
"Cc": "copied@example.com",
"Bcc": "blind-copied@example.com",
"Subject": "Test",
"Tag": "Invitation",
"HtmlBody": "<b>Hello</b> <img src=\"cid:image.jpg\"/>",
"TextBody": "Hello",
"ReplyTo": "reply@example.com",
"Headers": [
{
"Name": "CUSTOM-HEADER",
"Value": "value"
}
],
"TrackOpens": true,
"TrackLinks": "None",
"Attachments": [
{
"Name": "readme.txt",
"Content": "dGVzdCBjb250ZW50",
"ContentType": "text/plain"
},
{
"Name": "report.pdf",
"Content": "dGVzdCBjb250ZW50",
"ContentType": "application/octet-stream"
},
{
"Name": "image.jpg",
"ContentID": "cid:image.jpg",
"Content": "dGVzdCBjb250ZW50",
"ContentType": "image/jpeg"
}
],
"Metadata": {
"color":"blue",
"client-id":"12345"
},
"MessageStream": "outbound"
}
Many thanks for your help last night in the NT user group, invaluable sessions,
I certainly learned a few things.
I had one other question about inline images for the HTML body, is using NetEmailSend the only way to do this?
If yes, then my plan was to create a dummy NetEmailSend object, load the HTML string, do the EmbedImages, and then move the HTML string out again with the images embedded.
Postmark has an alternative, in that if the CID is specified in the HTML and the image is on the attachment list,
then it would do the embedding of inline images when the Postmark server processes the email.
But not sure how to handle the CID creation
Any thoughts are appreciated.
thanks
Johan
{
"From": "sender@example.com",
"To": "receiver@example.com",
"Cc": "copied@example.com",
"Bcc": "blind-copied@example.com",
"Subject": "Test",
"Tag": "Invitation",
"HtmlBody": "<b>Hello</b> <img src=\"cid:image.jpg\"/>",
"TextBody": "Hello",
"ReplyTo": "reply@example.com",
"Headers": [
{
"Name": "CUSTOM-HEADER",
"Value": "value"
}
],
"TrackOpens": true,
"TrackLinks": "None",
"Attachments": [
{
"Name": "readme.txt",
"Content": "dGVzdCBjb250ZW50",
"ContentType": "text/plain"
},
{
"Name": "report.pdf",
"Content": "dGVzdCBjb250ZW50",
"ContentType": "application/octet-stream"
},
{
"Name": "image.jpg",
"ContentID": "cid:image.jpg",
"Content": "dGVzdCBjb250ZW50",
"ContentType": "image/jpeg"
}
],
"Metadata": {
"color":"blue",
"client-id":"12345"
},
"MessageStream": "outbound"
}
75
Web Server - Ask For Help / Re: 2 way certificate authentication
« Last post by Jane on December 19, 2024, 10:15:45 AM »Quote
What I also wanted to ask is how I can do the get from a netwebservice method?
I have used client certificates to authenticate to servers, but not from NetTalk. On this page there is some info on client-side certificates: https://www.capesoft.com/docs/NetTalk12/NetTalkWebClient.Htm Bruce may have further advice.
I have, however, built a web server that is at the same time both an API server and an API client, which is what you're apparently doing.
The API client part is built like any of the API client examples that ship with NetTalk. (Such as 77).
Because an API request is asynchronous, you need a window running on a separate thread with a webclient object. It authenticates to the server you're querying and fetches the data from that other server's API. The window is obviously never visible to anyone; it's just used for the asynchronous process. Once you've sorted the certificate authentication the rest will be quite straightforward.
76
Web Server - Ask For Help / Re: 2 way certificate authentication
« Last post by joep on December 18, 2024, 05:53:29 AM »Hi Bruce,
Sorry for the late reaction. There is still some confusion at the customer.
But to answer your questions.
I am server and client.
See the attachments how it looks.
So i get an notification from the customer (Api service) saying there is a new object available.
This works with certificates ( no problem)
The notification is a json with the unique number.
From there I have to send From ower Server a new json message asking for the object with the previous number from the notification.
Hope this helps to clear things.
What I also wanted to ask is how I can do the get from a netwebservice method?
Cheers
Joep
Sorry for the late reaction. There is still some confusion at the customer.
But to answer your questions.
I am server and client.
See the attachments how it looks.
So i get an notification from the customer (Api service) saying there is a new object available.
This works with certificates ( no problem)
The notification is a json with the unique number.
From there I have to send From ower Server a new json message asking for the object with the previous number from the notification.
Hope this helps to clear things.
What I also wanted to ask is how I can do the get from a netwebservice method?
Cheers
Joep
77
Web Server - Ask For Help / Re: Filter error on compile
« Last post by Bruce on December 17, 2024, 09:38:25 PM »You have an item in the Conditional Filter settings for the browse. But without a filter set.
Set the filter, or remove the item.
Cheers
Bruce
Set the filter, or remove the item.
Cheers
Bruce
78
Web Server - Ask For Help / Re: Filter error on compile
« Last post by rjolda on December 17, 2024, 02:10:55 AM »Hi Johan,
A couple of things I have found. If it had a filter and the filter is removed, that happens - solution - filter is: "1 = 2"
Second, the app generator builds all kind of forms and browses linked to forms, etc. - it is trying to do it according to the file relationships. I have had to delete relationships so that the TEMPLATEs would not complain. I have found that sometimes it is easier to add necessary relationships in after APPGEN does its thing.
So, putting in a filter there or deleting the Child of Browse would do the trick.
Ron
A couple of things I have found. If it had a filter and the filter is removed, that happens - solution - filter is: "1 = 2"
Second, the app generator builds all kind of forms and browses linked to forms, etc. - it is trying to do it according to the file relationships. I have had to delete relationships so that the TEMPLATEs would not complain. I have found that sometimes it is easier to add necessary relationships in after APPGEN does its thing.
So, putting in a filter there or deleting the Child of Browse would do the trick.
Ron
79
Web Server - Ask For Help / Re: Filter error on compile
« Last post by JohanR on December 16, 2024, 09:55:13 PM »Hi,
Seems to be something to do with the file relationship and how it's setup.
Will report back once I get back to it and solved it
I have typed in a filter for now.
thanks
Johan
Seems to be something to do with the file relationship and how it's setup.
Will report back once I get back to it and solved it
I have typed in a filter for now.
thanks
Johan
80
Web Server - Ask For Help / Filter error on compile
« Last post by JohanR on December 16, 2024, 09:19:14 PM »Hi,
I have received this in the past and could not solve it, lucky for me it was a test browse that I was playing around with and simply deleted it.
Now getting it again, almost as if there is an invalid character there triggering the filter code but then as it's invalid does not generate anything valid?
I have cleaned out the filter fields in the template area.
Any ideas?
thanks
Johan
I have received this in the past and could not solve it, lucky for me it was a test browse that I was playing around with and simply deleted it.
Now getting it again, almost as if there is an invalid character there triggering the filter code but then as it's invalid does not generate anything valid?
I have cleaned out the filter fields in the template area.
Any ideas?
thanks
Johan