# How to parse an WSDL file?

**URL:** <https://www.ruby-forum.com/t/how-to-parse-an-wsdl-file/74807>\
**Category:** Ruby\
**Created:** [November 7, 2006, 10:57am UTC](https://www.ruby-forum.com/t/how-to-parse-an-wsdl-file/74807 "2006-11-07T10:57:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrixise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Post date:** [November 7, 2006, 10:57am UTC](https://www.ruby-forum.com/t/how-to-parse-an-wsdl-file/74807/1 "2006-11-07T10:57:34Z")

</div>

Hi all,

I would like to use the wsdl api from stdlib, but I didn’t understand.  
So, I will try to parse my wsdl file with REXML.

Is there a small example of the use of this API ?

Thanks

Stephane

---

<div class="post-metadata">

**Author:** ![matrixise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Post date:** [November 7, 2006, 10:57am UTC](https://www.ruby-forum.com/t/how-to-parse-an-wsdl-file/74807/2 "2006-11-07T10:57:38Z")

</div>

Hi Stephane,

soap4r can use REXML as the XML parser. I think you can use it’s WSDL  
parsing code as a good example.

[http://raa.ruby-lang.org/project/soap4r](http://raa.ruby-lang.org/project/soap4r)

Lei Ming

---

<div class="post-metadata">

**Author:** ![matrixise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Post date:** [November 7, 2006, 10:57am UTC](https://www.ruby-forum.com/t/how-to-parse-an-wsdl-file/74807/3 "2006-11-07T10:57:38Z")

</div>

Lei Ming wrote:

> Hi Stephane,
> 
> soap4r can use REXML as the XML parser. I think you can use it’s WSDL  
> parsing code as a good example.
> 
> [http://raa.ruby-lang.org/project/soap4r](http://raa.ruby-lang.org/project/soap4r)  
> Thanks, because I would like to generate a C++ code from this WSDL with  
> Ruby. Because there is some information from this file to indicate if a  
> data is mandatory or not.

---

<div class="post-metadata">

**Author:** ![matrixise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/94ad74/32.png) [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Post date:** [November 7, 2006, 11:00am UTC](https://www.ruby-forum.com/t/how-to-parse-an-wsdl-file/74807/4 "2006-11-07T11:00:15Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

Stephane W. wrote:

> > soap4r can use REXML as the XML parser. I think you can use it’s WSDL  
> > parsing code as a good example.
> > 
> > [http://raa.ruby-lang.org/project/soap4r](http://raa.ruby-lang.org/project/soap4r)  
> > Thanks, because I would like to generate a C++ code from this WSDL with  
> > Ruby. Because there is some information from this file to indicate if a  
> > data is mandatory or not.

lib/wsdl/classDefCreator.rb (and friends) generates Ruby code from WSDL  
with Ruby. It may help you. Please find the latest snapshot release  
from [http://dev.ctor.org/soap4r](http://dev.ctor.org/soap4r) instead of stdlib.

Regards,  
// NaHi  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRUwBVx9L2jg5EEGlAQKlSAf/TGxs+FL6Cl2+5UkVp8eYAlfKhGnU//u5  
9pb/a2dUNDTMu55F5VQ0Z5yfuaxl5H7oOUwLqPuDTUrlB1Mu9BIN++9qGgYYHpTz  
CCr7osED5EnZLh5NNsx/zlEqBGzJnncbjgV2gqUzYnFxnX9AEwO/rm+mrGjcOtCX  
C4nkS+0SJrN84e+qdA+gzlxi5zH2gup0vmeSFafFKpa0Ow4eT5Di65M4G4/AVpEu  
Pg6A2Mtbp26RUKE/KqH+mh924QzjonLQDjFJ46IkN44tbnzpv6bShDfUjR1JZM0M  
dIdubs4moCDqb2Q3n+qZYKypNxEN+Y+NVP0nZ/H4r1HiH9t4H0bQrQ==  
=ppuj  
-----END PGP SIGNATURE-----
