Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

soaplite · SOAP::Lite for Perl (soaplite.com)

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 1205
  • Category: Protocols
  • Founded: Jan 28, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 6308 - 6337 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#6308 From: rahed <raherh@...>
Date: Tue Mar 24, 2009 7:41 pm
Subject: Re: How do I add custom trace callbacks?
raherh
Send Email Send Email
 
Petar Shangov <pshangov@...> writes:

> Hi, I have tried enabling all traces but that is no what I need. +trace->'all'
gives me this:
>
> SOAP::Transport::new: ()
> SOAP::Serializer::new: ()
> SOAP::Deserializer::new: ()
> SOAP::Parser::new: ()
> SOAP::Server::new: ()
> SOAP::Transport::HTTP::Server::new: ()
> SOAP::Transport::HTTP::Daemon::new: ()
> Contact to SOAP server at http://localhost:8080/
> SOAP::Server::handle: ()
> SOAP::Deserializer::deserialize: ()
> SOAP::Parser::decode: ()
> SOAP::SOM::new: ()
> SOAP::Data::new: ()
> SOAP::Data::DESTROY: ()
> (eval): HASH(0x145635c) HASH(0x1471264)
> SOAP::Data::new: ()
> SOAP::Server::handle: SOAP::Data=HASH(0x14e7a7c)
> SOAP::Serializer::envelope: ()
> SOAP::Serializer::envelope: get_setResponse SOAP::Data=HASH(0x14e7a7c)
> SOAP::Data::new: ()
> SOAP::Data::new: ()
> SOAP::Data::new: ()
> SOAP::Data::new: ()
> SOAP::Data::new: ()
> SOAP::SOM::DESTROY: ()

Apparently you access your local server. I haven't tried this. When you
call a remote host you must get what you want, xml request & response.

I guess the trace is not enabled for your particular case or the service
is called wrongly.

For instance when calling

$soap = SOAP::Lite->new(
			 uri   => ("http://www.webserviceX.NET"),
			 proxy => ('http://www.webservicex.com/globalweather.asmx' ),
		        );

the trace is like this:

SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Data::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: GetCitiesByCountry SOAP::Data=HASH(0xe91964)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0xea1d14)
SOAP::Transport::HTTP::Client::send_receive: POST
http://www.webservicex.com/globalweather.asmx HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 552
Content-Type: text/xml; charset=utf-8
SOAPAction: http://www.webserviceX.NET/GetCitiesByCountry

<?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>
     <GetCitiesByCountry xmlns="http://www.webserviceX.NET">
       <CountryName xsi:type="xsd:string">Singapore</CountryName>
     </GetCitiesByCountry>
   </soap:Body>
</soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1091a9c)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Date: Tue, 24 Mar 2009 19:36:05 GMT
Server: Microsoft-IIS/6.0
Content-Length: 702
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 24 Mar 2009 19:36:13 GMT
Client-Peer: 209.162.186.60:80
Client-Response-Num: 1
X-AspNet-Version: 1.1.4322
X-Powered-By: ASP.NET

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetCitiesByCountryRespo\
nse
xmlns="http://www.webserviceX.NET"><GetCitiesByCountryResult><NewDataSet>
   <Table>
     <Country>Singapore</Country>
     <City>Singapore / Paya Lebar</City>
   </Table>
   <Table>
     <Country>Singapore</Country>
     <City>Singapore / Changi Airport</City>
   </Table>
</NewDataSet></GetCitiesByCountryResult></GetCitiesByCountryResponse></soa\
p:Body></soap:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
SOAP::SOM::DESTROY: ()
SOAP::Lite::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()


--
Radek

#6309 From: Lee Carmichael <lecar_red@...>
Date: Wed Mar 25, 2009 5:37 pm
Subject: Re: Re: How do I add custom trace callbacks?
lecar_red
Send Email Send Email
 
Hello Petar,

After seeing your example, I just realized that you are trying to debug a server. Sorry my last post won't be much help since it seems that transport level debugging is a client only option.

It seems that most of the server code doesn't have any trace statements besides the empty create/destroy ones (you can see these as SOAP::Trace::trace( '()' ) ).

You tell what is traceable by looking through the code for SOAP::Trace::<signal>. For example in SOAP::Lite under the package SOAP::Server you can see an entry like:

    SOAP::Trace::result(@results);

It seems that you could get information from parameters or results for servers. Which doesn't strike me as terribly helpful.

I did have an idea that i tested out. Since you said you were trying to debug request and responses, these will get passed to the deserializer and serializer. I was able to write a stub that logs the requests by sub classing the existing deserializer class into one that includes logging.

Here is an example:

#!/usr/local/bin/perl5

use SOAP::Lite +trace => 'all';
use SOAP::Transport::HTTP;
use warnings;
use strict;

package DebugDS;

use SOAP::Lite;
use Data::Dumper qw(Dumper);
our @ISA =  qw( SOAP::Deserializer ); ## can't use base due to error about deserializer not returning true...

sub deserialize {
    SOAP::Trace::trace('()');
    my $self = shift;

    SOAP::Trace::trace( $_[0] );

    return $self->SUPER::deserialize( @_ );
}

package main;

my $daemon;
my $end_port = 9905;
my $started = 0;

foreach (my $port = 9900; $port <= $end_port; $port++ ) {
    eval {
        $daemon = SOAP::Transport::HTTP::Daemon
            -> new( LocalAddr => 'localhost', LocalPort => $port )
            -> dispatch_to( '../../lib/', 'TestSoap' )
            -> deserializer( DebugDS->new );
    };

    if (!$@) {
        $started = 1;
        last;
    }
}

