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

Re: [soaplite] Re: Problem with SOAP::Lite and DSML Client

Expand Messages
  • Bruno Grossmann
    Byrne, Thanks for the feedback. According to the DSML v2 documentation, the base URN for DSMLv2 is oasis:names:tc:DSML:2:0:core; an example request should look
    Message 1 of 5 , Jan 6, 2004
    • 0 Attachment
      Byrne,
      Thanks for the feedback.
      According to the DSML v2 documentation, the base URN
      for DSMLv2 is oasis:names:tc:DSML:2:0:core; an example
      request should look like

      <batchRequest xmlns="oasis:names:tc:DSML:2:0:core">
      <searchRequest>...</searchRequest>
      </batchRequest>

      Now, the presence of colons in the namespace is what
      is causing problems to Lite.pm, in the subroutine
      find_target at line

      eval 'local $^W; ' . "require $class";

      I temporarily modified the Lite.pm module to deal with
      the colons in my particular case. However, if
      namespaces with colons are valid (and if I am not
      doing anything wrong), Lite.pm may have to be modified
      to deal with these particular cases


      --- Byrne Reese <byrne@...> a écrit :
      > I am very surprised by this error. The on_action
      > call should help you
      > construct whatever SOAP Action header you need.
      >
      > $soap = SOAP::Lite->proxy(...)->uri(...);
      > $soap->on_action(sub { return
      > 'oasis:names:tc:DSML:2:0:core' });
      >
      > Or whatever. But a SOAP Action header must be a URI,
      > so the colons proably
      > shouldn't be there as you suspect.
      >
      > I might try something like:
      > $soap->on_action(sub { return
      > 'oasis.names.tc.DSML.2.0.core#methodname' });
      >
      > But that too looks like a really weird SOAP Action.
      > I would expect you to
      > reference a java package name or something.
      > 'oasis.names.tc.DSML.2.0.core'
      > seems too clunky.
      >
      > >
      > >
      > >
      > >
      > > Using
      > >
      > > -< on_action(sub{return})
      > >
      > > does not solve my problem, although I get a
      > different error:
      > >
      > > javax.naming.CommunicationException: [SOAP: fault
      > code SOAP-ENV:Client -
      > > Failed
      > > to access class (oasis:names:tc:DSML:2:0:core):
      > syntax error at (eval
      > > 86) line 1, near "require oasis:"
      > > ]; remaining name 'objectclass=*'
      > > at
      > >
      >
      com.sun.jndi.dsmlv2.soap.DsmlSoapClnt.mapSoapFaultToException(DsmlSoapClnt.java:505)
      > > .
      > > .
      > > .
      > >
      > > I guess this error has to do with the colons in
      > the namespace
      > > (>batchRequest
      > xmlns="urn:oasis:names:tc:DSML:2:0:core"?xml
      > > version='1.0' encoding='UTF-8'?soap-env:Envelope
      > >
      >
      xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
      > >
      >
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      > >
      >
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"soap-env:BodybatchRequest
      > >
      >
      xmlns="urn:oasis:names:tc:DSML:2:0:core"searchRequest
      > > dn="ou=hermes,o=gc,c=ca" scope="singleLevel"
      > > derefAliases="neverDerefAliases"
      > timeLimit="3600"
      > > sizeLimit="2000"
      > > typesOnly="false"filterpresent
      > >
      >
      name="objectClass"//filter/searchRequest/batchRequest/soap-env:Body/soap-env:Envelope
      > >
      > >
      > >
      > >
      > > To unsubscribe from this group, send an email to:
      > > soaplite-unsubscribe@yahoogroups.com
      > >
      > >
      > >
      > >
      > >
      > > Your use of Yahoo! Groups is subject to the Yahoo!
      > Terms of Service.
      > >
      > >
      > >
      > >
      > >
      >
      >
      > ^byrne :/

      __________________________________________________________
      Lèche-vitrine ou lèche-écran ?
      magasinage.yahoo.ca
    • Bruno Grossmann
      Here is another solution I came up with to solve my problem. The advantage of this one is that I can use my script with the original Lite.pm module. However,
      Message 2 of 5 , Jan 9, 2004
      • 0 Attachment
        Here is another solution I came up with to solve my
        problem. The advantage of this one is that I can use
        my script with the original Lite.pm module. However,
        it is really cludgy, so I would appreciate any
        comments on making it more robust.

        #!/usr/bin/perl
        use SOAP::Transport::HTTP;
        #use MonSerialiseur;

        SOAP::Transport::HTTP::CGI
        # specify path to My/Examples.pm here
        -> deserializer(MonDeserialiseur->new)
        -> serializer(MonSerialiseur->new)
        -> dispatch_to('oasis')
        -> on_action(sub{return})
        -> handle();


        BEGIN
        {
        package MonSerialiseur;
        @MonSerialiseur::ISA='SOAP::Serializer';
        sub envelope
        {
        @bla=@_;

        $bla[2]=SOAP::Data->name('batchResponse')->prefix('')->uri('urn:oasis:names:tc:DSML:2:0:core')
        if $_[1] =~ /^(?:method|response)$/;
        @_=@bla;
        shift->SUPER::envelope(@_)
        }
        package MonDeserialiseur;
        @MonDeserialiseur::ISA='SOAP::Deserializer';
        sub decode_object
        {
        @bla=@_;
        if ((ref $bla[1] eq 'ARRAY')&&(${$bla[1]}[0] =~
        /\w*:+batchRequest/))
        {
        foreach my $key (%{${$bla[1]}[1]})
        {
        ${${$bla[1]}[1]}{$key} =~
        s/urn:oasis:names:tc:DSML:2:0:core/oasis/;
        }
        }
        @_=@bla;
        shift->SUPER::decode_object(@_)
        }
        }

        __________________________________________________________
        Lèche-vitrine ou lèche-écran ?
        magasinage.yahoo.ca
      Your message has been successfully submitted and would be delivered to recipients shortly.