Loading ...
Sorry, an error occurred while loading the content.

6057Problem with SOAP

Expand Messages
  • Oeschey, Lars (I/EK-142, extern)
    Nov 19, 2007
    • 0 Attachment
      Hi,

      I'm very new to SOAP in general, and I need to work with a SOAP interface of another application. I tried to generate a stub file and use it, but get an Error 500 from the server. Here are the facts:

      WSDL-File from Browser:
      ----------------------------snip-------------------------------------

      <definitions name="" targetNamespace="http://soap.data.inform.com">

      <message name="teInput">
      <part name="in0" type="xs:string"/>
      <part name="in1" type="xs:string"/>
      </message>
      <message name="teInputResponse"/>

      <portType name="IAudiTESoap">

      <operation name="teInput">
      <input message="tns:teInput"/>
      <output message="tns:teInputResponse"/>
      </operation>
      </portType>

      <binding name="AudiTESoapServiceSoap" type="tns:IAudiTESoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>

      <operation name="teInput">
      <soap:operation soapAction="http://soap.data.inform.com#teInput" style="rpc"/>

      <input>
      <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>

      <output>
      <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
      </operation>
      </binding>

      <service name="AudiTESoapService">

      <port name="AudiTESoapServiceSoap" binding="tns:AudiTESoapServiceSoap">
      <soap:address location="http://audiinsa00220.in.audi.vwg:3003/soap/"/>
      </port>
      </service>
      </definitions>
      -------------------------------snip--------------------------------------

      the generated stub file:
      -----------------------snip---------------------------------------------
      package AudiTESoapService;

      # -- generated by SOAP::Lite (v0.55) for Perl -- soaplite.com -- Copyright (C) 2000-2001 Paul Kulchenko --
      # -- generated from http://audiinsa00220.in.audi.vwg:3003/wsdl/all [Mon Nov 19 10:04:32 2007]

      my %methods = (
      teInput => {
      endpoint => 'http://audiinsa00220.in.audi.vwg:3003/soap/',
      soapaction => 'http://soap.data.inform.com#teInput',
      uri => '',
      parameters => [
      SOAP::Data->new(name => 'in0', type => 'ns:string', attr => {'xmlns:ns' => 'http://www.w3.org/2001/XMLSchema'}),
      SOAP::Data->new(name => 'in1', type => 'ns:string', attr => {'xmlns:ns' => 'http://www.w3.org/2001/XMLSchema'}),
      ],
      },
      );

      use SOAP::Lite;
      use Exporter;
      use Carp ();

      use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
      @ISA = qw(Exporter SOAP::Lite);
      @EXPORT_OK = (keys %methods);
      %EXPORT_TAGS = ('all' => [@EXPORT_OK]);

      no strict 'refs';
      for my $method (@EXPORT_OK) {
      my %method = %{$methods{$method}};
      *$method = sub {
      my $self = UNIVERSAL::isa($_[0] => __PACKAGE__)
      ? ref $_[0] ? shift # OBJECT
      # CLASS, either get self or create new and assign to self
      : (shift->self || __PACKAGE__->self(__PACKAGE__->new))
      # function call, either get self or create new and assign to self
      : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new));
      $self->proxy($method{endpoint} || Carp::croak "No server address (proxy) specified") unless $self->proxy;
      my @templates = @{$method{parameters}};
      my $som = $self
      -> endpoint($method{endpoint})
      -> uri($method{uri})
      -> on_action(sub{qq!"$method{soapaction}"!})
      -> call($method => map {@templates ? shift(@templates)->value($_) : $_} @_);
      UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result
      : $som;
      }
      }

      sub AUTOLOAD {
      my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
      return if $method eq 'DESTROY';

      die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n";
      }

      1;
      -----------------------snip-------------------------------------------

      and the script I use for testing:

      ----------------------------------
      use strict;
      use AudiTESoapService qw(teInput);

      my $result=teInput("test","test");
      print $result;
      ----------------------------------

      I get the following Error:
      500 Internal Server Error at test2.pl line 5

      what am I doing wrong?

      regards, Lars
    • Show all 2 messages in this topic