kadir_beyazli
kadir_beyazli

Reputation: 197

Perl Soap::Schema Output

To call a web service I always use SOAP::Schema and use returned parameters as follow:

my $wsdl     = "wsdl adres";

my $schema   = SOAP::Schema->new( schema_url => $wsdl )->parse();
my $services = $schema->services();

my $first_key = undef;
foreach my $key (keys %$services) {
 $first_key = $key unless ($first_key);
}

my $proxy      = "$$services{$first_key}{$method}{endpoint}";
my $uri        = "$$services{$first_key}{$method}{soapaction}";
my $ns         = "$$services{$first_key}{$method}{namespace}";
my $parameters = $$services{$first_key}{$method}{parameters};

my $soap = SOAP::Lite
    -> on_action( sub { join '/', @_ } )
    -> readable(1)
    -> uri($uri)
    -> proxy($proxy)
    -> ns("http://schemas.xmlsoap.org/soap/envelope/","soapenv")
    -> ns($ns);

It always worked, but now I got following error for a new wsdl adress:

mismatched tag at line 8, column 2, byte 84 at /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/XML/Parser.pm line 187

What may problem be? wsdl definition is correct because it works when I try from SOAPUI.

Upvotes: 2

Views: 118

Answers (2)

kadir_beyazli
kadir_beyazli

Reputation: 197

The problem is at my server. My server is redirecting URL to a wrong one, xml is not found and this error occurs

Upvotes: 0

Sobrique
Sobrique

Reputation: 53498

Apologies, this is only a partial answer - because the URL you gave does work, but that error you have is specifically a problem with the XML you've fetched not parsing.

So going back to basics:

#!/usr/bin/env perl
use strict; 
use warnings 'all';
use LWP::Simple;
use XML::Twig; 

my $url = 'http://xperiaclub.com/Service/Service1.svc?singleWsdl';

my $content = get ( $url );
my $twig = XML::Twig -> parse ( $content );
$twig -> set_pretty_print ( 'indented_a');
$twig -> print;

This will error if the content is invalid XML - and it isn't, it works fine. Which doesn't answer your question, I know.

So this XML isn't the problem.

Upvotes: 1

Related Questions