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

RE: Re: SOAP::Lite server, .NET Client, WSDL and complexTypes

Expand Messages
  • Perl Median
    Why yes.. here is the code that works for a single string :) Just add web reference.. (point to the wsdl file) and you re ready to go! ... PERL CODE
    Message 1 of 7 , Apr 23, 2004
    • 0 Attachment
      Why yes.. here is the code that works for a single
      string :) Just add web reference.. (point to the wsdl
      file) and you're ready to go!

      --- Matt Long <matt.long@...> wrote:
      > p.s. Do you have an example .NET client and perl
      > server that sends/receives
      > just a scalar successfully? I have yet to get this
      > to work either. If you
      > have something like that, would you be willing to
      > share your code so I can
      > get a better grasp on this stuff? TIA.
      >

      PERL CODE (singleString.cgi):

      #!/u/deliv/perl-5.6.1-unix/bin/perl

      ## Packages used
      use strict;
      use warnings;
      use SOAP::Transport::HTTP;

      ################## MAIN ##################

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('singleString')
      -> handle;

      ################ MAIN END ##################


      package singleString;


      sub singleStringFunc {

      my($self, $input) = @_;

      ### doing my data crunching
      if( not $input ){
      die SOAP::Fault
      ->faultcode('Server.Custom')
      ->faultstring('Nothing sent!')
      ;
      }

      ## this is important you must use type and uri on all
      items for .NET
      return

      SOAP::Data->name('singleStringFuncResult')->value("Hello
      $input")->type('string')->uri('urn:singleString');
      ;

      } ########## END singleStringFunc

      __END__

      ####
      ####
      ####

      AND HERE IS THE WSDL (singleString.wsdl):

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="singleString"
      targetNamespace="urn:singleString"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:tns="urn:singleString"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <documentation>
      The WSDL Spec for singleString
      </documentation>

      <message name="singleStringFuncRequest">
      <part name="input" type="xsd:string" />
      </message>

      <message name="singleStringFuncResponse">
      <part name="singleStringFuncResult"
      type="xsd:string" />
      </message>

      <portType name="singleStringPort">
      <operation name="singleStringFunc">
      <input message="tns:singleStringFuncRequest" />
      <output message="tns:singleStringFuncResponse" />
      </operation>
      </portType>

      <binding name="SOAP" type="tns:singleStringPort">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http" />

      <operation name="singleStringFunc">
      <soap:operation
      soapAction="urn:singleString#singleStringFunc" />

      <input>
      <soap:body use="encoded"
      namespace="urn:singleString"

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

      <output>
      <soap:body use="encoded"
      namespace="urn:singleString"

      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      />
      </output>

      </operation>
      </binding>

      <service name="singleString">
      <port name="singleStringPort" binding="tns:SOAP">
      <soap:address
      location="http://www/reldistdoc/deliv/external/cgi-bin/soap/singleString.cgi"
      />
      </port>
      </service>

      </definitions>


      =====
      Thank you,
      Perl Median (the mediocre Perl Programmer)




      __________________________________
      Do you Yahoo!?
      Yahoo! Photos: High-quality 4x6 digital prints for 25�
      http://photos.yahoo.com/ph/print_splash
    • Matt Long
      Nik, I added this code to your complexTypes (returnThings) script: BEGIN { local($^W) = 0; *SOAP::Serializer::gen_ns = sub {}; } and I found that I can
      Message 2 of 7 , Apr 23, 2004
      • 0 Attachment
        Nik,

        I added this code to your complexTypes (returnThings) script:

        BEGIN {
        local($^W) = 0;
        *SOAP::Serializer::gen_ns = sub {};
        }

        and I found that I can actually connect to the service without any errors
        since it overrides adding the namsp1 values. The only problem now is that
        the return values in the returnThings object are null. I'm not sure what the
        problem is at this point.

        Anyhow, thanks for sharing your code with me. I'll play around with that as
        well and we'll see what happens. Not sure about you, but I'm pretty
        frustrated. Hopefully perseverance will pay off. ;-)

        Thanks.

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