Hi.
I want to be able to create a persistent connection between an XML-RPC
client and server... i.e. I want to be able to login once, carry
out a number of calls and then logout rather than send login info for
every call.
Is there a way to do this with the xml-rpc code in the standard library?
Thanks in advance 15 6500
The Fumigator wrote: Hi.
I want to be able to create a persistent connection between an XML-RPC client and server... i.e. I want to be able to login once, carry out a number of calls and then logout rather than send login info every call. Is there a way to do this with the xml-rpc code in the standard library?
Not to my knowlegde - and the reason is not python, but the primitiveness of
xmlrpc. It simply doesn't allow for connection state to be associated.
What I do is to create handles, and pass these around - that at least limits
and sort of normalizes the api usage:
proxy = xmlrpclib.Serve r('http://localhost:7080/')
ak = proxy.authentic ate(user, password)
print proxy.some_meth od(ak, argument)
If you want stateful connection, use better IPC-standards, as CORBA - its
way more advanced. SOAP gets attention lately, but its similarily limited
as xmlrpc, and while session state associoated with soap connections is
possible sometimes, its not standarized....
--
Regards,
Diez B. Roggisch
The Fumigator wrote: Hi.
I want to be able to create a persistent connection between an XML-RPC client and server... i.e. I want to be able to login once, carry out a number of calls and then logout rather than send login info for every call.
Is there a way to do this with the xml-rpc code in the standard library?
Thanks in advance
What do you mean by login, logout and login info? Do you mean establish
connection, close connection and <I don't know what would be equivalent
for login info>? Are you wanting a keepalive? If so, I don't know of
how to do that with the standard library. If you've got some sort of
login mechanism on your XMLRPCServer, I would assume you would have to
pass back whatever "key" you received upon login per call.... But I
guess it depends on what you mean.
Jeremy Jones I want to be able to create a persistent connection between an XML-RPC client and server... i.e. I want to be able to login once, carry out a number of calls and then logout rather than send login info for every call.
Is there a way to do this with the xml-rpc code in the standard library?
Look at the multicall capability of the xmlrpclib library. It may do what
you want.
Skip
> Look at the multicall capability of the xmlrpclib library. It may do what you want.
Verifying my response I found that, too - but thats more a bundling of calls
together instead of what the op wanted - a way to have some server-side
"cookie" that identifies an incoming call as authenticated. That's not
possible.
--
Regards,
Diez B. Roggisch
Diez B. Roggisch wrote: a way to have some server-side "cookie" that identifies an incoming call as authenticated. That's not possible.
The standard pattern for doing that is having an xmlrpc call
that you supply username/password/other credentials to. It
then responds with a pair of tokens. You then use them as
part of the URL where usernames and passwords are usually
used. For example:
sp=xmlrpclib.Se rverProxy("http ://foo.example.com ")
c1,c2=sp.login( "username", "password", "etc")
sp=xmlrpclib.Se rverProxy("http ://%s:%s@foo.examp le.com" % (c1,c2))
sp.DoSomething( 1,2)
sp.DoSomethingE lse(3,4)
This will work fine with the current client side xmlrpclib. If
you server side is written in Python then you will need to make
a derived request handler that grabs and verifies the authentication
headers before calling the intended routines (except for the login
function :-)
Roger
Hi, The standard pattern for doing that is having an xmlrpc call that you supply username/password/other credentials to. It then responds with a pair of tokens. You then use them as part of the URL where usernames and passwords are usually used. For example:
sp=xmlrpclib.Se rverProxy("http ://foo.example.com ") c1,c2=sp.login( "username", "password", "etc")
sp=xmlrpclib.Se rverProxy("http ://%s:%s@foo.examp le.com" % (c1,c2)) sp.DoSomething( 1,2) sp.DoSomethingE lse(3,4)
This will work fine with the current client side xmlrpclib. If you server side is written in Python then you will need to make a derived request handler that grabs and verifies the authentication headers before calling the intended routines (except for the login function :-)
While I have to admit that it is a nice trick, its something I expect beeing
part of a IPC-standard - otherwise, it renders the standard short of beeing
useless.
There are alternatives out there, like corba, which allow for much better
implementations - in terms of ease of use from the api side as well as
performance and interoperabilit y. Having to tweak a standard to make it
work in a certainly common pattern strikes me as awkward. Unfortunately, I
have to use xmlrpc myself as php corba support isn't too good - but I keep
it to a minimum, and its dead ugly...
--
Regards,
Diez B. Roggisch
On Fri, 29 Oct 2004 20:49:50 +0200, Diez B. Roggisch wrote: While I have to admit that it is a nice trick, its something I expect beeing part of a IPC-standard - otherwise, it renders the standard short of beeing useless.
XML-RPC was designed from the get go to be very, very simple, as in
"person skilled in a language ought to be able to get one going in a
matter of hours". It breaks out of that domain, but it is nice to have a
cross-platform RPC mechanism that meets that description. If I want to get
a weather report for zip-code XXXXX, I shouldn't need CORBA.
It isn't useless, but it definitely has established its niche at the lower
end of the scale.
I would point out the XML-RPC is built on HTTP and XML and theoretically
inherits the benefits and disadvantages of both. Specifically, if your
server and client supported it, you should be able to use Cookie: headers
just as you would in HTTP. That would sort of be a grey area in the
standard.
(It's probably about time for XML-RPC 1.1 that seperates the data encoding
from the transport; right now according to the standard they are
intertwined and "XML-RPC over SMTP" or "over Jabber" are meaningless
phrases; those things are just "XML-RPC-like". Then maybe we could allow
various transports to be used more fully, according to the defined
transport; Jabber is another example where the transport has useful
capabilities but they are just thrown away for RPC purposes.) XML-RPC was designed from the get go to be very, very simple, as in "person skilled in a language ought to be able to get one going in a matter of hours". It breaks out of that domain, but it is nice to have a cross-platform RPC mechanism that meets that description. If I want to get a weather report for zip-code XXXXX, I shouldn't need CORBA.
And not much beyond that - more or less all serious applications have _some_
sort of authentication scheme - and thus associating state with a
connection is neccessary in nearly all but the most trivial applications.
And I think we can agree that these days a object orientied interface is how
apis are designed, and thats also beyond the scope of xmlrpc/soap.
Its not so complicated to get a corba server running - at least imho.
Writing a idl is a thing every programmer should be able to do. if its a
well-designed one - well, thats a totally different beast, and beyond rpc
in general - but the inherent clumsiness of xmlrpc/soap based interface
doesn't help here, too.
It isn't useless, but it definitely has established its niche at the lower end of the scale.
I would point out the XML-RPC is built on HTTP and XML and theoretically inherits the benefits and disadvantages of both. Specifically, if your server and client supported it, you should be able to use Cookie: headers just as you would in HTTP. That would sort of be a grey area in the standard.
Exactly - its grey. SOAP is grey in that field, too. So it renders e.g. .NET
and AXIS un-interoperable when more than the most trivial tasks are
planned.
I've been in contact with xmlrpc/soap after I became aquainted with corba,
and I have to say that to me its a huge step back in time. But it gets the
attention these days, due to clever marketing and the fact that its based
on xml - something that seems to be a must these days.
--
Regards,
Diez B. Roggisch
Diez B. Roggisch wrote: Exactly - its grey. SOAP is grey in that field, too. So it renders e.g. .NET and AXIS un-interoperable when more than the most trivial tasks are planned.
Which is a big pain in the butt! We had to deal with this a few times
in our company, and (if I recall correctly) had to decide on a custom
XML structure that was sent inside a very very basic SOAP wrapper.
(the client wanted SOAP, they got SOAP... :-( )
I've been in contact with xmlrpc/soap after I became aquainted with corba, and I have to say that to me its a huge step back in time. But it gets the attention these days, due to clever marketing and the fact that its based on xml - something that seems to be a must these days.
Back in 2002 I wrote a very extensive article/whitepaper on this subject.
It's available on the OMG website: http://www.omg.org/news/whitepapers/CORBA_vs_SOAP1.pdf
Interesting stuff inside, if you're into this kind of technology.
(it's PDF, other formats also available on my own website)
--Irmen de Jong This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dominik Stadler |
last post by:
Hi,
We have a file that contains multiple XML-Messages in the form of:
<FIRSTMESSAGE>...</FIRSTMESSAGE><SECONDMESSAGE>...</SECONDMESSAGE>
I know this looks broken from the beginning, but we cannot change the
application that generates these kind of data, so we need a way to cope
with it.
|
by: bouton |
last post by:
I am trying to 'union' multiple xml files into one html table with only
a few of the many fields/elements displayed using xsl.
I have index.xml which lists the documents, all of which validate with
the same .xsd
<?xml version="1.0"?>
<index>
<title>My List</title>
<entry>1111</entry>
|
by: Andy Britcliffe |
last post by:
Hi
I'm faced with the situation where I could have a single physical file that
could contain multiplie XML documents e.g
file.txt contains the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE doc SYSTEM "1.0b.dtd">
<doc transmission-date="20050715T154340Z" >
|
by: randall g |
last post by:
I have a stored procedure which returns multiple result sets, enclosing
each in its own tag. This works in ADO but not ADO.NET, where an error
is returned by ExecuteXmlReader:
"Invalid command sent to ExecuteXmlReader. The command must return an
Xml result."
The procedure looks like this:
create procedure xxx as
select '<tag1>'
|
by: David Svoboda |
last post by:
I have a server program that takes commands and acts on them. The
server program can also take these commands from an input file or
standard input (mainly for testing purposes). As such, I often have
files full of input commands to feed to the server.
Right now the commands that the server takes are well-defined, but not
in XML. Since the commands are not self-delimiting, I have to prepend
each command with a 'length' number indicating...
| |
by: PK9 |
last post by:
I'm building a windows app using C#. The goal is to merge portions of
multiple xml files into one.
I currently have an .xsl stylesheet that pulls in the required sections of
multiple xml files and combines them into one xml file. This xsl works
correctly.
I'm now trying to utilize this xsl in my C# application, along with the
required xml files, to merge them into the one document. Basically I'm
looking for a code example of how...
|
by: bourenane |
last post by:
I want to summarize data from multiple xml forms into an Excel 2003 spreadsheet. Each xml file has the identical structure, but different data. I want to define the XML map in Excel, and import data for each file, with each file's data being on a new row.
Any ideas?
Thanks in advance.
|
by: Rama Jayapal |
last post by:
hi
i am developing a web application where i have to read multiple XML feeds amd store their values to database
but i require the same type of fields from multiple XML feeds like
for example
|
by: Kevin |
last post by:
I would like to change the naming convention for my stylesheets so
they include the version number of the release. Because the xml files
that are created by the application may be read and created between
multiple versions of the application (those that have the latest
updates, and those that do not), there is a need to either use the
latest xsl stylesheet, or use the previous xsl (generic version)
stylesheet.
Is there a way to use the...
|
by: jonker |
last post by:
Hi All,
I have a TCP Client which reads the data from the socket. Now I have to deserialize the received data. The data can contain multiple XML documents like :
<customer field="value">
<address>road 11<address/>
<customer/>
<supplier>
<goods>printers<goods/>
<supplier/>
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |