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 6288 - 6318 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#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

#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.


Messages 6288 - 6318 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