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

Problem with SOAP::Lite and DSML Client

Expand Messages
  • Bruno Grossmann
    Hello, I am presently trying to use SOAP::Lite in conjunction with Sun (jndi- based) DSML client. However, as can be expected, I am running in to some issues.
    Message 1 of 5 , Dec 15, 2003
    • 0 Attachment
      Hello,
      I am presently trying to use SOAP::Lite in conjunction with Sun (jndi-
      based) DSML client. However, as can be expected, I am running in to some
      issues. Below is the HTTP packet sent by the DSML client

      POST / HTTP/1.0
      Host: xxx.xxx.xxx.xxx:80
      Content-Type: text/xml; charset=utf-8
      Content-Length: 590
      SOAPAction: "#batchRequest"

      <?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:Body>
      <batchRequest 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">
      <filter>
      <present name="objectClass"/>
      </filter>
      </searchRequest>
      </batchRequest>
      </soap-env:Body>
      </soap-env:Envelope>

      And here is the error message from SOAP::Lite

      Search example failed.
      javax.naming.CommunicationException: [SOAP: fault code SOAP-ENV:Client -
      SOAPAction shall match 'uri#method' if present (got '#batchRequest',
      expected 'urn:oasis:names:tc:DSML:2:0:core#batchRequest'
      ]; remaining name 'objectclass=*'
      at
      com.sun.jndi.dsmlv2.soap.DsmlSoapClnt.mapSoapFaultToException(DsmlSoapClnt.java:505)
      .
      .
      .

      Now, I did a bit of research on the SOAPAction tag in the HTTP header,
      and I am not sure whether it is still mandatory in SOAP1.2 (can't tell
      from the SOAP 1.2 specs).
      I thus have a couple of questions:
      1) Is the SOAPAction tag still mandatory? If so, is the format coming
      from the DSML client valid (as far as I can tell, RFC 2396 seems to
      allow such syntax)?
      2) Is there a way to get SOAP::Lite to accept the DSML query? Right now,
      my SOAP gateway is minimal:

      use SOAP::Transport::HTTP;

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('/usr/local/apache/cgi-bin/','dds')
      -> handle;

      Thanks in advance for any help.

      Bruno Grossmann
    • Bruno Grossmann
      Using - on_action(sub{return}) does not solve my problem, although I get a different error: javax.naming.CommunicationException: [SOAP: fault code
      Message 2 of 5 , Dec 15, 2003
      • 0 Attachment
        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">), but I do not
        have any control over this. Any suggestions?

        On Mon, 2003-12-15 at 10:08, Bruno Grossmann wrote:
        Hello,
        I am presently trying to use SOAP::Lite in conjunction with Sun (jndi-
        based) DSML client. However, as can be expected, I am running in to some
        issues. Below is the HTTP packet sent by the DSML client

        POST / HTTP/1.0
        Host: xxx.xxx.xxx.xxx:80
        Content-Type: text/xml; charset=utf-8
        Content-Length: 590
        SOAPAction: "#batchRequest"

        <?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:Body>
        <batchRequest 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">
        <filter>
        <present name="objectClass"/>
        </filter>
        </searchRequest>
        </batchRequest>
        </soap-env:Body>
        </soap-env:Envelope>

        And here is the error message from SOAP::Lite

        Search example failed.
        javax.naming.CommunicationException: [SOAP: fault code SOAP-ENV:Client -
        SOAPAction shall match 'uri#method' if present (got '#batchRequest',
        expected 'urn:oasis:names:tc:DSML:2:0:core#batchRequest'
        ]; remaining name 'objectclass=*'
        at
        com.sun.jndi.dsmlv2.soap.DsmlSoapClnt.mapSoapFaultToException(DsmlSoapClnt.java:505)
        .
        .
        .

        Now, I did a bit of research on the SOAPAction tag in the HTTP header,
        and I am not sure whether it is still mandatory in SOAP1.2 (can't tell
        from the SOAP 1.2 specs).
        I thus have a couple of questions:
        1) Is the SOAPAction tag still mandatory? If so, is the format coming
        from the DSML client valid (as far as I can tell, RFC 2396 seems to
        allow such syntax)?
        2) Is there a way to get SOAP::Lite to accept the DSML query? Right now,
        my SOAP gateway is minimal:

        use SOAP::Transport::HTTP;

        SOAP::Transport::HTTP::CGI
        -> dispatch_to('/usr/local/apache/cgi-bin/','dds')
        -> handle;

        Thanks in advance for any help.

        Bruno Grossmann
        --
        Bruno Grossmann
        SSD - Federated Directory Infrastructure Services
        SGTI-GTIS
        PWGSC-TPSGC
        Place du Portage, Phase III - 2A1
        11 rue Laurier, Hull, Québec, Canada (K1A 0S5)
        Télephone: 819-956-1224 Télecopieur: 819-956-6476
      • Byrne Reese
        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(...);
        Message 3 of 5 , Jan 5, 2004
        • 0 Attachment
          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 :/
        • 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 4 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 5 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.