Skip to content

Instantly share code, notes, and snippets.

@mavnn
Created February 13, 2012 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mavnn/1815931 to your computer and use it in GitHub Desktop.
Save mavnn/1815931 to your computer and use it in GitHub Desktop.
Perl WSDL Regeneration
#!/usr/bin/perl
use strict;
use Data::Dumper;
use File::Find;
my $abc_deploy = '\\\\cvsw90163\\c$\\Apps\\ABC2\\apache-tomcat-6.0.18\\webapps\\ABC';
my $svc_util = 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe';
my @files = ();
find(sub
{
push(@files, $File::Find::name) if (/^deploy.+wsdd$/);
}, $abc_deploy);
foreach (@files) {
open (WSDD, $_) or die($!);
my @lines = ();
while (<WSDD>) {
push(@lines, $_);
}
close (WSDD);
my $content = join('', @lines);
$content =~ /service.+name="(\w+)"/;
my $serviceName = $1;
my $cmd = "\"$svc_util\" /out:${serviceName}.cs /noConfig /namespace:\"*,CCC.CRM.Integration.Academy.Contracts.${serviceName}\" /serializer:XmlSerializer http://cvsw90163:9090/ABC/services/${serviceName}?wsdl >nul 2>&1";
my $ret = system($cmd);
print "Error generating proxy class for $serviceName.\n" if ($ret != 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment