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 5106 - 5154 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#5106 From: "harbica" <andrew_harbick@...>
Date: Mon Jan 2, 2006 6:24 pm
Subject: Re: Any examples of SOAP attachments?
harbica
Send Email Send Email
 
Got it working!  Thanks for the pointer Byrne (BTW, if you search for
"attachments" on your site it doesn't turn up anything... Google found
it).  I found some stuff to  help out.

Here's the snippet that works for me:
#  Build a MIME attachment
my $name = $file; $name =~ s/.*\/([^\/]*)$/$1/;
my $ent = MIME::Entity->build(Type => "application/octet-stream",
                               Encoding => "8bit",
                               Path => $file,
                               Disposition => "attachment",
                               Id => $name,
                               Mode => 1);
$svc->parts(($ent));

die "Failed to upload file" if $svc->uploadFile(
     SOAP::Data->type("datahandler")
               ->attr({'href' => "cid:$name"})) < 0;

My JAX-RPC endpoint looks like this:
    public long uploadFile(DataHandler dh) throws RemoteException;

Working with a TCP proxy/snooper (I still use
org.apache.soap.util.net.TcpTunnelGui) I culled enough information to
  get it going.  So here's the lessons learned:

1.  Use MIME::Entity to build up the message

2.  You must have SOAP::Lite .60 or greater...  The parts() API
doesn't exist in other versions...  Looks like there was a module
SOAP::MIME that you could use with pre .60 versions but I didn't try
that out.

3.  You've gotta add a maptype for datahandler:
     $svc->maptype({datahandler => 'http://java.sun.com/jax-rpc-ri/
internal});

4.  When you build the MIME::Entity be sure to include the "Id"...
It gets added as the Content-Id header which JAXRPC expects.

5.  When you call the API be sure to pass a "datahandler" with an
href to the Content-Id that you added.

Andy

On Dec 22, 2005, at 12:49 PM, Byrne Reese wrote:

> http://www.majordojo.com/soaplite/
>

#5107 From: "wanda_b_anon" <wanda_b_anon@...>
Date: Mon Jan 2, 2006 8:43 pm
Subject: Re: client sending multiple parameter/values
wanda_b_anon
Send Email Send Email
 
I got the following to work in 0.66, but I could not understand how to
escape the XML with the Data method- the examples "return" it, but I
do not understand where to put it then so it goes to the service.


Here is what worked for me for Open Patent Services at the EPO.  Sorry
about the wrapping... it is crucial not to wrap the request, nor
squash out the spaces in the seed.

#!/usr/local/bin/perl
use SOAP::Lite 'trace' , 'debug';
print "SOAP::Lite VERSION: $SOAP::Lite::VERSION \n";

my $wsdl
='http://ops.espacenet.com/OpenPatentServices/OpenPatentServices.wsdl';

# careful to have 5 spaces after US- html squashes it to one! see
http://ops.espacenet.com/ for good requests
my $req_xml =   '<OpenPatentServices
ACTION="FamilyAndLegalAndBiblio"><WORLDPATENTDATA><FAMILY SEED=" US
   5000012A#" SEED_FORMAT="D" SEED_TYPE="PN" DESC_LNG="ENG"
DATE_MIGR="00000000"
LEGAL="YES"/></WORLDPATENTDATA></OpenPatentServices>';
# x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x xUSxyxyx400...

#<OpenPatentServices ACTION="Biblio"><WORLDPATENTDATA><BIBLIO SEED="
US     4000034A#" SEED_FORMAT="D"
SEED_TYPE="PN"/></WORLDPATENTDATA></OpenPatentServices>
# <WORLDPATENTDATA><BIBLIO
Seed="US4000034"><SDOBI><B111EP
DATE="19761228
">US4000034</B111EP><B131EP>A</B131EP><B211EP
DATE="19750815">US19750605093</B211EP><B311EP
DATE="19750815">US19750605093</B311EP><B510
TYPE="EPC">D21C11/06B2</B510><B510
TYPE="IPC">D21C11/06</B510><B510
TYPE="CI">D21C11/00</B510><B510
TYPE="AI">D21C11/06</B510><B542
TYPE="TI">Kraft mill recovery
system</B542><B570EP>An improved process for the
treatment, separation, and utilization of precipitator catch wherein
treated precipitation catch is separated by countercurrent washing in
a column.</B570EP><B711EP>HOOKER CHEMICALS PLASTICS
CORP</B711EP><B721EP>PARTRIDGE HAROLD
DEVERE;</B721EP><B721EP>FULLER WILLARD
A</B721EP></SDOBI></BIBLIO></WORLDPATENTDATA>

#<OpenPatentServices ACTION="Biblio"><WORLDPATENTDATA><BIBLIO SEED="
US     4000034A#" SEED_FORMAT="D"
SEED_TYPE="PN"/></WORLDPATENTDATA></OpenPatentServices>


print SOAP::Lite
-> service($wsdl)
#-> ns('urn:EPO-OpenPatentServices')
#-> proxy('http://ops.espacenet.com/OpenPatentServices/webService')
-> getPatentData($req_xml)
;


print SOAP::Lite
#-> service($wsdl)
-> ns('urn:EPO-OpenPatentServices')
-> proxy('http://ops.espacenet.com/OpenPatentServices/webService')
-> getPatentData($req_xml)
-> result
;

print "\nSOAP::Lite VERSION: $SOAP::Lite::VERSION \n";

print SOAP::Lite
-> service($wsdl)
#-> ns('urn:EPO-OpenPatentServices')
#-> proxy('http://ops.espacenet.com/OpenPatentServices/webService')
-> getPatentData($req_xml)
;






