#14 Add XML over TCP/IP support

open
nobody
None
5
2006-04-15
2006-04-15
Doekman
No

Adding XML over TCP/IP support would be nice. The topic is defined less
clearly, but this is what I know:

== message reading ==
Opening a socket for every call is too costly, so multiple messages can be
sent over a socket. XML parsers can't handle this, because they rely on the
end-of-file mechanism to determine when a xml-document is complete.

Some implementations rely on XML element recognition. When reading a
response message, the XML-tags are parsed, and when an closing
element is encountered that matches the first opening element, the
message is considered complete. With this example:
<?xml version="1.0"?><first-open><another/></first-open><bla>
the message would be complete right after the string "</first-open>".
Most of the time, Xml parsing will not be needed, because the root-
element name is unique as a string within the Xml message.

Other implementations send an ASCII length header (decimal) before the
XML message: "0000056<?xml version="1.0"?><first-open><another/
></first-open>".

== message matching ==
Often, more than one message can be sent, before responses are
returned ("window-size" is bigger than one). The responses also do not
need to be returned in the same order as the requests are sent. To match
the response with a request, one ore more textnodes in both the
messages have to match (transaction identifier).

Discussion

  • Ole Lensmar
    Ole Lensmar
    2006-04-16

    Logged In: YES
    user_id=838515

    hmm.. interesting.. are there any "official" specifications
    for this? can you point us to some implementations or articles?

    thanks for the suggestion!

    /Ole

     
  • Logged In: YES
    user_id=1370849

    Yep, it IS interesting but as I see it it's not something
    you sneeze out.

    It is interestiong because implementing TCP/IP would open
    the door to a lot of non HTTP implementations (as specific
    MQ's or FTP).

    The downside is that it would require a slight uptdate
    (albeit better) in the architecture where we have
    connectors of n types. This means, the connector would be
    responsible for retrieveing and collecting a full XML
    messsage before sending it to the parser. I'm not quite
    sure what the overhead is in regards to moving http
    message handling towards an architecture like this.

    As far as what I know about XML over TCP you have descibed
    prtty much what I know. Generally you have to have a
    tcplistener or a tcpserver in order to listen to incoming
    packets.

    The problem is, whithout public specs or a standard it's
    hard to make an implementation that is genereally useful.

    I'll get in touch!

     
  • Doekman
    Doekman
    2006-04-19

    Logged In: YES
    user_id=677669

    The problem is there's no spec. Maybe the best solution is, to create a HTTP
    to TCP proxy in PHP. For every type of xml/tcp implementation (I described
    two above), you create mini program. To forward the HTTP xml-body to TCP
    and vice versa it is easy. The hard part is to get the reuse of tcp/ip channels
    right. Is this possible with, say php? Or wouldn't this be necesary?

    Ideas anyone?

     
  • Logged In: YES
    user_id=1370849

    Short notice:

    soapui 1.6 is now "pluggable" in the connection end. That
    means adding support for additional protocols will be
    easier.