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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 6282 - 6312 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#6282 From: rahed <raherh@...>
Date: Thu Jan 29, 2009 7:52 pm
Subject: Re: Installation error for SOAP::Lite
raherh
Send Email Send Email
 
On Tue, Jan 27, 2009 at 5:55 PM, Jeff Gao <zfgao@...> wrote:
> Hi,
>
> I am trying to install SOAP::Lite on Redhat Linux 4ES. My perl version
> is 5.8.5.
>
> I tried "perl Makefile.PL, make" and "perl -MCPAN -e 'install
> SOAP::Lite', and I already got this error:
>
> WARNING: LICENSE is not a known parameter.
> Checking if your kit is complete...
> Looks good
> Warning: prerequisite version 0 not found.
> 'LICENSE' is not a known MakeMaker parameter name.
> Could not eval '
> package ExtUtils::MakeMaker::_version;
> no strict;
>
> local $VERSION;
> $VERSION=undef; do {
> use version; $VERSION = qv('0.710.08');
> }; $VERSION
> ' in lib/SOAP/Lite.pm: Can't locate version.pm in @INC (@INC
> contains:
> /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/usr/lib/perl5/5.8.5
> /usr/lib64/
>

Is version.pm installed? It's not located in @INC.

--
Radek

#6283 From: "ncbjd@..." <ncbjd@...>
Date: Tue Feb 3, 2009 6:28 pm
Subject: Need paid consult to solve SOAP::Lite complex parameter issue
ncbjd...
Send Email Send Email
 
At this point, I am looking for someone to hire to help solve what may
be a simple problem of serializing a slightly complex parameter sent
with a SOAP method call. Thank you for your help in solving the
problem directly, or passing me a pointer to someone who can.

Below, I have included
0. the form of the desired xml request
1. my script,
2. the relevant parts of the wsdl file, and
3. the SOAP error message:

Overview:


I need to pass a single string (wsdl defined "ticketNumber" of type
"string") + a [complex] data item (of type "nameValuePairs")
consisting of two (or more) elements, each a "nameValuePair" (wsdl
defined as string "name" + string "value"). The resulting XML needs to
look like this:

#----------------------------------------------
#----------------------------------------------

<correct request xml>

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
     <generateSecureLinkTicketRequest
xmlns="http://types.secureLink.touchnet.com">
       <ticketName>Test Ticket</ticketName>
       <nameValuePairs>
         <name>AMT</name>
         <value>45.00</value>
       </nameValuePairs>
       <nameValuePairs>
         <name>ID</name>
         <value>123</value>
       </nameValuePairs>
     </generateSecureLinkTicketRequest>
   </soapenv:Body>
</soapenv:Envelope>

</correct request xml>

#------------------------------------------
#------------------------------------------
<script>


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

$ENV{HTTPS_KEY_FILE}="/root/KeyStoreFinal20081222.x509";
$ENV{HTTPS_CERT_FILE}="/root/SignedCert20081222.crt";
$ENV{HTTPS_DEBUG}=1;

my $uri   ='https://198.136.211.18:8448/axis/services';
my $proxy ='https://198.136.211.18:8448/axis/services/TPGSecureLink';

my
$params=SOAP::Data->name("aRequest")->type("SecureLinkTicketRequest")=>SOAP::Dat\
a->name("ticketName"
=> "PY13579"),
SOAP::Data->name("nameValuePairs")->type("secureLinkTypes:nameValuePair")
=> {SOAP::Data->name("AMT"=>"45.00"),
SOAP::Data->name("BILL_NAME"=>"Luigi Barzoni") };
my $response =
SOAP::Lite->uri($uri)->proxy($proxy)->generateSecureLinkTicket($params)->result;

my @out=$response->paramsout;
my $out_1=$out[1];
my $out_2=$out[2];
my $out_3=$out[3];

if ($response) {

print "$out_1\n";
print "$out_2\n";} else {print"NoJoy";}

</script>


#----------------------------------------------
#----------------------------------------------

<wsdl>

       <complexType name="nameValuePair" >
         <sequence>
           <element name="name"               type="xsd:string" />
           <element name="value"              type="xsd:string" />
         </sequence>
       </complexType>




      <complexType name="GenerateSecureLinkTicketRequest">
         <sequence>
           <element name="ticketName"         type="xsd:string" />
           <element name="nameValuePairs"
type="secureLinkTypes:nameValuePair" minOccurs="0"
maxOccurs="unbounded" />
         </sequence>
       </complexType>

</wsdl>

#----------------------------------------------
#----------------------------------------------

<fault message>


<?kml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
       <soapenv:Fault>
          <faultcode>
             soapenv:Server.userException
          </faultcode>
          <faultstring>org.xml.sax.SAXException:
                Invalid element in
com.touchnet.secureLink.types.GenerateSecureLinkTicketRequest - aRequest
          </faultstring>
          <detail>
                <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
                     TNETREADY2
                </ns1:hostname>
          </detail>
       </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

</fault message>

#6284 From: "dennis.davidoff" <dennis.davidoff@...>
Date: Thu Feb 5, 2009 9:57 am
Subject: Gzip in XMLRPC::Lite & logging client peer address
dennis.davidoff
Send Email Send Email
 
Hello, all!

I have two questions about XMLRPC::Lite.

-- 1. Can I use gzip for XMLRPC::Transport::HTTP::Daemon?

Server:

#!/usr/bin/perl -I /usr/home/null/.Eclipse/RT/lib
# vim: ts=8:sw=4

use strict;
use warnings;
use XMLRPC::Lite +trace => 'all';
use XMLRPC::Transport::HTTP;
use Router;
use Data::Dumper;

my $daemon = XMLRPC::Transport::HTTP::Daemon
     -> new (LocalPort => 9850, ReuseAddr => 1)
     -> options({compress_threshold => 1000})
     -> dispatch_to('Router');

$daemon->handle;

(there's one method in Router package which returns alot of data, I
want to compress it)

Client:

#!/usr/bin/perl -w
use strict;
use XMLRPC::Lite +trace => 'all';
use Data::Dumper;

my $client = XMLRPC::Lite
     ->proxy('http://localhost:9850/', options => {compress_threshold
=> 1})
     ->on_fault(sub { die "Transport error: " . $_[1]->faultstring });

print Dumper($client->call('Router.GetAddrList', '192.168.0')->result);

While digging client's trace I saw that the first client's query were
packed, that the header:

POST http://localhost:9850/ HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Accept-Encoding: gzip
Content-Encoding: gzip
Content-Length: 147
Content-Type: text/xml

Server answer for that request:
415 Unsupported Media Type

For next time the client tried to make not compressed re-request and
got non compressed answer. Notice that Accept-Encoding is exists in
client. Server answered with 37 Kb content. Why server not compress
answer data?

-- 2. How to log host peers that connects to a server?

For example, client request Router.GetAddrList, is there a method to
log client's host peer (IP address) in my package Router? As I guess I
somehow I may get an access to {client_socket}->peerhost and
{client_socket}->peerport. Could you show an example?

Thanks!

--
Sincerely,
Dennis S.Davidoff

#6285 From: Paul Gallagher <gallagher.paul@...>
Date: Mon Feb 9, 2009 5:38 pm
Subject: Re: Need paid consult to solve SOAP::Lite complex parameter issue
paulpg_sg
Send Email Send Email
 
just saw your message ncbjd; here's something that may help. I can't test it of course, but I think it is generating the structure you'd indicated is 'correct'..

Regards,
Paul
http://tardate.blogspot.com


#!/usr/bin/perl -w
# $Id$
# see: http://tech.groups.yahoo.com/group/soaplite/message/6283
#
use strict;
use SOAP::Lite +trace => 'debug';
use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1;


$ENV{HTTPS_KEY_FILE}="/root/KeyStoreFinal20081222.x509";
$ENV{HTTPS_CERT_FILE}="/root/SignedCert20081222.crt";
$ENV{HTTPS_DEBUG}=1;

my $uri ='https://198.136.211.18:8448/axis/services';
my $proxy ='https://198.136.211.18:8448/axis/services/TPGSecureLink';
my $serviceNs = 'http://types.secureLink.touchnet.com';


# define the soap object
my $soap = SOAP::Lite
  -> uri ( $uri )
  -> proxy ( $proxy );

# define the ticketName structure
my $ticketName=SOAP::Data->name("ticketName" => "Test Ticket");

# define one of the nameValuePairs on its own
my $nameValuePair1=
  \SOAP::Data->value(
        SOAP::Data->name("name" => "AMT"),
        SOAP::Data->name("value" => "45.00")->type("xsd:string")
    );

# define the nameValuePairs structure, using two techniques    
my $nameValuePairs =
  SOAP::Data->value(
      SOAP::Data->name("nameValuePairs" => $nameValuePair1 ),
      SOAP::Data->name("nameValuePairs" =>
          \SOAP::Data->value(
              SOAP::Data->name("name" => "ID"),
              SOAP::Data->name("value" => "123")->type("xsd:string")
          )
      )
  );
 
# debug/inspect a structure
print Dumper $nameValuePairs;

   
# make the call and get the request
my $som = $soap->call(
    SOAP::Data
    ->name('generateSecureLinkTicketRequest')->attr({xmlns => $serviceNs})
    => $ticketName
    => $nameValuePairs
);

# cool for debugging. see http://tech.groups.yahoo.com/group/soaplite/message/5946
print $soap->transport->http_request->content();

1;


__END__
# notes and comments

<request as generated by this script ncbjd_soapProblem.pl>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<generateSecureLinkTicketRequest xmlns="http://types.secureLink.touchnet.com">
<ticketName xsi:type="xsd:string">Test Ticket</ticketName>
<nameValuePairs>
<name xsi:type="xsd:string">AMT</name>
<value xsi:type="xsd:string">45.00</value>
</nameValuePairs>
<nameValuePairs>
<name xsi:type="xsd:string">ID</name>
<value xsi:type="xsd:string">123</value>
</nameValuePairs>
</generateSecureLinkTicketRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

</request as generated by this script ncbjd_soapProblem.pl>

On Wed, Feb 4, 2009 at 2:28 AM, ncbjd@... <ncbjd@...> wrote:
At this point, I am looking for someone to hire to help solve what may
be a simple problem of serializing a slightly complex parameter sent
with a SOAP method call. Thank you for your help in solving the
problem directly, or passing me a pointer to someone who can.

Below, I have included
0. the form of the desired xml request
1. my script,
2. the relevant parts of the wsdl file, and
3. the SOAP error message:

Overview:


I need to pass a single string (wsdl defined "ticketNumber" of type
"string") + a [complex] data item (of type "nameValuePairs")
consisting of two (or more) elements, each a "nameValuePair" (wsdl
defined as string "name" + string "value"). The resulting XML needs to
look like this:

#----------------------------------------------
#----------------------------------------------

<correct request xml>

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
   <generateSecureLinkTicketRequest
xmlns="http://types.secureLink.touchnet.com">
     <ticketName>Test Ticket</ticketName>
     <nameValuePairs>
       <name>AMT</name>
       <value>45.00</value>
     </nameValuePairs>
     <nameValuePairs>
       <name>ID</name>
       <value>123</value>
     </nameValuePairs>
   </generateSecureLinkTicketRequest>
 </soapenv:Body>
</soapenv:Envelope>

</correct request xml>

#------------------------------------------
#------------------------------------------
<script>


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

$ENV{HTTPS_KEY_FILE}="/root/KeyStoreFinal20081222.x509";
$ENV{HTTPS_CERT_FILE}="/root/SignedCert20081222.crt";
$ENV{HTTPS_DEBUG}=1;

my $uri   ='https://198.136.211.18:8448/axis/services';
my $proxy ='https://198.136.211.18:8448/axis/services/TPGSecureLink';

my
$params=SOAP::Data->name("aRequest")->type("SecureLinkTicketRequest")=>SOAP::Data->name("ticketName"
=> "PY13579"),
SOAP::Data->name("nameValuePairs")->type("secureLinkTypes:nameValuePair")
=> {SOAP::Data->name("AMT"=>"45.00"),
SOAP::Data->name("BILL_NAME"=>"Luigi Barzoni") };
my $response =
SOAP::Lite->uri($uri)->proxy($proxy)->generateSecureLinkTicket($params)->result;

my @out=$response->paramsout;
my $out_1=$out[1];
my $out_2=$out[2];
my $out_3=$out[3];

if ($response) {

print "$out_1\n";
print "$out_2\n";} else {print"NoJoy";}

</script>


#----------------------------------------------
#----------------------------------------------

<wsdl>

     <complexType name="nameValuePair" >
       <sequence>
         <element name="name"               type="xsd:string" />
         <element name="value"              type="xsd:string" />
       </sequence>
     </complexType>




    <complexType name="GenerateSecureLinkTicketRequest">
       <sequence>
         <element name="ticketName"         type="xsd:string" />
         <element name="nameValuePairs"
type="secureLinkTypes:nameValuePair" minOccurs="0"
maxOccurs="unbounded" />
       </sequence>
     </complexType>

</wsdl>

#----------------------------------------------
#----------------------------------------------

<fault message>


<?kml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
     <soapenv:Fault>
        <faultcode>
           soapenv:Server.userException
        </faultcode>
        <faultstring>org.xml.sax.SAXException:
              Invalid element in
com.touchnet.secureLink.types.GenerateSecureLinkTicketRequest - aRequest
        </faultstring>
        <detail>
              <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
                   TNETREADY2
              </ns1:hostname>
        </detail>
     </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>

</fault message>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/soaplite/

<*> Your email settings:
   Individual Email | Traditional

<*> To change settings online go to:
   http://groups.yahoo.com/group/soaplite/join
   (Yahoo! ID required)

<*> To change settings via email:
   mailto:soaplite-digest@yahoogroups.com
   mailto:soaplite-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
   soaplite-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/



#6286 From: Bill.Costa@...
Date: Thu Feb 12, 2009 1:05 pm
Subject: SOAP::Lite fault doesn't report misspelled srvc as expected
bill.costa_01
Send Email Send Email
 
Folks,

In a Tech Republic article:

      http://articles.techrepublic.com.com/5100-10878_11-1052448.html

the author describes the 'free' fault detection you get with
SOAP::Lite, including:

      "...if someone were to invoke a method that wasn't defined in
      the dispatch handler, SOAP::Lite would return SOAP Fault with
      a fault string that said something like Failed To Locate
      Method (Foo) In Class (Echo)."

This is exactly the sort of behavior I expected.  But in my
simple test, I try to first call an existing service (works fine)
then call an non-existing one, and the error comes back that
suddenly it can't find the class it successfully used in the
first call.  I am very confused.  Any ideas what silly thing I'm
doing wrong?

server: 0.710.08
client: 0.69

Thanks in advance for any clues.

                                                      ...BC

    -- server -- -- -- -- -- -- --

#!/usr/bin/perl
#
#  A super simple SOAP service.

use warnings;
use strict;
use SOAP::Transport::HTTP;
use Sys::Hostname;

my $thisHost = hostname();

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

package Demo;

sub hi { return "$thisHost sez: hello, world" }

1;

    -- client -- -- -- -- -- -- --

#!/usr/bin/perl

# Super simple client for a super simple service.

use warnings;
use strict;
use SOAP::Lite;

my $soap =
    SOAP::Lite -> uri('https://riddle.unh.edu/Demo')
               -> proxy('https://riddle.unh.edu/cgi-bin/SOAP/hibye.cgi');

my $rtrn; # The result object returned from remote call.

$rtrn = $soap->hi();  # A real service
if (not $rtrn->fault())
    {
      print($rtrn->result(), "\n");
    }
else
    {
      print("    faultcode = ", $rtrn->faultcode,   "\n",
 	   "  faultstring = ", $rtrn->faultstring, "\n",
 	   "   faultactor = ", $rtrn->faultactor,  "\n",
 	   "  faultdetail = ", $rtrn->faultdetail, "\n",
 	  );
    }

$rtrn = $soap->hello();   # A non-service
if (not $rtrn->fault())
    {
      print($rtrn->result(), "\n");
    }
else
    {
      print("    faultcode = ", $rtrn->faultcode,   "\n",
 	   "  faultstring = ", $rtrn->faultstring, "\n",
 	   "   faultactor = ", $rtrn->faultactor,  "\n",
 	   "  faultdetail = ", $rtrn->faultdetail, "\n",
 	  );
    }

    -- output -- -- -- -- -- -- --

$ ./simple-client.pl
riddle.unh.edu sez: hello, world
      faultcode = soap:Client
    faultstring = Failed to access class (Demo):
                  Can't locate Demo.pm in
                  @INC (@INC contains: /usr/l .... etc ....

     faultactor =
    faultdetail =


--
+-------------------------[ Bill.Costa@... ]---+
| Bill Costa                                       |  No good
| 1 Leavitt Lane                 Voice:            |   deed...
|   CIS/Telecom -- 2nd Floor       +1-603-862-3056 |
|   University of New Hampshire                    |  Goes
| Durham, NH  03824       USA                      |   unpunished.
+---------------[ http://pubpages.unh.edu/~wfc/ ]--+

#6287 From: "discorogers" <dan.j.rogers@...>
Date: Sun Feb 15, 2009 12:56 pm
Subject: SOAP::SOM return object
discorogers
Send Email Send Email
 
Hi all,

Would really appreciate your help. I'm relatively new to Perl and
SOAP, and I'm trying to implement a connection to the Google Adwords
API using SOAP::Lite. I have it almost working but however I try and
get a return value from SOAP::SOM (e.g. using valueof or result) I
only seem to get the last element. Even calling valueof("//Body") just
gives me one element. I have tried debugging the code and using
Dumper, but the SOAP::Lite code is quite unreadable (at least to me :)
and I can't work out whats going on.

This what I get from valueof("//Body):

$VAR1 = {
           'getKeywordVariationsResponse' => {

'getKeywordVariationsReturn' => {

           'moreSpecific' => {

                               'searchVolumeScale' => '2',

                               'language' => '',

                               'text' => 'trusted places 1',

                               'advertiserCompetitionScale' => '3'

                             }

         }
                                             }
         };

But I know there is more than one KeywordVariation from using Dumper
on the SOAP::SOM object.

This is the code I am using:

use strict;
use warnings;
use English '-no_match_vars';
use SOAP::Lite;
use Data::Dumper;
binmode(STDOUT, ':utf8');

# Provide AdWords login information.
my $email = '';
my $password = '';
my $client_email = 'client_1+dan.j.rogers@...';
my $useragent = 'QYPE: AdWords API Perl Sample Code';
my $developer_token = 'dan.j.rogers@...++USD';
my $application_token = 'INSERT_APPLICATION_TOKEN_HERE';

# Set up service connection with autotyping disabled and fault handler
# registered. To send requests to production environment, replace
"sandbox" with
# "adwords". To view XML request/response, uncomment
# "SOAP::Lite->import(+trace => 'debug');".
my $url =
sprintf('https://%s.google.com/api/adwords/v12/KeywordToolService',
                   'sandbox');

my $wsdl = $url . '?wsdl';

my $service =
SOAP::Lite->service($wsdl)->autotype(0)->readable(1)->proxy($url);

#my $service = SOAP::Lite->uri('urn:getKeywordVariations')->proxy($url);

$service->on_fault(sub {
                      my $response = $ARG[1];
                      die('The following SOAP fault occurred:', "\n",
                          '  faultcode: ', $response->faultcode(), "\n",
                          '  faultstring: ', $response->faultstring(),
"\n")
                    });
SOAP::Lite->import(+trace => 'debug');

# Define SOAP headers.
my @headers = (
   SOAP::Header->name('email' => $email),
   SOAP::Header->name('password' => $password),
   SOAP::Header->name('clientEmail' => $client_email),
   SOAP::Header->name('useragent' => $useragent),
   SOAP::Header->name('developerToken' => $developer_token),
   SOAP::Header->name('applicationToken' => $application_token)
);

# Create seed keyword structure.
my $seed_keyword = {
   'negative' => 'false',
   'text' => 'trusted places',
   'type' => 'Broad',
};

my $seed_keywords = SOAP::Data->name('seed_keywords' => [$seed_keyword]);
my $use_synonyms = SOAP::Data->name('useSynonyms' => 'true');
my $languages = SOAP::Data->name('languages' => ['en']);
my $countries = SOAP::Data->name('countries' => ['US']);

# Get keyword variations.
  my $variation_lists = $service->call('getKeywordVariations' =>
$seed_keywords,
   $use_synonyms, $languages, $countries, @headers);

print Dumper($variation_lists);

my @data = $variation_lists->valueof("//Body");

foreach my $data_word (@data){
	 print Dumper($data_word);
}


If anyone knows where I am going wrong I'd be most grateful!

Thanks for your help.

Danielle

#6288 From: "aka gw1500se" <dap1@...>
Date: Tue Feb 17, 2009 12:30 pm
Subject: First SOAP Attempt
i_was_yah00ed
Send Email Send Email
 
This is my first attempt writing a simple SOAP::Lite client. I followed the documentation best I could, considering where I am on the learning curve, but am having no luck. First here is the SOAP information sent to me by the vendor:

The following are the Web Service values in order to call this new
Web service:
- AccessURL: http://127.0.0.1:8080/4DSOAP/
- SoapAction: ADMS_WebService#WSS_SetPackageStatus
- MethodName: WSS_SetPackageStatus
- NameSpace: http://www.MyDomain.com/ADMS/namespace/default
- Type: Dynamic
- ArgumentNames: PackageName, PackageStatus

Here is the relevant code segments. The omitted part of the script is to generate the values for $data and $status.

use SOAP::Lite +trace=> [qw(transport method fault)];
 .
 .
 .
my $soapuri="http://www.MyDomain.com/ADMS/namespace/default";
my $soapproxy="http://imageone.mydomain.com:8080/4DSOAP";
my $soapaction="ADMS_WebService#WSS_SetPackageStatus";
 .
 .
 .
my $soap=SOAP::Lite
        ->uri($soapuri)
        ->proxy($soapproxy)
        ->on_action(sub {return($soapaction);});
$results=$soap->WSS_SetPackageStatus(PackageName=>$data,PackageStatus=>$status);
if ($results->fault()) {
         print("SOAP
error:",$results->faultcode(),":",$results->faultstring(),"\n");
}
else {
         print("SOAP result: ",$results->result(),"\n");
}

The output produces no 'fault' and 'results' is a null string. In other words there is no error nor is there any output. The documentation is not at all clear on how to pass parameters to the method so what I used was a guess on my part. However, even if that were wrong, I'd expect an error of some kind. This seems like a relatively simple thing but obviously I am not properly transferring the information provided by the vendor into what SOAP::Lite needs. I know I am accessing the remote server but beyond that without even an error, I'm stuck. Can someone help on this? TIA.

#6289 From: "killyourspam" <killyourspam@...>
Date: Tue Feb 17, 2009 10:00 pm
Subject: using soap:lite as daemon, capturing the clients IP ?? Help
killyourspam
Send Email Send Email
 
Trying to find a way to get a hold of the client's IP as they
come to the soap daemon server..




Date: Tue, 17 Feb 2009 21:23:59 GMT
Server: libwww-perl-daemon/1.36
Content-Length: 5860
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 17 Feb 2009 21:23:59 GMT
Client-Peer: 127.0.0.1:88
Client-Response-Num: 1
SOAPServer: SOAP::Lite/Perl/0.710.08

here is my server script
#!/usr/bin/perl -w
# -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko -
use strict;
use DBI;
use SOAP::payload ;
use Data::Dumper;
use SOAP::Transport::HTTP

$SIG{PIPE} = $SIG{INT} = 'IGNORE'; # don't want to die on 'Broken
pipe' or Ctrl-C

my $daemon = SOAP::Transport::HTTP::Daemon
   -> new (LocalAddr => 'localhost', LocalPort => 88, 'Reuse' => 1 )
   -> objects_by_reference(qw(My::PersistentIterator
My::SessionIterator My::Chat SOAP::payload))
   -> dispatch_to('/home/tmoore/soap', 'Module::Hello', 'Module::HIBY')
   -> options({compress_threshold => 10000});
print "Contact to SOAP server at ", $daemon->url, "\n";
$daemon->handle;

###################################
this works great but how can I obtain the clients IP address showing
up at port 88 to get service.

I can go back to the cgi version to use apache and its logging but
that is way to easy.

I dug into the  IO::Socket  modules looking for things but was not
able to put anything together using the soap modules.


use Socket;
     $mysockaddr = getsockname(SOCK);
     ($port, $myaddr) = sockaddr_in($mysockaddr);
     printf "Connect to %s [%s]\n",
        scalar gethostbyaddr($myaddr, AF_INET),
        inet_ntoa($myaddr);


use Socket;
     $hersockaddr    = getpeername(SOCK);
     ($port, $iaddr) = sockaddr_in($hersockaddr);
     $herhostname    = gethostbyaddr($iaddr, AF_INET);
     $herstraddr     = inet_ntoa($iaddr);


Thanks in advance  for tips on capuring at client IP ..

#6290 From: "alexukua" <alexukua@...>
Date: Wed Feb 18, 2009 10:16 am
Subject: Re: Construction Example(s) ???
alexukua
Send Email Send Email
 
Example how to working  with Ukraine text utf8

my $utf8='Åëåêòðîííà á³áë³îòåêà';

my $utf8 = pack 'U*', unpack 'U0U*', $utf8;

my $title=SOAP::Data->name('title')->type('string')->value($utf8);
--- In soaplite@yahoogroups.com, Bill Jones <sneex@...> wrote:
>
> Hi All  :)
>
> I have a basic question, I've been playing with only a few days now
but I am
> not sure how to 'implement' the few examples I've seen both here and
on the
> WWW.
>
> I want to talk via SSL using basic authentication to:
>
>
http://207.203.95.95/bill/BrokerEmployee.asmx/ClassRoster?strBrokerID=ETB251
> &strClassReferenceNumber=138887&strTerm=20021
>
> (Sorry for the long URL, you may need to fix formatting errors caused by
> posting.)
>
> I posted a NTLM question the other day and got two very good
responses about
> various NTLM sites to get the protocol for implementing it in Perl
(which I
> am following up on :)
>
> The remote server supports SOAP, GET, and POST - however, I am at a
loss as
> to how to use SOAP to do this.  Ultimately I want to parse the XML -
but I
> am not sure I am even talking to the server correctly to start with.
>
> Any thoughts or references would be most appreciated  :)
>
> -Sx-
> William C (Bill) Jones
> Lead, Courseware Support Analyst
> (Lead e-Systems Developer)
> Florida Community College at Jacksonville
> 501 West State Street, Rm 229
> Jacksonville, Florida  32202-4030
>         wcjones@...
> PHONE   (904) 632-3089
> FAX     (904) 632-3007
> __________________________________________________________________
> "I know you believe you understand what you think I said, but I am
> not sure you realize that what you heard is not what I meant."
>   :::  Richard Nixon
>

#6291 From: rahed <raherh@...>
Date: Thu Feb 19, 2009 12:14 pm
Subject: Re: using soap:lite as daemon, capturing the clients IP ?? Help
raherh
Send Email Send Email
 
On Tue, Feb 17, 2009 at 11:00 PM, killyourspam <killyourspam@...> wrote:
> Trying to find a way to get a hold of the client's IP as they
> come to the soap daemon server..

You can get the address from peerhost method applied on a connected socket.
The method is from IO::Socket::INET.


--
Radek

#6292 From: rahed <raherh@...>
Date: Fri Feb 20, 2009 9:38 am
Subject: Re: using soap:lite as daemon, capturing the clients IP ?? Help
raherh
Send Email Send Email
 
On Thu, Feb 19, 2009 at 2:56 PM, dennis.davidoff
<dennis.davidoff@...> wrote:
> Please, show an example.

I use ForkOnAccept module which is part of the distribution:
$daemon->ForkOnAccept::handle;
...

package ForkOnAccept;
...
sub handle {
  my $self = shift->new;

  CLIENT:
  while (my $c = $self->accept) {
   my $address = $c->peerhost;
  ....

Where $c is the object of the connected socket.
Actually I do not call peerhost to use it further.


--
Radek

#6293 From: "sergey.romanovsky" <sergey.romanovsky@...>
Date: Wed Mar 4, 2009 12:51 pm
Subject: Expect: 100 Continue and mod_perl
sergey.roman...
Send Email Send Email
 
Hello,

I've got a problem with running SOAP::Lite service under mod_perl.
In module SOAP::Transport::HTTP::Apache function handler there's Expect header
processing:
===
   if ($r->headers_in->{'Expect'} =~ /\b100-Continue\b/i) {
       $r->print("HTTP/1.1 100 Continue\r\n\r\n");
   }
===
That's strange because Expect header is processed by Apache itself. So there's
effect like:
- a client send headers of a request with Expect header
- the client receives from Apache '100-Continue'
- the client posts the request
- SOAP::Lite sends response: xml started with '100-Continue' generated by the
code above
- the client receives wrong xml and brakes.

For now I just commented the print line and everything is works.
Can you please help me to understand who is wrong here?
Thanks.

#6294 From: "bostromanders" <bostromanders@...>
Date: Fri Mar 6, 2009 9:01 am
Subject: "integrated security" ?
bostromanders
Send Email Send Email
 
Hallo
I'm trying to use a server that is said to use "integrated security".
Anyone that knows what that refers to?
And is that something that SOAP-Lite can handle?
Thanks
Anders

#6295 From: "tomsw" <tweb@...>
Date: Tue Mar 10, 2009 9:43 pm
Subject: Namespace question
tomsw
Send Email Send Email
 
Hi,

I have a web service that needs to respond to soap requests from two name
spaces.  (The current namespace and a legacy one.)  I'm swapping out the uri in
an on_dispatch call.  This works fine in that I receive the requests and respond
to them.  The problem is that the namespace listed in the response is always the
current one.

For example the old namespace was "http://wilma.com" and the new one is
"http://fred.com/SOAP".  When requests come in using the wilma.com namespace the
response lists "http://fred.com/SOAP".

How does one change the response namespace?

I'm sure that was incoherent.

Thanks!

Tom

#6296 From: "Vlad" <vlad@...>
Date: Thu Mar 12, 2009 10:22 am
Subject: Problem implementing web service
vlad@...
Send Email Send Email
 
Hello everyone,
 
I've encountered the following problem while implementing Web Service server side using Soap::Lite (Perl).
I receive the following error message:
"SOAPAction shall match 'uri#method' if present (got 'SushiService:GetReport', expected 'http://www.niso.org/schemas/sushi/counter#ReportRequest'"
What is the reason of this error?
 
My WSDL is:
 
<definitions xmlns:tns="SushiService"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:sc="http://www.niso.org/schemas/sushi/counter"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             name="SushiService"
             targetNamespace="SushiService"
             xmlns="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
   <types>
      <xsd:schema>
         <xsd:import schemaLocation="http://www.niso.org/schemas/sushi/counter_sushi3_0.xsd" namespace="http://www.niso.org/schemas/sushi/counter"/>
      </xsd:schema>
   </types>
   <message name="GetReportIn">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
      <part name="messagePart" element="sc:ReportRequest"/>
   </message>
   <message name="GetReportOut">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
      <part name="messagePart" element="sc:ReportResponse"/>
   </message>
   <portType name="SushiServiceInterface">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
      <operation name="GetReport">
         <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
         <input message="tns:GetReportIn"/>
         <output message="tns:GetReportOut"/>
      </operation>
   </portType>
   <binding name="SushiService" type="tns:SushiServiceInterface">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="GetReport">
         <soap:operation soapAction="SushiService:GetReportIn" style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
   </binding>
   <service name="SushiService">
      <port name="SushiServicePort"
            binding="tns:SushiService">
         <soap:address location="http://dl/SushiService"/>
      </port>
   </service>
</definitions>
 
My server side code is very small:
 
    #!/usr/bin/perl
    use strict;
 
    use SOAP::Transport::HTTP;
 
    my $server = SOAP::Transport::HTTP::CGI
     ->dispatch_to("SushiService")
     ->handle;
 
    package SushiService;
    sub GetReport {
        my $xml_response;
        ....
        return $xml_response;
    }
 
    1;
 
Could you please help me to resolve this problem?
 
Best regards,
Vlad

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

#6298 From: jing han <jing_han_66@...>
Date: Fri Mar 13, 2009 7:33 pm
Subject: unsubscribe
jing_han_66
Send Email Send Email
 
unsubscribe

#6299 From: "malcolmpdx" <malcolmpdx@...>
Date: Tue Mar 17, 2009 9:01 pm
Subject: Complex types help
malcolmpdx
Send Email Send Email
 
I'm certain that buried somewhere in the archives there is the answer to my
question, but so far, I've been unable to find it, at least in the form that I
can understand.

I'm porting some code that uses SOAP::Lite to interface with a SOAP interface to
a CRM system.  Generally speaking, this is going well, and I've been able to get
the various chunks of XML that are required by the various calls to work just
fine.  But when confronted with this spec (from the wsdl for the service)

<xsd:complexType name="name_value_list">

<xsd:complexContent>

<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:name_value[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>

I have hit a real block.  The eventual output I need to have sent looks like
this:

<name_value_list xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="tns:name_value[1]">
<item xsi:type="tns:name_value">
<name xsi:type="xsd:string">modified_by_name</name>
<value xsi:type="xsd:string">admin</value>
</item>
</name_value_list>

And, after days of trying to get this to work, I've come to the end of my rope. 
Perhaps someone else would be so kind as to give me a clue.

Thanks,

Malcolm

#6300 From: "Peter Farr" <Peter.Farr@...>
Date: Thu Mar 19, 2009 12:05 am
Subject: "No port for method" fault
pgfarr
Send Email Send Email
 
I am pretty new to this so I am probably doing something stupid, but I can't
figure it out. I have the following code attempting to access a commercial
product via its web services interface:

my $soap = SOAP::Lite
   -> uri('http://vm-impact1/ImpactManager')
   -> proxy('http://vm-impact1.home.dom:6070/imapi/');

my $som = $soap->bmciiws_getCellInfo;

if ($som->fault) {
     print "Fault encountered: "
      . $som->faultcode . ":\n"
      . $som->faultstring . "\n";
} else {
	 print "Ok\n\n";
	 my @return_vals = $som->paramsall;
	 foreach my $val (@return_vals) {
		 print "\t$val\n"
	 }
}

I get the response:
No port for method 'bmciiws_getCellInfo:http://vm-impact1/ImpactManager' with
SOAPAction '"http://vm-impact1/ImpactManager#bmciiws_getCellInfo"' found

The vendor documentation is very poor. All I have to go on is the WSDL. Instead
of taking up space here I have posted it at
http://peter.lpi-solutions.com/ImpactManager.wsdl

Any assistance would be appreciated.

#6301 From: rahed <raherh@...>
Date: Thu Mar 19, 2009 1:26 pm
Subject: Re: Complex types help
raherh
Send Email Send Email
 
"malcolmpdx" <malcolmpdx@...> writes:

> I have hit a real block.  The eventual output I need to have sent looks like
this:
>
> <name_value_list xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="tns:name_value[1]">
> <item xsi:type="tns:name_value">
> <name xsi:type="xsd:string">modified_by_name</name>
> <value xsi:type="xsd:string">admin</value>
> </item>
> </name_value_list>

Try this, it should generate exactly the same structure.


$SOAP::Constants::PREFIX_ENC = 'SOAP-ENC';

@data = (
	  ['modified_by_name','admin'],
	 );
$soap->serializer->register_ns('http://my.namespace1'=>'xmlns:tns');

for my $item (@data) {
   push @name_value,
SOAP::Data->name('item')->type('tns:name_value'=>\SOAP::Data->value(
				        SOAP::Data->name(name  => $item->[0])->type('string'),
				        SOAP::Data->name(value => $item->[1])->type('string'),
							      ),
				   );
}

And object to send:

$object =
SOAP::Data->name('name_value_list')->type('SOAP-ENC:Array'=>\@name_value);

hth

--
Radek

#6302 From: Petar Shangov <pshangov@...>
Date: Mon Mar 23, 2009 3:21 pm
Subject: How do I add custom trace callbacks?
pshangov
Send Email Send Email
 
Hi, I have a SOAP::Lite based server and an need to enable soma
advanced debugging. In particular, I need to print out the full
requests and responses for each call. But I cannot get my callbacks to
get invoked. In my soap server script (currently running in a
development environment with SOAP::Transport::HTTP::Daemon) I have
tried:

use SOAP::Lite +trace => [debug => sub {print "test!\n";}];

but nothing happens. I have tried printing to a filehandle as well, but still no
result.

Regards,

Petar

#6303 From: rahed <raherh@...>
Date: Mon Mar 23, 2009 8:44 pm
Subject: Re: How do I add custom trace callbacks?
raherh
Send Email Send Email
 
Petar Shangov <pshangov@...> writes:

> Hi, I have a SOAP::Lite based server and an need to enable soma
> advanced debugging. In particular, I need to print out the full
> requests and responses for each call. But I cannot get my callbacks to
> get invoked. In my soap server script (currently running in a
> development environment with SOAP::Transport::HTTP::Daemon) I have
> tried:
>
> use SOAP::Lite +trace => [debug => sub {print "test!\n";}];
>
> but nothing happens. I have tried printing to a filehandle as well, but still
no result.
I simply use

use SOAP::Lite +trace=>'all';

It's documented in SOAP::Trace.

--
Radek

#6304 From: Petar Shangov <pshangov@...>
Date: Tue Mar 24, 2009 1:31 pm
Subject: Re: How do I add custom trace callbacks?
pshangov
Send Email Send Email
 
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: ()

I need to be able to print out the complete requests and responses, such as:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:MyWebServices">
    <soapenv:Header/>
    <soapenv:Body>
       <urn:get_set>
          <parameter>
             ...
          </parameter>
       </urn:get_set>
    </soapenv:Body>
</soapenv:Envelope>

Regards,

Petar



----- Original Message ----
> From: rahed <raherh@...>
> To: Petar Shangov <pshangov@...>
> Cc: soaplite@yahoogroups.com
> Sent: Monday, 23 March, 2009 22:44:30
> Subject: Re: [soaplite] How do I add custom trace callbacks?
>
> Petar Shangov writes:
>
> > Hi, I have a SOAP::Lite based server and an need to enable soma
> > advanced debugging. In particular, I need to print out the full
> > requests and responses for each call. But I cannot get my callbacks to
> > get invoked. In my soap server script (currently running in a
> > development environment with SOAP::Transport::HTTP::Daemon) I have
> > tried:
> >
> > use SOAP::Lite +trace => [debug => sub {print "test!\n";}];
> >
> > but nothing happens. I have tried printing to a filehandle as well, but
still
> no result.
> I simply use
>
> use SOAP::Lite +trace=>'all';
>
> It's documented in SOAP::Trace.
>
> --
> Radek
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#6305 From: Petar Shangov <pshangov@...>
Date: Tue Mar 24, 2009 3:19 pm
Subject: Re: How do I add custom trace callbacks?
pshangov
Send Email Send Email
 
Hi,

Using WinXP, Strawbery Perl 5.10, latest SOAP::Lite from cpan. I am running the
daemon script from the command line.

Like I said, I tried printing to a file as well, just in case STDOUT got
redirected somewhere, but that did not work either. I think the problem is with
the callback not being invoked at all.



----- Original Message ----
> From: Peter Farr <Peter.Farr@...>
> To: Petar Shangov <pshangov@...>
> Sent: Tuesday, 24 March, 2009 16:49:05
> Subject: Re: How do I add custom trace callbacks?
>
> Peter, what environment is this? Unix or Windows? I believe the output will go
> to stdout so you will have to run your daemon from the command line to see it.
>
> --- In soaplite@yahoogroups.com, Petar Shangov wrote:
> >
> >
> > Hi, I have a SOAP::Lite based server and an need to enable soma
> > advanced debugging. In particular, I need to print out the full
> > requests and responses for each call. But I cannot get my callbacks to
> > get invoked. In my soap server script (currently running in a
> > development environment with SOAP::Transport::HTTP::Daemon) I have
> > tried:
> >
> > use SOAP::Lite +trace => [debug => sub {print "test!\n";}];
> >
> > but nothing happens. I have tried printing to a filehandle as well, but
still
> no result.
> >
> > Regards,
> >
> > Petar
> >

#6306 From: Petar Shangov <pshangov@...>
Date: Tue Mar 24, 2009 4:21 pm
Subject: Re: How do I add custom trace callbacks?
pshangov
Send Email Send Email
 
Hi,

I have attached a sample test script that produces no output on my machine.

Regards,

Petar



----- Original Message ----
> From: Peter Farr <Peter.Farr@...>
> To: Petar Shangov <pshangov@...>
> Sent: Tuesday, 24 March, 2009 17:41:23
> Subject: Re: How do I add custom trace callbacks?
>
> Peter, if you want to you send me your code and I will try to run it in
> my Linux environment. I can run it under my debugger and see if I can
> see what is happening.
> -
> Regards,
>
> Peter
>
> Emancipate yourselves from mental slavery;
> None but ourselves can free our minds.
>         Bob Marley, Redemption Song
>
>
> On Tue, 2009-03-24 at 08:19 -0700, Petar Shangov wrote:
> > Hi,
> >
> > Using WinXP, Strawbery Perl 5.10, latest SOAP::Lite from cpan. I am running
> the daemon script from the command line.
> >
> > Like I said, I tried printing to a file as well, just in case STDOUT got
> redirected somewhere, but that did not work either. I think the problem is
with
> the callback not being invoked at all.
> >
> >
> >
> > ----- Original Message ----
> > > From: Peter Farr
> > > To: Petar Shangov
> > > Sent: Tuesday, 24 March, 2009 16:49:05
> > > Subject: Re: How do I add custom trace callbacks?
> > >
> > > Peter, what environment is this? Unix or Windows? I believe the output
will
> go
> > > to stdout so you will have to run your daemon from the command line to see
> it.
> > >
> > > --- In soaplite@yahoogroups.com, Petar Shangov wrote:
> > > >
> > > >
> > > > Hi, I have a SOAP::Lite based server and an need to enable soma
> > > > advanced debugging. In particular, I need to print out the full
> > > > requests and responses for each call. But I cannot get my callbacks to
> > > > get invoked. In my soap server script (currently running in a
> > > > development environment with SOAP::Transport::HTTP::Daemon) I have
> > > > tried:
> > > >
> > > > use SOAP::Lite +trace => [debug => sub {print "test!\n";}];
> > > >
> > > > but nothing happens. I have tried printing to a filehandle as well, but
> still
> > > no result.
> > > >
> > > > Regards,
> > > >
> > > > Petar
> > > >
> >

#6307 From: Lee Carmichael <lecar_red@...>
Date: Tue Mar 24, 2009 9:02 pm
Subject: Re: How do I add custom trace callbacks?
lecar_red
Send Email Send Email
 
Hello Petar,

You can you be more specific by adding transport layer debugging:
use SOAP::Lite +trace => [
transport => sub { print "calls to transport for request and response\n";
];
It is important to know that this must be defined before any other use SOAP::Lite statement (I'm not sure why but i had troubles with it other places).

You can create smarter logging subs by doing the following (note: untested and brief):

use SOAP::Lite +trace => [
transport => &transport_logger
];

sub transport_logger {
my $in = shift; # SOAP::Lite pushes in the object its call

## only log request and responses
return unless ref $in =~ /HTTP::(Request|Request)/'

open my $fh, '>>', 'transport.log' or return;
printf $fh "%s: %s\n", ref $in, ( $in->content ? $in->content : "N/A" );
close $fh;

return;
}

You can see more details about how SOAP::Trace works at: http://search.cpan.org/~mkutter/SOAP-Lite-0.710.08/lib/SOAP/Trace.pod
I have a little write up on this at my blog: http://blog.leecarmichael.com/2009/03/adding-http-requestresponse-logging-to.html

HTH,

Lee


> > Hi, I have a SOAP::Lite based server and an need to enable soma
> > advanced debugging. In particular, I need to print out the full
> > requests and responses for each call. But I cannot get my callbacks to
> > get invoked. In my soap server script (currently running in a
> > development environment with SOAP::Transport: :HTTP::Daemon) I have
> > tried:
> >
> > use SOAP::Lite +trace => [debug => sub {print "test!\n";}] ;
> >
> > but nothing happens. I have tried printing to a filehandle as well, but still
> no result.
> I simply use
>


#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

Messages 6282 - 6312 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