--- In soaplite@yahoogroups.com, "Dan Horne" <dan.horne@r...> wrote:
>
> After further testing: it works in 0.66. For older versions you'll
need to
> escape the xml tags.
>
> > -----Original Message-----
> > From: soaplite@yahoogroups.com [mailto:soaplite@yahoogroups.com]
On Behalf
> > Of Dan Horne
> > Sent: Sunday, 1 January 2006 4:51 p.m.
> > To: 'Byrne Reese'
> > Cc: 'wanda_b_anon'; soaplite@yahoogroups.com
> > Subject: RE: [soaplite] client sending multiple parameter/values
> >
> > Er, it works for me
> >
> > > -----Original Message-----
> > > From: Byrne Reese [mailto:byrne@m...]
> > > Sent: Sunday, 1 January 2006 4:47 p.m.
> > > To: Dan Horne
> > > Cc: 'wanda_b_anon'; soaplite@yahoogroups.com
> > > Subject: Re: [soaplite] client sending multiple parameter/values
> > >
> > > I am pretty sure that won't work. SOAP::Lite will interpret the
text as
> > > a string that needs to be XML escaped - not as XML that should be
> > > included as-is.
> > >
> > > Dan Horne wrote:
> > > > Sorry, I don't understand. Are you saying that I shouldn't
send XML as
> > > > shown
> > > > below?
> > > >
> > > > > -----Original Message-----
> > > > > From: Byrne Reese [mailto:byrne@m...]
> > > > > Sent: Sunday, 1 January 2006 4:31 p.m.
> > > > > To: Dan Horne
> > > > > Cc: 'wanda_b_anon'; soaplite@yahoogroups.com
> > > > > Subject: Re: [soaplite] client sending multiple parameter/values
> > > > >
> > > > > Perhaps this article may help:
> > > > > http://www.majordojo.com/soaplite/2003/05/composing_messa.html
> > > > >
> > > > > Dan Horne wrote:
> > > > > > How about:
> > > > > >
> > > > > >
> > > > > >
> > > > > > #!/usr/local/bin/perl
> > > > > > use SOAP::Lite;
> > > > > >
> > > > > > my $wsdl =
> > > > > >
> > > >
'http://ops.espacenet.com/OpenPatentServices/OpenPatentServices.wsdl';
> > > >
> > >
> >
<http://ops.espacenet.com/OpenPatentServices/OpenPatentServices.wsdl%27;>
> > > > > >
> > > > >
> > > >
> > >
> >
<http://ops.espacenet.com/OpenPatentServices/OpenPatentServices.wsdl%27;>
> > > > > > my $req_xml = <<EOT;
> > > > > > <OpenPatentServices ACTION="Biblio">
> > > > > >   <WORLDPATENTDATA>
> > > > > >      <BIBLIO
> > > > > >         SEED=" US     4000034A#"
> > > > > >         SEED_FORMAT="D" SEED_TYPE="PN"/>
> > > > > >   </WORLDPATENTDATA>
> > > > > > </OpenPatentServices>
> > > > > > EOT
> > > > > >
> > > > > > print SOAP::Lite
> > > > > >    -> service($wsdl)
> > > > > >    -> getPatentData($req_xml);
> > > > > >
> > > > > >
> > > > > > Dan
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: soaplite@yahoogroups.com
[mailto:soaplite@yahoogroups.com]
> > > On
> > > > > > Behalf
> > > > > > > Of wanda_b_anon
> > > > > > > Sent: Sunday, 1 January 2006 11:35 a.m.
> > > > > > > To: soaplite@yahoogroups.com
> > > > > > > Subject: [soaplite] client sending multiple parameter/values
> > > > > > >
> > > > > > > A specific server has defeated my knowledge of
SOAP::Lite, so I
> > am
> > > > > > > coming to the list for some help.
> > > > > > >
> > > > > > > The service I want to write a client for is described at
> > > > > > >
> > > > > > > http://ops.espacenet.com/
> > > > > > >
> > > > > > > with WSDL and input and output XML and DTD.  The WSDL
works on a
> > > > > > > demonstration client,
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
http://www.soapclient.com/soapclient?template=/clientform.html&fn=soapform
> > > >
> > >
> >
<http://www.soapclient.com/soapclient?template=/clientform.html&fn=soapfor
> > > m>
> > > > > >
> > > > >
> > > >
> > >
> >
<http://www.soapclient.com/soapclient?template=/clientform.html&fn=soapfor
> > > >
> > >
> >
<http://www.soapclient.com/soapclient?template=/clientform.html&fn=soapfor
> > > >
> > > > > m>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
&SoapTemplate=none&SoapWSDL=http://ops.espacenet.com/OpenPatentServices/Op
> > > > > > > enPatentServices.wsdl
> > > > > > >
> > > > > > > (tiny url: http://tinyurl.com/bzx33 )
> > > > > > >
> > > > > > > and gives a good response from the input_request: (remove
> > breaks)
> > > > > > >
> > > > > > > <OpenPatentServices ACTION="Biblio"><WORLDPATENTDATA>
> > > > > > > <BIBLIO SEED=" US    4000034A#" SEED_FORMAT="D"
> > > > > > > SEED_TYPE="PN"/></WORLDPATENTDATA></OpenPatentServices>
> > > > > > >
> > > > > > > But for the life of me, I do not understand how to use
> > SOAP::Lite
> > > to
> > > > > > > make the input request, especially things like
> > > > > > >
> > > > > > > <BIBLIO SEED=" US     4000034A#" SEED_FORMAT="D"
> > SEED_TYPE="PN"/>
> > > > > > >
> > > > > > > Can anyone illustrate how to construct and send this
request?
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Yahoo! Groups Links
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
----------------------------------------------------------------------
> > --
> > > > > > YAHOO! GROUPS LINKS
> > > > > >
> > > > > >     *  Visit your group "soaplite
> > > > > >       <http://groups.yahoo.com/group/soaplite>" on the web.
> > > > > >
> > > > > >     *  To unsubscribe from this group, send an email to:
> > > > > >        soaplite-unsubscribe@yahoogroups.com
> > > > > >
> > > > <mailto:soaplite-unsubscribe@yahoogroups.com?subject=Unsubscribe>
> > > > > >
> > > > > >     *  Your use of Yahoo! Groups is subject to the Yahoo!
Terms of
> > > > > >       Service <http://docs.yahoo.com/info/terms/>.
> > > > > >
> > > > > >
> > > > > >
> > > >
----------------------------------------------------------------------
> > --
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > SPONSORED LINKS
> > > > Protocol analyzer
> > > >
> > >
> >
<http://groups.yahoo.com/gads?t=ms&k=Protocol+analyzer&w1=Protocol+analyze
> > >
> >
r&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analys
> > > is&w6=Protocol&c=6&s=120&.sig=-vNi0F9sGxz3wJiUypOlsA>
> > > >  Ssl protocol
> > > >
> > >
> >
<http://groups.yahoo.com/gads?t=ms&k=Ssl+protocol&w1=Protocol+analyzer&w2=
> > >
> >
Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6
> > > =Protocol&c=6&s=120&.sig=QcUDWIbIdXkmz4QSFhqszw>
> > > >  Protocol converter
> > > >
> > >
> >
<http://groups.yahoo.com/gads?t=ms&k=Protocol+converter&w1=Protocol+analyz
> > >
> >
er&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analy
> > > sis&w6=Protocol&c=6&s=120&.sig=8MMcEvfzdk5saYSJv-2g3g>
> > > >
> > > > Sip protocol
> > > >
> > >
> >
<http://groups.yahoo.com/gads?t=ms&k=Sip+protocol&w1=Protocol+analyzer&w2=
> > >
> >
Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6
> > > =Protocol&c=6&s=120&.sig=X7aZ6IACnEQUtAC57u829w>
> > > >  Protocol analysis
> > > >
> > >
> >
<http://groups.yahoo.com/gads?t=ms&k=Protocol+analysis&w1=Protocol+analyze
> > >
> >
r&w2=Ssl+protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analys
> > > is&w6=Protocol&c=6&s=120&.sig=SI1LEHwb69y6gddZAv_Fuw>
> > > >  Protocol
> > > >
> > >
> >
<http://groups.yahoo.com/gads?t=ms&k=Protocol&w1=Protocol+analyzer&w2=Ssl+
> > >
> >
protocol&w3=Protocol+converter&w4=Sip+protocol&w5=Protocol+analysis&w6=Pro
> > > tocol&c=6&s=120&.sig=aCiMFP0b3kFn96wqrZacGA>
> > > >
> > > >
> > > >
> > > >
----------------------------------------------------------------------
> > --
> > > > YAHOO! GROUPS LINKS
> > > >
> > > >     *  Visit your group "soaplite
> > > >       <http://groups.yahoo.com/group/soaplite>" on the web.
> > > >
> > > >     *  To unsubscribe from this group, send an email to:
> > > >        soaplite-unsubscribe@yahoogroups.com
> > > >       <mailto:soaplite-
> > unsubscribe@yahoogroups.com?subject=Unsubscribe>
> > > >
> > > >     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > > >       Service <http://docs.yahoo.com/info/terms/>.
> > > >
> > > >
> > > >
----------------------------------------------------------------------
> > --
> > > >
> > >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>

#5108 From: "amla2216" <amla2216@...>
Date: Tue Jan 3, 2006 9:50 am
Subject: use_prefix has been deprecated warning
amla2216
Send Email Send Email
 
Hello,

I have a problem when upgrading to Soap::Lite 0.66

I have a simple code which worked in previous version (I replaced uri
by ns (using default_ns instead of ns doesn't solve the problem)).

use SOAP::Lite + autodispatch => ns => 'FilterList', proxy =>
'tcp://localhost:4444';
my $f = FilterList->new();
$f->add_new_filter('Filtre 1');

this code now generates several warnings on both client and server
side "use_prefix has been deprecated. if you wish to turn off or on
the use of a default namespace, then please use either ns(uri) or
default_ns(uri) at /usr/lib/perl5/site_perl/5.8.6/SOAP/Lite.pm line 858."

but the worse is that the second method (add_new_filter from my
example is never called, (it was in the previous version of SOAP::Lite)

I'm new to SOAP::Lite and I really don't see how to make this simple
peace of code work in the new version.

Any help would be gretely apprecaited.

Michael

#5109 From: Byrne Reese <byrne@...>
Date: Tue Jan 3, 2006 4:18 pm
Subject: use_prefix warnings...
byrnereese
Send Email Send Email
 
Dear SOAP::Lite developers,

I wanted to let everyone know that I am aware of the annoying use_prefix
warnings that many of you are reporting. I am going to release a patch
in the coming 48 hours to address the problem (0.67). Please be patient
and bare with me. I am a wee busy having just returned to work, so I ask
for your understanding.

In the meantime, I believe you can turn off these warnings by adding
'use no warnings;' to the top of your perl scripts.

Byrne
Lead Developer, SOAP::Lite

#5111 From: Don Seiler <don@...>
Date: Wed Jan 4, 2006 4:22 pm
Subject: Re: Passing XML strings as arguments
dtseiler
Send Email Send Email
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Don Seiler wrote:
> I'm writing a SOAP server (CGI), and some of the functions need to take
> in XML strings as arguments.  However it looks like the SOAP server is
> removing the XML string entirely, so when I check in my function the
> entire parameter is just null (I get uninitialized warnings when trying
> to use it).

Re-pinging the list.  Am I the only one trying to pass XML strings as
arguments?

- --
Don Seiler
don@...

Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xFC87F041
Fingerprint: 0B56 50D5 E91E 4D4C 83B7  207C 76AC 5DA2 FC87 F041
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFDu/Y4dqxdovyH8EERAu5IAJwMfRRHCH/TMPqedcKpJu07xejYCwCdFPge
3qkeTpK6dElWLGytNEMQ8ZI=
=dFdw
-----END PGP SIGNATURE-----

#5112 From: "dongleuk" <robh@...>
Date: Wed Jan 4, 2006 5:24 pm
Subject: Generating SOAP request manually?
dongleuk
Send Email Send Email
 
Hi,

I'm using a SOAP::Lite based client to call a method called "submit"
which takes a (fairly) complex xml structure as an argument. This
structure is used in other places so I don't want / need to generate
it using SOAP::Lite.

I'm trying to call the method using something like:

$soap = SOAP::Lite->new()
      ->uri($uri)
      ->proxy($proxy)
      ->encprefix('')
      ->encoding('UTF-8')
      ->use_prefix(0)
      ->encodingStyle(undef)
      ->autotype(0)
      ->submit($xml);

which generates a request which looks like:

<soap:Body>
   <submit xmlns="http://workflowengine.ixico.net">
     <c-gensym2>
       <xmlstuff...>
     </c-gensym2>
etc...


The <c-gensym2> tags (which appear to be generated by
&SOAP::Serializer::gen_name) are causing the request to be rejected by
the (axis) server.

Is it possible to either:
1) Generate the request without the <c-gensym2> tags?

or

2) Generate the entire SOAP request manually? Obviously this would be
fairly simple in this case since I just need to put <submit> tags
round the xml data.

The SOAP::Lite man page seems to imply this is possible but doesn't
really describe how to - I'm guessing I need to supply an alternative
to SOAP::Serializer?

Sorry if this is obvious / has been asked before but I can't find it
anywhere :)

Thanks,

Rob

#5113 From: "Nate" <nate@...>
Date: Wed Jan 4, 2006 10:24 pm
Subject: Sibling Root Elements? Amazon woes
jashmenn
Send Email Send Email
 
Greetings, I am having some difficulties getting SOAP::Lite to have
two sibling root elements. Why would I want to do this? Because Amazon
requires it, oddly enough. Below is a (cleaned-up) version of the SOAP
request I intercepted from the Amazon-created-but-not-supported
Merchant Transport Utility (http://sourceforge.net/projects/amtu/).

Now I am certainly not looking for anyone to help me write my SOAP
client to Amazon, I just have one question:

How can I achieve this effect of sibling root elements using
SOAP::Lite? ( The tags 'Body -> merchant' and 'Body -> messageType' )

Whenever I try to actually 'call' the method it seems that method name
becomes the root element tag.

<?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"
  xmlns:syst="http://systinet.com/xsd/SchemaTypes/"
  xmlns:amazon="http://www.amazon.com/merchants/merchant-interface/">
  <soapenv:Body>
   <syst:merchant>
    <amazon:merchantIdentifier>A_FOO_BAR</amazon:merchantIdentifier>
    <amazon:merchantName>Foo Bar Inc</amazon:merchantName>
   </syst:merchant>
   <syst:messageType>_GET_ORDERS_DATA_</syst:messageType>
  </soapenv:Body>
</soapenv:Envelope>

-Nate Murray http://www.natemurray.com

p.s. For those of you who are wondering YES they do provide a WSDL but
it makes liberal use of MIME bindings and SOAP::Lite does not seem to
be able to parse it. ("Can't call method 'namespace' on undefined
value." is the error)

#5114 From: Byrne Reese <byrne@...>
Date: Wed Jan 4, 2006 11:23 pm
Subject: use_prefix warnings update
byrnereese
Send Email Send Email
 
Dear SOAP::Lite Users,

I am uploading into CPAN as we speak SOAP::Lite 0.66.1 - this is a MINOR
release that simply suppresses the warning message about the use of
use_prefix. It does not fix any other underlying problems. I wanted to
get this out there as a stop gap so that people's error logs weren't
getting spammed with these warning messages.

Meanwhile, I working on unraveling a bit of the SOAP::Lite code base to
see if I can't fix the problem more elegantly. I am using the Delayed
Stock Quote service as a core use case, and so far I have been unable to
send a message to it without hacking the source code directly to swap
out the use of "ns()" for "default_ns()". Long story short, I have some
work to do. My sincerest apologies for any trouble this has caused. I am
working on a fix. But if you have ever looked at the SOAP::Lite source
code, you may have some empathy for me. Paul (the original author) is a
genius (sincerely), but reading the notes of a genius can be
excruciating work sometimes. :)

Anyway - here is what I am proposing I do:

I am going to rewrite the source code that SOAP::Lite generates from a
WSDL file, then I am going to modify SOAP::Lite to generate that
sourcecode as opposed to what it is generated currently.

Take a look at this code:
my $client = SOAP::Lite->service(<URL TO WSDL>);

Now, let me ask you: what do you think is the object type of the $client
variable? The intuitive response I believe is the same thing that would
be returned if I called:
my $client = SOAP::Lite->proxy(<URL TO endpoint>)->ns(<NAMESPACE>);

Or in other words, an instance of a SOAP::Lite client. It is in fact an
instance of net_xmethods_services_stockquote_StockQuoteService. Which is
fine by me assuming I can still access the accessors or a SOAP::Lite
client to toggle the use of a default namespace or not.

Anyway, for the Perl hackers out there who are interested - here is a
snapshot of the code SOAP::Lite generates based upon a WSDL. You may
notice that it is not that object oriented. I need to fix that. But then
again, there are sooooo many things about SOAP::Lite I need to fix.

# Generated by SOAP::Lite (v0.66) for Perl -- soaplite.com
# Copyright (C) 2000-2006 Paul Kulchenko, Byrne Reese
# -- generated at [Wed Jan  4 14:06:54 2006]
# -- generated from http://www.xmethods.net/sd/StockQuoteService.wsdl
package net_xmethods_services_stockquote_StockQuoteService;
my %methods = (
getQuote => {
     endpoint => 'http://services.xmethods.net/soap',
     soapaction => 'urn:xmethods-delayed-quotes#getQuote',
     namespace => 'urn:xmethods-delayed-quotes',
     parameters => [
       SOAP::Data->new(name => 'symbol', type => 'xsd:string', attr => {}),
     ], # end parameters
   }, # end getQuote
); # end my %methods

use SOAP::Lite;
use Exporter;
use Carp ();

use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter SOAP::Lite);
@EXPORT_OK = (keys %methods);
%EXPORT_TAGS = ('all' => [@EXPORT_OK]);

sub _call {
   my ($self, $method) = (shift, shift);
   my $name = UNIVERSAL::isa($method => 'SOAP::Data') ? $method->name :
$method;
   my %method = %{$methods{$name}};
   $self->proxy($method{endpoint} || Carp::croak "No server address
(proxy) specified")
     unless $self->proxy;
   my @templates = @{$method{parameters}};
   my @parameters = ();
   foreach my $param (@_) {
     if (@templates) {
       my $template = shift @templates;
       my ($prefix,$typename) = SOAP::Utils::splitqname($template->type);
       my $method = 'as_'.$typename;
       # TODO - if can('as_'.$typename) {...}
       my $result = $self->serializer->$method($param, $template->name,
$template->type, $template->attr);
       push(@parameters, $template->value($result->[2]));
     } else {
       push(@parameters, $param);
     }
   }
   $self->endpoint($method{endpoint})
        ->ns($method{namespace})
        ->on_action(sub{qq!"$method{soapaction}"!});

$self->serializer->register_ns("http://www.themindelectric.com/","electric");

$self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/soap/","soap");
   $self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/","wsdl");

$self->serializer->register_ns("http://schemas.xmlsoap.org/soap/encoding/","soap\
enc");

$self->serializer->register_ns("http://www.themindelectric.com/wsdl/net.xmethods\
.services.stockquote.St
ockQuote/","tns");
   $self->serializer->register_ns("http://www.w3.org/2001/XMLSchema","xsd");
   my $som = $self->SUPER::call($method => @parameters);
   if ($self->want_som) {
       return $som;
   }
   UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall :
$som->result : $som;
}

sub BEGIN {
   no strict 'refs';
   for my $method (qw(want_som)) {
     my $field = '_' . $method;
     *$method = sub {
       my $self = shift->new;
       @_ ? ($self->{$field} = shift, return $self) : return $self->{$field};
     }
   }
}
no strict 'refs';
for my $method (@EXPORT_OK) {
   my %method = %{$methods{$method}};
   *$method = sub {
     my $self = UNIVERSAL::isa($_[0] => __PACKAGE__)
       ? ref $_[0] ? shift # OBJECT
                   # CLASS, either get self or create new and assign to self
                   : (shift->self || __PACKAGE__->self(__PACKAGE__->new))
       # function call, either get self or create new and assign to self
       : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new));
     $self->_call($method, @_);
   }
}

sub AUTOLOAD {
   my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
   return if $method eq 'DESTROY' || $method eq 'want_som';
   die "Unrecognized method '$method'. List of available method(s):
@EXPORT_OK\n";
}

1;

#5115 From: Eric Bridger <eric@...>
Date: Thu Jan 5, 2006 6:23 pm
Subject: Re: Generating SOAP request manually?
ebridger2004
Send Email Send Email
 
You will need to use the SOAP::Data element to define both your method
and your parameters

See:

http://www.majordojo.com/soaplite/docs/SOAP/Data.html#COMPOSING_MESSAGES_USING_R\
AW_XML

Then use the SOAP::Lite->call method.

See: (in a different context but shows the general idea)
http://www.majordojo.com/soaplite/2003/04/how_to_specify.html

HTH
Eric


On Wed, 2006-01-04 at 12:24, dongleuk wrote:
> Hi,
>
> I'm using a SOAP::Lite based client to call a method called "submit"
> which takes a (fairly) complex xml structure as an argument. This
> structure is used in other places so I don't want / need to generate
> it using SOAP::Lite.
>
> I'm trying to call the method using something like:
>
> $soap = SOAP::Lite->new()
>      ->uri($uri)
>      ->proxy($proxy)
>      ->encprefix('')
>      ->encoding('UTF-8')
>      ->use_prefix(0)
>      ->encodingStyle(undef)
>      ->autotype(0)
>      ->submit($xml);
>
> which generates a request which looks like:
>
> <soap:Body>
>   <submit xmlns="http://workflowengine.ixico.net">
>     <c-gensym2>
>       <xmlstuff...>
>     </c-gensym2>
> etc...
>
>
> The <c-gensym2> tags (which appear to be generated by
> &SOAP::Serializer::gen_name) are causing the request to be rejected by
> the (axis) server.
>
> Is it possible to either:
> 1) Generate the request without the <c-gensym2> tags?
>
> or
>
> 2) Generate the entire SOAP request manually? Obviously this would be
> fairly simple in this case since I just need to put <submit> tags
> round the xml data.
>
> The SOAP::Lite man page seems to imply this is possible but doesn't
> really describe how to - I'm guessing I need to supply an alternative
> to SOAP::Serializer?
>
> Sorry if this is obvious / has been asked before but I can't find it
> anywhere :)
>
> Thanks,
>
> Rob
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>

