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

Few problems

Expand Messages
  • iminchev_bg <iminchev_bg@yahoo.com>
    The situation is: Client: MSSOAP SDK 3.0 Server: IIS, ActiveState ActivePerl 5.6, $SOAP::Lite::VERSION = 0.51 Serveice code: use SOAP::Transport::HTTP;
    Message 1 of 1 , Feb 13, 2003
    • 0 Attachment
      The situation is:
      Client: MSSOAP SDK 3.0
      Server: IIS, ActiveState ActivePerl 5.6, $SOAP::Lite::VERSION = '0.51'

      Serveice code:

      use SOAP::Transport::HTTP;
      SOAP::Transport::HTTP::CGI
      -> dispatch_to('MyModule')->handle;
      package MyModule;
      BEGIN {
      @MyModule::ISA = qw(SOAP::Server::Parameters);
      }

      sub SaveDocument {
      my $envelope = pop;
      my @files = $envelope->dataof( "//Files/File" );
      foreach my $file ( @files ) {
      my $filename = $file->attr->{ name };
      open DOCFILE, ">$filename" || return SOAP::Fault->faultcode
      ('Server.SaveDocument')
      ->faultstring("Unable to create file $filename");

      binmode DOCFILE;
      print DOCFILE $file->value;
      close DOCFILE;
      }
      return SOAP::Data->type('SaveDocumentResponse')->name(Result
      => { message => 'OK', code => 1 });
      }
      1;


      The client output is:

      <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
      <SOAP-ENV:Envelope SOAP-ENV:encodingStyle=""
      xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
      xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <m:SaveDocument xmlns:m="http://tempuri.org/CRM" SOAP-
      ENV:encodingStyle="">
      <Files SOAP-ENV:encodingStyle="">
      <File SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      name="somefile.doc" type="SOAPSDK2:base64Binary">
      PGh0bWwgeG1sb
      ..........
      oNCjwvaHRtbD4NCg==
      </File>
      </Files>
      </m:SaveDocument>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      Problem 1:
      The cgi hangs! I found that it hangs in
      SOAP::Transport::HTTP::CGI::handle() function in my $content; read
      (STDIN,$content,$ENV{'CONTENT_LENGTH'} || 0); line
      I solved the problem by setting binmode(STDIN)... ?!?!
      Problem 2:
      The file that was saved contains base64 encoded data. Why the
      deserializer didn't decode it?

      Regards,
      Ivan Minchev
    Your message has been successfully submitted and would be delivered to recipients shortly.