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

RE: [soaplite] RE: SOAP::Lite server to .NET/C# client and arrays

Expand Messages
  • Maurice McCabe
    I meant Visual Studio .NET. It may not be necessary to use document/literal . I don t recall the specifics on what I ran into that caused me to standardize on
    Message 1 of 3 , Oct 14, 2004
      Message
      I meant Visual Studio .NET.
       
      It may not be necessary to use 'document/literal'. I don't recall the specifics on what I ran into that caused me to standardize on 'document/literal' but it was how I got it to work. And it has continued to work for Axis. Coldfusion MX and nuSOAP, including the use of more complex datatypes such as DataSet, etc.. So, so far I have not needed to switch back.
       
      The following is an example of using the serializers (including the actual serializers from Alberto):
       
      use SOAP::Lite;
      use SOAP::Transport::HTTP ;
      my $uri = 'myNameSpace';
      my $serializer = LiteralSerializer->new;
      my $deSerializer = LiteralDeserializer->new;
       

      $daemon = SOAP::Transport::HTTP::CGI
        -> serializer($serializer)
        -> deserializer($deSerializer)
        -> dispatch_to('./modules');
       
      $daemon->serializer->xmlschema('2001');
       
      $daemon -> handle ;
       
      BEGIN {
       
          package LiteralSerializer;
          @LiteralSerializer::ISA = 'SOAP::Serializer';
          sub xmlize {
       my $self = shift;
       my($name, $attrs, $values, $id) = @{+shift};
       $attrs ||= {};
       
       # keep only namespace attributes for all elements
       my $a = $attrs->{xmlns} ? {xmlns => $attrs->{xmlns}} : {};
       
       return $self->SUPER::xmlize([$name, $a, $values, $id]);
          }
          sub envelope {
              $_[2] = (UNIVERSAL::isa($_[2] => 'SOAP::Data') ? $_[2] :
                       SOAP::Data->name($_[2])->attr({xmlns => $uri}))
                  if $_[1] =~ /^(?:method|response)$/;
              shift->SUPER::envelope(@_);
          }
       
          package LiteralDeserializer;
          @LiteralDeserializer::ISA = 'SOAP::Deserializer';
          sub deserialize {
          my $self = shift;
       my $result = $self->SUPER::deserialize(@_);
         $result->{_message} = @_[0];
       return $result;
          }
       
      }
       
       
      -----Original Message-----
      From: Youngblood, Gregory S. [mailto:youngbloodg@...]
      Sent: Thursday, October 14, 2004 1:04 PM
      To: 'Maurice McCabe'
      Subject: RE: [soaplite] RE: SOAP::Lite server to .NET/C# client and arrays

      "Developer Studio .NET", do you mean Visual Studio .NET? If so, yes, I have VS.NET 2003 Enterprise.

       

      So far, I haven't had a problem with the RPC/Encoded stuff and .Net (for simple types). Is it really still necessary to switch to document/literal? Also, the Harvard URL for the serializers just sits and spins - nothing is displayed, no files listed to download. Is it on CPAN?

       

      Thanks,
      Greg

       

      -----Original Message-----
      From: Maurice McCabe [mailto:mmccabe@...]
      Sent: Thursday, October 14, 2004 2:21 PM
      To: 'Youngblood, Gregory S.'; soaplite@yahoogroups.com
      Subject: RE: [soaplite] RE: SOAP::Lite server to .NET/C# client and arrays

       

      Sometimes it is easier for a camel to pass through the eye of a needle than to try to do this 'correctly'. But with the right kind of persistence you can squeeze the camel through almost any tight spot.

       

      Getting this to work correctly, means you have a high degree of interoperability with not only .NET but also Axis and nuSOAP and probably most other WSDL aware SOAP toolkits.

       

      Unless you already have Developer Studio .NET, the first thing I recommend is to download the WebServicesStudio for free from gotdotnet.com. This will allow you to build a test .NET client from your WSDL automatically. It also generates error messages on your WSDL. You won't have to fiddle with WSDL.exe, or C#, etc...

       

      Second, you can use .NET to build your WSDL by creating a Web Service that returns an array of string. Boom! Just like that your done fiddling with WSDL editors. (But you have to learn how to make a web service in .NET)

       

      Step 3. Since .NET uses the 'document/literal' format of SOAP messaging, and SOAP::Lite defaults to 'rpc/encoded' you have to switch-out the default SOAP::Lite Serializer and Deserializer. See message 3606 (http://groups.yahoo.com/group/soaplite/message/3606) for more details including an example of a WSDL for array of complex datatype. You can find the serializers here: http://ads.harvard.edu/~alberto/SOAP/

       

      If you get this far it means you have found a huge needle or a really tiny camel.

       

      Finally, use WSDL.exe to build your .dll and drop it into your .NET project.

       

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