#5117 From: "herk_destro" <herk_destro@...>
Date: Fri Jan 6, 2006 2:57 pm
Subject: Malformed Headers
herk_destro
Send Email Send Email
 
Howdy,

   I have written a SOAP server and seemed to have encountered
something bizarre, and I am not sure where to go on it.  This is the
core of my SOAP Server.

--Begin after this line--
#!/usr/bin/perl -w

use strict;
use SOAP::Transport::HTTP;
use MyServer::Server;
SOAP::Transport::HTTP::CGI->dispatch_to('RetrieverService')
     ->handle;

package RetrieverService;

sub retrieveInfo {
     my $self    = shift;
     my $request = shift;

     return "SUCCESS Before object";
     my $server = MyServer::Server->new({
         request_xml => $request
     });
     return "SUCCESS After object";

     return $server->response if ($server->error );
     return $server->response if (not $server->request_valid );
     return $server->response if (not $server->request_case  );
     return ( $server->response, $server->get_case );
}
--end here--

When I run this script, I encounter the first return "SUCCESS Before
object" and it returns the value just fine.  If I comment out that
line and try to get the second return to execute, I get a 500 error.
Looking in the Apache logs gives me,

malformed header from script. Bad heaer=<?xml version="1.0" encoding=":

I am not sure what mistake I am making, should I move this out to a
module instead of having it in the Server script?  Do I need some
header information?  Someone have an ideas?

