Board index » delphi » parse WSDL and build soap request

parse WSDL and build soap request

Hello, borland.public.delphi.webservices.soap!

My client has web service for upload document and few items additional
information. WSDL-file may be changed in future and I need encapsulate
this changes in my code by custom mapping WSDL attributes (messages and
their parameters) to attributes in my application.

Well, I've got the URL for WSDL file and set of persistent attributes ()
with mapping schema to objects in my application.

Well, I need parse WSDL and create correct SOAP request to web service

I'm newbie in web services and soap subject. I need samples about
dynamic work with web services.

Sorry my English.

--
With best regards,
Nikolay Voynov

 

Re:parse WSDL and build soap request


"Nikolai Voynov"

Quote
> Well, I've got the URL for WSDL file and set of persistent attributes ()
> with mapping schema to objects in my application.

> Well, I need parse WSDL and create correct SOAP request to web service

If you mean dynamically invoking a web service method, I don't think you can
do that with Delphi SOAP.  You can with www.pocketsoap.com but you'll need
to reverse engineer Simon's vb app to Delphi that parses a WSDL (xml) and
constructs the vb calls from it.

Does that help?

Re:parse WSDL and build soap request


Hello Nikolai,

As mentioned by Abdullah, Delphi SOAP does not lend itself to dynamic
handling of SOAP request/response because the premise of Delphi SOAP
(unfortunately so, I might add) is that the information gleaned from the
WSDL is encoded in Delphi RTTI (backed by a registry). This approach makes
it really hard to handle SOAP messages dynamically short of building RTTI
programmatically (i.e. at runtime).

I too recommend PocketSOAP or the (now deprecated) MS-SOAP [a.k.a. ROPE]
toolkit. They are COM-based libraries, hence can be used with
Delphi/C++Builder/etc.

Cheers,

Bruneau.

Quote
"Nikolai Voynov" <voy...@ukr.net> wrote in message

news:46a80cd2@newsgroups.borland.com...
Quote
> Hello, borland.public.delphi.webservices.soap!

> My client has web service for upload document and few items additional
> information. WSDL-file may be changed in future and I need encapsulate
> this changes in my code by custom mapping WSDL attributes (messages and
> their parameters) to attributes in my application.

> Well, I've got the URL for WSDL file and set of persistent attributes ()
> with mapping schema to objects in my application.

> Well, I need parse WSDL and create correct SOAP request to web service

> I'm newbie in web services and soap subject. I need samples about
> dynamic work with web services.

> Sorry my English.

> --
> With best regards,
> Nikolay Voynov

Re:parse WSDL and build soap request


"Jean-Marie Babet":

Quote
> I too recommend PocketSOAP or the (now deprecated) MS-SOAP [a.k.a.
> ROPE]

Why do they call it ROPE?  :)

Re:parse WSDL and build soap request


Hello,

Quote
> Why do they call it ROPE?  :)

It stood for the 'Remote Object Proxy Engine'. And to quote the 'SOAP Soup'
article from xmlfiles [see
http://www.xmlfiles.com/articles/adam/soapsoup/default.asp ], 'No SOAP on a
ROPE jokes here!' :)

Cheers,

Bruneau.

Re:parse WSDL and build soap request


"Jean-Marie Babet":

Quote
> It stood for the 'Remote Object Proxy Engine'. And to quote the 'SOAP
> Soup'
> article from xmlfiles [see
> http://www.xmlfiles.com/articles/adam/soapsoup/default.asp ],

Thanks.

Quote
> 'No SOAP on a
> ROPE jokes here!' :)

Oooh, the temptation.

Re:parse WSDL and build soap request


Jean-Marie Babet schrieb:
Is the WSDLIMPORTER opensource?
It would help the community to achieve the goal to develope some
framework for dynamically analyisng wsdl and invoking soap-ws.
Imo that would be needed to support WS-* with Delphi/Win32 - even though
it might be arguable if that makes sense. Some people just love win32 -
and somehow I can understand them.
If anybody else has a hint on invoking ws dynamically with delphi - I
would be happy.

Regards

Roland

Re:parse WSDL and build soap request


Nikolai - you might be able to achieve what you want using Indy.Soap.
The newest implementation is available here:
http://sourceforge.net/project/showfiles.php?group_id=153674
You would have to parse the current wsdl an inject or delete what you
need in the dom. I bet it is not easy though.
Imo there is a lack of a component that allows parsing of wsdl and
dynamically invoking a ws. Does anybody know one? I would pay money for it.

 From the docs:
===========
SOAP Packet Access
Type
   TIdViewMessageEvent = procedure (ASender : TIdSoapITIProvider;
AMessage : TStream) of object;
   TIdViewMessageDomEvent = procedure (ASender : TIdSoapComponent; ADom
: TIdSoapXmlDom) of object;

   property OnReceiveMessage :  TIdViewMessageEvent;
   property OnSendMessage :  TIdViewMessageEvent;
   property OnReceiveMessageDOM :  TIdViewMessageDOMEvent;
   property OnSendMessageDOM :  TIdViewMessageDOMEvent;
   property OnSendExceptionDOM :  TIdViewMessageDOMEvent;
These events exist to allow the application raw access to the actual
SOAP packets as a stream or as a DOM. Applications can use these events
to log the soap messages (i.e. for debugging), or to manipulate the
messages (i.e. by using transforms or manipulating the DOM).

It's safe to replace the contents of the stream. The stream position
will be reset to position 0 by IndySoap after this event is called. On
the server, any event handler catching these events should be thread safe
===========

Re:parse WSDL and build soap request


Hello,

The WSDL importer is not open source although with D2007 I managed to
convince the folks here to include the source as an example. I would love
for it to be open source but I suspect that there might be some resistance
against that - people were already worried that I'd have to release some IDE
code with the sample. I reassured them that the sample would only build the
command line version. Code in the sample that relies on other IDE services
is IFDEF'ed out.

On the issue of invoking WS dynamically I must say that Delphi's current
SOAP runtime is not suited at all for that. The reason is that the runtime
is driven off RTTI. We don't have a API to build RTTI (interface RTTI, that
is). It's something that the compiler generates. It's possible to create
interface RTTI programmatically but it's not very well documented and there
are a few places in the runtime when the code would have to be tweaked to
retrieve RTTI from some other source.

I think that COM-based SOAP runtime, such as MS-SOAP/ROPE or PocketSOAP are
a better option for this kind of usage.

Please let me know if I can provide more information.

Cheers,

Bruneau.

PS: And if you don't have the latest Delphi, I'm happy to email you a copy
of the importer.

Re:parse WSDL and build soap request


Hi.
I checked since a long time this thread and read your answer.

Quote
> PS: And if you don't have the latest Delphi, I'm happy to email you a copy
> of the importer.

If it is legal I would be happy to get it at ich(a__t)ro-land.net .At
The moment I aonly have a Delphi 2005 license.

Regards

Roland

Re:parse WSDL and build soap request


Hello,

I'm sending you a copy of the importer sources.

Cheers,

Bruneau.

Other Threads