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

Re: [soaplite] .NET client and Soap-Lite Server?

Expand Messages
  • Paul Kulchenko
    Hi, Weidong! ... You may specify not only SOAPAction, but also URI value: - dispatch_with({ http://someurl/ = Test }); which means ALL requests with this
    Message 1 of 11 , Sep 21, 2001
    • 0 Attachment
      Hi, Weidong!

      > But if I say
      >
      > dispatch_with({'http://someurl/method1' => 'Test' });
      >
      > method1 call works. But other method calls do not. So I have to
      > list them all to make all work. Is there an easy way to say all
      > methods are in this Test class?
      You may specify not only SOAPAction, but also URI value:

      ->dispatch_with({'http://someurl/' => 'Test' });

      which means "ALL requests with this URI will go to class 'Test'". URI
      should be EXACTLY the same, so check trailing slash in your case.

      I also double checked, and you DO NOT need to include
      ->on_dispatch('Test')
      with dispatch_with call mentioned above. This logic is already there
      ;).

      Best wishes, Paul.

      --- Weidong Wang <wwang@...> wrote:
      > Sorry, I think I made a mistake in describing my problem.
      >
      > On the server side, I implement all my methods (call it method1,
      > method2, ..., methodn) in a package called Test.pm. In my
      > daemon.pl, I "use Test", and do "dispatch_to('Test').
      >
      > With .NET client, the SoapAction looks like:
      >
      > SoapAction: http://someurl/method1
      >
      > With just "dispatch_to('Test')", I got the error like:
      >
      > SOAP::Serializer::envelope: Client Failed to access class
      > (method1): Can't locate method1.pm in @INC (@INC contains:) at
      > (eval 88) line 3.
      >
      > But if I say
      >
      > dispatch_with({'http://someurl/method1' => 'Test' });
      >
      > method1 call works. But other method calls do not. So I have to
      > list them all to make all work. Is there an easy way to say all
      > methods are in this Test class?
      >
      > Thanks.
      >
      > Weidong
      >
      > ----- Original Message -----
      > From: Paul Kulchenko
      > To: soaplite@yahoogroups.com
      > Sent: Thursday, September 20, 2001 11:25 PM
      > Subject: Re: [soaplite] .NET client and Soap-Lite Server?
      >
      >
      > Hi, Weidong!
      >
      > > name, like http://someurl/Test). I tried to use static
      > dispatching
      > > dispatch_to('My::Class'). or dispatch_with with just the URI
      > part,
      > > but the server complains:
      > >
      > > SOAP::Serializer::envelope: Client Failed to access class
      > (Test):
      > > Can't locate Test.pm in @INC (@INC contains:) at (eval 88) line
      > 3.
      > It's because you're using dispatch_to('My::Class') instead of
      > dispatch_to('Your::Class'). Just kidding.
      >
      > It's because you're making static dispatch for 'My::Class', but
      > using
      > 'Test' class. My::Class is just an example. If you want dispatch
      > to
      > 'Test' you need to do:
      >
      > ->dispatch_to('Test')
      > ->dispatch_with({'http://someurl/Test' => 'Test'})
      >
      > and everything should work. Let me know if it doesn't.
      >
      > > I suppose I can use dispatch_with to list all my methods, but
      > why
      > > doesn't static dispatch work?
      > You may, but you don't need to.
      >
      > Best wishes, Paul.
      >
      > --- Weidong Wang <wwang@...> wrote:
      > > Thanks alot.
      > >
      > > Last question, so far I can only get it to work with
      > dispatch_with
      > > to give the full SoapAction specification (including the method
      > > name, like http://someurl/Test). I tried to use static
      > dispatching
      > > dispatch_to('My::Class'). or dispatch_with with just the URI
      > part,
      > > but the server complains:
      > >
      > > SOAP::Serializer::envelope: Client Failed to access class
      > (Test):
      > > Can't locate Test.pm in @INC (@INC contains:) at (eval 88) line
      > 3.
      > >
      > > I suppose I can use dispatch_with to list all my methods, but
      > why
      > > doesn't static dispatch work?
      > >
      > > Thanks again.
      > >
      > > Weidong
      > > ----- Original Message -----
      > > From: Paul Kulchenko
      > > To: soaplite@yahoogroups.com
      > > Sent: Thursday, September 20, 2001 10:39 PM
      > > Subject: Re: [soaplite] .NET client and Soap-Lite Server?
      > >
      > >
      > > Hi, Weidong!
      > >
      > > Oops. You're right. Forgot to tell. SOAPAction is checked
      > against
      > > URI#method combination, so just disable this check on server
      > side
      > > with
      > >
      > > ->on_action(sub{return})
      > >
      > > I will probably do it by default in future versions, because
      > > SOAP1.2
      > > is heading toward optional SOAPAction, so server will not
      > mandate
      > > it.
      > >
      > > As for @INC problem. It's rather feature I'd like to change.
      > To
      > > get
      > > desired result you need to put your class ALSO in
      > dispatch_to:
      > >
      > > ->dispatch_to('My::Class')
      > >
      > > You need to do it only if you are loading other classes (or
      > you
      > > can
      > > follow Dana's advice). I'll update the code, so you won't
      > need to
      > > do
      > > that.
      > >
      > > Best wishes, Paul.
      > >
      > > --- Weidong Wang <wwang@...> wrote:
      > > > Got past this one. But it still does not work for me.
      > > >
      > > > I am using Soap-Lite client to simulate .NET client by
      > sending
      > > a
      > > > request with SoapAction in the format of:
      > > >
      > > > SoapAction: http://someurl/Test (Test is the method
      > > name)
      > > >
      > > > I tried both dispatch_to with static dispatch and
      > dispatch_with
      > > for
      > > > SoapAction matching. But the server is not happy:
      > > >
      > > > SOAP::Serializer::envelope: Client SOAPAction shall match
      > > > 'uri#method' if present (got 'http://someurl/Test',
      > expected
      > > > 'http://someuri/Test#Test'
      > > >
      > > > So it seems to me that the SOAP-Lite server is insisting on
      > > seeing
      > > > "uri#method" format, which .NET is not giving.
      > > >
      > > > Did I miss anything here?
      > > >
      > > > Thanks for all the help.
      > > >
      > > > Weidong
      > > >
      > > > ----- Original Message -----
      > > > From: Dana Powers
      > > > To: soaplite@yahoogroups.com
      > > > Sent: Thursday, September 20, 2001 8:20 PM
      > > > Subject: Re: [soaplite] .NET client and Soap-Lite Server?
      > > >
      > > >
      > > > Either
      > > >
      > > > ## Pull in file explicitly
      > > > require '/path/to/your/modules/module.pm';
      > > >
      > > > or
      > > >
      > > > ## Add script specific directory to search path
      > > > use lib '/path/to/your/modules/';
      > > >
      > > > then
      > > >
      > > > use module;
      > > >
      > > > dpk
      > > > ----- Original Message -----
      > > > From: Weidong Wang
      > > > To: soaplite@yahoogroups.com
      > > > Sent: Thursday, September 20, 2001 5:00 PM
      > > > Subject: Re: [soaplite] .NET client and Soap-Lite
      > Server?
      > > >
      > > >
      > > > Thanks for the quick reply. Now I have the problem that
      > the
      > > > server complains that it fails to access my class: can't
      > locate
      > > > myclass.pm in @INC (@INC contains:).
      > > >
      > > > I tried adding
      >
      === message truncated ===


      __________________________________________________
      Terrorist Attacks on U.S. - How can you help?
      Donate cash, emergency relief information
      http://dailynews.yahoo.com/fc/US/Emergency_Information/
    • Weidong Wang
      Sorry, Paul. URI s dispatch_with() does not work. I got client failed to access error. I did have trailign slash. Also, when you say on_dispatch(), you meant
      Message 2 of 11 , Sep 21, 2001
      • 0 Attachment
        Sorry, Paul. URI's dispatch_with() does not work. I got client failed to access error. I did have trailign slash.
         
        Also, when you say on_dispatch(), you meant dispatch_to()? The code does not like on_dispatch().
         
        Oh, to make the server responding to both .NET client and soap-lite client, I needed both dispatch_to('Class') and dispatch_with() with exact SoapAction for each method. That is what is working for me now.
         
         
        Weidong
         
        ----- Original Message -----
        Sent: Friday, September 21, 2001 2:11 PM
        Subject: Re: [soaplite] .NET client and Soap-Lite Server?

        Hi, Weidong!

        > But if I say
        >
        >     dispatch_with({'http://someurl/method1' => 'Test' });
        >
        > method1 call works. But other method calls do not. So I have to
        > list them all to make all work. Is there an easy way to say all
        > methods are in this Test class?
        You may specify not only SOAPAction, but also URI value:

          ->dispatch_with({'http://someurl/' => 'Test' });

        which means "ALL requests with this URI will go to class 'Test'". URI
        should be EXACTLY the same, so check trailing slash in your case.

        I also double checked, and you DO NOT need to include
        ->on_dispatch('Test')
        with dispatch_with call mentioned above. This logic is already there
        ;).

        Best wishes, Paul.

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