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

Re: [soaplite] Serializer problems

Expand Messages
  • Eric Bridger
    You need to use $client- call() method. my $method = SOAP::Data- name( someMethod ); my $result = $client- call($method = $data); Eric
    Message 1 of 5 , Mar 24, 2006
    • 0 Attachment
      You need to use $client->call() method.
      my $method = SOAP::Data->name('someMethod');

      my $result = $client->call($method => $data);

      Eric

      On Fri, 2006-03-24 at 09:30, Pieter Neerincx wrote:
      > Hi All,
      >
      > I'm still having big problems with the S::L (de)serialiser. The auto
      > typing doesn't work for me anymore. My content is recognised as
      > "anyURI" type, which is wrong and not de-serialised client-side.
      > Therefore I tried to override the type and send raw XML as documented
      > with:
      >
      > $data = SOAP::Data->type('xml' => $xml_content);
      > $result = $client->someMethod($data);
      >
      > However this gives me the error:
      >
      > "String value expected instead of SOAP::Data reference"
      >
      > Tried different types as well with the same result :(. Does anyone
      > have a clue what I'm doing wrong here?
      >
      > Cheers,
      >
      > Pieter
      >
      > On 30-Jan-2006, at 1:49 PM, Pieter Neerincx wrote:
      >
      > > Dear Byrne,
      > >
      > > I'm working with a framework where services are stored in a central
      > > database. A client searches this database and the database server
      > > returns WSDL data for the service that is found. The client uses the
      > > WSDL to execute the service. Service discovery, retrieval and
      > > execution are all done using SOAP. This used to work with SOAP::Lite
      > > 0.60, but I couldn't make it work with several of the beta's that
      > > came after that. Last week I tried 0.66 and unfortunately it still
      > > didn't work. So I started digging and finally found the problem. I
      > > could see that the WSDL is still generated by the database server and
      > > send back to the client. It even arrives client-side, but somewhere
      > > during the parsing of the result it vanished into thin air.
      > >
      > > The difference between the result from the database server running
      > > S::L 0.60 or 0.66 is in the <s-gensym3> tag:
      > >
      > > S::L 0.60: <s-gensym3 xsi:type="xsd:string">
      > >
      > > S::L 0.66: <s-gensym3 xsi:type="xsd:anyURI">
      > >
      > > So a response for S::L 0.60 starts like this:
      > >
      > > <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      > > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > > xmlns:soap="http://schemas.xmlsoap.org/soap/
      > > envelope/"><soap:Body><retrieveServiceResponse xmlns="http://
      > > bioinfw05/MOBY/Central"><s-gensym3 xsi:type="xsd:string"> ....
      > > result ....
      > >
      > > With the type = string it works, but the anyURI type that was added
      > > to later versions of S::L is not recognized by S::L on the client (I
      > > guess it's missing for some deserializer, but I'm not sure if this is
      > > the cruelpit). The result is that it is simply ignored. Serverside
      > > the anyURI thing is generated by:
      > >
      > > package SOAP::Serializer;
      > >
      > > ...some other subs...
      > >
      > > sub new {
      > > my $self = shift;
      > > return $self if ref $self;
      > > unless (ref $self) {
      > > my $class = ref($self) || $self;
      > > $self = bless {
      > > _level => 0,
      > > _autotype => 1,
      > > _readable => 0,
      > > _ns_uri => '',
      > > _ns_prefix => '',
      > > _use_default_ns => 1,
      > > _multirefinplace => 0,
      > > _seen => {},
      > > _typelookup => {
      > >
      > > ...some other types...
      > >
      > > 'anyURI' =>
      > > [95, sub { $_[0] =~ /^(urn:)|(http:\/\/)/i; },
      > > 'as_anyURI'],
      > > 'string' =>
      > > [100, sub {1}, 'as_string'],
      > >
      > > The WSDL info has namespaces that contain "http://" -> it is
      > > recognized as "anyURI". As a temporay fix I commented out the lines
      > > for anyURI in the sub above. This results in sending the result back
      > > as type = string making it work again. I assume the anyURI type was
      > > added for a good reason, so disabling it is not a long term
      > > solution... Could you please have a look at it?
      > >
      > > Thanks,
      > >
      > > Pieter
      > >
      > >
      > > Wageningen University and Research centre (WUR)
      > > Laboratory of Bioinformatics
      > > Transitorium (building 312) room 1034
      > > Dreijenlaan 3
      > > 6703 HA Wageningen
      > > The Netherlands
      > > phone: 0317-483 060
      > > fax: 0317-483 584
      > > mobile: 06-143 66 783
      > > pieter.neerincx@...
      > >
      > >
      > >
      > >
      > >
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      > >
      > >
      >
      >
      > Wageningen University and Research centre (WUR)
      > Laboratory of Bioinformatics
      > Transitorium (building 312) room 1034
      > Dreijenlaan 3
      > 6703 HA Wageningen
      > The Netherlands
      > phone: 0317-483 060
      > fax: 0317-483 584
      > mobile: 06-143 66 783
      > pieter.neerincx@...
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.