Steve Kirkup

#5118 From: "Steve Piercey" <PIERCEY@...>
Date: Fri Jan 6, 2006 3:02 pm
Subject: base64Binary SOAP::Lite problem with Apache Axis
vbfan78
Send Email Send Email
 
I'm using SOAP::Lite 0.66.1 as a client (though it fails with other
releases) and having a problem receiving byte arrays from an
Apache Axis server.
I'm using Axis v1.3 and it appears that the SOAP::Lite "base64Binary" is no
longer working.
I get a message "Unrecognized type
'{http://schemas.xmlsoap.org/soap/encoding/}base64Binary'"
If I go back to v1.1 everything works correctly. I am using the '2001'
schema by SOAP::Lite ... , xmlschema => '2001'
I've included the response envelope from the two different versions.
NOTE the <getGrahicReturn 'xsi:type=..."> difference. Shouldn't SOAP::Lite
be able to handle the newer soap encoding schema?

Thanks
Steve


Axis v1.1
------------------------------------
<?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>

<ns1:getGraphicResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:Xpp">
<ns1:getGraphicReturn xsi:type="xsd:base64Binary">
JSFQUy1BZG9iZS0zLjAgRVBTRi0zLjAKCiUlQm91bmRpbmdCb3g6IDUgNSAxMDUgMTA1CjEwIHNl
dGxp
bmV3aWR0aAoxMCAxMCBtb3ZldG8KMCA5MCBybGluZXRvIDkwIDAgcmxpbmV0byAwIC05MCBybGlu
ZXRv
IGNsb3NlcGF0aApzdHJva2U=</ns1:getGraphicReturn></ns1:getGraphicResponse></so
apenv:Body></soapenv:Envelope>

Axis v1.3
----------------------------------------
<?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>

<ns1:getGraphicResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:Xpp">
<getGraphicReturn xsi:type="soapenc:base64Binary"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
JSFQUy1BZG9iZS0zLjAgRVBTRi0zLjAKCiUlQm91bmRpbmdCb3g6IDUgNSAxMDUgMTA1CjEwIHNl
dGxp
bmV3aWR0aAoxMCAxMCBtb3ZldG8KMCA5MCBybGluZXRvIDkwIDAgcmxpbmV0byAwIC05MCBybGlu
ZXRv
IGNsb3NlcGF0aApzdHJva2U=</getGraphicReturn></ns1:getGraphicResponse></soapen
v:Body></soapenv:Envelope>

#5120 From: "Nate" <nate@...>
Date: Fri Jan 6, 2006 8:28 pm
Subject: No "start" attribute in Content-Type: trouble with WASP and MIME
jashmenn
Send Email Send Email
 
I am working with Amazons (WASP, I believe) server to download MIME
attachments. The problem is WASP doesn't send the optional 'start'
attribute in the Content-Type header. This causes SOAP::Lite to die.
Obviously I could handle the fault so it wouldnt die, but I still
would not be able to parse the MIME.

