[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

I need to send (from Notes Client) & receive xml files (on Domino Server) via http, but how?

Posted on 2006-03-31
28
Medium Priority
?
304 Views
Last Modified: 2013-12-18
I am developing a Notes/Domino application that will receive XML files containing such things as purchase orders, & send XML files containing such things as delivery notifications back to the sender's web server.

So there are two things to be done:

The Domino server needs to be able to receive these files via http - I think I've got an idea how I need to do this: the database needs an agent that can receive the file which can then be accessed via the DocumentContext property - is that correct?

The Notes client needs to be able to send similar files back to the sender's web server via http - how would I go about doing this? Once this part is sorted out, I can use it to send things to my own server, but I can't develop the server end until I can send files to it.

So please can you suggest how I go about sending the files, along with any pointers on how to receive them on the server?

Any thoughts & suggestions welcomed.

Thanks.
0
Comment
Question by:PaulCutcliffe
  • 12
  • 10
  • 5
  • +1
28 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16341655
Just some thoughts...

Send file to Domino:
1) an agent indeed, not easy, because you have to put everything in the URL
2) in a form, in a textfield
3) in a form, with some upload-controle
4) with an agent, you send an URL of an XML-page to the Domino-server, the Domino-server retrieves that XML-page (using NWEB.EXE)
5) mail

Send file by Domino/Notes:
1) in a form, in a textfield
2) mail
3) as a form (you can develop XML-forms and XML-views in Notes)
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 16341815
Hi PaulCutcliffe,
web is not my "strong side", but I know this cuz I needed it a while ago:

to get any file, whose URL you have, use this:

    Sub Click(Source As Button)
        Dim s As New NotesSession
        Dim db As NotesDatabase
        Dim note As NotesDocument
        Dim n As NotesEmbeddedObject
        Dim fileNames
   
        Set db = s.CurrentDatabase
        Set note = db.GetDocumentByURL( "http://www.alanlepofsky.com/alepofsky/alanblog.nsf/blog.rss")
   
        fileNames = Evaluate( "@AttachmentNames", note )
        Forall fileName In fileNames
            Set n = note.GetAttachment( fileName )
            n.ExtractFile ( "D:\Downloads\" & fileName )
        End Forall
    End Sub
   

Hope this helps,
Marko
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16341857
That's where you need NWEB.EXE...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:PaulCutcliffe
ID: 16342868
Sorry, I'll come back to this Monday.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16343051
What's wrong with the weekend??
0
 

Author Comment

by:PaulCutcliffe
ID: 16349813
Nothing's wrong with the weekend, & yes, I am having to work today, but not in this issue! :-)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16352142
LOL
0
 

Author Comment

by:PaulCutcliffe
ID: 16359722
Right, back now!

So, does anyone know how XML is normally sent/received via HTTP? Is it sent as part of the HTTP Header? I need to be able to send the file exactly like other systems do. What is the standard way to do this?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16359787
Make an XML form... Open the Designer Help db, Index, type XML and Bob's your uncle. The first document you will see is called "Putting XML in a form or page". I could copy/paste it here, for more points...?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16359794
But you need it as a file? Why is that? What's the difference between a file and a page on the web, to the other side? If necessary, you could use document names like "file123.xml".
0
 

Author Comment

by:PaulCutcliffe
ID: 16361232
I don't need it as a file, sorry that was misleading terminology. My system will provide the XML dynamically on request, by using the methods you suggest (pages, embedded views & documents etc). However, this resulting (I won't call it a file this time!) chunk of XML needs to be 'posted' to another party's web server using the HTTP protocol.

So having got myself some XML, how can I post it to another party's web server from the Notes client?

