[ifmapdev] I don't think the WSDL is defined properly.

15 views
Skip to first unread message

Terry Simons

unread,
May 16, 2010, 5:22:58 AM5/16/10
to ifmapdev
I'm attempting to use the WSDL interface with the soap-lite Perl
module.

I've done this in the past with other SOAP services, so I have some
experience, but I don't know WSDL very well.

I'm trying to use the NewSession WSDL interface, but my resultant
query isn't formed right... either that, or perhaps the version of
WSDL being used isn't compatible with soap-lite, which I believe only
supports version 1.0.

Which version of WSDL is being used in ifmap.wsdl?

Was the wsdl file generated with some sort of tool, or was it created
by hand?

If a tool was used (and the version is > 1.0) is there a way to export
a 1.0 version? If we're using a version > 1.0 already then the below
information may be moot.

One thing I've noticed is that the ifmap.wsdl file does things
differently than some of the examples I've seen floating around the
web, and it doesn't behave as I'd expect.

It *should* contain "new-session" in the body, but instead contains
"NewSession".

My script is below.

There are a few things you will need to do to make it work:

First, I assume a working omapd server.

0) (assuming Ubuntu) sudo apt-get install lib-soap-lite-perl
1) Download the wsdl and base xsd files and store them in the same
directory as the script.
2) Edit the wsdl file and change the references (both of them) to the
xsd file so that the name is correct (ifmap-base-1.0v28.xsd instead of
ifmap-base-1.0v23.xsd)
3) Edit the wsdl:service definition at the bottom of ifmap.wsdl to
point at https://localhost:8081
3) Soft link the xsd to the root of the drive (I think there's a bug
in soap-lite) with sudo ln -s <full/path/to/ifmap-base-1.0v28.xsd> /

The Script:

#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite
# For debugging
+trace=>'all';

my $soap = SOAP::Lite
->readable(1)
->service('file:ifmap.wsdl')
->endpoint("https://127.0.0.1:8081");

my $soapResponse = $soap->NewSession();


Here's the resultant SOAP request:

Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 692
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:ifmapwsdl="http://www.trustedcomputinggroup.org/2008/IFMAP/1/
ifmap.wsdl"
xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/">
<soap:Body>
<ifmapwsdl:NewSession xsi:nil="true" />
</soap:Body>
</soap:Envelope>


I did some research on WSDL trying to figure out why this was
happening... and I ran across the following tutorial:

http://www.w3schools.com/wsdl/wsdl_ports.asp

According to that page, a "message" type inside of a WSDL port is a
parameter. So I tried the following:

my $soapResponse = $soap->NewSession("NewSessionRequest");

Which gives a different result:

Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 724
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:ifmapwsdl="http://www.trustedcomputinggroup.org/2008/IFMAP/1/
ifmap.wsdl"
xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/">
<soap:Body>
<ifmapwsdl:NewSession>
<request xsi:nil="true" />
</ifmapwsdl:NewSession>
</soap:Body>
</soap:Envelope>

So based on all of this I think the WSDL definition is incorrect.

I think that the WSDL format used here would behave as expected:

http://www.w3.org/2001/03/14-annotated-WSDL-examples.html

That example appears to use complex types and reference them from the
XSD, which is more like what I've done before... rather than message=
syntax, which doesn't behave properly... at least with soap-lite.

Andrew Benton

unread,
May 16, 2010, 3:47:39 PM5/16/10
to ifma...@googlegroups.com
i have had no luck with using the wsdl for anything. i'm pretty sure
it was generated from a tool. roger chickering or stu bailey will know
more. but i'm pretty sure that you are correct that the wsdl is
defined in a way that is incompatible with perl's soap-lite.

amb

Roger Chickering

unread,
May 16, 2010, 3:57:47 PM5/16/10
to ifma...@googlegroups.com
Hi Andrew and Terry,

I wrote the original ifmap.wsdl by hand. It was crafted so that the gsoap wsdl2h tool could process it. Some folks from Infoblox made subsequent modifications.

It sounds like what's happening is that the tool is interpreting the values of the schemaLocation and/or location attributes in ifmap.wsdl as relative links from the place where ifmap.wsdl is located. I suggest copying all of the files to a local directory, which will make the relative links work (since you got past this, Terry, this is probably what you did :-)

-Roger

Terry Simons

unread,
May 16, 2010, 4:28:35 PM5/16/10
to ifmapdev
Hi Roger,

Yes, the SOAP library is trying to load the values from the relative
locations, but the XSD filename was wrong in the WSDL.

That problem was not a big deal to fix, but I think the WSDL itself is
broken because when I use the SOAP::Lite module to auto load the
schema definitions so that I can do useful things like:

$soap->NewSession()

The resulting XML is malformed... and I've used SOAP::Lite in the past
with auto load, so I don't think the problem is SOAP::Lite.

I may hack up a very small WSDL file that works with $soap-
>NewSession() if I can figure out all the pieces and parts.

If I get that working I'll post to the list.

- Terry

On May 16, 1:57 pm, Roger Chickering <rog...@juniper.net> wrote:
> Hi Andrew and Terry,
>
> I wrote the original ifmap.wsdl by hand. It was crafted so that the gsoap wsdl2h tool could process it. Some folks from Infoblox made subsequent modifications.
>
> It sounds like what's happening is that the tool is interpreting the values of the schemaLocation and/or location attributes in ifmap.wsdl as relative links from the place where ifmap.wsdl is located. I suggest copying all of the files to a local directory, which will make the relative links work (since you got past this, Terry, this is probably what you did :-)
>
> -Roger
>
> On May 16, 2010, at 12:47 PM, Andrew Benton wrote:
>
> > i have had no luck with using the wsdl for anything. i'm pretty sure
> > it was generated from a tool. roger chickering or stu bailey will know
> > more. but i'm pretty sure that you are correct that the wsdl is
> > defined in a way that is incompatible with perl's soap-lite.
>
> > amb
>
> >> point athttps://localhost:8081
Reply all
Reply to author
Forward
0 new messages