if (! $started ) { die "ERROR: Failed to start webserver: $@\n"; }

print "Contact to SOAP server at ", $daemon->url, " ($$)\n";

$daemon->handle;

exit;
------------------------------------------

I'm sure you could do something similar to SOAP::Transport::HTTP::Daemon by using a sub class to do custom processing of the accept and dumping out the request/response content. Maybe I'll look at that tonight.

HTH,

Lee

#6310 From: Petar Shangov <pshangov@...>
Date: Wed Mar 25, 2009 6:06 pm
Subject: Re: How do I add custom trace callbacks?
pshangov
Send Email Send Email
 
Hi,

thanks to everyone who responded.

----- Original Message ----
> From: rahed <raherh@...>
> To: Petar Shangov <pshangov@...>
> Cc: soaplite@yahoogroups.com
> Sent: Tuesday, 24 March, 2009 21:41:48
> Subject: Re: [soaplite] How do I add custom trace callbacks?
>
> Apparently you access your local server. I haven't tried this. When you
> call a remote host you must get what you want, xml request & response.
>
> I guess the trace is not enabled for your particular case or the service
> is called wrongly.
>
> For instance when calling
>
> $soap = SOAP::Lite->new(
>             uri   => ("http://www.webserviceX.NET"),
>             proxy => ('http://www.webservicex.com/globalweather.asmx' ),
>                );
>
> the trace is like this:
>
> ...

rahed,

the problem turned out to be that all the relevant tracing calls are made inside
SOAP::Transport::HTTP::Client and so this code does not work when S::L is used
as a server, which is my case.



----- Original Message ----
> From: Peter Farr <Peter.Farr@...>
> To: Petar Shangov <pshangov@...>
> Sent: Tuesday, 24 March, 2009 20:43:13
> Subject: Re: How do I add custom trace callbacks?
>
> Peter, I typed this response into the Yahoo group but I haven't seen it
> show up yet, so here it is again:
>
> I can get your daemon to print to a log and to stdout with the following
> change:
>
> use SOAP::Lite +trace => [ all =>
>     sub {
>         open LOGFILE,">>trace.log";
>         print LOGFILE "This:" . $_[0] . "\n";
>         close LOGFILE;
>         warn("This:" . $_[0] . "\n");
>     }
>
> ];
>
> When I change "all" to "debug" it stops working, but "transport" (or any
> other valid value) works okay. I suspect a conflict between debug and
> the SOAP::Transport::HTTP::Daemon code. I don't know what is causing it,
> but you could always file a bug and see what happens.

Peter,

