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

RE: [soaplite] Problems accessing Headers and Envelope Server Side

Expand Messages
  • Ragnar Hakonarson
    Hi Radek, I must have been somewhat tired when I wrote the email below; what it is is that I am not getting the envelope as the last parameter. The last
    Message 1 of 6 , Nov 15, 2007
    • 0 Attachment

      Hi Radek,

       

      I must have been somewhat tired when I wrote the email below; what it is is that I am not getting the envelope as the last parameter. The last parameter contains my last in parameter to the function call. The first parameter contains the package name, or class name, rather than the SOAP::SOM object. Any ideas?

       

      Regards,

      Ragnar

       

      From: soaplite@yahoogroups.com [mailto:soaplite@yahoogroups.com] On Behalf Of rahed
      Sent: 15 November 2007 10:49
      To: lormidorido
      Cc: soaplite@yahoogroups.com
      Subject: Re: [soaplite] Problems accessing Headers and Envelope Server Side

       

      > sub new_matter {
      >
      > shift;
      > my $som_object = pop;
      >
      > .
      > .
      > .
      >
      > ... and so on.
      >
      > the variable $som_object contains my last parameter rather than the
      > SOAP::SOM object. Any ideas? Do you require any further info on my
      > setup? All help greatly appreciated!

      The first parameter is SOAP::SOM object and the last one is envelope.

      --
      Radek

    • rahed
      ... What I said may hold true when a dispatch_to method requests a module. Is it ok when you omit the methods and dispatch only to the IDES package? -- Radek
      Message 2 of 6 , Nov 15, 2007
      • 0 Attachment
        > I must have been somewhat tired when I wrote the email below; what it is is that I am not getting the envelope as the last parameter. The last parameter contains my last in parameter to the function call. The first parameter contains the package name, or class name, rather than the SOAP::SOM object. Any ideas?

        What I said may hold true when a dispatch_to method requests a module.
        Is it ok when you omit the methods and dispatch only to the IDES
        package?

        --
        Radek
      • Ragnar Hakonarson
        Hi Radek, I would like to start by thanking you for taking time and looking at this! I have tried to omit the methods and dispatched only to the IDES packages
        Message 3 of 6 , Nov 16, 2007
        • 0 Attachment
          Hi Radek,

          I would like to start by thanking you for taking time and looking at this!

          I have tried to omit the methods and dispatched only to the IDES packages and still that did not give desired result.

          I am using Apache 1.3.26 and not 2.x if that makes any difference.

          To recap, I am accessing following package through SOAP::Lite:
          __________________________________
          package IDES;

          use vars qw(@ISA);
          @ISA = qw(SOAP::Server::Parameters);

          sub new_matter {
          my($a, $b, $c) = SOAP::Server::Parameters::byNameOrOrder([qw(a b c)], @_);
          return "a=$a, b=$b, c=$c";
          }
          1;
          ___________________________________


          Configuration in httpd.conf:
          ___________________________________
          <Location /ides_soap>
          SetHandler perl-script
          PerlHandler Apache::SOAP
          PerlSetVar dispatch_to "IDES"
          PerlSetVar options "compress_threshold => 10000"
          </Location>
          ___________________________________


          When testing the SOAP server I do so in following manner:
          ___________________________________
          #!/usr/bin/perl

          use SOAP::Lite +trace => qw(debug);
          use MIME::Entity;

          my $ent = build MIME::Entity
          Id => '<123456>',
          Type => "image/gif",
          Encoding => "base64",
          Path => 'box_h_123_1.gif',
          Filename => "image.gif",
          Disposition => "attachment";

          my $som = SOAP::Lite
          ->readable(1)
          ->uri('urn:IDES')
          ->parts([$ent])
          ->proxy('http://localhost/ides_soap')
          ->new_matter(SOAP::Data->name('some_attr' => 94610)->type('string'),SOAP::Data->name("foo" => undef));
          ___________________________________


          The output from the test script is:
          ___________________________________
          clm@ineus:~/packages> ./test.pl
          SOAP::Transport::HTTP::Client::send_receive: POST http://localhost/ides_soap HTTP/1.1
          Accept: text/xml
          Accept: multipart/*
          Accept: application/soap
          Content-Length: 2145
          Content-Type: Multipart/Related; type="text/xml"; start="<main_envelope>"; boundary="----------=_1195246264-22870-0"; charset=utf-8
          SOAPAction: "urn:IDES#new_matter"

          This is a multi-part message in MIME format...

          ------------=_1195246264-22870-0
          Content-Type: text/xml
          Content-Disposition: inline
          Content-Location: /main_envelope
          Content-Id: <main_envelope>

          <?xml version="1.0" encoding="UTF-8"?>
          <soap:Envelope
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
          <soap:Body>
          <new_matter xmlns="urn:IDES">
          <some_attr xsi:type="xsd:string">94610</some_attr>

          <foo xsi:nil="true" />
          </new_matter>
          </soap:Body>
          </soap:Envelope>

          ------------=_1195246264-22870-0
          Content-Type: image/gif; name="image.gif"
          Content-Disposition: attachment; filename="image.gif"
          Content-Transfer-Encoding: base64
          Content-Id: <123456>
          MIME-Version: 1.0
          X-Mailer: MIME-tools 6.110 (Entity 6.109 )

          R0lGODlhAQAkAIcAAK+urru7u83NzdbV1dzc3Ojo6AAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          AAAAAAAAAAAAAAAAAAAAACH5BAAAAP8ALAAAAAABACQAAAgRAAcIHEiwoMGD
          AwEEEECgQEAAOw==

          ------------=_1195246264-22870-0--

          SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
          Connection: close
          Date: Fri, 16 Nov 2007 20:51:04 GMT
          Server: Apache/1.3.26 (Linux/SuSE) mod_ssl/2.8.10 OpenSSL/0.9.6g mod_perl/1.27 mod_gzip/1.3.19.1a
          Content-Length: 489
          Content-Type: text/xml; charset=utf-8
          Client-Date: Fri, 16 Nov 2007 20:51:05 GMT
          Client-Response-Num: 1
          SOAPServer: SOAP::Lite/Perl/0.69

          <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><new_matterResponse xmlns="urn:IDES"><s-gensym3 xsi:type="xsd:string">a=IDES, b=94610, c=</s-gensym3></new_matterResponse></soap:Body></soap:Envelope>
          clm@ineus:~/packages>
          ________________________________________________

          As you can see the input parameters to the IDES::new_matter method is "a=IDES, b=94610, c=" and not "a=SOAP::SOM, b=94610, c=<envelope>" as desired.

          You can further see that I am in need of accessing the envelope as I intend to sent attachments to the SOAP server.

          Is there something that I am missing here?

          Many thanks,
          Ragnar

          -----Original Message-----
          From: rahed [mailto:raherh@...]
          Sent: 15 November 2007 18:47
          To: Ragnar Hakonarson
          Cc: soaplite@yahoogroups.com
          Subject: Re: [soaplite] Problems accessing Headers and Envelope Server Side

          > I must have been somewhat tired when I wrote the email below; what it is is that I am not getting the envelope as the last parameter. The last parameter contains my last in parameter to the function call. The first parameter contains the package name, or class name, rather than the SOAP::SOM object. Any ideas?

          What I said may hold true when a dispatch_to method requests a module.
          Is it ok when you omit the methods and dispatch only to the IDES
          package?

          --
          Radek
        • Ragnar Hakonarson
          Hi Radek, If I enclose the complete content of the IDES packages within the BEGIN statement it works! File IDES.pm: ___________________________ BEGIN { package
          Message 4 of 6 , Nov 18, 2007
          • 0 Attachment
            Hi Radek,

            If I enclose the complete content of the IDES packages within the BEGIN statement it works!

            File IDES.pm:
            ___________________________
            BEGIN {

            package IDES;

            use vars qw(@ISA);
            @ISA = qw(SOAP::Server::Parameters);


            sub new_matter {

            my $envelope = pop;
            return ref($envelope);
            }
            1;
            ___________________________


            Does anybody know why that is or how I should set things up so that I do not have to include the contents of the IDES package within the BEGIN statemen?

            Many Thanks,
            Ragnar

            -----Original Message-----
            From: rahed [mailto:raherh@...]
            Sent: 15 November 2007 18:47
            To: Ragnar Hakonarson
            Cc: soaplite@yahoogroups.com
            Subject: Re: [soaplite] Problems accessing Headers and Envelope Server Side

            > I must have been somewhat tired when I wrote the email below; what it is is that I am not getting the envelope as the last parameter. The last parameter contains my last in parameter to the function call. The first parameter contains the package name, or class name, rather than the SOAP::SOM object. Any ideas?

            What I said may hold true when a dispatch_to method requests a module.
            Is it ok when you omit the methods and dispatch only to the IDES
            package?

            --
            Radek
          Your message has been successfully submitted and would be delivered to recipients shortly.