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

maptype

Expand Messages
  • floriantreml
    Hi! I m using a webservice which takes a complex object, which is defined in an xsd file, as parameter. I have to set the namespace of this element by using
    Message 1 of 2 , Nov 29, 2002
    • 0 Attachment
      Hi!
      I'm using a webservice which takes a complex object, which is defined
      in an xsd file, as parameter. I have to set the namespace of this
      element by using the maptype-Funktion.
      The name of the type contains some dots, as the schema is
      automatically generated from a Java-Class.

      $terminal_ws->maptype->{'at.co.sbs.kixfs.agent.command.CommandData'}
      = 'http://www.terminal.com/schemas/TerminalRemoteInterface';

      The problem is that the soap type isn't mapped to this namespace
      while serializing, it is always mapped to the default
      namespace "http://namespaces.soaplite.org/..". I think the problem is
      due to the dots in the typename: As soon as I remove the package part
      of the typename and using this type when building the soap object,
      the element is correctly set into the given namespace (but, of
      course, the soap server doesn't recognize the element any more).
      Can anyone help me ?
      thanks in advance,
      Treml Florian

      my $terminal_ws = SOAP::Lite
      -> serializer(MySerializer -> new)
      -> uri('http://sbs.co.at/ejb.Terminal')
      -> proxy
      ('http://localhost:8081/kixfswebservices/servlet/rpcrouter');

      $terminal_ws->maptype->{'at.co.sbs.kixfs.agent.command.CommandData'}
      = 'http://www.terminal.com/schemas/TerminalRemoteInterface';

      my $commanddata = SOAP::Data->name("command")
      ->type("at.co.sbs.kixfs.agent.command.CommandData")
      ->uri("http://sbs.co.at/ejb.Terminal")
      ->value([
      SOAP::Data->name("terminalID")->value("R001J001"),
      SOAP::Data->name("source")->value("sendcommand.pl"),
      SOAP::Data->name("command")->value("openTerminal"),
      SOAP::Data->name("commandID")->value("0815") ]);

      my $result = $terminal_ws -> executeCommand($commanddata);
    • Duncan Cameron
      ... It looks as if you must specify the type as a Perl package name when using maptype(). This seems to work: $soap- maptype({
      Message 2 of 2 , Dec 1, 2002
      • 0 Attachment
        On 2002-11-29 floriantreml wrote:
        >Hi!
        >I'm using a webservice which takes a complex object, which is defined
        >in an xsd file, as parameter. I have to set the namespace of this
        >element by using the maptype-Funktion.
        >The name of the type contains some dots, as the schema is
        >automatically generated from a Java-Class.
        >
        >$terminal_ws->maptype->{'at.co.sbs.kixfs.agent.command.CommandData'}
        >= 'http://www.terminal.com/schemas/TerminalRemoteInterface';
        >
        >The problem is that the soap type isn't mapped to this namespace
        >while serializing, it is always mapped to the default
        >namespace "http://namespaces.soaplite.org/..". I think the problem is
        >due to the dots in the typename: As soon as I remove the package part
        >of the typename and using this type when building the soap object,
        >the element is correctly set into the given namespace (but, of
        >course, the soap server doesn't recognize the element any more).
        >Can anyone help me ?
        >thanks in advance,
        >Treml Florian
        >
        >my $terminal_ws = SOAP::Lite
        > -> serializer(MySerializer -> new)
        > -> uri('http://sbs.co.at/ejb.Terminal')
        > -> proxy
        >('http://localhost:8081/kixfswebservices/servlet/rpcrouter');
        >
        >$terminal_ws->maptype->{'at.co.sbs.kixfs.agent.command.CommandData'}
        >= 'http://www.terminal.com/schemas/TerminalRemoteInterface';
        >
        >my $commanddata = SOAP::Data->name("command")
        > ->type("at.co.sbs.kixfs.agent.command.CommandData")
        > ->uri("http://sbs.co.at/ejb.Terminal")
        > ->value([
        > SOAP::Data->name("terminalID")->value("R001J001"),
        > SOAP::Data->name("source")->value("sendcommand.pl"),
        > SOAP::Data->name("command")->value("openTerminal"),
        > SOAP::Data->name("commandID")->value("0815") ]);
        >
        >my $result = $terminal_ws -> executeCommand($commanddata);
        >

        It looks as if you must specify the type as a Perl package name
        when using maptype(). This seems to work:

        $soap->maptype({
        'at::co::sbs::kixfs::agent::command::CommandData' =>
        'http://www.terminal.com/schemas/TerminalRemoteInterface'
        });

        my $a = SOAP::Data
        ->name('p1')
        ->type('at.co.sbs.kixfs.agent.command.CommandData', '&&<<>>');

        If in doubt, then dig around in the innards of SOAP::Lite, see the
        maptypetouri() method for what's going on.

        Regards,
        Duncan Cameron
      Your message has been successfully submitted and would be delivered to recipients shortly.