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

Interop with mssoap sp2

Expand Messages
  • hblarsen@image.dk
    Hi Im trying to get a soaplite client to talk to a simple mssoap service, but i keep getting the following error message from the client program: Can t call
    Message 1 of 5 , Aug 22, 2001
    • 0 Attachment
      Hi

      Im trying to get a soaplite client to talk to a simple mssoap
      service, but i keep getting the following error message from the
      client program:

      Can't call method "send_receive" on an undefined value at
      c:/perl/site/lib/SOAP/Lite.pm line 395.

      I'm using the examples from the "cookbook":

      ..
      use SOAP::Lite;
      my $remsvc = SOAP::Lite
      -> service('http://localhost:8080/demo1/simple1.wsdl');
      print $remsvc->Echo('Hello SOAP');
      ..

      The wsdl file is generated using wsdlgen.exe from the ms soaptoolkit.

      There's no problem calling my service from a client that uses the
      mssoap1.dll

      Any suggestions ?

      Regards Henrik
    • Paul Kulchenko
      Hi, Henrik! ... WSDL file could be helpful, but in most cases it means that WSDL parser couldn t find an address where call should be made. It s not an error
      Message 2 of 5 , Aug 22, 2001
      • 0 Attachment
        Hi, Henrik!

        > Im trying to get a soaplite client to talk to a simple mssoap
        > service, but i keep getting the following error message from the
        > client program:
        > Can't call method "send_receive" on an undefined value at

        WSDL file could be helpful, but in most cases it means that WSDL
        parser couldn't find an address where call should be made. It's not
        an error per se, because it's legal do not have this part in a
        service description and provide it later (like in
        examples/fullsearch.pl). However, in can be also the result of
        incorrect logic in handling multiple bindings in SOAP::Lite and
        structure of WSDL document, generated by MSSOAP toolkit. In addition
        to <soap:binding> element MS toolkit also generates <stk:binding>
        element before it, and SOAP::Lite skips <binding> element. If this is
        the case, you can either drop <stk:binding> element from your WSDL
        file, or update SOAP/Lite.pm (SOAP::Schema::WSDL::parser) from

        # is this a SOAP binding?
        next unless
        $_->binding->uri eq 'http://schemas.xmlsoap.org/wsdl/soap/';

        to

        # is this a SOAP binding?
        next unless grep
        { $_->uri eq 'http://schemas.xmlsoap.org/wsdl/soap/' } $_->binding;

        Hope it helps. Next version should handle this case properly. Let me
        know if it's something else.

        Best wishes, Paul.

        --- hblarsen@... wrote:
        > Hi
        >
        > Im trying to get a soaplite client to talk to a simple mssoap
        > service, but i keep getting the following error message from the
        > client program:
        >
        > Can't call method "send_receive" on an undefined value at
        > c:/perl/site/lib/SOAP/Lite.pm line 395.
        >
        > I'm using the examples from the "cookbook":
        >
        > ..
        > use SOAP::Lite;
        > my $remsvc = SOAP::Lite
        > -> service('http://localhost:8080/demo1/simple1.wsdl');
        > print $remsvc->Echo('Hello SOAP');
        > ..
        >
        > The wsdl file is generated using wsdlgen.exe from the ms
        > soaptoolkit.
        >
        > There's no problem calling my service from a client that uses the
        > mssoap1.dll
        >
        > Any suggestions ?
        >
        > Regards Henrik
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Make international calls for as low as $.04/minute with Yahoo! Messenger
        http://phonecard.yahoo.com/
      • Henrik Buch-Larsen
        Hi Paul The correction to Lite.pm resulted in another error: Can t call method uri on an undefined value at c:/perl/site/lib/SOAP/Lite.pm l ine 2191. Attempt
        Message 3 of 5 , Aug 23, 2001
        • 0 Attachment
          Hi Paul

          The correction to Lite.pm resulted in another error:

          Can't call method "uri" on an undefined value at
          c:/perl/site/lib/SOAP/Lite.pm l
          ine 2191.
          Attempt to free unreferenced scalar.

          The wsdl for my service is as following:

          <?xml version='1.0' encoding='UTF-8' ?>
          <!-- Generated 08/20/01 by Microsoft SOAP Toolkit WSDL File
          Generator, Version 1.02.813.0 -->
          <definitions name ='Simple1' targetNamespace
          = 'http://tempuri.org/wsdl/'
          xmlns:wsdlns='http://tempuri.org/wsdl/'
          xmlns:typens='http://tempuri.org/type'
          xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
          xmlns:xsd='http://www.w3.org/2001/XMLSchema'
          xmlns:stk='http://schemas.microsoft.com/soap-toolkit/wsdl-
          extension'
          xmlns='http://schemas.xmlsoap.org/wsdl/'>
          <types>
          <schema targetNamespace='http://tempuri.org/type'
          xmlns='http://www.w3.org/2001/XMLSchema'
          xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
          xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
          elementFormDefault='qualified'>
          </schema>
          </types>
          <message name='Simple1.Echo'>
          <part name='x' type='xsd:string'/>
          </message>
          <message name='Simple1.EchoResponse'>
          <part name='Result' type='xsd:string'/>
          <part name='x' type='xsd:string'/>
          </message>
          <portType name='Simple1SoapPort'>
          <operation name='Echo' parameterOrder='x'>
          <input message='wsdlns:Simple1.Echo' />
          <output message='wsdlns:Simple1.EchoResponse' />
          </operation>
          </portType>
          <binding name='Simple1SoapBinding' type='wsdlns:Simple1SoapPort' >
          <stk:binding preferredEncoding='UTF-8'/>
          <soap:binding style='rpc'
          transport='http://schemas.xmlsoap.org/soap/http' />
          <operation name='Echo' >
          <soap:operation
          soapAction='http://tempuri.org/action/Simple1.Echo' />
          <input>
          <soap:body use='encoded'
          namespace='http://tempuri.org/message/'

          encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
          </input>
          <output>
          <soap:body use='encoded'
          namespace='http://tempuri.org/message/'

          encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
          </output>
          </operation>
          </binding>
          <service name='Simple1' >
          <port name='Simple1SoapPort' binding='wsdlns:Simple1SoapBinding' >
          <soap:address
          location='http://localhost:8080/demo1/Simple1.ASP' />
          </port>
          </service>
          </definitions>


          When i try to access the webservice directly from the soaplite client
          with the following code:

          $s = SOAP::Lite
          -> proxy('http://localhost:8080/demo1/Simple1.asp')
          -> uri('http://tempuri.org/action/Simple1.Echo');

          print $s->Echo('Hello SOAP')->result;

          ..i get a soap fault from mssoap:

          The operation requested in the Soap message with soapAction
          http://tempuri.org/action/Simple1.Echo#Echo isn't defined in the WSDL
          file. This may be because it is in the wrong namespace or has
          incorrect case.

          A trace shows that the soap header from the soaplite client request
          contains the soapaction as specified above...what i want it to be is:

          http://tempuri.org/action/Simple1.Echo

          I dont know if the two problems are connected.

          Regards Henrik
        • Paul Kulchenko
          Hi, Henrik! ... Looks like patch had been applied incorrectly. ... *************** *** 2186,2192 **** my $endpoint = ref $_- address ? $_- address- location :
          Message 4 of 5 , Aug 23, 2001
          • 0 Attachment
            Hi, Henrik!

            --- Henrik Buch-Larsen <hblarsen@...> wrote:
            > The correction to Lite.pm resulted in another error:
            >
            > Can't call method "uri" on an undefined value at
            > c:/perl/site/lib/SOAP/Lite.pm l
            > ine 2191. Attempt to free unreferenced scalar.
            Looks like patch had been applied incorrectly.

            *** Lite.pm.org
            --- Lite.pm.patch
            ***************
            *** 2186,2192 ****
            my $endpoint = ref $_->address ? $_->address->location :
            undef;
            foreach ($s->binding) {
            # is this a SOAP binding?
            ! next unless $_->binding->uri eq
            'http://schemas.xmlsoap.org/wsdl/soap/';
            next unless $_->name eq $binding;
            my $porttype = SOAP::Utils::disqualify($_->type);
            foreach ($_->operation) {
            --- 2186,2192 ----
            my $endpoint = ref $_->address ? $_->address->location :
            undef;
            foreach ($s->binding) {
            # is this a SOAP binding?
            ! next unless grep { $_->uri eq
            'http://schemas.xmlsoap.org/wsdl/soap/' } $_->binding;
            next unless $_->name eq $binding;
            my $porttype = SOAP::Utils::disqualify($_->type);
            foreach ($_->operation) {

            > The wsdl for my service is as following:
            Works for me with your WSDL file.

            > When i try to access the webservice directly from the soaplite
            > client with the following code:
            >
            > $s = SOAP::Lite
            > -> proxy('http://localhost:8080/demo1/Simple1.asp')
            > -> uri('http://tempuri.org/action/Simple1.Echo');
            >
            > print $s->Echo('Hello SOAP')->result;
            >
            > ..i get a soap fault from mssoap:
            >
            > The operation requested in the Soap message with soapAction
            > http://tempuri.org/action/Simple1.Echo#Echo isn't defined in the
            > WSDL
            > file. This may be because it is in the wrong namespace or has
            > incorrect case.
            >
            > A trace shows that the soap header from the soaplite client request
            > contains the soapaction as specified above...what i want it to be
            > is:
            >
            > http://tempuri.org/action/Simple1.Echo
            >
            > I dont know if the two problems are connected.
            They are not. YOu may specify SOAPAction header with on_action:

            > $s = SOAP::Lite
            > -> proxy('http://localhost:8080/demo1/Simple1.asp')
            -> on_action(sub{'"http://tempuri.org/action/Simple1.Echo"'})
            > -> uri('http://tempuri.org/action/Simple1.Echo');

            Since on_action handler receives URI and method you can also do:

            -> on_action(sub{sprintf'"%s"',shift})

            to do not hardcode SOAPAction. Let me know if it doesn't help.

            Best wishes, Paul.

            __________________________________________________
            Do You Yahoo!?
            Make international calls for as low as $.04/minute with Yahoo! Messenger
            http://phonecard.yahoo.com/
          • Henrik Buch-Larsen
            Hi Paul You were right. The patch was not correctly applied. Everything works well now. Thank you very much for your help. Regards Henrik
            Message 5 of 5 , Aug 24, 2001
            • 0 Attachment
              Hi Paul

              You were right. The patch was not correctly applied. Everything works
              well now. Thank you very much for your help.

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