I got this to work, but it still did not print out the request and response
strings. The 'debug' option does not work since when used as a server, S::L
encounters no calls to SOAP::Trace::debug() during its lifetime. I ended up
inserting these calls manually, and submitted a bug report
(https://rt.cpan.org/Ticket/Display.html?id=44568).

> From: Lee Carmichael <lecar_red@...>
> To: Petar Shangov <pshangov@...>; soaplite@yahoogroups.com
> Sent: Wednesday, 25 March, 2009 19:37:40
> Subject: Re: [soaplite] Re: How do I add custom trace callbacks?
>
> Hello Petar,
>
> After seeing your example, I just realized that you
are trying to debug a server. Sorry my last post won't be much help
since it seems that transport level debugging is a client only option.
>
> It
seems that most of the server code doesn't have any trace statements
besides the empty create/destroy ones (you can see these as
SOAP::Trace::trace( '()' ) ).
>
> You tell what is traceable by
looking through the code for SOAP::Trace::<signal>. For example
in SOAP::Lite under the package SOAP::Server you can see an entry like:
>
>     SOAP::Trace::result(@results);
>
> It seems that you could get information from parameters or results for
servers. Which doesn't strike me as terribly helpful.
>
> I
did have an idea that i tested out. Since you said you were trying to
debug request and responses, these will get passed to the deserializer
and serializer. I was able to write a stub that logs the requests by
sub classing the existing deserializer class into one that includes
logging.
>
> Here is an example:
>
> ...
>
> I'm
sure you could do something similar to SOAP::Transport::HTTP::Daemon by
using a sub class to do custom processing of the accept and dumping out
the request/response content. Maybe I'll look at that tonight.

Lee,

I received your mail just after I had posted a bug report. Your approach is
probably safer in the long run since I am now using a locally modified version
of S::L.

On a side note, I need server debugging since I will be testing my server with
various non-perl clients, and it is easier to do my testing on the perl side.


Regards,

Petar

#6311 From: "sampengdotnet" <sampengdotnet@...>
Date: Thu Apr 2, 2009 8:43 am
Subject: how to retrieve the result from a soap call
sampengdotnet
Send Email Send Email
 
hi SOAP::Lite experts

I met a problem in retrieve SOAP call result.

when i can a remote method
use SOAP::Lite;# + trace => qw(method debug);

my $PROXY   = "http://myhost/";
my $NS     = "urn:testing";
my $soap = SOAP::Lite
             ->readable(1)
             ->uri($NS)
             ->outputxml(1)
             ->proxy($PROXY);
my $method = SOAP::Data->name('foobar');
my @params = SOAP::Data->name("a" => $a,
                               "b" => $b );
if i call $soap->call($method => @params)
it returns a correct XML response.
how every if i call it the following way, it prompt that the result method is
not found:

my $ret= $soap->call($method => @params)
                                   ->result;
Can't call method "result" without a package or object reference at
/path/to/module.pm line 101.

I am very new to SOAP::Lite, and i see examples from SOAP::Lite are doing it
this way, but it seems not work for me.

Can anybody help me on this?
Thank you very much.

#6312 From: "Martin Busik" <martin.busik@...>
Date: Thu Apr 2, 2009 2:25 pm
Subject: SOAP::Lite and WS-Security - userToken
mbusik70
Send Email Send Email
 
Hello list,

I was googling on SOAP::Lite and WS-Security / userToken, but haven't found
an appropriate
solution.

There is a package WSRF::Lite, but this does not offer a userToken profile,
as specified
by
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profi
le-1.0.

So I've decided to implement it on my own. Eventually, I was suprised, how
easy it was - in terms of
lines of code and in terms of SOAP::Lite integration.

If anybody is interested, I can post the solution to this list here.

Cheers,
Martin

#6313 From: "Srinivas Vippagunta" <sriniv@...>
Date: Thu Apr 2, 2009 6:59 pm
Subject: construct soap request
srinivasvipp...
Send Email Send Email
 
Hello,
      I am trying to construct the parameters for a method. I am following
instructions at
http://search.cpan.org/~mkutter/SOAP-Lite-0.710.08/lib/SOAP/Data.pod
but, how do I verify what my request xml looks like. I maybe missing the
obvious. I would really appreciate if someone can help me out here.

Here is the code snippet:

my $method = SOAP::Data->name('MyMethod')
          ->attr({xmlns => 'http://abc.com/'});

   @params = ( SOAP::Data->name("parameterId" => 'abc'),
                         SOAP::Data->name("myquery" => \SOAP::Data->value(

SOAP::Data->name("Parameter" =>'')
                                               ->attr({ 'Key' =>'key1',
                                         'Value' =>' value1'}
                                                              )    ,

SOAP::Data->name("Parameter" =>'')
                                               ->attr({ 'Key' =>'key2',
                                         'Value' =>'value2'}
                                                              )
                         ->attr({xmlns => 'http://abc.com/defg'});

   my $som1 = $s->call($method => @params);

How can I find out what the actual xml looks like?

thanks,
Srinivas.

#6314 From: "Srinivas Vippagunta" <sriniv@...>
Date: Thu Apr 2, 2009 8:52 pm
Subject: suppress type info
srinivasvipp...
Send Email Send Email
 
Hello,
      Is there an easy way to suppress the type info in a request? For eg:

    my $method = SOAP::Data->name('TestMethod')
                           ->attr({xmlns => 'http://abc.com/'});

@params = ( SOAP::Data->name("param1" => 'abc'),
                         SOAP::Data->name("myquery" => \SOAP::Data->value(

SOAP::Data->name("Parameter" =>'')
                                                                  ->attr({
'key1' =>'abc1',

'Value1' =>'1234'
                                                                    }
                                                                   )
                           ->attr({xmlns => 'http://abcd.com/xyz'});
   my $som1 = $s->call($method => @params);

the above call generates an soap request with types in it and I am
getting an error because of that. My request looks like as shown below.
How can I suppress the xsi:type info. Should I override the Serializer?
Is this the only way.

<?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"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <soap:Body>
          <TestMethod xmlns="http://abc.com/">
              <param1 xsi:type="xsd:string">abc</param1>
              <myquery xmlns="http://abc.com/xyz">
                  <Parameter Value="1234" xsi:type="xsd:string"
KeyId="abc1"/>
              </query>
          </TestMethod>
      </soap:Body>
</soap:Envelope>

thanks,
Srinivas.

#6315 From: Petar Shangov <pshangov@...>
Date: Thu Apr 2, 2009 9:33 pm
Subject: Re: suppress type info
pshangov
Send Email Send Email
 
You can always create the xml you need using whatever tool you wish and them
pass it in raw format to SOAP::Data.

From the docs:

   $xml_content = "<foo><bar>123</bar></foo>";
   $elem = SOAP::Data->type('xml' => $xml_content);


----- Original Message ----
> From: Srinivas Vippagunta <sriniv@...>
> To: soaplite@yahoogroups.com
> Sent: Thursday, 2 April, 2009 23:52:34
> Subject: [soaplite] suppress type info
>
> Hello,
>      Is there an easy way to suppress the type info in a request? For eg:
>
>    my $method = SOAP::Data->name('TestMethod')
>                           ->attr({xmlns => 'http://abc.com/'});
>
> @params = ( SOAP::Data->name("param1" => 'abc'),
>                         SOAP::Data->name("myquery" => \SOAP::Data->value(
>
> SOAP::Data->name("Parameter" =>'')
>                                                                  ->attr({
> 'key1' =>'abc1',
>
> 'Value1' =>'1234'
>                                                                    }
>                                                                   )
>                           ->attr({xmlns => 'http://abcd.com/xyz'});
>   my $som1 = $s->call($method => @params);
>
> the above call generates an soap request with types in it and I am
> getting an error because of that. My request looks like as shown below.
> How can I suppress the xsi:type info. Should I override the Serializer?
> Is this the only way.
>
>
>
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>
>
>             abc
>
>
> KeyId="abc1"/>
>
>
>
>
>
> thanks,
> Srinivas.
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#6316 From: Srinivas Vippagunta <sriniv@...>
Date: Thu Apr 2, 2009 9:39 pm
Subject: Re: suppress type info
srinivasvipp...
Send Email Send Email
 
Thanks peter. I tried that and it works but I was somehow hesitant in using
the raw xml. I figured out a way to suppress the type info. I created a
custom serializer and in it I "overwrote" the typelookup method.

     sub typelookup() {
         return undef;
     }

This worked like a charm, but I am not aware of any other side-effects it
may have.

I have also tried setting autotype() to false but it didn't work.

Thanks,
Srinivas.

On 4/2/09 2:33 PM, "Petar Shangov" <pshangov@...> wrote:

>
> You can always create the xml you need using whatever tool you wish and them
> pass it in raw format to SOAP::Data.
>
> From the docs:
>
>   $xml_content = "<foo><bar>123</bar></foo>";
>   $elem = SOAP::Data->type('xml' => $xml_content);
>
>
> ----- Original Message ----
>> From: Srinivas Vippagunta <sriniv@...>
>> To: soaplite@yahoogroups.com
>> Sent: Thursday, 2 April, 2009 23:52:34
>> Subject: [soaplite] suppress type info
>>
>> Hello,
>>      Is there an easy way to suppress the type info in a request? For eg:
>>
>>    my $method = SOAP::Data->name('TestMethod')
>>                           ->attr({xmlns => 'http://abc.com/'});
>>
>> @params = ( SOAP::Data->name("param1" => 'abc'),
>>                         SOAP::Data->name("myquery" => \SOAP::Data->value(
>>
>> SOAP::Data->name("Parameter" =>'')
>>                                                                  ->attr({
>> 'key1' =>'abc1',
>>
>> 'Value1' =>'1234'
>>                                                                    }
>>                                                                   )
>>                           ->attr({xmlns => 'http://abcd.com/xyz'});
>>   my $som1 = $s->call($method => @params);
>>
>> the above call generates an soap request with types in it and I am
>> getting an error because of that. My request looks like as shown below.
>> How can I suppress the xsi:type info. Should I override the Serializer?
>> Is this the only way.
>>
>>
>>
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>>
>>
>>             abc
>>
>>
>> KeyId="abc1"/>
>>
>>
>>
>>
>>
>> thanks,
>> Srinivas.
>>
>>
>>
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>

#6317 From: Lee Carmichael <lecar_red@...>
Date: Mon Apr 6, 2009 4:23 pm
Subject: Re: suppress type info
lecar_red
Send Email Send Email
 
Hello,

Maybe I'm missing something more here but when I want to make sure SOAP::Lite doesn't do its automatic typing of an data element I just use the 'type' method and set it to empty string.

example:  SOAP::Data->name( 'StartDate' => $start )->type('')

This removes any autotyping.

In your code below I think this would work:

   SOAP::Data-> name("Parameter" =>'')->attr({ 'key1' =>'abc1', 'Value1' =>'1234' })->attr({xmlns => 'http://abcd. com/xyz'})->type('');

Not sure but you might be able to add it to the attr method too something like:

   SOAP::Data-> name("Parameter" =>'')->attr({ 'key1' =>'abc1', 'Value1' =>'1234', type => '' })

But I haven't tested that... it makes me wonder though :)

Take care,

Lee




From: Srinivas Vippagunta <sriniv@...>
To: Petar Shangov <pshangov@...>; soaplite@yahoogroups.com
Sent: Thursday, April 2, 2009 4:39:45 PM
Subject: Re: [soaplite] suppress type info

Thanks peter. I tried that and it works but I was somehow hesitant in using
the raw xml. I figured out a way to suppress the type info. I created a
custom serializer and in it I "overwrote" the typelookup method.

sub typelookup() {
return undef;
}

This worked like a charm, but I am not aware of any other side-effects it
may have.

I have also tried setting autotype() to false but it didn't work.

Thanks,
Srinivas.

On 4/2/09 2:33 PM, "Petar Shangov" <pshangov@yahoo. com> wrote:

>
> You can always create the xml you need using whatever tool you wish and them
> pass it in raw format to SOAP::Data.
>
> From the docs:
>
> $xml_content = "<foo><bar>123< /bar></foo> ";
> $elem = SOAP::Data-> type('xml' => $xml_content) ;
>
>
> ----- Original Message ----
>> From: Srinivas Vippagunta <sriniv@yahoo- inc.com>
>> To: soaplite@yahoogroup s.com
>> Sent: Thursday, 2 April, 2009 23:52:34
>> Subject: [soaplite] suppress type info
>>
>> Hello,
>> Is there an easy way to suppress the type info in a request? For eg:
>>
>> my $method = SOAP::Data-> name('TestMethod ')
>> ->attr({xmlns => 'http://abc.com/'});
>>
>> @params = ( SOAP::Data-> name("param1" => 'abc'),
>> SOAP::Data-> name("myquery" => \SOAP::Data- >value(
>>
>> SOAP::Data-> name("Parameter" =>'')
>> ->attr({
>> 'key1' =>'abc1',
>>
>> 'Value1' =>'1234'
>> }
>> )
>> ->attr({xmlns => 'http://abcd. com/xyz'});
>> my $som1 = $s->call($method => @params);
>>
>> the above call generates an soap request with types in it and I am
>> getting an error because of that. My request looks like as shown below.
>> How can I suppress the xsi:type info. Should I override the Serializer?
>> Is this the only way.
>>
>>
>>
>> xmlns:soapenc= "http://schemas. xmlsoap.org/ soap/encoding/"
>> xmlns:xsd="http://www.w3. org/2001/ XMLSchema"
>> xmlns:soap="http://schemas. xmlsoap.org/ soap/envelope/"
>> soap:encodingStyle= "http://schemas. xmlsoap.org/ soap/encoding/">
>>
>>
>> abc
>>
>>
>> KeyId="abc1" />
>>
>>
>>
>>
>>
>> thanks,
>> Srinivas.
>>
>>
>>
>>
>> ------------ --------- --------- ------
>>
>> Yahoo! Groups Links
>>
>>
>>


#6318 From: Lee Carmichael <lecar_red@...>
Date: Mon Apr 6, 2009 5:01 pm
Subject: Re: how to retrieve the result from a soap call
lecar_red
Send Email Send Email
 
Hello,

In your example, $ret is really a soap response object (SOM) unless something happened to cause an exception (die or croak) to occur. You can read the data access methods in: http://search.cpan.org/perldoc?SOAP::SOM

But in general you can use XPath methods to retrieve data. Here is an example:

   my $resp= $soap->call( $method => @params); # changed ret to resp

   die "Fault occurred: " . $resp->faultstring if $resp && $resp->fault;
  
   # grab data from response
   print "Cat: " . $resp->match('//cat') if $resp->match('//cat'); ## not a great example...

In your example the 'result' method will only return the data in a method Response block. This is kind of confusing but basically the server needs to return something that looks like:

<soap:Body><methodResponse>...data here...</methodResponse></soap:Body>

If it doesn't then the 'result' method will return undef even though there might a SOAP repsonse with data from your service. Otherwise, you can grab the other data in the SOAP response with the method above.

HTH,

Lee




it returns a correct XML response.
how every if i call it the following way, it prompt that the result method is not found:

my $ret= $soap->call( $method => @params)
->result;
Can't call method "result" without a package or object reference at /path/to/module. pm line 101.

I am very new to SOAP::Lite, and i see examples from SOAP::Lite are doing it this way, but it seems not work for me.

Can anybody help me on this?
Thank you very much.


#6319 From: rahed <raherh@...>
Date: Tue Apr 7, 2009 7:47 am
Subject: Re: suppress type info
raherh
Send Email Send Email
 
"Srinivas Vippagunta" <sriniv@...> writes:

> Hello,
>      Is there an easy way to suppress the type info in a request? For eg:

$s->autotype(0);

should be ok for requests from a client.

--
Radek

#6320 From: "Allen Goldschmidt" <allen@...>
Date: Sat Apr 11, 2009 2:10 pm
Subject: Installation freezes
allengo
Send Email Send Email
 
I installed ActiveState PERL and then used CPAN command line to install
SOAP::Lite.  It freezes in the middle of the installation at
"t/SOAP/Transport/HTTP/CGI".  I've tried this on several computers.  Any ideas?

#6321 From: Petar Shangov <pshangov@...>
Date: Sun Apr 12, 2009 4:13 pm
Subject: Re: Installation freezes
pshangov
Send Email Send Email
 
This is a known bug, reported at rt.cpan.org, but has not been fixed yet.



----- Original Message ----
> From: Allen Goldschmidt <allen@...>
> To: soaplite@yahoogroups.com
> Sent: Saturday, 11 April, 2009 17:10:46
> Subject: [soaplite] Installation freezes
>
> I installed ActiveState PERL and then used CPAN command line to install
> SOAP::Lite.  It freezes in the middle of the installation at
> "t/SOAP/Transport/HTTP/CGI".  I've tried this on several computers.  Any
ideas?
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#6322 From: "mtys0904" <mtys0904@...>
Date: Thu Apr 16, 2009 10:40 am
Subject: Bad stub: syntax error... in connecting with Open Patent Services
mtys0904
Send Email Send Email
 
Hello,

I am trying the connection with a specific Web service, but unfortunately it is
not working...and I would like to ask someone if you could help me.

The Web service I want to connect with is Open Patent Services(OPS:
http://www.epo.org/patents/patent-information/free/open-patent-services.html).

My environment is as follows;
  -Fedoracore3
  -Perl5.85
  -SOAP::Lite0.60

When I run the Example1 below, I always get the error message as "Bad stub:
syntax error at (eval 90) line 7, near....)".  However, I can successfully
connect with other web services by same environment.  Example2 is the example I
used it when successfully connecting with Yahoo Auction.

(Example1)
  ================================================================

    #!/usr/bin/perl
    #use SOAP::Lite;
    use SOAP::Lite +trace => 'debug';

    my $service = SOAP::Lite->service('http://ops.epo.org/wsdl/ops.wsdl');
    my $result = $service->getDDBJEntry("AB000100");

  ================================================================

(Error message on Example1)
  ----------------------------------------------------------------
    Bad stub: syntax error at (eval 90) line 7, near "-and"
     at /usr/lib/perl5/site_perl/5.8.5/SOAP/Lite.pm line 2921
  ----------------------------------------------------------------

(Example2)
  ================================================================

    #!/usr/bin/perl
    #use SOAP::Lite;
    use SOAP::Lite +trace => 'debug';
    my $service =
SOAP::Lite->service('http://soap.auctions.yahoo.co.jp/AuctionWSDL/V1/yahooAuctio\
nService.wsdl');
    my $result = $service->getCategory("");

  ================================================================

I am afraid that I do not know cause(Inconsistency of SOAP::Lite version or
others...).

When I use soap-UI(http://www.soapui.org/) for Open Patent Services, I can
connect with it and get response without any problems. Consequently, I guess the
problem may be in somewhere on my side.

Can anyone please kindly give me advice to solve the problem?

Thank you.

Mitsu

#6323 From: rahed <raherh@...>
Date: Fri Apr 17, 2009 9:31 am
Subject: Re: Bad stub: syntax error... in connecting with Open Patent Services
raherh
Send Email Send Email
 
"mtys0904" <mtys0904@...> writes:

> (Example1)
>  ================================================================
>
>    #!/usr/bin/perl
>    #use SOAP::Lite;
>    use SOAP::Lite +trace => 'debug';
>
>    my $service = SOAP::Lite->service('http://ops.epo.org/wsdl/ops.wsdl');
>    my $result = $service->getDDBJEntry("AB000100");
>
>  ================================================================
>
> (Error message on Example1)
>  ----------------------------------------------------------------
>    Bad stub: syntax error at (eval 90) line 7, near "-and"
>     at /usr/lib/perl5/site_perl/5.8.5/SOAP/Lite.pm line 2921
>  ----------------------------------------------------------------

I don't see any getDDBJEntry operation in wsdl definition.

Cannot you upgrade to the latest SOAP::Lite 0.710.08? 0.60 is way too
old.

--
Radek

#6324 From: "Srinivas Vippagunta" <sriniv@...>
Date: Fri Apr 17, 2009 11:56 pm
Subject: Generate soap request from wsdl
srinivasvipp...
Send Email Send Email
 
Hello,
    Is there a way dynamically construct a soap request from the wsdl using
soap::lite? Using java you can use JAX-WS-RI, Axis, XFire etc but I am not sure
how to do it in perl.

thanks,
Srinivas.

#6325 From: Petar Shangov <pshangov@...>
Date: Sat Apr 18, 2009 6:33 pm
Subject: Re: Generate soap request from wsdl
pshangov
Send Email Send Email
 
see XML::Compile::SOAP



----- Original Message ----
> From: Srinivas Vippagunta <sriniv@...>
> To: soaplite@yahoogroups.com
> Sent: Saturday, 18 April, 2009 2:56:31
> Subject: [soaplite] Generate soap request from wsdl
>
> Hello,
>    Is there a way dynamically construct a soap request from the wsdl using
> soap::lite? Using java you can use JAX-WS-RI, Axis, XFire etc but I am not
sure
> how to do it in perl.
>
> thanks,
> Srinivas.
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#6326 From: rahed <raherh@...>
Date: Mon Apr 20, 2009 1:13 pm
Subject: Re: Bad stub: syntax error... in connecting with Open Patent Services
raherh
Send Email Send Email
 
On Mon, Apr 20, 2009 at 2:09 PM, mtys0904 <mtys0904@...> wrote:
> Thank you.
>
> I tried ver.0710.08, but I got the similar error too...
>
> (Example)
> ================================================================
> #!/usr/bin/perl
> #use SOAP::Lite;
> use SOAP::Lite +trace => 'debug';
>
> my $service = SOAP::Lite->service('http://ops.epo.org/wsdl/ops.wsdl');
> ================================================================
>
> (Error message)
> ----------------------------------------------------------------
> Bad stub: syntax error at (eval 95) line 7, near "-and"
> Β at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 3613
> ----------------------------------------------------------------

I guess you won't succeed with generating the request directly from
wsdl. The module is not ready for more complex wsdl definitions.

I rather explicitly define an xml structure with SOAP::Data objects
(described in the docs).

Or you can try SOAP::WSDL or XML::Compile::SOAP.

--
Radek

#6327 From: "mtys0904" <mtys0904@...>
Date: Mon Apr 20, 2009 12:11 pm
Subject: Re: Bad stub: syntax error... in connecting with Open Patent Services
mtys0904
Send Email Send Email
 
Thank you.

I tried ver.0710.08, but I got the similar error too...

(Example)
================================================================
#!/usr/bin/perl
#use SOAP::Lite;
use SOAP::Lite +trace => 'debug';

my $service = SOAP::Lite->service('http://ops.epo.org/wsdl/ops.wsdl');
================================================================

(Error message)
----------------------------------------------------------------
Bad stub: syntax error at (eval 95) line 7, near "-and"
  at /usr/lib/perl5/site_perl/5.8.8/SOAP/Lite.pm line 3613
----------------------------------------------------------------

As I was not able to upgrade SOAP::Lite ver. on Fedoracore3 environment, and I
tried the ver.0710.08 on CentOS.

My environment of this time is as follows;
-CentOS release 5.2
-Perl5.8.8
-SOAP::Lite0.710.08

This time, I did not specify the getDDBJEntry part.
The Lite.pm error occurred at the same Function with the error result I got in
my previous try.

(Function incuding "line@3613")
============================================
3608 # Naming? wsdl
3609 sub service {
3610     my $self = shift->new;
3611     return $self->{'_service'} unless @_;
3612     $self->schema->schema_url($self->{'_service'} = shift);
3613     my %services = %{$self->schema->parse(@_)->load->services};

          Carp::croak "More than one service in service description.
Service and port names have to be specifie
      d\n"
              if keys %services > 1;
          my $service = (keys %services)[0]->new;
          return $service;
      }
============================================

I guess the error occurred in WSDL analysis process, but do you know how to
avoid the error?

Thank you again.

Mitsu

#6328 From: "Srinivas Vippagunta" <sriniv@...>
Date: Wed Apr 22, 2009 7:32 pm
Subject: make sure get_basic_credentials is called in a subclass
srinivasvipp...
Send Email Send Email
 
Hello,
     I am trying to make sure, when the invoke() method in the subclass(package
B) is called that the get_basic_credentials from the super class(package A) is
automatically invoked. SOAP::Lite, I think under the covers uses LWP and it
calls get_basic_credentials. Because, I dont explicitly call the
get_basic_credentials, I am not sure how to do that. Any help is appreciated.

thanks,
srinivas.

Package A;
Use Exporter;
our @ISA = qw(Exporter);
use SOAP::Lite;

Sub new {
      Returns the blessed obj. ref.
}

Sub invoke{
      Does some stuff here
}

sub SOAP::Transport::HTTP::Client::get_basic_credentials {
          return $user => $passwd;
}
1;

Package B;
Use Exporter;
our @ISA = qw(Exporter A);
use SOAP::Lite;

Sub new {
Add some more variables to the parent obj ref
}

Sub invoke{
my $s = SOAP::Lite
       -> uri($self->{uri})
       -> proxy($self->{proxy});
$s->call($method);
}

#6329 From: "joemustafa" <joemustafa@...>
Date: Wed May 13, 2009 6:38 pm
Subject: Help with Soap::Lite issue
joemustafa
Send Email Send Email
 
I have a old Perl script that uses SOAP::Lite. I am trying to reuse it but when
I try to run the web client I get the following error.
"Tk::Error: Can't locate object method "on_action" via package SOAP::SOM. I
don't know if it is a compatibility issue I do see the SOAP::SOM installed on
the UNIX server. Any help would be greatly appreciated.

#6330 From: Joseph Werner <telcodev@...>
Date: Wed May 13, 2009 7:11 pm
Subject: Re: Help with Soap::Lite issue
telcodev@...
Send Email Send Email
 
Need more info here, perhaps a code snippett?

You apparently have a GUI using Perl Tk and SOAP::Lite, I suspect a
syntax error in one of your graphics declerations.

Saltbreez


On Wed, May 13, 2009 at 11:38 AM, joemustafa <joemustafa@...> wrote:
>
>
> I have a old Perl script that uses SOAP::Lite. I am trying to reuse it but
> when I try to run the web client I get the following error.
> "Tk::Error: Can't locate object method "on_action" via package SOAP::SOM. I
> don't know if it is a compatibility issue I do see the SOAP::SOM installed
> on the UNIX server. Any help would be greatly appreciated.
>
>



--
I require any third parties to obtain my permission to submit my
information to any other party for each such submission. I further
require any third party to follow up on any submittal of my
information by sending detailed information regarding each such
submission to telcodev@...
Joseph Werner

#6331 From: "joemustafa" <joemustafa@...>
Date: Wed May 13, 2009 10:38 pm
Subject: Re: Help with Soap::Lite issue
joemustafa
Send Email Send Email
 
Here is a snippet. Yes it is a GUI based program.
# Intranet Transfer

     if($Config{'TransferType'} == 0){
       # Make a SOAP request to the administrator server.
       my $soap = SOAP::Lite
         ->
proxy("$SoapScheme://$Config{'SoapServer'}:$Config{'SoapPort'}/$Config{'SoapProx\
y'}")
         -> uri("$Config{'SoapURI'}")
         -> namespace("$Config{'SoapNamespace'}")
         -> on_action(sub{join '', @_;});

       # Set the HTTP timeout
       $soap->transport->timeout($Config{'SoapTimeout'});

       # Enable the Proxy settings
       if($Proxy){ $soap->transport->env_proxy(); }

       # build the SA and DATA
       my $SA   = SOAP::Data->name('sa')->value(\@sa)->uri($Config{'SoapURI'});
       my $DATA =
SOAP::Data->name('Data')->value(\@Data)->uri($Config{'SoapURI'});

       $response = eval { $soap->SaveXmlDataAttachmentArray($SA,$DATA) };
     }
--- In soaplite@yahoogroups.com, Joseph Werner <telcodev@...> wrote:
>
> Need more info here, perhaps a code snippett?
>
> You apparently have a GUI using Perl Tk and SOAP::Lite, I suspect a
> syntax error in one of your graphics declerations.
>
> Saltbreez
>
>
> On Wed, May 13, 2009 at 11:38 AM, joemustafa <joemustafa@...> wrote:
> >
> >
> > I have a old Perl script that uses SOAP::Lite. I am trying to reuse it but
> > when I try to run the web client I get the following error.
> > "Tk::Error: Can't locate object method "on_action" via package SOAP::SOM. I
> > don't know if it is a compatibility issue I do see the SOAP::SOM installed
> > on the UNIX server. Any help would be greatly appreciated.
> >
> >
>
>
>
> --
> I require any third parties to obtain my permission to submit my
> information to any other party for each such submission. I further
> require any third party to follow up on any submittal of my
> information by sending detailed information regarding each such
> submission to telcodev@...
> Joseph Werner
>

#6332 From: "zoltan_kiss@..." <zoltan.kiss@...>
Date: Thu May 21, 2009 1:27 pm
Subject: Big POST request to .net webservice
zoltan_kiss...
Send Email Send Email
 
Hi,

I have a little problem with my SOAP Client program.
I'm using SOAP::Lite with perl 5.8 on debian lenny. The WebServices server is a
Windows 2003 - IIS 6.0 Server :(. Now, i can send for the webservices a simple
post with ~200K of content, but if i want to send for the webservice a 522880
long raw XML content, then IIS response is Err401 - Unauthorized.
The webservices are protected by Windows Authentication, and i'm use the
LWP::Authen::NTLM module to authenticate myself for the damn Windows server, but
if my POST size are bigger than ~300K, then i'm receiving the 401 error from the
server.

Can anybody help me?

Thanks!

Best regards,

Zoltan Kiss

#6333 From: "mbusik70" <martin.busik@...>
Date: Fri May 22, 2009 4:38 pm
Subject: SOAP::Lite and WS-Security - userToken
mbusik70
Send Email Send Email
 
Hello list,
few days ago I've been asked for the solution to this, now I've made it
publicly available under:
http://www.wlp-systems.de/soap-lite-and-ws-security.html

Cheers,
Martin

#6334 From: "Erwin Lesmana Liem" <liem.erwin@...>
Date: Wed May 27, 2009 12:16 pm
Subject: convert protocol http/1.1 to http/1.0
liemerwin
Send Email Send Email
 
Hi there,

does anybody know how to change http protocol in soaplite? i've been searching
for the guide, but still found nothing.

what I want to do is converting from standard value http/1.1 into http/1.0. this
is a sample extract from a soap header!

^^^^^^^^^^^^^^^^^^^^^^
SOAPtools::debug(10) called.
SOAP::Transport::HTTP::Client::send_receive: POST http://erwin HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 3212
Content-Type: text/xml; charset=utf-8
^^^^^^^^^^^^^^^^^^^^^^

I hope somebody could help me! Thanks a lot!

Regards,
Erwin

#6335 From: "Michael Zedeler" <michael@...>
Date: Mon Jun 8, 2009 2:25 pm
Subject: How to test that message generation and parsing?
mzedeler
Send Email Send Email
 
Hi.

I'd like to be able to use SOAP::Lite to generate soap request messages from a perl simple perl data structure and parse them again to check that I get the same structure back.

Like so:

$data_in ~> SOAP::Data
        
~> <your answer here>
        
~> <valid SOAP method or response request>
        
~> SOAP::SOM
         
~> $data_out

And then I'll check that is_deeply($data_in, $data_out).

I've tried using then envelope method on SOAP::Serializer, but it seems that its not possible to use that in conjunction with SOAP::Data. Is there some other way I can generate a complete envelope if what I start with is a SOAP::Data structure?

Regards,

Michael.


#6336 From: "rsvancara" <rsvancara@...>
Date: Thu Jun 11, 2009 11:19 pm
Subject: Cannot encode unnamed element as 'hash'. Will be encoded as 'map' instead
rsvancara
Send Email Send Email
 
I have created a very basic soap service that returns a hash of hashes.  When I
call my soap service, I see this in the apache error logs for every request I
make.

Cannot encode unnamed element as 'hash'. Will be encoded as 'map' instead

Here is my code in a perl object method that returs the hash of hashes.

sub getJobList {

     my $self = shift;

     # Get the result of the output
     my $result = `/usr/bin/qstat -f`;

     # An array that contains all the lines of the result
     my @result_array = split(/\n/,$result);

     # Hash to store all the jobs
     my %result_hash = ();

     # temporary hash to store attributes for a job
     my %temp_hash =();

     my $i = 1;

     my $jobid = 0;

     foreach my $line (@result_array){



         #Each job section is seperated by jobid
         #Iterate through the list and look for these "Job Id" lines
         if($line=~/^Job\sId:/){

             #if($i > 0){
               #$result_hash{$i} = \%temp_hash;
               #%temp_hash=();
             #}

             my @jobid_array = split(/:/,$line);
             #$jobid = $jobid_array[1];

             $jobid_array[1] =~s/^\s//;
             $jobid = $jobid_array[1];

             #$temp_hash{'jobid'} = $jobid_array[1];
             $result_hash{$jobid}{'jobid'} = $jobid;
             $i++;
         }

         # Job State, C for completed Q for queued
         if($line=~/job_state/){
             my @jobstate_array = split(/=/,$line);
             #$temp_hash{'job_state'} = $jobstate_array[1];
             $jobstate_array[1] =~s/^\s//;
             $result_hash{$jobid}{'job_state'} = $jobstate_array[1];
         }
     }

     return \%result_hash;
}


Here is the is my webservice cgi that uses the object method described above:

#!/usr/bin/perl -w

use strict;
use grid::Grid;

use SOAP::Transport::HTTP

SOAP::Transport::HTTP::CGI
   -> dispatch_to('grid::Grid')
   -> handle;

So what can I do to eliminate this error.

Thanks,

Randall

#6337 From: Paul Dwerryhouse <paul@...>
Date: Thu Jun 25, 2009 1:45 pm
Subject: Passing a reference to a SOAP handler?
pdwerryhouse
Send Email Send Email
 
Hi all,

Wondering if someone might be able to point me in the right direction on
this. I've written some SOAP::Lite server code which is being called from
Apache with mod-perl, and I'm trying to figure out how I can pass a
database filehandle to the handler module, from the main mod-perl script.

My code is as follows:

File: /var/www/modperl/my-soap-handler
============================================================
use SOAP::Transport::HTTP;

$dbh = DBI->connect(...) if (! defined($dbh));

SOAP::Transport::HTTP::CGI
         ->dispatch_to('MyClass::Handler')
         ->handle;
============================================================


File: MyClass/Handler.pm
============================================================
package MyClass::Handler;

use SOAP::Lite;

sub method {
	 my $self = shift;
	 my $envelope = pop;
	 my $param = $envelope->dataof("//method//param")->value;

	 ...

	 [[do something with $dbh]
}
============================================================

Basically I want to connect to the database only once, not for every SOAP
connection; if I make the connection to the database in MyClass::Handler,
$dbh doesn't get retained between connections. If instead, I connect to the
database in the my-soap-handler file, then it is retained between calls
(as you would expect mod-perl to do), but I just can't work out a way to
pass it to MyClass::Handler.

Thanks muchly in advance for any advice.

Cheers,

Paul

--
Paul Dwerryhouse 		 | PGP Key ID: 0x6B91B584

Messages 6308 - 6337 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help