I have been working on a product which provides access to its APIs
using web services. The way to invoke any API is to start telnet
session and pasting the SOAP xml requests on command prompt.
The results are returned on the command prompt in the form of the
SOAP xml responses.
Now I am new to the concepts of Webservices/SOAP etc.
I wanted to write a perl script which will invoke these APIs.
I looked into SOAP::Lite module and it is really nicely written.
I was able to form the SOAP requests by directly manipulating the
SOAP::Serializer object. However, I did not see any transport layer
protocols which will help me to carry this request to the end point.
(I initially thought that may be IO.pm or TCP.pm could be used for
this but later, with more investigation I think that is not the case)
I have already written few perl scripts which execute various programs
on remote machines and return the results, using the perl expect module.
Initially I was thinking of implementing this as follows:
1. Construct the SOAP requst message using SOAP::Lite (SOAP::Serializer)
2. Execute the constructed message on the telent session using my own
3. Get the output SOAP response message and decode it using
However, I think a better idea would be to write one more transport
protocol for telnet (SOAP::Transport::Telnet). With that I will be
able to encapsulate all of my expect logic inside the SOAP module and
my client will not become complex. (Currently I am only interested in
writing it for Client side). I see from the documentation that I will
have to override the methods 'new' and 'send_recieve'.
The questions which I want to ask are:
1. Is it really necessary to write a separate Transport protocol for
Telnet or is there an easier way to achieve what I want to do?
2. If the need for the telnet/SSH (the ones which I think can be
implemented using perl expect module) protocols as transport protocols
is universal, then should we write modules in SOAP::Lite to handle that?
(I will be happy to contribute in the efforts)