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

.NET client, SOAP::Lite server and complex types' namespaces

Expand Messages
  • hapm_ml
    Hi there! I ve been trying to consume a SOAP::Lite web service from a .NET client (C#) which returns a complex type. I couldn t make it work (in the .NET side)
    Message 1 of 1 , Jan 27, 2006
    • 0 Attachment
      Hi there!

      I've been trying to consume a SOAP::Lite web service from a .NET
      client (C#) which returns a complex type.

      I couldn't make it work (in the .NET side) until I realized that there
      was a problem with the namespace that SOAP::Lite uses as default for
      custom (complex) types: http://namespaces.soaplite.com/perl.

      The problem is that in the WSDL (generated with Pod::WSDL), I use a
      namespace for my types, in which it's encoded the service name
      (http://<location>/<service_module>), but I did not found a
      "documented" way to tell SOAP::Lite to use it as the namespace for my
      types (SOAP::Lite asociates the type with the default one).

      Diving into the code, I found two ways to specify the namespace for my
      complex types:

      1)

      use SOAP::Transport::HTTP;
      $SOAP::Constants::NS_SL_PERLTYPE = "http://<location>/<service_module>";
      ...

      or

      2)

      ...
      my $ser = SOAP::Serializer->new;
      $ser->maptype->{'MyType'} = "http://<location>/<service_module>";

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new(LocalPort => $port)
      -> dispatch_to("<service_module>")
      -> serializer($ser)
      -> handle;

      Neither 1 nor 2 convinced me, because neither use a "documented"
      interface, so I have no warranty for these to work on the next release.

      I also tried to change the namespace in the WSDL to the SOAP::Lite's
      default one, but I had many problems with this (and, of course, it may
      change in the future, so this is not an option anyway).

      How do you specify the namespace for a given custom type? (notice that
      the problem is not the namespace for the "data", which I can specify
      with SOAP::Data, but the "type" of the data). Or, how do you specify a
      default namespace for all your custom types?

      Thanks in advance!

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