2009-02-01 16:38:06 +01:00
|
|
|
package Lemonldap::NG::Common::BuildWSDL;
|
|
|
|
|
|
|
|
use Lemonldap::NG::Common::Conf;
|
|
|
|
|
|
|
|
sub new {
|
2009-02-08 18:12:42 +01:00
|
|
|
my ( $class, $configStorage ) = @_;
|
2009-02-01 16:38:06 +01:00
|
|
|
my $self = bless {}, $class;
|
2009-02-08 18:12:42 +01:00
|
|
|
my $lmConf = Lemonldap::NG::Common::Conf->new($configStorage)
|
|
|
|
or die($Lemonldap::NG::Common::Conf::msg);
|
2009-02-01 16:38:06 +01:00
|
|
|
$self->{conf} = $lmConf->getConf() or die "Unable to load configuration";
|
|
|
|
return $self;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub buildWSDL {
|
2009-02-08 18:12:42 +01:00
|
|
|
my ( $self, $xml ) = @_;
|
|
|
|
my $portal = $self->{conf}->{portal};
|
|
|
|
$portal .= "index.pl" if ( $portal =~ /\/$/ );
|
|
|
|
$xml =~ s/__PORTAL__/$portal/gs;
|
2009-02-01 16:38:06 +01:00
|
|
|
$xml =~ s/__DOMAIN__/$self->{conf}->{domain}/gs;
|
|
|
|
my @cookies = split /\s+/, $self->{conf}->{cookieName};
|
2009-02-08 18:12:42 +01:00
|
|
|
s#(.*)#<element name="$1" type="xsd:string"></element># foreach (@cookies);
|
|
|
|
|
|
|
|
#s#(.*)#<element name="$1" nillable="true" type="xsd:string"></element># foreach(@cookies);
|
2009-02-01 16:38:06 +01:00
|
|
|
$xml =~ s/__XMLCOOKIELIST__/join("\n",@cookies)/ges;
|
|
|
|
return $xml;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|