The other half of my question is, how can I receive similarly posted XML from the other party? This is where I think I need an Agent, accessible via the web (http://server.domain.com/database.nsf/AgentName?OpenAgent), that accesses the posted data via the DocumentContext property - does this sound feasible, or am I speaking rubbish?

Thanks,
Paul Cutcliffe
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16362281
Post XML? I don't know if that's possible, in my view it's always the other party that GETs the XML. What you can do is use a special URL to the other party. The URL can contain the URL to your XML-page, in a coded form, e.g.
    http: //www.otherparty.com/thingum.asp?fetch&url=www.overhere.com~pages~thispage.xml

The same would work from the other side. This is how I would do it, but that doesn't say that it's the best method. :-|
0
 
LVL 14

Accepted Solution

by:
p_partha earned 1400 total points
ID: 16365342
I didn't read the other posts but to answer your question, any web application can post to an agent in lotus notes, Our agent can pick up the XML, parse it and do all the information you want. When you post it to an agent using the action parameter in the form tag, you can access all the information that is posted using a field by name request_content.

<form action ='http://yournotesserver/databasename/agentname?openagent" method=post>
your html fields
</form>

all you need to do in ur agent is to get the value of doc.request_content(0), where doc is pointing to documentcontext


So your agent is going to be :

dim session as new notessession
dim doc as notesdocument
set doc = session.documentcontext
print doc.request_content(0)


Now to return back the XML you have lot of ways,

1. agent output, with the content-type changed to text/xml
2. Using readviewentries

Feel free  to ask me more questions...

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16368453
Interesting, that with request_content...
0
 

Author Comment

by:PaulCutcliffe
ID: 16369075
p_partha, you've saved the day!

This is what I thought you could do, I just wasn't sure how. I was so sure you could do it, I had committed to developing something using Domino. So when I started to draw blanks with this question, I started to worry somewhat.

So thanks for the tip - I will try to set it up my end & come back to you. Trouble is, until I solve the other end of the same issue, i.e. how I can send some XML to a web server, I can't actually test my server-end solution.

So, does anyone know how I can send XML to a web server so that the web server can retrieve it using the NotesAgent.DocumentContext.request_content(0) field?

Thanks again.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 16370904
hey just create a simple html file anywhere ( even in your desktop )which will have the xml inside a field and post it to a agent

soemthing like this:

<html>
<body>
<form action = "youragentname?openagent" method = 'post'>
<input type='field' value = 'your xml stuff'>
</form>
</body>
</html>

0
 

Author Comment

by:PaulCutcliffe
ID: 16373556
So is this something I could recreate within Notes on the fly? A page, perhaps, with the HTML in, just like when we use pages as XML files? Or perhaps a document, rather than a page, so I could have fields containing the actual data?

I'm going to need the Notes/Domino application to be able to post updates to the other party when something in the workflow dictates. For example, when something is complete, a status notification needs to be sent. It can be on the client rather than the server, but I need Notes to do this behind the scenes when, for example, the user presses a button (or more likely when a document is saved with a particular status, or some other arbitrary event).

So if I had a document that contained an HTML form with the post action set as you suggest, could I 'drive' the posting of this form using code, say LotusScript? Perhaps using NWeb, could I open the web page (in code), and could post the information from LotusScript?

Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16380699
As I said earlier, you can create XML-forms. But that's still not a POST. What's running on the destination server??
0
 

Author Comment

by:PaulCutcliffe
ID: 16381077
I don't know what exactly, other than that it's a web server. I'll be finding out more about their end in the next day or two.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 16381395
Sjef bro,
I still don't understand what does this mean :  "But that's still not a POST", i can create a page or form and paste the entire html like this and do a post:
</form>
<html>
<body>
<form action = "http://www.google.com" method = 'post'>
<input type='field' value = 'your xml stuff'>
<input type='submit' >
</form>
</body>
</html>

SO it does a post to google.com, so in your case you will post it to a agent as mentioned earlier, The form starts with a </form> tag , so as to close the form tag created by domino. Hope i am clear here

Partha

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16381901
Sorry Bro, I may have misunderstood :$

What I meant to say is that you can force something up a Domino server using the agent and the request_content field, but if you want to force something down some other server's throat, you'd have to know a similar construction. Or do you suggest that you open the webpage you gave yourself, on your own server (using GetDocumentByURL or so)? But how to trigger the POST then? If I'm not mistaken, Paul intends to force-feed XML to the other server.
0
 

Author Comment

by:PaulCutcliffe
ID: 16382104
Surely, whilst the NotesAgent.DocumentContext.request_content(0) is indeed a Domino-specific way to get hold of the information posted by the client, but all web servers must have an equivalent method? And I don't need to know what that is or how it works, as long as the person who wrote the system running on it did!

What I mean is, as long as I can post the information to a web server using the 'standard method' (posting to a form), then the receiving web server will know what to do with it (assuming I am right about how they receive it - I will be able to confirm this soon).

And as long as I know how to get the information posted by them to my web server, then I'll know what to do with it too.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 16382203
Paul,
Why should you bother about how the webserver in the other end going to handle the request, All you tell them is that you are going to throw a XML as a post operation. It's "THE" method of sending data across web applications as far as i know. ALL you need to tell them is i can post a XML to your server, and it's upto to their server to handle the request posted, we need not contemplate whether it's going ot be request_content(0) or some other thing, it's their headache..

Hope i am clear

partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16382245
Apparently there's something to learn for me here, which is great! Still wondering though how the POST should be activated from your server...
0
 

Author Comment

by:PaulCutcliffe
ID: 16383191
Perfectly, partha. I'm glad you confirmed my thoughts on it.

But we haven't quite solved how to do this on the Notes client exactly. Presumably, I can program the Notes client to open a web page that can be my page/document containing my XML - does this have to happen on screen, or can it be done invisibly? Having done this, can I program the client to Post the form? How can I do that?

Thanks.

(I've increased the points a bit!)
0
 
LVL 14

Expert Comment

by:p_partha
ID: 16383250
Hi Paul
It can be done invisibly also: take a look at this example:
http://codestore.net/store.nsf/unid/DOMM-4ZPHD5?OpenDocument

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16383672
And on Linux...?
0
 

Author Comment

by:PaulCutcliffe
ID: 16383859
Brilliant! I didn't know you could use the MS XML Parser to create HTTP requests, I thought it just parsed XML (don't know where I got that idea from, after all, it is called an XML Parser!)

Anyway, that does look really useful, so thanks for that.

I guess it's time to dish the points - congratulations p_partha - they're all yours. :-)

Thanks to p_partha & everyone else for their contributions. I'll be coming back to this in a day or two & trying to implement this, so watch this space for further questions!

Paul Cutcliffe
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question