I guess I could override the method and do my own MIME parsing (bluhk,
  I'd rather not...)

Anyone have any suggestions?

-Nate Murray

#5121 From: Byrne Reese <byrne@...>
Date: Fri Jan 6, 2006 8:59 pm
Subject: Re: No "start" attribute in Content-Type: trouble with WASP and MIME
byrnereese
Send Email Send Email
 
I assume you are using SOAP::Lite 0.66.1.

I would also contact Amazon - as the W3C SOAP with Attachment
specification strongly recommends that the start parameter be present.

http://www.w3.org/TR/SOAP-attachments
It is strongly recommended that the root part contain a |Content-ID|
MIME header structured in accordance with RFC 2045
<http://www.w3.org/TR/2000/NOTE-SOAP-attachments-20001211#MIME1>, and
that in addition to the required parameters for the |Multipart/Related|
media type, the start parameter (optional in RFC 2387
<http://www.w3.org/TR/2000/NOTE-SOAP-attachments-20001211#MultipartRelated>)
always be present. This permits more robust error detection.

But since technically it is not required, let me take a look.

Nate wrote:
> I am working with Amazons (WASP, I believe) server to download MIME
> attachments. The problem is WASP doesn't send the optional 'start'
> attribute in the Content-Type header. This causes SOAP::Lite to die.
> Obviously I could handle the fault so it wouldnt die, but I still
> would not be able to parse the MIME.
>
> I guess I could override the method and do my own MIME parsing (bluhk,
> I'd rather not...)
>
> Anyone have any suggestions?
>
> -Nate Murray
>
>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "soaplite
>       <http://groups.yahoo.com/group/soaplite>" on the web.
>
>     *  To unsubscribe from this group, send an email to:
>        soaplite-unsubscribe@yahoogroups.com
>       <mailto:soaplite-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>

#5122 From: Byrne Reese <byrne@...>
Date: Fri Jan 6, 2006 9:04 pm
Subject: Re: No "start" attribute in Content-Type: trouble with WASP and MIME
byrnereese
Send Email Send Email
 
Weird - it should behave correctly with 0.66+. Here is the code from the
Packager:

   die "Multipart MIME messages MUST declare Multipart/Related content-type"
     if ($entity->head->mime_attr('content-type') !~ /^multipart\/related/i);
   my $start =
get_multipart_id($entity->head->mime_attr('content-type.start'))
     || get_multipart_id($entity->parts(0)->head->mime_attr('content-id'));
   my $location = $entity->head->mime_attr('content-location') ||
     'thismessage:/';

As you can see - it first looks for the start parameter and if it cannot
be found it simply grabs the content id of the root part... do you have
code I can use to reproduce the problem?

Nate wrote:
> I am working with Amazons (WASP, I believe) server to download MIME
> attachments. The problem is WASP doesn't send the optional 'start'
> attribute in the Content-Type header. This causes SOAP::Lite to die.
> Obviously I could handle the fault so it wouldnt die, but I still
> would not be able to parse the MIME.
>
> I guess I could override the method and do my own MIME parsing (bluhk,
> I'd rather not...)
>
> Anyone have any suggestions?
>
> -Nate Murray
>
>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "soaplite
>       <http://groups.yahoo.com/group/soaplite>" on the web.
>
>     *  To unsubscribe from this group, send an email to:
>        soaplite-unsubscribe@yahoogroups.com
>       <mailto:soaplite-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>

#5123 From: "dcraul70" <dcraul70@...>
Date: Mon Jan 9, 2006 2:17 pm
Subject: Problem with the installation of Soap::Liste 0.66.1 Patch
dcraul70
Send Email Send Email
 
Hi,

i am running Windows XP SP1 with Active Perl 5.8.0 Build 806. When I
do the "nmake test" the result I get is the lines below. I can build
the 0.66 base version properly though.

Can anybody advise?


         E:\Perl\bin\perl.exe -MExtUtils::Command -e cp bin/SOAPsh.pl
blib\scrip
\SOAPsh.pl
         pl2bat.bat blib\script\SOAPsh.pl
         E:\Perl\bin\perl.exe -MExtUtils::Command -e cp
bin/stubmaker.pl blib\sc
ipt\stubmaker.pl
         pl2bat.bat blib\script\stubmaker.pl
         E:\Perl\bin\perl.exe -MExtUtils::Command -e cp bin/XMLRPCsh.pl
blib\scr
pt\XMLRPCsh.pl
         pl2bat.bat blib\script\XMLRPCsh.pl
         E:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'b
ib\lib', 'blib\arch')" t/01-core.t t/02-payload.t t/03-server.t
t/04-attach.t t
05-customxml.t t/06-modules.t t/07-xmlrpc_payload.t t/08-schema.t
t/01-core..............ok 1/35# Failed test 2 in t/01-core.t at line 31
t/01-core..............ok 3/35# Failed test 4 in t/01-core.t at line 45
t/01-core..............NOK 4# Failed test 5 in t/01-core.t at line 50
t/01-core..............FAILED tests 2, 4-5
         Failed 3/35 tests, 91.43% okay
t/02-payload...........ok
t/03-server............ok
         8/32 skipped: Could not find MIME::Parser - is MIME::Tools
installed? A
orting.
t/04-attach............skipped
         all skipped: Could not find MIME::Parser - is MIME::Tools
installed? Ab
rting.
t/05-customxml.........ok
t/06-modules...........ok
         5/19 skipped: various reasons
t/07-xmlrpc_payload....ok
t/08-schema............ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/01-core.t               35    3   8.57%  2 4-5
1 test and 13 subtests skipped.
Failed 1/8 test scripts, 87.50% okay. 3/306 subtests failed, 99.02% okay.
NMAKE : fatal error U1077: 'E:\Perl\bin\perl.exe': R³ckgabe-Code '0xff'
Stop.

#5125 From: "wanda_b_anon" <wanda_b_anon@...>
Date: Tue Jan 10, 2006 8:20 pm
Subject: service XML response not parsed
wanda_b_anon
Send Email Send Email
 
I get a response from a server that looks like good XML, but
SOAP::Lite only provides it as a long string of XML rather than
parsing it into a hash of entities, attributes, and values as I
expected.  Am I doing something wrong?  Can I feed the string into a
parser and get the hash I expect?

Here is a response string and code to exercise the server.

<WORLDPATENTDATA><BIBLIO Seed="US4000034"><SDOBI><B111EP
DATE="19761228">US4000034</B111EP><B131EP>A</B131EP><B211EP
DATE="19750815">US19750605093</B211EP><B311EP
DATE="19750815">US19750605093</B311EP><B510
TYPE="EPC">D21C11/06B2</B510><B510 TYPE="IPC">D21C11/06</B510><B510
TYPE="CI">D21C11/00</B510><B510 TYPE="AI">D21C11/06</B510><B542
TYPE="TI">Kraft mill recovery system</B542><B570EP>An improved process
for the treatment, separation, and utilization of precipitator catch
wherein treated precipitation catch is separated by countercurrent
washing in a column.</B570EP><B711EP>HOOKER CHEMICALS PLASTICS
CORP</B711EP><B721EP>PARTRIDGE HAROLD DEVERE;</B721EP><B721EP>FULLER
WILLARD A</B721EP></SDOBI></BIBLIO></WORLDPATENTDATA>


#!/usr/bin/perl
use SOAP::Lite 'trace' , 'debug';
print "SOAP::Lite VERSION: $SOAP::Lite::VERSION \n";

# service described at http://ops.espacenet.com/
my $wsdl =
'http://ops.espacenet.com/OpenPatentServices/OpenPatentServices.wsdl';
my $req_xml = '<OpenPatentServices ACTION="Biblio">'
.'<WORLDPATENTDATA><BIBLIO SEED=" US '.' '.' '.' '.' '.
'4000034A#" SEED_FORMAT="D" SEED_TYPE="PN"/>'.'
</WORLDPATENTDATA></OpenPatentServices>';

my $som = SOAP::Lite
-> ns('urn:EPO-OpenPatentServices')
-> proxy('http://ops.espacenet.com/OpenPatentServices/webService')
-> getPatentData($req_xml);

print "\n\nHere it comes:\n", $som->result(), "\n\n",
${${${$som->envelope()}{'Body'}}{'getPatentDataResponse'}}{'getPatentDataReturn'\
},
"\n\n",
${${$som->body()}{'getPatentDataResponse'}}{'getPatentDataReturn'},
"\n\n",$som->faultdetail(),
"\n\n",%{$som->method()} ;

#5126 From: "tilmant_a" <amelie.tilmant@...>
Date: Wed Jan 11, 2006 3:09 pm
Subject: Modify Namespace in SOAP envelope
tilmant_a
Send Email Send Email
 

Hi,

First I'm newbie in Perl.

I would like to change the soap envelope in order to have something like this :


<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
  xmlns:wsman="http://schemas.xmlsoap.org/ws/2005/06/management"
  xmlnss="http://www.w3.org/2001/XMLSchema">

I tried the following function but nothing seems to work.

use SOAP::Lite +trace;
my $client=SOAP::Lite->new();

$client->serializer->namespaces("http://schemas.xmlsoap.org/soap/encoding/"=>"SOAP-ENC",
"
http://schemas.xmlsoap.org/soap/envelope/"=>"SOAP-ENV",
"
http://www.w3.org/2001/XMLSchema"=>"xs",
"
http://www.w3.org/2001/XMLSchemainstance"=>"xsi",
"
http://schemas.xmlsoap.org/ws/2004/08/adressing"=>"wsa");

$client->envprefix('env');

$client->xmlschema("http://www.w3.org/2001/XMLSchema");

$client->proxy("http://localhost:8080/wsman?ResourceURI=wsman:system/2005/02/this");
$client->uri("
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get");

my $som =$client->request();
my $output=$som->result;
print $output ."\n";

 

I have got this error :

SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP:eserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
Can't use string ("
http://schemas.xmlsoap.org/soap/") as a HASH ref while "stric
t refs" in use at D:/Perl/site/lib/SOAP/Lite.pm line 773.
SOAP::Lite:ESTROY: ()
SOAP:eserializer:ESTROY: ()
SOAP::Parser:ESTROY: ()
SOAP::Transport:ESTROY: ()
SOAP::Serializer:ESTROY: ()

 


Then I tried something like this

use SOAP::Lite +trace;
my $client=SOAP::Lite->new();
$client->proxy("
http://localhost:8080/wsman?ResourceURI=wsman:system/2005/02/this");
$client->uri("
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get");

$client->serializer->register_ns('http://schemas.xmlsoap.org/ws/2004/08/adressing','wsa');

my $som =$client->request();
my $output=$som->result;
print $output ."\n";

In this case nothing change and 'wsa' don't appear in the trace.

I already have a look in SOAP cookbook, Active Perl Guide ...

If someone can help me ....

Thanks,

Amelie


#5127 From: Eric Bridger <eric@...>
Date: Wed Jan 11, 2006 4:06 pm
Subject: Re: Modify Namespace in SOAP envelope
ebridger2004
Send Email Send Email
 
I've used SOAP::Serializer->register_ns(uri, prefix). The prefix is
optional.

$client->serializer->register_ns(
	 "http://schemas.xmlsoap.org/ws/2004/08/addressing, "wsa");

You'll need to repeat for each namespace.

But I believe you get the 2001/XMLSchema attributes by default.

Eric


On Wed, 2006-01-11 at 10:09, tilmant_a wrote:
>
> Hi,
>
> First I'm newbie in Perl.
>
> I would like to change the soap envelope in order to have something like this
:
>
>
> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
>   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
>   xmlns:wsman="http://schemas.xmlsoap.org/ws/2005/06/management"
>   xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
> I tried the following function but nothing seems to work.
>
> use SOAP::Lite +trace;
> my $client=SOAP::Lite->new();
>
>
$client->serializer->namespaces(""SOAP-ENC">http://schemas.xmlsoap.org/soap/enco\
ding/"=>"SOAP-ENC",
> ""SOAP-ENV">http://schemas.xmlsoap.org/soap/envelope/"=>"SOAP-ENV",
> ""xs">http://www.w3.org/2001/XMLSchema"=>"xs",
> ""xsi">http://www.w3.org/2001/XMLSchemainstance"=>"xsi",
> ""wsa">http://schemas.xmlsoap.org/ws/2004/08/adressing"=>"wsa");
>
> $client->envprefix('env');
>
> $client->xmlschema("http://www.w3.org/2001/XMLSchema");
>
>
$client->proxy("http://localhost:8080/wsman?ResourceURI=wsman:system/2005/02/thi\
s");
> $client->uri("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get");
>
> my $som =$client->request();
> my $output=$som->result;
> print $output ."\n";
>
>
>
> I have got this error :
>
> SOAP::Transport::new: ()
> SOAP::Serializer::new: ()
> SOAP::Deserializer::new: ()
> SOAP::Parser::new: ()
> SOAP::Lite::new: ()
> Can't use string ("http://schemas.xmlsoap.org/soap/") as a HASH ref while
"stric
> t refs" in use at D:/Perl/site/lib/SOAP/Lite.pm line 773.
> SOAP::Lite::DESTROY: ()
> SOAP::Deserializer::DESTROY: ()
> SOAP::Parser::DESTROY: ()
> SOAP::Transport::DESTROY: ()
> SOAP::Serializer::DESTROY: ()
>
>
>
>
> Then I tried something like this
>
> use SOAP::Lite +trace;
> my $client=SOAP::Lite->new();
>
$client->proxy("http://localhost:8080/wsman?ResourceURI=wsman:system/2005/02/thi\
s");
> $client->uri("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get");
>
>
$client->serializer->register_ns('http://schemas.xmlsoap.org/ws/2004/08/adressin\
g','wsa');
>
> my $som =$client->request();
> my $output=$som->result;
> print $output ."\n";
>
> In this case nothing change and 'wsa' don't appear in the trace.
>
> I already have a look in SOAP cookbook, Active Perl Guide ...
>
> If someone can help me ....
>
> Thanks,
>
> Amelie
>
>

#5133 From: "pfconrey" <pfconrey@...>
Date: Wed Jan 18, 2006 7:04 pm
Subject: .NET Problem with Response in SOAP::Lite 0.66
pfconrey
Send Email Send Email
 
I am returning the following envelope to a .NET Client, which only
partially works. The client recognizes that there are 2 "Summary"
objects returned in the array, but all of the properies of each of the
objects is set to null:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <SearchResponse xmlns="http://crm.mycompany.com/gpm/ws/Property">
       <PropertyList soapenc:arrayType="Summary[2]"
                     xsi:type="soapenc:Array">
         <Summary>
           <PropertyCode xsi:type="xsd:string">ABCDE</PropertyCode>
           <BrandCode xsi:type="xsd:string">AB</BrandCode>
           <Name xsi:type="xsd:string">Property A</Name>
           <Address xsi:type="xsd:string">123 ANY STREET</Address>
           <City xsi:type="xsd:string">SOMETOWN</City>
           <State xsi:type="xsd:string">AK</State>
           <Country xsi:type="xsd:string">US</Country>
         </Summary>
         <Summary>
           <PropertyCode xsi:type="xsd:string">VWXYZ</PropertyCode>
           <BrandCode xsi:type="xsd:string">YZ</BrandCode>
           <Name xsi:type="xsd:string">Property Z</Name>
           <Address xsi:type="xsd:string">
             321 GOINGNOWHERE ROAD
           </Address>
           <City xsi:type="xsd:string">SOMETOWN</City>
           <State xsi:type="xsd:string">AK</State>
           <Country xsi:type="xsd:string">US</Country>
         </Summary>
       </PropertyList>
     </SearchResponse>
   </soap:Body>
</soap:Envelope>

SOAP::Lite 0.60 adds a namespace prefix to the "SearchResponse" element:

     <namesp2:SearchResponse
              xmlns:namesp2="http://crm.mycompany.com/gpm/ws/Property">
       ...
     </namesp2:SearchResponse>

everything works fine.  Is there something about that namespace not
being there that makes .NET choke?  Any thoughts?

#5135 From: "herk_destro" <herk_destro@...>
Date: Fri Jan 20, 2006 8:28 pm
Subject: XMLSchema encoding
herk_destro
Send Email Send Email
 
Howdy,

   I am trying to write a client that sends an XML message, however it
requires me to use a Schema with it.

This is a sample  of the XML I was trying to send.  It fails on the
Axis server horribly.

<echoRequest>
<JITRequest>
   <RequestDateTime>2006-10-05T12:20:20</RequestDateTime>
</JITRequest>
</echoRequest>

This is the formatted XML that I got working,

<echoRequest>
<ns1:JITRequest xmlns:ns1="http://urn:us:gov:hhs:act:jitrequest">
   <ns2:RequestDateTime xsi:type="xsd:dateTime"
xmlns:ns2="urn:us:gov:hhs:act:cse">2006-10-05T12:20:20</ns2:RequestDateTime>
</ns1:JITRequest>
</echoRequest>

There is a WSDL that refers to .xsd for the Schema information.

I am just stuck, I am not sure if SOAP::Lite can do the formatting and
if it does, what I should be looking for.  Can anyone help?

Steve Kirkup

#5141 From: Philip Reetz <p.reetz@...>
Date: Mon Jan 23, 2006 11:16 am
Subject: SOAP Serverresponse with compleyType
philipreetz
Send Email Send Email
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
I've got the following problem: I'm using SOAP::Lite 0.66 to realise a
SOAP-Server. Everything works fine. The only thing that's really getting
to me is multiple occurrences of elements.
Example:
Clientrequest
<foo>
   <bar>123</bar>
   <bar>234</bar>
   <bar>333</bar>
</foo>
is deserialized to
$response{'foo'}{'bar'}[0-2]
perfect.

But what must I do to produce the same xml-structure in my
server-response. I tried to put an array in the hash but the result on
the client was something like SOAP::Data(Hashx98).

I'm really desperate. Anybody knows how to handle such a thing easily.
Usually I use Hashes  and return SOAP::Data->name('responseElement' =>
\%response);
in my Server sub and everything is serialized fine by SOAP::Lite.

Any help is greatly appreciated.

Bye,
Phil

PS: I did look at the example on how to encode arrays in SOAP:Lite:Data.
But I'm either to dumb or it is not for my problem: I didn't get it
running. And I would like to keep the Hashes. It is so simple ;)
- --
LINET Services GbR

Gotenweg 15                      Tel.: 0531-280 191 71
38106 Braunschweig               Fax.: 0531-280 191 72

http://www.linet-services.de
mailto:info@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD1Lr6Hf7qoDPJh6ERAqD9AJ98HwqaAFdNEmfOO8AiiSpfcEwBEQCffSkS
IwAlcAyHtFFNjWw77UrbnFc=
=Vk1K
-----END PGP SIGNATURE-----

#5146 From: "csuresh02" <csuresh02@...>
Date: Tue Jan 24, 2006 6:25 pm
Subject: SOAP request using XM L
csuresh02
Send Email Send Email
 
I've XML request like the below one from this I would like to send a
soap request. Can some one tell me whether is possible to send a xml
request like this using SOAP::Lite. If so please let me know clear
examples .



<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
   <ns1:getConfiguration xmlns:ns1="urn:CSSoapServer"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
       <getRequest>
          <REQUEST>
            <TABLE name="TABLE_ALAD_USERS" operation="fetch">
             <RECORD  seqNo="all">
              <FIELD name="Seq_nbr"></FIELD>
              <FIELD name="UserID"></FIELD>
               <FIELD name="Description"></FIELD>
               <FIELD name="Password"></FIELD>
               <FIELD name="ProfileID"></FIELD>
            </RECORD>
          </TABLE>
        </REQUEST>
      </getRequest>
    </ns1:getConfiguration>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Thanking you all in advance
Suresh C

#5147 From: "tilmant_a" <amelie.tilmant@...>
Date: Wed Jan 25, 2006 2:32 pm
Subject: generate uuid and check soap envelope
tilmant_a
Send Email Send Email
 

Hi,

I would like to generate an UUID using soaplite.  Data::uuid seems to be good way to do that but I can't succeed in installing it in windows 2003 server.

If someone can help me?

Otherwise I try to implement this soap envelope

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="
http://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="
http://schemas.xmlsoap.org/ws/2004/08/addressing"
  xmlns:wse="
http://schemas.xmlsoap.org/ws/2004/08/eventing"
  xmlns:wsen="
http://schemas.xmlsoap.org/ws/2004/09/enumeration"
  xmlns:wsman="
http://schemas.xmlsoap.org/ws/2005/06/management"
  xmlns:wsmancat="
http://schemas.xmlsoap.org/ws/2005/06/wsmancat"
  xmlns:wxf="
http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlnss="http://www.w3.org/2001/XMLSchema">
  <env:Header>
    <wsa:To env:mustUnderstand="true">http://localhost:8080/wsman/</wsa:To>
    <wsman:ResourceURI>wsman:system/2005/02/this</wsman:ResourceURI>
    <wsa:Action env:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>
    <wsa:ReplyTo>
      <wsa:Address env:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsa:MessageID env:mustUnderstand="true">uuid:b184ed90-e6a5-49db-a640-e9f883003e07</wsa:MessageID>
  </env:Header>
  <env:Body/>
</env:Envelope>

This is my code :

package SOAP::Header;
package SOAP:ata;
use SOAP::Lite +trace ;

my $client=SOAP::Lite->new();
$client->envprefix('env');

$client->serializer()->register_ns('http://schemas.xmlsoap.org/ws/2004/08/addressing', 'wsa');
$client->serializer()->register_ns('http://schemas.xmlsoap.org/ws/2005/06/management', 'wsman');
$client->serializer()->register_ns('http://schemas.xmlsoap.org/ws/2004/08/eventing','wse');
$client->serializer()->register_ns('http://schemas.xmlsoap.org/ws/2004/09/enumeration', 'wsen');
$client->serializer()->register_ns('http://schemas.xmlsoap.org/ws/2005/06/wsmancat', 'wsmancat');
$client->serializer()->register_ns('http://schemas.xmlsoap.org/ws/2004/09/transfer', 'wxf');
$client->serializer()->register_ns('http://www.w3.org/2001/XMLSchema', 'xs');

$client->proxy("http://localhost:8080/wsman?ResourceURI=wsman:system/2005/02/this");
$client->uri("
http://schemas.xmlsoap.org/ws/2004/09/transfer/Get");

$client->readable(1);

sub generate_random_string
{
 my $length_of_randomstring=shift;# the length of the random string to generate

 my @chars=('a'..'f','0'..'9');
 my $random_string;
 foreach (1..$length_of_randomstring)
 {
  # rand @chars will generate a random
  # number between 0 and scalar @chars
  $random_string.=$chars[rand @chars];
 }
 return $random_string;
}

#Generate the random string
my $random_string1=&generate_random_string(8);
my $random_string2=&generate_random_string(4);
my $random_string3=&generate_random_string(4);
my $random_string4=&generate_random_string(4);
my $random_string5=&generate_random_string(12);

my $uuid = "uuid:".$random_string1."-".$random_string2."-".$random_string3."-".$random_string4."-".$random_string5;

import  SOAP:ata 'name';

$header_To=SOAP::Header->name('To'=>'http://localhost:8080/wsman/')->mustUnderstand(1)->prefix('wsa');
$header_ResourceURI= SOAP::Header->name('ResourceURI'=>'wsman:system/2005/02/this')->prefix('wsman');

$header_Action= SOAP::Header->name('Action'=>'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get')->prefix('wsa')->mustUnderstand(1);

$header_ReplyTO=SOAP::Header->name('ReplyTo'=>\SOAP:ata->value(SOAP:ata->name("Adress"=>'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous')->mustUnderstand(1)->prefix('wsa')))
->prefix('wsa');

$header_MessageID=SOAP::Header->name('MessageID'=>$uuid)->mustUnderstand(1)->prefix('wsa');

my $som =$client->getServletInfo($header_To,$header_ResourceURI,$header_Action,$header_ReplyTO,$header_MessageID);
my $output=$som->result;

Is it the good way to create the header, because I have always the HTTP error 406 : type Inacceptable !!!

If someone have an idea ?

Thanks,

Amélie

 

 


#5148 From: "dtikhonov" <dtikhonov@...>
Date: Wed Jan 25, 2006 2:51 pm
Subject: Re: SOAP::Lite interaction w/ Exception::Class results in Perl seg fault
dtikhonov
Send Email Send Email
 
Let's revisit this thread.  I did my own investigation of the problem
and realized that the problem is not stringification, but numeric
conversion overloading done in Error.pm.  Here's my analysis from
perlmonks.org[1]:

---------------------------------------------
I have a server written in Perl that does some tasks that clients ask
it to. Requests and responses are passed using soap, namely
SOAP::Lite. Responses can be successful or unsuccessful. The latter
are of two types: error codes plus honest-to-God exceptions (well, as
close as Perl comes to them, anyway) of type Error or
Exception::Class. The problem occurs when SOAP::Serializer tries to
serialize objects of type Error. Error.pm has the following code
(shortened for our purposes):

use overload ("0+" => 'value');
sub value {
     my $self = shift;
     exists $self->{'-value'} ? $self->{'-value'} : undef;
}

Note that this subroutine may return undef. Now, SOAP::Serializer
calls subroutine gen_id on references, which for normal objects is
just the value of memory address:

sub gen_id { sprintf "%U", $_[1] }

Now, the problem is that when objects of type Error do not have a
value (returns undef), this produces a segfault in perl 5.6.1. This
problem can be demonstrated with the following short script:

package My;

use overload ('0+' => 'num_conv');
sub new {
     my $self = shift;
     bless {}, ref($self) || $self;
}
sub num_conv { undef }

package main;
my $var = My->new;
print int($var);
---------------------------------------------

We can see that gen_id should try to detect whether object has numeric
conversion overloaded and if it does, use a different scheme to get
the ID (such as Scalar::Util::refaddr, also suggested in the perlmonks
thread).

Thoughts?

   - Dmitri.

1. http://www.perlmonks.org/?node_id=525293

#5149 From: "jbpostini" <jbrown@...>
Date: Wed Jan 25, 2006 11:15 pm
Subject: Anyone used .NET clients to retrieve complex data from a SOAP::Lite server?
jbpostini
Send Email Send Email
 
We are having problems with the wsdl specification or something - has
anyone ever pulled this off?

#5150 From: "Jonas B. Nielsen" <jni@...>
Date: Thu Jan 26, 2006 12:53 pm
Subject: Problem with mod_perl server, server closes connection
jni@...
Send Email Send Email
 

Hello,

I am having a hard time implementing a SOAP webservice on Linux using:

- Apache
- mod_perl 1
- Perl 5.6.1
- and SOAP::Lite 0.66

To just fool around and to get a proof of concept I implemented a webservice on my Mac running perl 5.8.6 (and the same version of SOAP).

This was working after about 10 minutes, so I copied the code to the Linux environment and tried again, but it does not seem as if the module to which I am dispatching is ever reached (or initialized) by the server.

I am not sure where I should look any more, but could somebody guide me to the place in the code where the action is defined or the dispatch_to target is initialized, that would be appreciated.

If you want to help me out but need more data, do not hesitate to ask.

Thanks,

jonasbn

#5151 From: Eric Bridger <eric@...>
Date: Thu Jan 26, 2006 1:30 pm
Subject: Re: Problem with mod_perl server, server closes connection
ebridger2004
Send Email Send Email
 
Most likely this has to do with your Perl @INC array under Apache.
Check your Apache httd.conf for a PerlRequire
"/path/to/modperl-startup.pl" then make sure your module is pushed onto
the @INC.
There may be other ways to do this

On Thu, 2006-01-26 at 07:53, Jonas B. Nielsen wrote:
> Hello,
>
> I am having a hard time implementing a SOAP webservice on Linux using:
>
> - Apache
> - mod_perl 1
> - Perl 5.6.1
> - and SOAP::Lite 0.66
>
> To just fool around and to get a proof of concept I implemented a
> webservice on my Mac running perl 5.8.6 (and the same version of SOAP).
>
> This was working after about 10 minutes, so I copied the code to the Linux
> environment and tried again, but it does not seem as if the module to
> which I am dispatching is ever reached (or initialized) by the server.
>
> I am not sure where I should look any more, but could somebody guide me to
> the place in the code where the action is defined or the dispatch_to
> target is initialized, that would be appreciated.
>
> If you want to help me out but need more data, do not hesitate to ask.
>
> Thanks,
>
> jonasbn

#5152 From: "Jonas B. Nielsen" <jni@...>
Date: Thu Jan 26, 2006 1:53 pm
Subject: Vedr.: Re: Problem with mod_perl server, server closes connection
jni@...
Send Email Send Email
 

Hi Eric,

Thanks for the response, I dumped the @INC array to the error log and it contains the path where my modules are :-/

I even tried requiring the the module in question as a bareword so it would be located via the @INC array, but still no problem.

jonasbn



Eric Bridger <eric@...>

26-01-2006 14:30

       
        Til:        "Jonas B. Nielsen" <jni@...>
        cc:        SoapLite List <soaplite@yahoogroups.com>
        Vedr.:        Re: [soaplite] Problem with mod_perl server, server closes        connection



Most likely this has to do with your Perl @INC array under Apache.
Check your Apache httd.conf for a PerlRequire
"/path/to/modperl-startup.pl" then make sure your module is pushed onto
the @INC.
There may be other ways to do this

On Thu, 2006-01-26 at 07:53, Jonas B. Nielsen wrote:
> Hello,
>
> I am having a hard time implementing a SOAP webservice on Linux using:
>
> - Apache
> - mod_perl 1
> - Perl 5.6.1
> - and SOAP::Lite 0.66
>
> To just fool around and to get a proof of concept I implemented a
> webservice on my Mac running perl 5.8.6 (and the same version of SOAP).
>
> This was working after about 10 minutes, so I copied the code to the Linux
> environment and tried again, but it does not seem as if the module to
> which I am dispatching is ever reached (or initialized) by the server.
>
> I am not sure where I should look any more, but could somebody guide me to
> the place in the code where the action is defined or the dispatch_to
> target is initialized, that would be appreciated.
>
> If you want to help me out but need more data, do not hesitate to ask.
>
> Thanks,
>
> jonasbn






#5153 From: Ollie Cook <oliver.cook@...>
Date: Thu Jan 26, 2006 6:59 pm
Subject: Client unable to detect fatal SOAP failure (e.g. unable to connect to host)
olliebetfair
Send Email Send Email
 
Good evening,

With a base install of SOAP::Lite version 0.66 I don't think it is
possible for the user/developer to detect whether the SOAP 'call'
failed, and I consider this a bug. I was wondering if any other
users have come across this.

For example, the following code returns the empty string ('') if
SOAP::Lite is unable to communicate with the SOAP server:

   $soap->call(SOAP::Data->name($action) => $soapdata)

This does not allow the user/developer to easily determine that there
has been a fatal error.

Within SOAP::Transport::HTTP the response structure is as follows during
this instance:

$VAR1 = bless( {
                  '_content' => '',
                  '_rc' => 500,
                  '_headers' => bless( {
                                         'client-date' => 'Wed, 25 Jan
2006 15:56:32 GMT'
                                       }, 'HTTP::Headers' ),
                  '_msg' => 'Can\'t connect to a.b.c.d:80 (connect:
Connection refused)',
                  '_request' => ...

_content is what is being returned to the client, where what would
actually be more useful would be to push _msg up to the client through
SOAP::Lite.

I have rolled a small patch (see #1) which will at least allow the
user/developer to detect the 'undef' and handle that error case, but it
doesn't expose the actual cause of the error "Can't connect to a.b.c.d",
so I don't think this is the _correct_ fix.

Does anyone have any opinion on what should be the correct way of pushing
that error up the stack and into the users visibility?

Thanks for your time,

Ollie

1: http://rt.cpan.org/Ticket/Attachment/158815/49167/HTTP.pm.patch
--
Ollie Cook
UNIX Scripter
Information Systems

Direct Line: 020 8834 8128
Waterfront | Hammersmith Embankment | Chancellors Road London | W6 9HP

#5154 From: Ollie Cook <oliver.cook@...>
Date: Fri Jan 27, 2006 5:23 pm
Subject: [PATCH] Content-Type: header grows and grows
olliebetfair
Send Email Send Email
 
Under SOAP::Lite 0.66 the Content-Type: HTTP header grows and grows with
each call. Enabling 'trace' shows the header being sent as follows:

   Content-Type: text/xml; charset=utf-8; charset=utf-8;
charset=utf-8;...

The number of occurrences of "charset=utf-8" increases with each call.

I thought this might have been related to the use of HTTP Keep-Alive and
the PATCH_HTTP_KEEPALIVE constant, but disabling those doesn't modify
this behaviour.

The bit of code that introduces this behaviour is in
SOAP/Transport/HTTP.pm:

       if(!$req->content_type){
         $req->content_type(join '; ',...

I have attached a patch which resolves this for me. I'm not terribly
familiar with this module though, so there may be a better way to fix
this.

Cheers,

Ollie

--
Ollie Cook
UNIX Scripter
Information Systems

Direct Line: 020 8834 8128
Waterfront | Hammersmith Embankment | Chancellors Road London | W6 9HP

Messages 5106 - 5154 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