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 919 - 948 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#919 From: Mental <mental@...>
Date: Thu Oct 18, 2001 4:58 pm
Subject: hello and ssl questions galore
mental@...
Send Email Send Email
 
Hello there. Sorry to jump right in with questions.

Currently I'm setting up a SOAP::Lite server and clients. Everything has
been easy to use and has worked well. Up to this point. I seem to have run
into a wall however. I suspect I know the cause, I just want to verify.

The soap server works fine over http. However, it is going to need to be
running over https. I'm using apache_mod_ssl. I'm also using a
self-generated certificate for development which is what I suspect to be
causing the problem.

When I change the client to use https, it doesnt work.... output to
follow. When I use http, its fine. @INC is the same in both environments,
and cgi's are handled the same.

I see the request in the ssl_engine_log and  ssl_request_log. Nothing
shows up in the error log.

I've tried changig the proxy and the uri to https, I've also just set the
proxy. Same results.

The server is a simple 2 liner. I'm dispatching to @INC for now just to
get it up and going. Later I'll add a BEGIN block to add the right paths
based on if I'm running under solaris or linux.

That all said, here is the code.

Server:

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI->dispatch_to(@INC)->handle();

The client:

#!/usr/bin/perl -w
use strict;
use diagnostics;
use SOAP::Lite +trace => 'all';

my $sid = shift || die "Usage: $0 <session_id>\n";

my @product1 = qw(28800-062 EA);
my @product2 = qw(21905-026 PK);
my @product3 = qw(21905-049 PK);
my @args;
# session id first
# followed by array of arrays (cat_num,uom)
push @args,$sid,\@product1,\@product2,\@product3;

my $ref =  SOAP::Lite
   -> uri('http://sl76msds.vwrsp.com/Com/Vwr/Soap/GetPrice')
   -> proxy('https://sl76msds.vwrsp.com/soap/')
   -> get_price(@args)
   -> result();

foreach my $i (@{$ref}){
   print join(':',@{$i}),"\n";
}
###################################END CLIENT############################

And heres the http (expected) output:

SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: get_price XOvAm3KuF91YCBTuqtbmhg ARRAY(0x80ffe48)
ARRAY(0x8134d08) ARRAY(0x8233704)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x848eb08)
SOAP::Transport::HTTP::Client::send_receive: POST
http://sl76msds.vwrsp.com/soap/
Accept: text/xml
Accept: multipart/*
Content-Length: 1087
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://sl76msds.vwrsp.com/Com/Vwr/Soap/GetPrice#get_price"

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:get_price
xmlns:namesp1="http://sl76msds.vwrsp.com/Com/Vwr/Soap/GetPrice"><c-gensym3
xsi:type="xsd:string">XOvAm3KuF91YCBTuqtbmhg</c-gensym3><SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item
xsi:type="xsd:string">28800-062</item><item
xsi:type="xsd:string">EA</item></SOAP-ENC:Array><SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item
xsi:type="xsd:string">21905-026</item><item
xsi:type="xsd:string">PK</item></SOAP-ENC:Array><SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item
xsi:type="xsd:string">21905-049</item><item
xsi:type="xsd:string">PK</item></SOAP-ENC:Array></namesp1:get_price></SOAP-ENV:B\
ody></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x85761e4)
SOAP::Transport::HTTP::Client::send_receive: HTTP/0.9 200 OK
Client-Date: Thu, 18 Oct 2001 17:02:59 GMT
Client-Peer: 12.20.55.70:80

Status: 200 OK
Content-Length: 1717
Content-Type: text/xml; charset=utf-8
SOAPServer: SOAP::Lite/Perl/0.51

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><names\
p1:get_priceResponse
xmlns:namesp1="http://sl76msds.vwrsp.com/Com/Vwr/Soap/GetPrice"><SOAP-ENC:Array
xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="SOAP-ENC:Array[3]"><item
xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:ur-type[8]"><item
xsi:type="xsd:string">28800-062</item><item xsi:type="xsd:string">EA</item><item
xsi:type="xsd:string">$13.65</item><item
xsi:type="xsd:string">$13.65</item><item xsi:type="xsd:int">0</item><item
xsi:type="xsd:int">0</item><item xsi:type="xsd:int">0</item><item
xsi:type="xsd:int">0</item></item><item xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:ur-type[8]"><item
xsi:type="xsd:string">21905-026</item><item xsi:type="xsd:string">PK</item><item
xsi:type="xsd:string">$3.76</item><item xsi:type="xsd:string">$3.76</item><item
xsi:type="xsd:int">0</item><item xsi:type="xsd:int">0</item><item
xsi:type="xsd:int">0</item><item xsi:type="xsd:int">0</item></item><item
xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:ur-type[8]"><item
xsi:type="xsd:string">21905-049</item><item xsi:type="xsd:string">PK</item><item
xsi:type="xsd:string">$11.43</item><item
xsi:type="xsd:string">$11.43</item><item xsi:type="xsd:int">0</item><item
xsi:type="xsd:int">0</item><item xsi:type="xsd:int">0</item><item
xsi:type="xsd:int">0</item></item></SOAP-ENC:Array></namesp1:get_priceResponse><\
/SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::MIMEParser::new: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
SOAP::Lite::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::SOM::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::MIMEParser::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Parser::DESTROY: ()
28800-062:EA:$13.65:$13.65:0:0:0:0
21905-026:PK:$3.76:$3.76:0:0:0:0
21905-049:PK:$11.43:$11.43:0:0:0:0

####################### END OUTPUT  ##################################

when the proxy is set to https, I get the following:

SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: get_price XOvAm3KuF91YCBTuqtbmhg ARRAY(0x80ffe48)
ARRAY(0x8134d08) ARRAY(0x8233704)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x848ea60)
SOAP::Transport::HTTP::Client::send_receive: POST
https://sl76msds.vwrsp.com/soap/
Accept: text/xml
Accept: multipart/*
Content-Length: 1087
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://sl76msds.vwrsp.com/Com/Vwr/Soap/GetPrice#get_price"

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:get_price
xmlns:namesp1="http://sl76msds.vwrsp.com/Com/Vwr/Soap/GetPrice"><c-gensym3
xsi:type="xsd:string">XOvAm3KuF91YCBTuqtbmhg</c-gensym3><SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item
xsi:type="xsd:string">28800-062</item><item
xsi:type="xsd:string">EA</item></SOAP-ENC:Array><SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item
xsi:type="xsd:string">21905-026</item><item
xsi:type="xsd:string">PK</item></SOAP-ENC:Array><SOAP-ENC:Array
SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item
xsi:type="xsd:string">21905-049</item><item
xsi:type="xsd:string">PK</item></SOAP-ENC:Array></namesp1:get_price></SOAP-ENV:B\
ody></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x85acfac)
SOAP::Transport::HTTP::Client::send_receive: HTTP/0.9 200 OK
Client-Date: Thu, 18 Oct 2001 17:02:37 GMT
Client-Peer: 12.20.55.70:443
Client-SSL-Cert-Issuer: /C=XY/ST=Snake Desert/L=Snake Town/O=Snake Oil,
Ltd/OU=Certificate Authority/CN=Snake Oil CA/Email=ca@...
Client-SSL-Cert-Subject: /C=US/ST=Pennsylvania/L=West
Chester/O=VWR/OU=LabVelocity Integration
Team/CN=sl76msds.vwrsp.com/Email=jstelzer@...
Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
Client-SSL-Warning: Peer certificate not verified

Status: 500 Internal Server Error
Content-Length: 1947
Content-Type: text/xml; charset=utf-8
SOAPServer: SOAP::Lite/Perl/0.51

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-\
ENV:Fault><faultcode
xsi:type="xsd:string">SOAP-ENV:Client</faultcode><faultstring
xsi:type="xsd:string">Uncaught exception from user code:
	 SOAP::Fault=HASH(0x781834) at /usr/local/lib/perl5/site_perl/5.005/SOAP/Lite.pm
line 1997
	 eval {...} called at /usr/local/lib/perl5/site_perl/5.005/SOAP/Lite.pm line
1944
	 SOAP::Server::handle('SOAP::Transport::HTTP::CGI=HASH(0x6afce0)', '<?xml
version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:S...') called at
/usr/local/lib/perl5/site_perl/5.005/SOAP/Transport/HTTP.pm line 237
	
SOAP::Transport::HTTP::Server::handle('SOAP::Transport::HTTP::CGI=HASH(0x6afce0)\
') called at /usr/local/lib/perl5/site_perl/5.005/SOAP/Transport/HTTP.pm line
309
	 SOAP::Transport::HTTP::CGI::handle('SOAP::Transport::HTTP::CGI=HASH(0x6afce0)')
called at /www/vwr3/web/soap/index.cgi line 4
	 eval 'package Apache::ROOTsl76msds_2evwrsp_2ecom::soap::index_2ecgi;use Apache
qw(exit);
#line 1 /www/vwr3/web/soap/index.cgi
BEGIN {$^W = 1;}; $^W = 1;#!/usr/bin/perl -w
use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI->dispatch_to(@INC)->handle();


;' called at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Apache/PerlRun.pm
line 115
	 Apache::PerlRun::compile('Apache::PerlRun=HASH(0x47b948)', 'SCALAR(0x48ec38)')
called at /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Apache/PerlRun.pm
line 291
	 Apache::PerlRun::handler('Apache::PerlRun', 'Apache=SCALAR(0x47b930)') called
at /www/vwr3/web/soap/index.cgi line 0
	 eval {...} called at /www/vwr3/web/soap/index.cgi line 0
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::MIMEParser::new: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
SOAP::Lite::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
SOAP::SOM::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::MIMEParser::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Parser::DESTROY: ()
######################### END OUTPUT #####################

Does anyone have an idea what could be causing this?


Client-SSL-Warning: Peer certificate not verified
How critical is this? Is a self generated cert ok for this?
I'm not doing certificate baset authentication, I'm just encrypting the
data channel.



Status: 500 Internal Server Error
Obviously this is bad, I just dont know what causes it. Its the same perl
binary. I dumped out perl's @INC. Its the same on the https side as it is
on the http side. I'm at a bit of a loss.



I'm sorry this is long, but I'm trying to include all relevent
information.

I'm using
apache_1.3.20
mm-1.1.3
mod_perl-1.26
mod_ssl-2.8.4-1.3.20
openssl-0.9.6b

I compiled apache with --disable-rule=EXPAT.
SOAP-Lite-0.51 and XML-Parser-2.30 are installed.


Anyone have any ideas?


--
Mental (Mental@...)

A darkness grows inside me in fading shades of gray
All the colors of the world are slowly sucked away
I'm sinking ever deeper to a place that's cold and black
I can't believe I've lost you and you're never coming back
--Stabbing Westward

GPG public key: http://www.neverlight.com/Mental.asc

#920 From: "Ivan R. Judson" <judson@...>
Date: Thu Oct 18, 2001 6:02 pm
Subject: Inheritance issue...
irjudson
Send Email Send Email
 
Hey,

So I'm using activestate perl, and soaplite 0.51 and I have the following
odd thing happening:

1) one side I have a server starting and instantiating some objects (which
are children of a GenericObject), and it's working fine (from the calling
side)

2) on the 'being called' side i have similar objects but they aren't calling
up to the parent.

Any ideas where this might be breaking?

--Ivan

PS -- it's like the @ISA isn't being considered...

..........
Ivan R. Judson .~. http://www.mcs.anl.gov/~judson
Futures Laboratory .~.  630 252 0920
Argonne National Laboratory .~. 630 252 6424 Fax

#921 From: "Ivan R. Judson" <judson@...>
Date: Thu Oct 18, 2001 6:20 pm
Subject: RE: Inheritance issue...
irjudson
Send Email Send Email
 
My problem also appears to be platform dependant.  When the 'being called'
side is windows it works, when it's linux, it screws up the inheritance.

--Ivan

> -----Original Message-----
> From: Ivan R. Judson [mailto:judson@...]
> Sent: Thursday, October 18, 2001 1:03 PM
> To: Soaplite@Yahoogroups. Com
> Subject: [soaplite] Inheritance issue...
>
>
>
> Hey,
>
> So I'm using activestate perl, and soaplite 0.51 and I have the following
> odd thing happening:
>
> 1) one side I have a server starting and instantiating some objects (which
> are children of a GenericObject), and it's working fine (from the calling
> side)
>
> 2) on the 'being called' side i have similar objects but they
> aren't calling
> up to the parent.
>
> Any ideas where this might be breaking?
>
> --Ivan
>
> PS -- it's like the @ISA isn't being considered...
>
> ..........
> Ivan R. Judson .~. http://www.mcs.anl.gov/~judson
> Futures Laboratory .~.  630 252 0920
> Argonne National Laboratory .~. 630 252 6424 Fax
>
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

#922 From: Paul Kulchenko <paulclinger@...>
Date: Thu Oct 18, 2001 6:30 pm
Subject: RE: Inheritance issue...
paulclinger
Send Email Send Email
 
Hi, Ivan!

I'm not aware of any platform-dependant issues. Client/server code
definitely will help (you can send it offlist at
paulclinger@...). Only one ISA-related aspect that comes to my
mind is problem with this code:

A->a;

package A;

@ISA = 'B'; # class B has method 'a'

specified inheritance will not work unless package+ISA combination is
wrapped into BEGIN{} block.

Best wishes, Paul.

--- "Ivan R. Judson" <judson@...> wrote:
>
> My problem also appears to be platform dependant.  When the 'being
> called'
> side is windows it works, when it's linux, it screws up the
> inheritance.
>
> --Ivan
>
> > -----Original Message-----
> > From: Ivan R. Judson [mailto:judson@...]
> > Sent: Thursday, October 18, 2001 1:03 PM
> > To: Soaplite@Yahoogroups. Com
> > Subject: [soaplite] Inheritance issue...
> >
> >
> >
> > Hey,
> >
> > So I'm using activestate perl, and soaplite 0.51 and I have the
> following
> > odd thing happening:
> >
> > 1) one side I have a server starting and instantiating some
> objects (which
> > are children of a GenericObject), and it's working fine (from the
> calling
> > side)
> >
> > 2) on the 'being called' side i have similar objects but they
> > aren't calling
> > up to the parent.
> >
> > Any ideas where this might be breaking?
> >
> > --Ivan
> >
> > PS -- it's like the @ISA isn't being considered...
> >
> > ..........
> > Ivan R. Judson .~. http://www.mcs.anl.gov/~judson
> > Futures Laboratory .~.  630 252 0920
> > Argonne National Laboratory .~. 630 252 6424 Fax
> >
> >
> > To unsubscribe from this group, send an email to:
> > soaplite-unsubscribe@yahoogroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
>
>
> ------------------------ Yahoo! Groups Sponsor
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#923 From: "Sheth, Niraj " <niraj_sheth@...>
Date: Thu Oct 18, 2001 7:51 pm
Subject: SOAP::Lite Server and Java client
niraj_sheth@...
Send Email Send Email
 
Hi,

Can anyone provide me code-example(or URL) to pass hash from perl
(SOAP::Lite server) to java client(as Vector)?

I am pretty much newbie to SOAP(on both perl and java side).
It's very simple from perl server to perl client, can't get it on java side.

Thanks,
-Niraj


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail by
anyone else is unauthorized. If you are not an addressee, any disclosure or
copying of the contents of this E-mail or any action taken (or not taken) in
reliance on it is unauthorized and may be unlawful. If you are not an addressee,
please inform the sender immediately.

#924 From: damullens@...
Date: Thu Oct 18, 2001 9:44 pm
Subject: Re: SOAP::Lite Server and Java client
dmullen5
Send Email Send Email
 
Hi,

I found using the Map datatype to be best.  You can create a hash in
perl, tell it (via Soap::Datatype) it is a type of map and send it
over.  Java will see it as a Java.util.Map on the other side.  It's
been a while since I worked on this, so I'm a bit foggy on
specifics...let me know if you need more info.

Hope this helps,

Dave.


--- In soaplite@y..., "Sheth, Niraj " <niraj_sheth@g...> wrote:
> Hi,
>
> Can anyone provide me code-example(or URL) to pass hash from perl
> (SOAP::Lite server) to java client(as Vector)?
>
> I am pretty much newbie to SOAP(on both perl and java side).
> It's very simple from perl server to perl client, can't get it on
java side.
>
> Thanks,
> -Niraj
>
>
> LEGAL NOTICE
> Unless expressly stated otherwise, this message is confidential and
may be privileged. It is intended for the addressee(s) only. Access to
this E-mail by anyone else is unauthorized. If you are not an
addressee, any disclosure or copying of the contents of this E-mail or
any action taken (or not taken) in reliance on it is unauthorized and
may be unlawful. If you are not an addressee, please inform the sender
immediately.

#925 From: damullens@...
Date: Thu Oct 18, 2001 10:06 pm
Subject: performance issues
dmullen5
Send Email Send Email
 
Hi,

Right now we have a soap cgi-based server.  We would like better
performance.  I read the guide and there were four options...which one
is the best (as far as performance is concerned)?

Also, which configuration would be easiest to implement given that we
are using the cgi-based soap server?

Thanks!!

Dave.

#926 From: bcase@...
Date: Thu Oct 18, 2001 10:57 pm
Subject: effectivily shutdown a daemon (SOAP::Transport::TCP::Server) under forked proc?
the_briefcas...
Send Email Send Email
 
how do i effectivily shutdown a daemon (SOAP::Transport::TCP::Server)
under a forked process.


your help is appreciated.

Jeremy.

###################
Loop();

sub Loop {
  print "Prompt>>";
  chomp( my $in = <> );
  if( $in eq "start") {
   if (($PID = fork()) == 0) {
 		 init();
   }elsif($PID != 0){
    print "Soap Service Started\n";
   }
  Loop();
  }elsif($in eq "close") {
	   if($PID == 0){
			 $daemon->close;
	   }elsif($PID != 0){
	    $daemon->shutdown(2);
	    undef $daemon;
	    print "Soap Service Stopped\n";
   }
    Loop();
  }else{
 	 Loop();
  }
}


sub init() {
	  $daemon = SOAP::Transport::TCP::Server
			 -> new (LocalPort => 8080, Listen => 5, Reuse
=> 1)
			 -> dispatch_to('info');

	 	 $daemon->handle;
}


package info;

sub about {
  return "Based on my Module";
}

1;

#927 From: Juan Julian Merelo Guervos <jmerelo@...>
Date: Fri Oct 19, 2001 7:57 am
Subject: Unstable behaviour of TCP client/server
jmerelo666
Send Email Send Email
 
Hi,
	 I managed to fix the problem with the client/server (thanks, Paul), but
now I have another problem. The client sends objects to the server, a
complicated object, but it fails 1 out of three times, this way:

Use of uninitialized value in pattern match (m//) at
/usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.Use of
uninitialized value in pattern match (m//) at
/usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.Use of
uninitialized value in subroutine entry at
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux-thread/XML/Parser/Expat.pm
line 474.
Use of uninitialized value in numeric eq (==) at
/usr/local/lib/perl5/site_perl/5.6.1/IO/SessionData.pm line
160.Connection reset by peer

The program is always the same: it sends 10 objects to a server, which
stores it in a queue.
Maybe it's a problem with buffer overflow or anything like that? A
timeout? Any hint?

J
--
JJ Merelo => http://geneura.ugr.es/~jmerelo
OPEAL => http://opeal.sourceforge.net
Atalaya => http://granavenida.com/atalaya

#928 From: Juan Julian Merelo Guervos <jmerelo@...>
Date: Fri Oct 19, 2001 7:58 am
Subject: Re: performance issues
jmerelo666
Send Email Send Email
 
damullens@... wrote:
>
> Hi,
>
> Right now we have a soap cgi-based server.  We would like better
> performance.  I read the guide and there were four options...which one
> is the best (as far as performance is concerned)?
>

From my own experiments, the fastest option is to use the TCP
server/client. Of course, it works better within the same machine.

> Also, which configuration would be easiest to implement given that we
> are using the cgi-based soap server?
>

Plain vanilla CGI; but the fastest is the mod_perl based.

J
--
Atalaya => http://granavenida.com/atalaya
Dream => http://dr-ea-m.sourceforge.net
OPEAL => http://opeal.sourceforge.net

#929 From: Juan Julian Merelo Guervos <jmerelo@...>
Date: Fri Oct 19, 2001 8:19 am
Subject: Re: Unstable behaviour of TCP client/server
jmerelo666
Send Email Send Email
 
Juan Julian Merelo Guervos wrote:
>
> Hi,
>       I managed to fix the problem with the client/server (thanks,
> Paul), but
> now I have another problem. The client sends objects to the server, a
> complicated object, but it fails 1 out of three times, this way:
>
> Use of uninitialized value in pattern match (m//) at
> /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.Use of
> uninitialized value in pattern match (m//) at
> /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.Use of
> uninitialized value in subroutine entry at
> /usr/local/lib/perl5/site_perl/5.6.1/i686-linux-thread/XML/Parser/Expat.pm
> line 474.
> Use of uninitialized value in numeric eq (==) at
> /usr/local/lib/perl5/site_perl/5.6.1/IO/SessionData.pm line
> 160.Connection reset by peer
>

Hm, did you read the manual, right? Did you read the IO::Socket::Inet
Manual? You didn't? Well, if you had bothered to do so, you would have
noticed this:

  Listen      Queue size for listen

And then, you would know that you need to set the Listen parameter in
the TCP server to, at least, ten times the number of things you want to
send...

I _just_ can't stand these newbies....

J
PS: ;-) ... just a proof that I keep testing things while I wait for an
answer from the list. And I don't know if the answer is right, but it
seems to work as a rule of thumb.
--
JJ Merelo => http://geneura.ugr.es/~jmerelo
AEB'02 => http://aeb02.unex.es
GeNeura Team => http://geneura.ugr.es

#930 From: Juan Julian Merelo Guervos <jmerelo@...>
Date: Fri Oct 19, 2001 8:32 am
Subject: Re: Unstable behaviour of TCP client/server
jmerelo666
Send Email Send Email
 
Juan Julian Merelo Guervos wrote:
>
> Juan Julian Merelo Guervos wrote:
> >
> > Hi,
> >       I managed to fix the problem with the client/server (thanks,
> > Paul), but
> > now I have another problem. The client sends objects to the server,
> a
> > complicated object, but it fails 1 out of three times, this way:
> >
> > Use of uninitialized value in pattern match (m//) at
> > /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.Use of
> > uninitialized value in pattern match (m//) at
> > /usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.Use of
> > uninitialized value in subroutine entry at
> >
> /usr/local/lib/perl5/site_perl/5.6.1/i686-linux-thread/XML/Parser/Expat.pm
> > line 474.
> > Use of uninitialized value in numeric eq (==) at
> > /usr/local/lib/perl5/site_perl/5.6.1/IO/SessionData.pm line
> > 160.Connection reset by peer
> >
>
> Hm, did you read the manual, right? Did you read the IO::Socket::Inet
> Manual? You didn't? Well, if you had bothered to do so, you would have
> noticed this:
>
> Listen      Queue size for listen
>
> And then, you would know that you need to set the Listen parameter in
> the TCP server to, at least, ten times the number of things you want
> to
> send...
>

Now _you_ should read the manual yourself, man! If you kept reading, you
would have noticed:
  Timeout     Timeout value for various operations
in the  IO::Socket::INET, of course, which you should have know is the
one used by SOAP::Lite... and then, by testing different values, like
Timeout => 10, it would have worked....

J
PS: It works now all the time, but it freezes from time to time... of
course, timeout is too high. Any way to fix that?

--
Atalaya => http://granavenida.com/atalaya
OPEAL => http://opeal.sourceforge.net
AEB'02 => http://aeb02.unex.es

#931 From: Juan Julian Merelo Guervos <jmerelo@...>
Date: Fri Oct 19, 2001 11:19 am
Subject: Illegal shift in TCP connections from one machine to another.
jmerelo666
Send Email Send Email
 
In my neverending quest for going into the deepest depth of the TCP
connections, now I'm trying to connect, through TCP, two different
machines, using the same code I used before for connecting two processes
within the same machine. Needless to say, it does not work. I get this
error:

IO::Select->select() returned error: Desplazamiento ilegal at
/usr/local/lib/perl5/site_perl/5.6.1/SOAP/Transport/TCP.pm line 199
SOAP::Transport::TCP::Server::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()

That translates roughly as "illegal shift"

That happens when the request is received; it looks like it gets the
message, but the server does not like it and it dies. The client also
dies with a timeout.

Trying different timeouts didn't work either.... Has anybody tried this?

J
--
Dream => http://dr-ea-m.sourceforge.net
GeNeura Team => http://geneura.ugr.es
OPEAL => http://opeal.sourceforge.net

#932 From: Juan Julian Merelo Guervos <jmerelo@...>
Date: Fri Oct 19, 2001 11:58 am
Subject: Remote TCP connection... again
jmerelo666
Send Email Send Email
 
Hi,
	 I have been trying to get this remote TCP connection running. I use
this server:

use SOAP::Transport::TCP;

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

my $daemon = SOAP::Transport::TCP::Server
   -> new (LocalAddr => shift , LocalPort => 8003, Listen => 5)
   -> dispatch_to(Test )
;
print "Contact to SOAP server at ", join(':', $daemon->sockhost,
$daemon->sockport), "\n";
$daemon->handle;

package Test;
sub test{
   return "Test =>".join( ', ', @_ ). "\n";
}
--

And this client (which is universal...)

--
use SOAP::Lite +trace;
my $host = shift || 'localhost' ;
my $port = shift || 8002;
my $protocol = shift || 'http' ;
print "Conectándose a $protocol://$host:$port\n";
my $soap = SOAP::Lite->uri( 'http://geneura.ugr.es/Test' )
   ->proxy ("$protocol://$host:$port")
   ->on_fault( sub { my($soap, $res) = @_;
					 die ref $res ? $res->faultdetail : $soap->transport->status, "\n";
				   } );
;

print $soap->test( "a", "b", "c")->result, "\n\n";
--

When I call with
  perl ttc3.pl hostname:8003 tcp

--
the server dies with:
Contact to SOAP server at 10.10.103.71:8003

bash-2.04$ Use of uninitialized value in pattern match (m//) at
/usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.
Use of uninitialized value in pattern match (m//) at
/usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1468.
Use of uninitialized value in subroutine entry at
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/XML/Parser/Expat.pm line
474.
Use of uninitialized value in numeric eq (==) at
/usr/local/lib/perl5/site_perl/5.6.1/IO/SessionData.pm line 160.

--

The same client with an http server (and the corresponding client),
works correctly...

J
--
Atalaya => http://granavenida.com/atalaya
Tutorial Perl => http://granavenida.com/perl
JJ Merelo => http://geneura.ugr.es/~jmerelo

#933 From: "Sheth, Niraj " <niraj_sheth@...>
Date: Fri Oct 19, 2001 6:03 pm
Subject: RE: Re: SOAP::Lite Server and Java client
niraj_sheth@...
Send Email Send Email
 
Thanks Dave,

I got it working ... but thought of writing down few lines so might be
helpful to someone.

From SOAP::Lite server
======================

SOAP::Data->type(map => \%info);

Java Client
===========

SOAPMappingRegistry smr = new SOPAMappingRegistry();
MapSerializer vecSer = new MapSerializer();
smr.mapTypes (Constants.NS_URI_SOAP_ENC,
			 new QName(urn, "Map"),
			 Map.class, vecSer, vecSer);

-Niraj


-----Original Message-----
From: damullens@... [mailto:damullens@...]
Sent: Thursday, October 18, 2001 5:45 PM
To: soaplite@yahoogroups.com
Subject: [soaplite] Re: SOAP::Lite Server and Java client


Hi,

I found using the Map datatype to be best.  You can create a hash in
perl, tell it (via Soap::Datatype) it is a type of map and send it
over.  Java will see it as a Java.util.Map on the other side.  It's
been a while since I worked on this, so I'm a bit foggy on
specifics...let me know if you need more info.

Hope this helps,

Dave.


--- In soaplite@y..., "Sheth, Niraj " <niraj_sheth@g...> wrote:
> Hi,
>
> Can anyone provide me code-example(or URL) to pass hash from perl
> (SOAP::Lite server) to java client(as Vector)?
>
> I am pretty much newbie to SOAP(on both perl and java side).
> It's very simple from perl server to perl client, can't get it on
java side.
>
> Thanks,
> -Niraj
>


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail by
anyone else is unauthorized. If you are not an addressee, any disclosure or
copying of the contents of this E-mail or any action taken (or not taken) in
reliance on it is unauthorized and may be unlawful. If you are not an addressee,
please inform the sender immediately.

#934 From: Sergei Dolmatov <sergei@...>
Date: Fri Oct 19, 2001 10:46 pm
Subject: Re: Base64 and Cyrillic
sergei@...
Send Email Send Email
 
On Wed, Oct 17, 2001 at 03:13:24PM -0700, Paul Kulchenko wrote:
> Hi, Sergei!
>
> > And how can I do something similar says in Delphi? Or I have to
> > convert all my strings in UTF8 before sending to server?
> Don't quite understand your question about Delphi. Did you mean COM
> interface? Something else?

Well, my english is very poor :(
I'd try to describe it more detailed - in perl client using SOAP::Lite I set
encoding('iso-8859-1') property in request.
AFAIK, other clients may have not this value (so, I still didn't find something
like that in Delphi's HTTPRio).
And I got error 500 - wide characters in request.
So question is - how can I set on server's side encoding property? And is it
even possible?

>
> you may also find helpful my message on this topic
> (http://groups.yahoo.com/group/soaplite/message/904) if you missed
> it.

Yes, it's helpful, but as far as I understood, it's again about client side?..

--
Regards,
Sergei Dolmatov.

#935 From: Bill Jones <sneex@...>
Date: Sat Oct 20, 2001 1:53 pm
Subject: (Perl) WWW-Authenticate: NTLM using Soap or Soap::Lite?
sneex@...
Send Email Send Email
 
Subject: (Perl) WWW-Authenticate: NTLM using Soap or Soap::Lite?

Is there a way to perform NTLM WWW-Authentication via Soap or
Soap::Lite?

I am on Solaris 8 talking to IIS/5.0 w/WebServices; I've been
trying (Perl) LWP::* with Soap::Lite; but I keep getting the
following error:

GET
http://207.203.95.95/bill/BrokerEmployee.asmx/ClassRoster?strBrokerID=ETB251
&strClassReferenceNumber=138887&strTerm=20021 --> 401 Access Denied
Connection: close
Date: Sat, 20 Oct 2001 04:10:10 GMT
Server: Microsoft-IIS/5.0
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Content-Length: 3643
Content-Type: text/html
Content-Type: text-html; charset=Windows-1252
Client-Date: Sat, 20 Oct 2001 04:08:53 GMT
Client-Request-Num: 1
Client-Warning: Unsupported authentication scheme 'ntlm'
Title: You are not authorized to view this page
X-Meta-ROBOTS: NOINDEX

<HTML>
<HEAD><TITLE>An Error Occurred</TITLE></HEAD>
<BODY>
<H1>An Error Occurred</H1>
401 Access Denied
</BODY>
</HTML>

Also, I guess ultimately, I want to talk to it via SSL (if I ever
get into production :(  Anyhow, any insiht, thoughts, or comments
would be most welcome  :)

Thx!
-Sx- :]

#936 From: Robert Taylor <theonetowhommyrefers@...>
Date: Mon Oct 22, 2001 5:06 am
Subject: Newbie question
theonetowhom...
Send Email Send Email
 
I created my first data-based connected SOAP
client/server combination using SOAP-Lite. Now I want
my business partner to be able to use my HTTPS/CGI
SOAP server and have run into a problem.

My goal is to receive an XML record for import into my
(MySQL) database. The partner defined the record but
I'm defining the SOAP service.

A few questions:

1) If the @lines in "$soap->store(@lines)" contains a
well-formed and x-schema validated XML file, why is
the payload (right term?) serialized?

2) Related to (1) -- the data sent to the server is
encoded (base 64?). Must it be?

3) My partner is coding his own client (not using
SOAP::Lite, but something in C++ on an MS platform --
not using .NET tools either). He's sending basically
handcrafted SOAP messages with the Body a simple XML
file. When I showed him the output of my client.cgi
(below) using the "on_debug" method he balked at the
Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
the XML file.

Pretend my XML Data looks like this:

<Test>
   <Question id="1" type="short answer"><text>What is
the correct spelling of your name?</text></Question>
   <Question id="2" type="multiple choice"><text>What
is your gender?</text>
     <option id="A">Male</option>
     <option id="B">Female</option>
     <option id="C">Cowboy Neal</option>
   </Question>
</Test>


Why is it encoded with the <c-gensym3...> tags?
(Dumped using on_debug)?

POST https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi
Accept: text/xml
Accept: multipart/*
Content-Length: 1434
Content-Type: text/xml; charset=utf-8
SOAPAction: "https://xxx.xxx.xxx.xxx/ONE#store"

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
   <SOAP-ENV:Body
   >
     <namesp1:newrx
xmlns:namesp1="https://xxx.xxx.xxx.xxx/ONE"
     >
       <c-gensym3 xsi:type="xsd:string"
       ><?xml version="1.0" encoding="UTF-8"?>
</c-gensym3>
       <c-gensym5 xsi:type="xsd:string"
       ><Test>
</c-gensym5>
       <c-gensym7 xsi:type="xsd:string"
       >  <Question id="1" type="short
answer"><text>What is the correct spelling of your
name?</text></Question>
</c-gensym7>
       <c-gensym9 xsi:type="xsd:string"
       >  <Question id="2" type="multiple
choice"><text>What is your gender?</text>
</c-gensym9>
       <c-gensym11 xsi:type="xsd:string"
       >    <option id="A">Male</option>
</c-gensym11>
       <c-gensym13 xsi:type="xsd:string"
       >    <option id="B">Female</option>
</c-gensym13>
       <c-gensym15 xsi:type="xsd:string"
       >    <option id="C">Cowboy Neal</option>
</c-gensym15>
       <c-gensym17 xsi:type="xsd:string"
       >  </Question>
</c-gensym17>
       <c-gensym19 xsi:type="xsd:string"
       ></Test>
</c-gensym19></namesp1:newrx></SOAP-ENV:Body></SOAP-ENV:Envelope>

4) What's the best way to send/receive a well-formed
and x-schema validating XML data record for import
into a local database?

Here's my client:

#!/usr/local/bin/perl -w
# SOAP Client -> simulates XML Data transfer via
# SOAP.
   use SOAP::Lite;

   my $server =
      'https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi';

#==========================
# Read in XML as if stream
#--------------------------
   open (FILE, "<data.xml");
   my @lines =  <FILE>;
   close(FILE);

#--------------------------
# Setup call
#--------------------------
my $soap = SOAP::Lite
     -> uri('https://xxx.xxx.xxx.xxx/ONE')
     -> proxy($server)
   ;
my $result = $soap->store(@lines);

#processing of $result excluded


My server is simple:

#!/usr/local/bin/perl -w
# SOAP Server - stores XML data in database
   use SOAP::Transport::HTTP;

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

   package ONE;


   sub store {
     my ($self, @passed) = @_;
     use XML::EasyOBJ; # yep, I'm using this module
#=========================
# Force input to tmp file
#
# *Sigh* couldn't find a
# way to parse streamed
# data with EasyOBJ...
#-------------------------
     use IO::File;
     use POSIX qw(tmpnam);
     use File::Copy;
     use Time::HiRes qw(gettimeofday);

     my ($fname,$fh);
     do { $fname = tmpnam() }
       until $fh = IO::File->new($fname,
                   O_RDWR|O_CREAT|O_EXCL);

     foreach (@passed) {
       print $fh $_;
     }

     close($fh);

     my $bak_dir = '../backups/';
     my $ext = gettimeofday;
     copy ($fname,"${bak_dir}store.$ext")
         || warn "Could not copy $fname: $!";
#=========================


#=========================
# Process XML with EasyOBJ
#-------------------------

#-------------------------------------
# Use temp file for EasyOBJ processing
#-------------------------------------
     my $doc = new XML::EasyOBJ($fname)
             || die "XML::EasyOBJ error: $!";

## processing of $doc excluded. It just stores the
## data in a MySQL table. Result of processing
## stored in $result

return $result;

}


Thanks reading this far!

--
Robert Taylor


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#937 From: "Silly Yahoo Readers" <theonetowhommyrefers@...>
Date: Mon Oct 22, 2001 9:21 am
Subject: Re: Newbie question
theonetowhom...
Send Email Send Email
 
Since writing the below I found the SOAP::Data->type(...) thingy
(attribute? directive?) and played around with a few settings. When I
specify the default (base64) my server finds and parses the message.
When I specify 'xml' I get the following error:

Fault: SOAP-ENV:Server, not well-formed (invalid token) at line 1,
column 4, byte 4 at /usr/local/lib/perl5/site_perl/5.6.1/i686-
linux/XML/Parser.pm line 185

*Sigh* Help?

--
Robert Taylor

--- In soaplite@y..., Robert Taylor <theonetowhommyrefers@y...> wrote:
> I created my first data-based connected SOAP
> client/server combination using SOAP-Lite. Now I want
> my business partner to be able to use my HTTPS/CGI
> SOAP server and have run into a problem.
>
> My goal is to receive an XML record for import into my
> (MySQL) database. The partner defined the record but
> I'm defining the SOAP service.
>
> A few questions:
>
> 1) If the @lines in "$soap->store(@lines)" contains a
> well-formed and x-schema validated XML file, why is
> the payload (right term?) serialized?
>
> 2) Related to (1) -- the data sent to the server is
> encoded (base 64?). Must it be?
>
> 3) My partner is coding his own client (not using
> SOAP::Lite, but something in C++ on an MS platform --
> not using .NET tools either). He's sending basically
> handcrafted SOAP messages with the Body a simple XML
> file. When I showed him the output of my client.cgi
> (below) using the "on_debug" method he balked at the
> Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> the XML file.
>
> Pretend my XML Data looks like this:
>
> <Test>
>   <Question id="1" type="short answer"><text>What is
> the correct spelling of your name?</text></Question>
>   <Question id="2" type="multiple choice"><text>What
> is your gender?</text>
>     <option id="A">Male</option>
>     <option id="B">Female</option>
>     <option id="C">Cowboy Neal</option>
>   </Question>
> </Test>
>
>
> Why is it encoded with the <c-gensym3...> tags?
> (Dumped using on_debug)?
>
> POST https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi
> Accept: text/xml
> Accept: multipart/*
> Content-Length: 1434
> Content-Type: text/xml; charset=utf-8
> SOAPAction: "https://xxx.xxx.xxx.xxx/ONE#store"
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> >
>   <SOAP-ENV:Body
>   >
>     <namesp1:newrx
> xmlns:namesp1="https://xxx.xxx.xxx.xxx/ONE"
>     >
>       <c-gensym3 xsi:type="xsd:string"
>       ><?xml version="1.0" encoding="UTF-8"?>
> </c-gensym3>
>       <c-gensym5 xsi:type="xsd:string"
>       ><Test>
> </c-gensym5>
>       <c-gensym7 xsi:type="xsd:string"
>       >  <Question id="1" type="short
> answer"><text>What is the correct spelling of your
> name?</text></Question>
> </c-gensym7>
>       <c-gensym9 xsi:type="xsd:string"
>       >  <Question id="2" type="multiple
> choice"><text>What is your gender?</text>
> </c-gensym9>
>       <c-gensym11 xsi:type="xsd:string"
>       >    <option id="A">Male</option>
> </c-gensym11>
>       <c-gensym13 xsi:type="xsd:string"
>       >    <option id="B">Female</option>
> </c-gensym13>
>       <c-gensym15 xsi:type="xsd:string"
>       >    <option id="C">Cowboy Neal</option>
> </c-gensym15>
>       <c-gensym17 xsi:type="xsd:string"
>       >  </Question>
> </c-gensym17>
>       <c-gensym19 xsi:type="xsd:string"
>       ></Test>
> </c-gensym19></namesp1:newrx></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> 4) What's the best way to send/receive a well-formed
> and x-schema validating XML data record for import
> into a local database?
>
> Here's my client:
>
> #!/usr/local/bin/perl -w
> # SOAP Client -> simulates XML Data transfer via
> # SOAP.
>   use SOAP::Lite;
>
>   my $server =
>      'https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi';
>
> #==========================
> # Read in XML as if stream
> #--------------------------
>   open (FILE, "<data.xml");
>   my @lines =  <FILE>;
>   close(FILE);
>
> #--------------------------
> # Setup call
> #--------------------------
> my $soap = SOAP::Lite
>     -> uri('https://xxx.xxx.xxx.xxx/ONE')
>     -> proxy($server)
>   ;
> my $result = $soap->store(@lines);
>
> #processing of $result excluded
>
>
> My server is simple:
>
> #!/usr/local/bin/perl -w
> # SOAP Server - stores XML data in database
>   use SOAP::Transport::HTTP;
>
>   SOAP::Transport::HTTP::CGI
>     -> dispatch_to('ONE')
>     -> handle;
>
>   package ONE;
>
>
>   sub store {
>     my ($self, @passed) = @_;
>     use XML::EasyOBJ; # yep, I'm using this module
> #=========================
> # Force input to tmp file
> #
> # *Sigh* couldn't find a
> # way to parse streamed
> # data with EasyOBJ...
> #-------------------------
>     use IO::File;
>     use POSIX qw(tmpnam);
>     use File::Copy;
>     use Time::HiRes qw(gettimeofday);
>
>     my ($fname,$fh);
>     do { $fname = tmpnam() }
>       until $fh = IO::File->new($fname,
>                   O_RDWR|O_CREAT|O_EXCL);
>
>     foreach (@passed) {
>       print $fh $_;
>     }
>
>     close($fh);
>
>     my $bak_dir = '../backups/';
>     my $ext = gettimeofday;
>     copy ($fname,"${bak_dir}store.$ext")
>         || warn "Could not copy $fname: $!";
> #=========================
>
>
> #=========================
> # Process XML with EasyOBJ
> #-------------------------
>
> #-------------------------------------
> # Use temp file for EasyOBJ processing
> #-------------------------------------
>     my $doc = new XML::EasyOBJ($fname)
>             || die "XML::EasyOBJ error: $!";
>
> ## processing of $doc excluded. It just stores the
> ## data in a MySQL table. Result of processing
> ## stored in $result
>
> return $result;
>
> }
>
>
> Thanks reading this far!
>
> --
> Robert Taylor
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com

#938 From: Paul Kulchenko <paulclinger@...>
Date: Mon Oct 22, 2001 1:48 pm
Subject: Re: Re: Newbie question
paulclinger
Send Email Send Email
 
Hi, Robert!

SOAP::Data->type(xml => ...) is the way to send XML fragment that
will look like XML on wire. SOAP::Lite doesn't do any validation in
this case, so it's quite possible that generated XML (by itself or in
combination with SOAP envelope) is invalid. ->type(base64 => ...)
doesn't have this problem and always generate valid XML. You may see
what do you have on wire if you switch on debug info on client side
with ->on_debug(sub{print@_}).

If you insert XML as a fragment I do not recommend you to use
unqualified 'id' attributes, because they may interfere with 'id'
attribute that is used by SOAP itself (yet you'll be able to access
that attribute).

> > 4) What's the best way to send/receive a well-formed
> > and x-schema validating XML data record for import
> > into a local database?
I would say base64 is the best way to go (esp. if XML processing is
required on another side anyway), because if you encode XML as a
fragment you'll need to write custom deserializer to process your
data. Let me know if you have any questions.

Best wishes, Paul.

--- Silly Yahoo Readers <theonetowhommyrefers@...> wrote:
> Since writing the below I found the SOAP::Data->type(...) thingy
> (attribute? directive?) and played around with a few settings. When
> I
> specify the default (base64) my server finds and parses the
> message.
> When I specify 'xml' I get the following error:
>
> Fault: SOAP-ENV:Server, not well-formed (invalid token) at line 1,
> column 4, byte 4 at /usr/local/lib/perl5/site_perl/5.6.1/i686-
> linux/XML/Parser.pm line 185
>
> *Sigh* Help?
>
> --
> Robert Taylor
>
> --- In soaplite@y..., Robert Taylor <theonetowhommyrefers@y...>
> wrote:
> > I created my first data-based connected SOAP
> > client/server combination using SOAP-Lite. Now I want
> > my business partner to be able to use my HTTPS/CGI
> > SOAP server and have run into a problem.
> >
> > My goal is to receive an XML record for import into my
> > (MySQL) database. The partner defined the record but
> > I'm defining the SOAP service.
> >
> > A few questions:
> >
> > 1) If the @lines in "$soap->store(@lines)" contains a
> > well-formed and x-schema validated XML file, why is
> > the payload (right term?) serialized?
> >
> > 2) Related to (1) -- the data sent to the server is
> > encoded (base 64?). Must it be?
> >
> > 3) My partner is coding his own client (not using
> > SOAP::Lite, but something in C++ on an MS platform --
> > not using .NET tools either). He's sending basically
> > handcrafted SOAP messages with the Body a simple XML
> > file. When I showed him the output of my client.cgi
> > (below) using the "on_debug" method he balked at the
> > Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> > the XML file.
> >
> > Pretend my XML Data looks like this:
> >
> > <Test>
> >   <Question id="1" type="short answer"><text>What is
> > the correct spelling of your name?</text></Question>
> >   <Question id="2" type="multiple choice"><text>What
> > is your gender?</text>
> >     <option id="A">Male</option>
> >     <option id="B">Female</option>
> >     <option id="C">Cowboy Neal</option>
> >   </Question>
> > </Test>
> >
> >
> > Why is it encoded with the <c-gensym3...> tags?
> > (Dumped using on_debug)?
> >
> > POST https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi
> > Accept: text/xml
> > Accept: multipart/*
> > Content-Length: 1434
> > Content-Type: text/xml; charset=utf-8
> > SOAPAction: "https://xxx.xxx.xxx.xxx/ONE#store"
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <SOAP-ENV:Envelope
> > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> >
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > >
> >   <SOAP-ENV:Body
> >   >
> >     <namesp1:newrx
> > xmlns:namesp1="https://xxx.xxx.xxx.xxx/ONE"
> >     >
> >       <c-gensym3 xsi:type="xsd:string"
> >       ><?xml version="1.0" encoding="UTF-8"?>
> > </c-gensym3>
> >       <c-gensym5 xsi:type="xsd:string"
> >       ><Test>
> > </c-gensym5>
> >       <c-gensym7 xsi:type="xsd:string"
> >       >  <Question id="1" type="short
> > answer"><text>What is the correct spelling of your
> > name?</text></Question>
> > </c-gensym7>
> >       <c-gensym9 xsi:type="xsd:string"
> >       >  <Question id="2" type="multiple
> > choice"><text>What is your gender?</text>
> > </c-gensym9>
> >       <c-gensym11 xsi:type="xsd:string"
> >       >    <option id="A">Male</option>
> > </c-gensym11>
> >       <c-gensym13 xsi:type="xsd:string"
> >       >    <option id="B">Female</option>
> > </c-gensym13>
> >       <c-gensym15 xsi:type="xsd:string"
> >       >    <option id="C">Cowboy Neal</option>
> > </c-gensym15>
> >       <c-gensym17 xsi:type="xsd:string"
> >       >  </Question>
> > </c-gensym17>
> >       <c-gensym19 xsi:type="xsd:string"
> >       ></Test>
> > </c-gensym19></namesp1:newrx></SOAP-ENV:Body></SOAP-ENV:Envelope>
> >
> > 4) What's the best way to send/receive a well-formed
> > and x-schema validating XML data record for import
> > into a local database?
> >
> > Here's my client:
> >
> > #!/usr/local/bin/perl -w
> > # SOAP Client -> simulates XML Data transfer via
> > # SOAP.
> >   use SOAP::Lite;
> >
> >   my $server =
> >      'https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi';
> >
> > #==========================
> > # Read in XML as if stream
> > #--------------------------
> >   open (FILE, "<data.xml");
> >   my @lines =  <FILE>;
> >   close(FILE);
> >
> > #--------------------------
> > # Setup call
> > #--------------------------
> > my $soap = SOAP::Lite
> >     -> uri('https://xxx.xxx.xxx.xxx/ONE')
> >     -> proxy($server)
> >   ;
> > my $result = $soap->store(@lines);
> >
> > #processing of $result excluded
> >
> >
> > My server is simple:
> >
> > #!/usr/local/bin/perl -w
> > # SOAP Server - stores XML data in database
> >   use SOAP::Transport::HTTP;
> >
> >   SOAP::Transport::HTTP::CGI
> >     -> dispatch_to('ONE')
> >     -> handle;
> >
> >   package ONE;
> >
> >
> >   sub store {
> >     my ($self, @passed) = @_;
> >     use XML::EasyOBJ; # yep, I'm using this module
> > #=========================
> > # Force input to tmp file
> > #
> > # *Sigh* couldn't find a
> > # way to parse streamed
> > # data with EasyOBJ...
> > #-------------------------
> >     use IO::File;
> >     use POSIX qw(tmpnam);
> >     use File::Copy;
> >     use Time::HiRes qw(gettimeofday);
> >
> >     my ($fname,$fh);
> >     do { $fname = tmpnam() }
> >       until $fh = IO::File->new($fname,
> >                   O_RDWR|O_CREAT|O_EXCL);
> >
> >     foreach (@passed) {
> >       print $fh $_;
> >     }
> >
> >     close($fh);
> >
> >     my $bak_dir = '../backups/';
> >     my $ext = gettimeofday;
> >     copy ($fname,"${bak_dir}store.$ext")
> >         || warn "Could not copy $fname: $!";
> > #=========================
> >
> >
> > #=========================
> > # Process XML with EasyOBJ
> > #-------------------------
> >
> > #-------------------------------------
> > # Use temp file for EasyOBJ processing
> > #-------------------------------------
> >     my $doc = new XML::EasyOBJ($fname)
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#939 From: Paul Kulchenko <paulclinger@...>
Date: Mon Oct 22, 2001 2:46 pm
Subject: Re: Base64 and Cyrillic
paulclinger
Send Email Send Email
 
Hi, Sergei!

--- Sergei Dolmatov <sergei@...> wrote:
> I'd try to describe it more detailed - in perl client using
> SOAP::Lite I set encoding('iso-8859-1') property in request.
> AFAIK, other clients may have not this value (so, I still didn't
> find something like that in Delphi's HTTPRio).
> And I got error 500 - wide characters in request.
> So question is - how can I set on server's side encoding property?
> And is it even possible?
Unfortunately can't tell you anything about Delphi, but you
definitely can change encoding on server side for SOAP::Lite. use:

my $server = SOAP::Transport::HTTP::CGI # or whatever server you have
   -> encoding('isao-8859-1')
   -> dispatch_to(...)
;

You can also transcode your data to utf8 and use default encoding.

> Yes, it's helpful, but as far as I understood, it's again about
> client side?..
There is no big difference between client and server side. Interface
is *slightly* different, but almost all that was said about client
side is true about server side also.

Best wishes, Paul.

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#940 From: "Silly Yahoo Readers" <theonetowhommyrefers@...>
Date: Mon Oct 22, 2001 3:04 pm
Subject: Accessing XML Data attributes (was Re: Newbie question)
theonetowhom...
Send Email Send Email
 
Paul,

Sometime around 3 AM I started getting it... ;-)  Thanks for your
input in this forum, etc.

Now I'm using type(xml =>...) and am able to get the elements (not
the attributes) of the XML record. Is there a way to get the
attributes, too? I can get at the elements with a simple

return "root__child: $_[0]->{root}->{child}";

How do I access the attributes in the XML Data?

Here's my simple server:

#!/usr/local/bin/perl -w
   use SOAP::Transport::HTTP;

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

   package ONE;

   sub dump {
    my ($class, @params) = @_;
    use Data::Dumper;
    #return Dumper(@params); # Dumps DOM tree, no attributes
    return $params[0]->{ROOT}->{some}->{node}; # access elements
   }

exit;

--- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> Hi, Robert!
>
> SOAP::Data->type(xml => ...) is the way to send XML fragment that
> will look like XML on wire. SOAP::Lite doesn't do any validation in
> this case, so it's quite possible that generated XML (by itself or
in
> combination with SOAP envelope) is invalid. ->type(base64 => ...)
> doesn't have this problem and always generate valid XML. You may see
> what do you have on wire if you switch on debug info on client side
> with ->on_debug(sub{print@_}).
>
> If you insert XML as a fragment I do not recommend you to use
> unqualified 'id' attributes, because they may interfere with 'id'
> attribute that is used by SOAP itself (yet you'll be able to access
> that attribute).
>
> > > 4) What's the best way to send/receive a well-formed
> > > and x-schema validating XML data record for import
> > > into a local database?
> I would say base64 is the best way to go (esp. if XML processing is
> required on another side anyway), because if you encode XML as a
> fragment you'll need to write custom deserializer to process your
> data. Let me know if you have any questions.
>
> Best wishes, Paul.
>
> --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > Since writing the below I found the SOAP::Data->type(...) thingy
> > (attribute? directive?) and played around with a few settings.
When
> > I
> > specify the default (base64) my server finds and parses the
> > message.
> > When I specify 'xml' I get the following error:
> >
> > Fault: SOAP-ENV:Server, not well-formed (invalid token) at line
1,
> > column 4, byte 4 at /usr/local/lib/perl5/site_perl/5.6.1/i686-
> > linux/XML/Parser.pm line 185
> >
> > *Sigh* Help?
> >
> > --
> > Robert Taylor
> >
> > --- In soaplite@y..., Robert Taylor <theonetowhommyrefers@y...>
> > wrote:
> > > I created my first data-based connected SOAP
> > > client/server combination using SOAP-Lite. Now I want
> > > my business partner to be able to use my HTTPS/CGI
> > > SOAP server and have run into a problem.
> > >
> > > My goal is to receive an XML record for import into my
> > > (MySQL) database. The partner defined the record but
> > > I'm defining the SOAP service.
> > >
> > > A few questions:
> > >
> > > 1) If the @lines in "$soap->store(@lines)" contains a
> > > well-formed and x-schema validated XML file, why is
> > > the payload (right term?) serialized?
> > >
> > > 2) Related to (1) -- the data sent to the server is
> > > encoded (base 64?). Must it be?
> > >
> > > 3) My partner is coding his own client (not using
> > > SOAP::Lite, but something in C++ on an MS platform --
> > > not using .NET tools either). He's sending basically
> > > handcrafted SOAP messages with the Body a simple XML
> > > file. When I showed him the output of my client.cgi
> > > (below) using the "on_debug" method he balked at the
> > > Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> > > the XML file.
> > >
> > > Pretend my XML Data looks like this:
> > >
> > > <Test>
> > >   <Question id="1" type="short answer"><text>What is
> > > the correct spelling of your name?</text></Question>
> > >   <Question id="2" type="multiple choice"><text>What
> > > is your gender?</text>
> > >     <option id="A">Male</option>
> > >     <option id="B">Female</option>
> > >     <option id="C">Cowboy Neal</option>
> > >   </Question>
> > > </Test>
> > >
> > >
> > > Why is it encoded with the <c-gensym3...> tags?
> > > (Dumped using on_debug)?
> > >
> > > POST https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi
> > > Accept: text/xml
> > > Accept: multipart/*
> > > Content-Length: 1434
> > > Content-Type: text/xml; charset=utf-8
> > > SOAPAction: "https://xxx.xxx.xxx.xxx/ONE#store"
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <SOAP-ENV:Envelope
> > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > >
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > > >
> > >   <SOAP-ENV:Body
> > >   >
> > >     <namesp1:newrx
> > > xmlns:namesp1="https://xxx.xxx.xxx.xxx/ONE"
> > >     >
> > >       <c-gensym3 xsi:type="xsd:string"
> > >       ><?xml version="1.0" encoding="UTF-8"?>
> > > </c-gensym3>
> > >       <c-gensym5 xsi:type="xsd:string"
> > >       ><Test>
> > > </c-gensym5>
> > >       <c-gensym7 xsi:type="xsd:string"
> > >       >  <Question id="1" type="short
> > > answer"><text>What is the correct spelling of your
> > > name?</text></Question>
> > > </c-gensym7>
> > >       <c-gensym9 xsi:type="xsd:string"
> > >       >  <Question id="2" type="multiple
> > > choice"><text>What is your gender?</text>
> > > </c-gensym9>
> > >       <c-gensym11 xsi:type="xsd:string"
> > >       >    <option id="A">Male</option>
> > > </c-gensym11>
> > >       <c-gensym13 xsi:type="xsd:string"
> > >       >    <option id="B">Female</option>
> > > </c-gensym13>
> > >       <c-gensym15 xsi:type="xsd:string"
> > >       >    <option id="C">Cowboy Neal</option>
> > > </c-gensym15>
> > >       <c-gensym17 xsi:type="xsd:string"
> > >       >  </Question>
> > > </c-gensym17>
> > >       <c-gensym19 xsi:type="xsd:string"
> > >       ></Test>
> > > </c-gensym19></namesp1:newrx></SOAP-ENV:Body></SOAP-
ENV:Envelope>
> > >
> > > 4) What's the best way to send/receive a well-formed
> > > and x-schema validating XML data record for import
> > > into a local database?
> > >
> > > Here's my client:
> > >
> > > #!/usr/local/bin/perl -w
> > > # SOAP Client -> simulates XML Data transfer via
> > > # SOAP.
> > >   use SOAP::Lite;
> > >
> > >   my $server =
> > >      'https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi';
> > >
> > > #==========================
> > > # Read in XML as if stream
> > > #--------------------------
> > >   open (FILE, "<data.xml");
> > >   my @lines =  <FILE>;
> > >   close(FILE);
> > >
> > > #--------------------------
> > > # Setup call
> > > #--------------------------
> > > my $soap = SOAP::Lite
> > >     -> uri('https://xxx.xxx.xxx.xxx/ONE')
> > >     -> proxy($server)
> > >   ;
> > > my $result = $soap->store(@lines);
> > >
> > > #processing of $result excluded
> > >
> > >
> > > My server is simple:
> > >
> > > #!/usr/local/bin/perl -w
> > > # SOAP Server - stores XML data in database
> > >   use SOAP::Transport::HTTP;
> > >
> > >   SOAP::Transport::HTTP::CGI
> > >     -> dispatch_to('ONE')
> > >     -> handle;
> > >
> > >   package ONE;
> > >
> > >
> > >   sub store {
> > >     my ($self, @passed) = @_;
> > >     use XML::EasyOBJ; # yep, I'm using this module
> > > #=========================
> > > # Force input to tmp file
> > > #
> > > # *Sigh* couldn't find a
> > > # way to parse streamed
> > > # data with EasyOBJ...
> > > #-------------------------
> > >     use IO::File;
> > >     use POSIX qw(tmpnam);
> > >     use File::Copy;
> > >     use Time::HiRes qw(gettimeofday);
> > >
> > >     my ($fname,$fh);
> > >     do { $fname = tmpnam() }
> > >       until $fh = IO::File->new($fname,
> > >                   O_RDWR|O_CREAT|O_EXCL);
> > >
> > >     foreach (@passed) {
> > >       print $fh $_;
> > >     }
> > >
> > >     close($fh);
> > >
> > >     my $bak_dir = '../backups/';
> > >     my $ext = gettimeofday;
> > >     copy ($fname,"${bak_dir}store.$ext")
> > >         || warn "Could not copy $fname: $!";
> > > #=========================
> > >
> > >
> > > #=========================
> > > # Process XML with EasyOBJ
> > > #-------------------------
> > >
> > > #-------------------------------------
> > > # Use temp file for EasyOBJ processing
> > > #-------------------------------------
> > >     my $doc = new XML::EasyOBJ($fname)
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com

#941 From: Paul Kulchenko <paulclinger@...>
Date: Mon Oct 22, 2001 3:05 pm
Subject: Re: Unstable behaviour of TCP client/server
paulclinger
Send Email Send Email
 
Hi, Juan!

--- Juan Julian Merelo Guervos <jmerelo@...> wrote:
> Juan Julian Merelo Guervos wrote:
> > Juan Julian Merelo Guervos wrote:
skipped...
> > Hm, did you read the manual, right? Did you read the
> > IO::Socket::Inet Manual? You didn't? Well, if you had bothered
> > to do so, you would have noticed this:
skipped...
> Now _you_ should read the manual yourself, man! If you kept
> reading, you would have noticed:
:)) I didn't realize immediately you're talking to yourself ;)

> PS: It works now all the time, but it freezes from time to time...
> of course, timeout is too high. Any way to fix that?
I don't think it freezes because of timeout (otherwise it would drop
connection). Any other possible reasons?

Best wishes, Paul.


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#942 From: Paul Kulchenko <paulclinger@...>
Date: Mon Oct 22, 2001 3:12 pm
Subject: Re: Accessing XML Data attributes (was Re: Newbie question)
paulclinger
Send Email Send Email
 
Hi, Robert!

--- Silly Yahoo Readers <theonetowhommyrefers@...> wrote:
> Sometime around 3 AM I started getting it... ;-)  Thanks for your
;)

> How do I access the attributes in the XML Data?
you need to do something like this (you can find more details in docs
and examples):

>   package ONE;
@ONE::ISA = 'SOAP::Server::Parameters';
>
>   sub dump {
      my $env = pop;
>    my ($class, @params) = @_;
>    use Data::Dumper;
>    #return Dumper(@params); # Dumps DOM tree, no attributes
      return $env->dataof('//Test/Question')->attr->{type}
      # should return "short answer"
      # dataof() returns SOAP::Data attribute that you can access
      # for attributes and other information
>    return $params[0]->{ROOT}->{some}->{node}; # access elements
>   }

Best wishes, Paul.

--- Silly Yahoo Readers <theonetowhommyrefers@...> wrote:
> Paul,
>
> Sometime around 3 AM I started getting it... ;-)  Thanks for your
> input in this forum, etc.
>
> Now I'm using type(xml =>...) and am able to get the elements (not
> the attributes) of the XML record. Is there a way to get the
> attributes, too? I can get at the elements with a simple
>
> return "root__child: $_[0]->{root}->{child}";
>
> How do I access the attributes in the XML Data?
>
> Here's my simple server:
>
> #!/usr/local/bin/perl -w
>   use SOAP::Transport::HTTP;
>
>   SOAP::Transport::HTTP::CGI
>     -> dispatch_to('ONE')
>     -> handle;
>
>   package ONE;
>
>   sub dump {
>    my ($class, @params) = @_;
>    use Data::Dumper;
>    #return Dumper(@params); # Dumps DOM tree, no attributes
>    return $params[0]->{ROOT}->{some}->{node}; # access elements
>   }
>
> exit;
>
> --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> > Hi, Robert!
> >
> > SOAP::Data->type(xml => ...) is the way to send XML fragment that
> > will look like XML on wire. SOAP::Lite doesn't do any validation
> in
> > this case, so it's quite possible that generated XML (by itself
> or
> in
> > combination with SOAP envelope) is invalid. ->type(base64 => ...)
> > doesn't have this problem and always generate valid XML. You may
> see
> > what do you have on wire if you switch on debug info on client
> side
> > with ->on_debug(sub{print@_}).
> >
> > If you insert XML as a fragment I do not recommend you to use
> > unqualified 'id' attributes, because they may interfere with 'id'
> > attribute that is used by SOAP itself (yet you'll be able to
> access
> > that attribute).
> >
> > > > 4) What's the best way to send/receive a well-formed
> > > > and x-schema validating XML data record for import
> > > > into a local database?
> > I would say base64 is the best way to go (esp. if XML processing
> is
> > required on another side anyway), because if you encode XML as a
> > fragment you'll need to write custom deserializer to process your
> > data. Let me know if you have any questions.
> >
> > Best wishes, Paul.
> >
> > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > Since writing the below I found the SOAP::Data->type(...)
> thingy
> > > (attribute? directive?) and played around with a few settings.
> When
> > > I
> > > specify the default (base64) my server finds and parses the
> > > message.
> > > When I specify 'xml' I get the following error:
> > >
> > > Fault: SOAP-ENV:Server, not well-formed (invalid token) at line
>
> 1,
> > > column 4, byte 4 at /usr/local/lib/perl5/site_perl/5.6.1/i686-
> > > linux/XML/Parser.pm line 185
> > >
> > > *Sigh* Help?
> > >
> > > --
> > > Robert Taylor
> > >
> > > --- In soaplite@y..., Robert Taylor <theonetowhommyrefers@y...>
> > > wrote:
> > > > I created my first data-based connected SOAP
> > > > client/server combination using SOAP-Lite. Now I want
> > > > my business partner to be able to use my HTTPS/CGI
> > > > SOAP server and have run into a problem.
> > > >
> > > > My goal is to receive an XML record for import into my
> > > > (MySQL) database. The partner defined the record but
> > > > I'm defining the SOAP service.
> > > >
> > > > A few questions:
> > > >
> > > > 1) If the @lines in "$soap->store(@lines)" contains a
> > > > well-formed and x-schema validated XML file, why is
> > > > the payload (right term?) serialized?
> > > >
> > > > 2) Related to (1) -- the data sent to the server is
> > > > encoded (base 64?). Must it be?
> > > >
> > > > 3) My partner is coding his own client (not using
> > > > SOAP::Lite, but something in C++ on an MS platform --
> > > > not using .NET tools either). He's sending basically
> > > > handcrafted SOAP messages with the Body a simple XML
> > > > file. When I showed him the output of my client.cgi
> > > > (below) using the "on_debug" method he balked at the
> > > > Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> > > > the XML file.
> > > >
> > > > Pretend my XML Data looks like this:
> > > >
> > > > <Test>
> > > >   <Question id="1" type="short answer"><text>What is
> > > > the correct spelling of your name?</text></Question>
> > > >   <Question id="2" type="multiple choice"><text>What
> > > > is your gender?</text>
> > > >     <option id="A">Male</option>
> > > >     <option id="B">Female</option>
> > > >     <option id="C">Cowboy Neal</option>
> > > >   </Question>
> > > > </Test>
> > > >
> > > >
> > > > Why is it encoded with the <c-gensym3...> tags?
> > > > (Dumped using on_debug)?
> > > >
> > > > POST https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi
> > > > Accept: text/xml
> > > > Accept: multipart/*
> > > > Content-Length: 1434
> > > > Content-Type: text/xml; charset=utf-8
> > > > SOAPAction: "https://xxx.xxx.xxx.xxx/ONE#store"
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <SOAP-ENV:Envelope
> > > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > > >
> > >
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > > > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > > > >
> > > >   <SOAP-ENV:Body
> > > >   >
> > > >     <namesp1:newrx
> > > > xmlns:namesp1="https://xxx.xxx.xxx.xxx/ONE"
> > > >     >
> > > >       <c-gensym3 xsi:type="xsd:string"
> > > >       ><?xml version="1.0" encoding="UTF-8"?>
> > > > </c-gensym3>
> > > >       <c-gensym5 xsi:type="xsd:string"
> > > >       ><Test>
> > > > </c-gensym5>
> > > >       <c-gensym7 xsi:type="xsd:string"
> > > >       >  <Question id="1" type="short
> > > > answer"><text>What is the correct spelling of your
> > > > name?</text></Question>
> > > > </c-gensym7>
> > > >       <c-gensym9 xsi:type="xsd:string"
> > > >       >  <Question id="2" type="multiple
> > > > choice"><text>What is your gender?</text>
> > > > </c-gensym9>
> > > >       <c-gensym11 xsi:type="xsd:string"
> > > >       >    <option id="A">Male</option>
> > > > </c-gensym11>
> > > >       <c-gensym13 xsi:type="xsd:string"
> > > >       >    <option id="B">Female</option>
> > > > </c-gensym13>
> > > >       <c-gensym15 xsi:type="xsd:string"
> > > >       >    <option id="C">Cowboy Neal</option>
> > > > </c-gensym15>
> > > >       <c-gensym17 xsi:type="xsd:string"
> > > >       >  </Question>
> > > > </c-gensym17>
> > > >       <c-gensym19 xsi:type="xsd:string"
> > > >       ></Test>
> > > > </c-gensym19></namesp1:newrx></SOAP-ENV:Body></SOAP-
> ENV:Envelope>
> > > >
> > > > 4) What's the best way to send/receive a well-formed
> > > > and x-schema validating XML data record for import
> > > > into a local database?
> > > >
> > > > Here's my client:
> > > >
> > > > #!/usr/local/bin/perl -w
> > > > # SOAP Client -> simulates XML Data transfer via
> > > > # SOAP.
> > > >   use SOAP::Lite;
> > > >
> > > >   my $server =
> > > >      'https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi';
> > > >
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#943 From: "Silly Yahoo Readers" <theonetowhommyrefers@...>
Date: Mon Oct 22, 2001 3:29 pm
Subject: Accessing XML Data attributes (was Re: Newbie question)
theonetowhom...
Send Email Send Email
 
Quick follow-up... (I meet with the biz partner in an hour and have
to sound smart...) I get this error:

Fault: SOAP-ENV:Server, Can't call method "dataof" on unblessed
reference at /www/one/cgi-bin/server.cgi line 17.

Here's my updated server (not cleaned up):

#!/usr/local/bin/perl -w
   use SOAP::Transport::HTTP;

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

   package ONE;
   @ONE::ISA = 'SOAP::Server::Parameters';


   sub dump {
    my $env = pop;
    my ($class, @params) = @_;
    use Data::Dumper;
    #return Dumper(@params);
    return $env->dataof('//Test/Question')->attr->{type};
   }


--- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> Hi, Robert!
>
> --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > Sometime around 3 AM I started getting it... ;-)  Thanks for your
> ;)
>
> > How do I access the attributes in the XML Data?
> you need to do something like this (you can find more details in
docs
> and examples):
>
> >   package ONE;
> @ONE::ISA = 'SOAP::Server::Parameters';
> >
> >   sub dump {
>      my $env = pop;
> >    my ($class, @params) = @_;
> >    use Data::Dumper;
> >    #return Dumper(@params); # Dumps DOM tree, no attributes
>      return $env->dataof('//Test/Question')->attr->{type}
>      # should return "short answer"
>      # dataof() returns SOAP::Data attribute that you can access
>      # for attributes and other information
> >    return $params[0]->{ROOT}->{some}->{node}; # access elements
> >   }
>
> Best wishes, Paul.
>
> --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > Paul,
> >
> > Sometime around 3 AM I started getting it... ;-)  Thanks for your
> > input in this forum, etc.
> >
> > Now I'm using type(xml =>...) and am able to get the elements
(not
> > the attributes) of the XML record. Is there a way to get the
> > attributes, too? I can get at the elements with a simple
> >
> > return "root__child: $_[0]->{root}->{child}";
> >
> > How do I access the attributes in the XML Data?
> >
> > Here's my simple server:
> >
> > #!/usr/local/bin/perl -w
> >   use SOAP::Transport::HTTP;
> >
> >   SOAP::Transport::HTTP::CGI
> >     -> dispatch_to('ONE')
> >     -> handle;
> >
> >   package ONE;
> >
> >   sub dump {
> >    my ($class, @params) = @_;
> >    use Data::Dumper;
> >    #return Dumper(@params); # Dumps DOM tree, no attributes
> >    return $params[0]->{ROOT}->{some}->{node}; # access elements
> >   }
> >
> > exit;
> >
> > --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> > > Hi, Robert!
> > >
> > > SOAP::Data->type(xml => ...) is the way to send XML fragment
that
> > > will look like XML on wire. SOAP::Lite doesn't do any validation
> > in
> > > this case, so it's quite possible that generated XML (by itself
> > or
> > in
> > > combination with SOAP envelope) is invalid. ->type(base64
=> ...)
> > > doesn't have this problem and always generate valid XML. You may
> > see
> > > what do you have on wire if you switch on debug info on client
> > side
> > > with ->on_debug(sub{print@_}).
> > >
> > > If you insert XML as a fragment I do not recommend you to use
> > > unqualified 'id' attributes, because they may interfere
with 'id'
> > > attribute that is used by SOAP itself (yet you'll be able to
> > access
> > > that attribute).
> > >
> > > > > 4) What's the best way to send/receive a well-formed
> > > > > and x-schema validating XML data record for import
> > > > > into a local database?
> > > I would say base64 is the best way to go (esp. if XML processing
> > is
> > > required on another side anyway), because if you encode XML as a
> > > fragment you'll need to write custom deserializer to process
your
> > > data. Let me know if you have any questions.
> > >
> > > Best wishes, Paul.
> > >
> > > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > > Since writing the below I found the SOAP::Data->type(...)
> > thingy
> > > > (attribute? directive?) and played around with a few
settings.
> > When
> > > > I
> > > > specify the default (base64) my server finds and parses the
> > > > message.
> > > > When I specify 'xml' I get the following error:
> > > >
> > > > Fault: SOAP-ENV:Server, not well-formed (invalid token) at
line
> >
> > 1,
> > > > column 4, byte 4 at /usr/local/lib/perl5/site_perl/5.6.1/i686-
> > > > linux/XML/Parser.pm line 185
> > > >
> > > > *Sigh* Help?
> > > >
> > > > --
> > > > Robert Taylor
> > > >
> > > > --- In soaplite@y..., Robert Taylor
<theonetowhommyrefers@y...>
> > > > wrote:
> > > > > I created my first data-based connected SOAP
> > > > > client/server combination using SOAP-Lite. Now I want
> > > > > my business partner to be able to use my HTTPS/CGI
> > > > > SOAP server and have run into a problem.
> > > > >
> > > > > My goal is to receive an XML record for import into my
> > > > > (MySQL) database. The partner defined the record but
> > > > > I'm defining the SOAP service.
> > > > >
> > > > > A few questions:
> > > > >
> > > > > 1) If the @lines in "$soap->store(@lines)" contains a
> > > > > well-formed and x-schema validated XML file, why is
> > > > > the payload (right term?) serialized?
> > > > >
> > > > > 2) Related to (1) -- the data sent to the server is
> > > > > encoded (base 64?). Must it be?
> > > > >
> > > > > 3) My partner is coding his own client (not using
> > > > > SOAP::Lite, but something in C++ on an MS platform --
> > > > > not using .NET tools either). He's sending basically
> > > > > handcrafted SOAP messages with the Body a simple XML
> > > > > file. When I showed him the output of my client.cgi
> > > > > (below) using the "on_debug" method he balked at the
> > > > > Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> > > > > the XML file.
> > > > >
> > > > > Pretend my XML Data looks like this:
> > > > >
> > > > > <Test>
> > > > >   <Question id="1" type="short answer"><text>What is
> > > > > the correct spelling of your name?</text></Question>
> > > > >   <Question id="2" type="multiple choice"><text>What
> > > > > is your gender?</text>
> > > > >     <option id="A">Male</option>
> > > > >     <option id="B">Female</option>
> > > > >     <option id="C">Cowboy Neal</option>
> > > > >   </Question>
> > > > > </Test>
> > > > >
> > > > >
> > > > > Why is it encoded with the <c-gensym3...> tags?
> > > > > (Dumped using on_debug)?
> > > > >
> > > > > POST https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi
> > > > > Accept: text/xml
> > > > > Accept: multipart/*
> > > > > Content-Length: 1434
> > > > > Content-Type: text/xml; charset=utf-8
> > > > > SOAPAction: "https://xxx.xxx.xxx.xxx/ONE#store"
> > > > >
> > > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > > <SOAP-ENV:Envelope
> > > > > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> > > > >
> > > >
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > > > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > > > > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > > > > >
> > > > >   <SOAP-ENV:Body
> > > > >   >
> > > > >     <namesp1:newrx
> > > > > xmlns:namesp1="https://xxx.xxx.xxx.xxx/ONE"
> > > > >     >
> > > > >       <c-gensym3 xsi:type="xsd:string"
> > > > >       ><?xml version="1.0" encoding="UTF-8"?>
> > > > > </c-gensym3>
> > > > >       <c-gensym5 xsi:type="xsd:string"
> > > > >       ><Test>
> > > > > </c-gensym5>
> > > > >       <c-gensym7 xsi:type="xsd:string"
> > > > >       >  <Question id="1" type="short
> > > > > answer"><text>What is the correct spelling of your
> > > > > name?</text></Question>
> > > > > </c-gensym7>
> > > > >       <c-gensym9 xsi:type="xsd:string"
> > > > >       >  <Question id="2" type="multiple
> > > > > choice"><text>What is your gender?</text>
> > > > > </c-gensym9>
> > > > >       <c-gensym11 xsi:type="xsd:string"
> > > > >       >    <option id="A">Male</option>
> > > > > </c-gensym11>
> > > > >       <c-gensym13 xsi:type="xsd:string"
> > > > >       >    <option id="B">Female</option>
> > > > > </c-gensym13>
> > > > >       <c-gensym15 xsi:type="xsd:string"
> > > > >       >    <option id="C">Cowboy Neal</option>
> > > > > </c-gensym15>
> > > > >       <c-gensym17 xsi:type="xsd:string"
> > > > >       >  </Question>
> > > > > </c-gensym17>
> > > > >       <c-gensym19 xsi:type="xsd:string"
> > > > >       ></Test>
> > > > > </c-gensym19></namesp1:newrx></SOAP-ENV:Body></SOAP-
> > ENV:Envelope>
> > > > >
> > > > > 4) What's the best way to send/receive a well-formed
> > > > > and x-schema validating XML data record for import
> > > > > into a local database?
> > > > >
> > > > > Here's my client:
> > > > >
> > > > > #!/usr/local/bin/perl -w
> > > > > # SOAP Client -> simulates XML Data transfer via
> > > > > # SOAP.
> > > > >   use SOAP::Lite;
> > > > >
> > > > >   my $server =
> > > > >      'https://xxx.xxx.xxx.xxx/cgi-bin/server.cgi';
> > > > >
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com

#944 From: Paul Kulchenko <paulclinger@...>
Date: Mon Oct 22, 2001 3:34 pm
Subject: Re: Accessing XML Data attributes (was Re: Newbie question)
paulclinger
Send Email Send Email
 
Hi, Robert!

> Fault: SOAP-ENV:Server, Can't call method "dataof" on unblessed
> reference at /www/one/cgi-bin/server.cgi line 17.
Oops, my fault. I didn't realize that 'package' declaration is in the
same file as your server code. That's Perl's feature. You need to
wrap "package ONE" and the rest into BEGIN block for @ISA declaration
to be valid. Hope it helps.

Best wishes, Paul.

--- Silly Yahoo Readers <theonetowhommyrefers@...> wrote:
> Quick follow-up... (I meet with the biz partner in an hour and have
>
> to sound smart...) I get this error:
>
> Fault: SOAP-ENV:Server, Can't call method "dataof" on unblessed
> reference at /www/one/cgi-bin/server.cgi line 17.
>
> Here's my updated server (not cleaned up):
>
> #!/usr/local/bin/perl -w
>   use SOAP::Transport::HTTP;
>
>   SOAP::Transport::HTTP::CGI
>     -> dispatch_to('ONE')
>     -> handle;
>
>   package ONE;
>   @ONE::ISA = 'SOAP::Server::Parameters';
>
>
>   sub dump {
>    my $env = pop;
>    my ($class, @params) = @_;
>    use Data::Dumper;
>    #return Dumper(@params);
>    return $env->dataof('//Test/Question')->attr->{type};
>   }
>
>
> --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> > Hi, Robert!
> >
> > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > Sometime around 3 AM I started getting it... ;-)  Thanks for
> your
> > ;)
> >
> > > How do I access the attributes in the XML Data?
> > you need to do something like this (you can find more details in
> docs
> > and examples):
> >
> > >   package ONE;
> > @ONE::ISA = 'SOAP::Server::Parameters';
> > >
> > >   sub dump {
> >      my $env = pop;
> > >    my ($class, @params) = @_;
> > >    use Data::Dumper;
> > >    #return Dumper(@params); # Dumps DOM tree, no attributes
> >      return $env->dataof('//Test/Question')->attr->{type}
> >      # should return "short answer"
> >      # dataof() returns SOAP::Data attribute that you can access
> >      # for attributes and other information
> > >    return $params[0]->{ROOT}->{some}->{node}; # access elements
> > >   }
> >
> > Best wishes, Paul.
> >
> > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > Paul,
> > >
> > > Sometime around 3 AM I started getting it... ;-)  Thanks for
> your
> > > input in this forum, etc.
> > >
> > > Now I'm using type(xml =>...) and am able to get the elements
> (not
> > > the attributes) of the XML record. Is there a way to get the
> > > attributes, too? I can get at the elements with a simple
> > >
> > > return "root__child: $_[0]->{root}->{child}";
> > >
> > > How do I access the attributes in the XML Data?
> > >
> > > Here's my simple server:
> > >
> > > #!/usr/local/bin/perl -w
> > >   use SOAP::Transport::HTTP;
> > >
> > >   SOAP::Transport::HTTP::CGI
> > >     -> dispatch_to('ONE')
> > >     -> handle;
> > >
> > >   package ONE;
> > >
> > >   sub dump {
> > >    my ($class, @params) = @_;
> > >    use Data::Dumper;
> > >    #return Dumper(@params); # Dumps DOM tree, no attributes
> > >    return $params[0]->{ROOT}->{some}->{node}; # access elements
> > >   }
> > >
> > > exit;
> > >
> > > --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> > > > Hi, Robert!
> > > >
> > > > SOAP::Data->type(xml => ...) is the way to send XML fragment
> that
> > > > will look like XML on wire. SOAP::Lite doesn't do any
> validation
> > > in
> > > > this case, so it's quite possible that generated XML (by
> itself
> > > or
> > > in
> > > > combination with SOAP envelope) is invalid. ->type(base64
> => ...)
> > > > doesn't have this problem and always generate valid XML. You
> may
> > > see
> > > > what do you have on wire if you switch on debug info on
> client
> > > side
> > > > with ->on_debug(sub{print@_}).
> > > >
> > > > If you insert XML as a fragment I do not recommend you to use
> > > > unqualified 'id' attributes, because they may interfere
> with 'id'
> > > > attribute that is used by SOAP itself (yet you'll be able to
> > > access
> > > > that attribute).
> > > >
> > > > > > 4) What's the best way to send/receive a well-formed
> > > > > > and x-schema validating XML data record for import
> > > > > > into a local database?
> > > > I would say base64 is the best way to go (esp. if XML
> processing
> > > is
> > > > required on another side anyway), because if you encode XML
> as a
> > > > fragment you'll need to write custom deserializer to process
> your
> > > > data. Let me know if you have any questions.
> > > >
> > > > Best wishes, Paul.
> > > >
> > > > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > > > Since writing the below I found the SOAP::Data->type(...)
> > > thingy
> > > > > (attribute? directive?) and played around with a few
> settings.
> > > When
> > > > > I
> > > > > specify the default (base64) my server finds and parses the
> > > > > message.
> > > > > When I specify 'xml' I get the following error:
> > > > >
> > > > > Fault: SOAP-ENV:Server, not well-formed (invalid token) at
> line
> > >
> > > 1,
> > > > > column 4, byte 4 at
> /usr/local/lib/perl5/site_perl/5.6.1/i686-
> > > > > linux/XML/Parser.pm line 185
> > > > >
> > > > > *Sigh* Help?
> > > > >
> > > > > --
> > > > > Robert Taylor
> > > > >
> > > > > --- In soaplite@y..., Robert Taylor
> <theonetowhommyrefers@y...>
> > > > > wrote:
> > > > > > I created my first data-based connected SOAP
> > > > > > client/server combination using SOAP-Lite. Now I want
> > > > > > my business partner to be able to use my HTTPS/CGI
> > > > > > SOAP server and have run into a problem.
> > > > > >
> > > > > > My goal is to receive an XML record for import into my
> > > > > > (MySQL) database. The partner defined the record but
> > > > > > I'm defining the SOAP service.
> > > > > >
> > > > > > A few questions:
> > > > > >
> > > > > > 1) If the @lines in "$soap->store(@lines)" contains a
> > > > > > well-formed and x-schema validated XML file, why is
> > > > > > the payload (right term?) serialized?
> > > > > >
> > > > > > 2) Related to (1) -- the data sent to the server is
> > > > > > encoded (base 64?). Must it be?
> > > > > >
> > > > > > 3) My partner is coding his own client (not using
> > > > > > SOAP::Lite, but something in C++ on an MS platform --
> > > > > > not using .NET tools either). He's sending basically
> > > > > > handcrafted SOAP messages with the Body a simple XML
> > > > > > file. When I showed him the output of my client.cgi
> > > > > > (below) using the "on_debug" method he balked at the
> > > > > > Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> > > > > > the XML file.
> > > > > >
> > > > > > Pretend my XML Data looks like this:
> > > > > >
> > > > > > <Test>
> > > > > >   <Question id="1" type="short answer"><text>What is
> > > > > > the correct spelling of your name?</text></Question>
> > > > > >   <Question id="2" type="multiple choice"><text>What
> > > > > > is your gender?</text>
> > > > > >     <option id="A">Male</option>
> > > > > >     <option id="B">Female</option>
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#945 From: "Silly Yahoo Readers" <theonetowhommyrefers@...>
Date: Mon Oct 22, 2001 3:46 pm
Subject: Accessing XML Data attributes (was Re: Newbie question)
theonetowhom...
Send Email Send Email
 
Works beautifully! Now i kan go bee smaRt 'n act learneded. (Later I
make sure I really understand it!).

Thanks.

--
Robert Taylor


--- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> Hi, Robert!
>
> > Fault: SOAP-ENV:Server, Can't call method "dataof" on unblessed
> > reference at /www/one/cgi-bin/server.cgi line 17.
> Oops, my fault. I didn't realize that 'package' declaration is in
the
> same file as your server code. That's Perl's feature. You need to
> wrap "package ONE" and the rest into BEGIN block for @ISA
declaration
> to be valid. Hope it helps.
>
> Best wishes, Paul.
>
> --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > Quick follow-up... (I meet with the biz partner in an hour and
have
> >
> > to sound smart...) I get this error:
> >
> > Fault: SOAP-ENV:Server, Can't call method "dataof" on unblessed
> > reference at /www/one/cgi-bin/server.cgi line 17.
> >
> > Here's my updated server (not cleaned up):
> >
> > #!/usr/local/bin/perl -w
> >   use SOAP::Transport::HTTP;
> >
> >   SOAP::Transport::HTTP::CGI
> >     -> dispatch_to('ONE')
> >     -> handle;
> >
> >   package ONE;
> >   @ONE::ISA = 'SOAP::Server::Parameters';
> >
> >
> >   sub dump {
> >    my $env = pop;
> >    my ($class, @params) = @_;
> >    use Data::Dumper;
> >    #return Dumper(@params);
> >    return $env->dataof('//Test/Question')->attr->{type};
> >   }
> >
> >
> > --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> > > Hi, Robert!
> > >
> > > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > > Sometime around 3 AM I started getting it... ;-)  Thanks for
> > your
> > > ;)
> > >
> > > > How do I access the attributes in the XML Data?
> > > you need to do something like this (you can find more details
in
> > docs
> > > and examples):
> > >
> > > >   package ONE;
> > > @ONE::ISA = 'SOAP::Server::Parameters';
> > > >
> > > >   sub dump {
> > >      my $env = pop;
> > > >    my ($class, @params) = @_;
> > > >    use Data::Dumper;
> > > >    #return Dumper(@params); # Dumps DOM tree, no attributes
> > >      return $env->dataof('//Test/Question')->attr->{type}
> > >      # should return "short answer"
> > >      # dataof() returns SOAP::Data attribute that you can access
> > >      # for attributes and other information
> > > >    return $params[0]->{ROOT}->{some}->{node}; # access
elements
> > > >   }
> > >
> > > Best wishes, Paul.
> > >
> > > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > > Paul,
> > > >
> > > > Sometime around 3 AM I started getting it... ;-)  Thanks for
> > your
> > > > input in this forum, etc.
> > > >
> > > > Now I'm using type(xml =>...) and am able to get the elements
> > (not
> > > > the attributes) of the XML record. Is there a way to get the
> > > > attributes, too? I can get at the elements with a simple
> > > >
> > > > return "root__child: $_[0]->{root}->{child}";
> > > >
> > > > How do I access the attributes in the XML Data?
> > > >
> > > > Here's my simple server:
> > > >
> > > > #!/usr/local/bin/perl -w
> > > >   use SOAP::Transport::HTTP;
> > > >
> > > >   SOAP::Transport::HTTP::CGI
> > > >     -> dispatch_to('ONE')
> > > >     -> handle;
> > > >
> > > >   package ONE;
> > > >
> > > >   sub dump {
> > > >    my ($class, @params) = @_;
> > > >    use Data::Dumper;
> > > >    #return Dumper(@params); # Dumps DOM tree, no attributes
> > > >    return $params[0]->{ROOT}->{some}->{node}; # access
elements
> > > >   }
> > > >
> > > > exit;
> > > >
> > > > --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
> > > > > Hi, Robert!
> > > > >
> > > > > SOAP::Data->type(xml => ...) is the way to send XML
fragment
> > that
> > > > > will look like XML on wire. SOAP::Lite doesn't do any
> > validation
> > > > in
> > > > > this case, so it's quite possible that generated XML (by
> > itself
> > > > or
> > > > in
> > > > > combination with SOAP envelope) is invalid. ->type(base64
> > => ...)
> > > > > doesn't have this problem and always generate valid XML. You
> > may
> > > > see
> > > > > what do you have on wire if you switch on debug info on
> > client
> > > > side
> > > > > with ->on_debug(sub{print@_}).
> > > > >
> > > > > If you insert XML as a fragment I do not recommend you to
use
> > > > > unqualified 'id' attributes, because they may interfere
> > with 'id'
> > > > > attribute that is used by SOAP itself (yet you'll be able to
> > > > access
> > > > > that attribute).
> > > > >
> > > > > > > 4) What's the best way to send/receive a well-formed
> > > > > > > and x-schema validating XML data record for import
> > > > > > > into a local database?
> > > > > I would say base64 is the best way to go (esp. if XML
> > processing
> > > > is
> > > > > required on another side anyway), because if you encode XML
> > as a
> > > > > fragment you'll need to write custom deserializer to
process
> > your
> > > > > data. Let me know if you have any questions.
> > > > >
> > > > > Best wishes, Paul.
> > > > >
> > > > > --- Silly Yahoo Readers <theonetowhommyrefers@y...> wrote:
> > > > > > Since writing the below I found the SOAP::Data->type(...)
> > > > thingy
> > > > > > (attribute? directive?) and played around with a few
> > settings.
> > > > When
> > > > > > I
> > > > > > specify the default (base64) my server finds and parses
the
> > > > > > message.
> > > > > > When I specify 'xml' I get the following error:
> > > > > >
> > > > > > Fault: SOAP-ENV:Server, not well-formed (invalid token)
at
> > line
> > > >
> > > > 1,
> > > > > > column 4, byte 4 at
> > /usr/local/lib/perl5/site_perl/5.6.1/i686-
> > > > > > linux/XML/Parser.pm line 185
> > > > > >
> > > > > > *Sigh* Help?
> > > > > >
> > > > > > --
> > > > > > Robert Taylor
> > > > > >
> > > > > > --- In soaplite@y..., Robert Taylor
> > <theonetowhommyrefers@y...>
> > > > > > wrote:
> > > > > > > I created my first data-based connected SOAP
> > > > > > > client/server combination using SOAP-Lite. Now I want
> > > > > > > my business partner to be able to use my HTTPS/CGI
> > > > > > > SOAP server and have run into a problem.
> > > > > > >
> > > > > > > My goal is to receive an XML record for import into my
> > > > > > > (MySQL) database. The partner defined the record but
> > > > > > > I'm defining the SOAP service.
> > > > > > >
> > > > > > > A few questions:
> > > > > > >
> > > > > > > 1) If the @lines in "$soap->store(@lines)" contains a
> > > > > > > well-formed and x-schema validated XML file, why is
> > > > > > > the payload (right term?) serialized?
> > > > > > >
> > > > > > > 2) Related to (1) -- the data sent to the server is
> > > > > > > encoded (base 64?). Must it be?
> > > > > > >
> > > > > > > 3) My partner is coding his own client (not using
> > > > > > > SOAP::Lite, but something in C++ on an MS platform --
> > > > > > > not using .NET tools either). He's sending basically
> > > > > > > handcrafted SOAP messages with the Body a simple XML
> > > > > > > file. When I showed him the output of my client.cgi
> > > > > > > (below) using the "on_debug" method he balked at the
> > > > > > > Base64 and <c-gensym6 xsi:type="xsd:int"> wrappers on
> > > > > > > the XML file.
> > > > > > >
> > > > > > > Pretend my XML Data looks like this:
> > > > > > >
> > > > > > > <Test>
> > > > > > >   <Question id="1" type="short answer"><text>What is
> > > > > > > the correct spelling of your name?</text></Question>
> > > > > > >   <Question id="2" type="multiple choice"><text>What
> > > > > > > is your gender?</text>
> > > > > > >     <option id="A">Male</option>
> > > > > > >     <option id="B">Female</option>
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com

#946 From: "Rik" <ukdiveboy@...>
Date: Mon Oct 22, 2001 9:35 pm
Subject: Re: Forking from a dispatched class
ukdiveboy
Send Email Send Email
 
Mike/Paul/Sean,

Just to confirm, I just had the same problem on Linux (2.2
kernel/RH6.2).

My client app hangs until the child process gets killed.  When I
implemented the KillSocketSOAPHTTPDaemon module everything works
great.

If you look in the Perl Cookbook, Ch 17.9, it tells you the same as we
experienced.



I had hoped there would be a neater way to access the socket guts of
the HTTP::Daemon that SOAP::Lite used for the handler.  Rather than
having to re-write a whole replacement ::Daemon myself.  Perhaps you
could add a method ...->shutdown(1|2|3).

Thanks for saving me the the time to do it anyway!

Regards,
Rik.



--- In soaplite@y..., Michael Percy <mpercy@p...> wrote:
> > -----Original Message-----
> > From: Meisner, Sean [mailto:Sean.Meisner@V...]
> > Sent: Tuesday, July 31, 2001 2:13 PM
> ...
> > Ummm, can't recall the exact train of thought that led me to that
> > solution, but I think I burned a good 2 or 3 work days of reading
> > man pages on fork and socket calls and looking at the SOAP::Lite
> > and HTTP::Daemon code to figure out what was going on.
>
> That sounds about right... I was really confused and about to embark
on that
> journey!
>
> > I *think* that Solaris will be the only OS that would benefit
from
> > this patch, but I'm not sure on that.  I seem to remember being
told
> > that other systems handle forking with open sockets in a
> > cleaner fashion.
>
> I don't know if this is the case or not, but this issue definitely
warrants
> at least a relnote! Checking on the linux manpage for fork(2), it
states:
>
> -- from Linux.com: http://www.linux.com/develop/man/2/fork/
> Linux> fork creates a child process that differs from the parent
> Linux> process only in its PID and PPID, and in the fact that
> Linux> resource utilizations are set to 0. File locks and pending
> Linux> signals are not inherited.
> Linux> ...
> Linux> The fork call conforms to SVr4, SVID, POSIX, X/OPEN, BSD 4.3.
>
> While on the manpage for Solaris, it says:
>
> -- for Solaris:
> http://www.hgmp.mrc.ac.uk/cgi-bin/man.cgi?section=2&topic=fork
> Solaris> The fork() and fork1() functions create a new process. The
> Solaris> new process (child process) is an exact copy of the calling
> Solaris> process (parent process). The child process inherits the
> Solaris> following attributes from the parent process:
> Solaris> ...
> Solaris> open file descriptors
> Solaris> ...
>
> Obviously Solaris does this explicitly, while on Linux is not quite
> documented but seems likely. Since file locks != file descriptors,
and I
> don't think resource utilizations would include FD's, I am assuming
without
> trying it that Linux follows the same behavior as Solaris on this
one.
>
> Can anyone developing on Linux verify this behavior?
>
> Thanks,
> Mike

#947 From: Paul Kulchenko <paulclinger@...>
Date: Mon Oct 22, 2001 10:14 pm
Subject: Re: Re: Forking from a dispatched class
paulclinger
Send Email Send Email
 
Hi, Rik!

> the HTTP::Daemon that SOAP::Lite used for the handler.  Rather than
> having to re-write a whole replacement ::Daemon myself.  Perhaps
> you could add a method ...->shutdown(1|2|3).
It's in the code already. I commited this change as suggested by Sean
Meisner. Will be available with the next version.

Best wishes, Paul.

--- Rik <ukdiveboy@...> wrote:
> Mike/Paul/Sean,
>
> Just to confirm, I just had the same problem on Linux (2.2
> kernel/RH6.2).
>
> My client app hangs until the child process gets killed.  When I
> implemented the KillSocketSOAPHTTPDaemon module everything works
> great.
>
> If you look in the Perl Cookbook, Ch 17.9, it tells you the same as
> we
> experienced.
>
>
>
> I had hoped there would be a neater way to access the socket guts
> of
> the HTTP::Daemon that SOAP::Lite used for the handler.  Rather than
> having to re-write a whole replacement ::Daemon myself.  Perhaps
> you
> could add a method ...->shutdown(1|2|3).
>
> Thanks for saving me the the time to do it anyway!
>
> Regards,
> Rik.
>
>
>
> --- In soaplite@y..., Michael Percy <mpercy@p...> wrote:
> > > -----Original Message-----
> > > From: Meisner, Sean [mailto:Sean.Meisner@V...]
> > > Sent: Tuesday, July 31, 2001 2:13 PM
> > ...
> > > Ummm, can't recall the exact train of thought that led me to
> that
> > > solution, but I think I burned a good 2 or 3 work days of
> reading
> > > man pages on fork and socket calls and looking at the
> SOAP::Lite
> > > and HTTP::Daemon code to figure out what was going on.
> >
> > That sounds about right... I was really confused and about to
> embark
> on that
> > journey!
> >
> > > I *think* that Solaris will be the only OS that would benefit
> from
> > > this patch, but I'm not sure on that.  I seem to remember being
> told
> > > that other systems handle forking with open sockets in a
> > > cleaner fashion.
> >
> > I don't know if this is the case or not, but this issue
> definitely
> warrants
> > at least a relnote! Checking on the linux manpage for fork(2), it
> states:
> >
> > -- from Linux.com: http://www.linux.com/develop/man/2/fork/
> > Linux> fork creates a child process that differs from the parent
> > Linux> process only in its PID and PPID, and in the fact that
> > Linux> resource utilizations are set to 0. File locks and pending
> > Linux> signals are not inherited.
> > Linux> ...
> > Linux> The fork call conforms to SVr4, SVID, POSIX, X/OPEN, BSD
> 4.3.
> >
> > While on the manpage for Solaris, it says:
> >
> > -- for Solaris:
> > http://www.hgmp.mrc.ac.uk/cgi-bin/man.cgi?section=2&topic=fork
> > Solaris> The fork() and fork1() functions create a new process.
> The
> > Solaris> new process (child process) is an exact copy of the
> calling
> > Solaris> process (parent process). The child process inherits the
> > Solaris> following attributes from the parent process:
> > Solaris> ...
> > Solaris> open file descriptors
> > Solaris> ...
> >
> > Obviously Solaris does this explicitly, while on Linux is not
> quite
> > documented but seems likely. Since file locks != file
> descriptors,
> and I
> > don't think resource utilizations would include FD's, I am
> assuming
> without
> > trying it that Linux follows the same behavior as Solaris on this
> one.
> >
> > Can anyone developing on Linux verify this behavior?
> >
> > Thanks,
> > Mike
>
>
> ------------------------ Yahoo! Groups Sponsor
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

#948 From: "Dana Powers" <dana@...>
Date: Mon Oct 22, 2001 10:52 pm
Subject: Re: (Perl) WWW-Authenticate: NTLM using Soap or Soap::Lite?
beatdown_1_2
Send Email Send Email
 
This is a transport issue, and not impacted by SOAP as far as I can tell -
it would need to be implemented at the LWP level, and I havent been able to
find any exisiting implementations. The module that you'd need is
LWP::Authen::NTLM.pm. If you're interested in implementing it yourself,
there is protocol information here: http://www.innovation.ch/java/ntlm.html
.
The open source web proxy project, squid, has some information available as
well: http://squid.sourceforge.net/ntlm/

Hope this helps
dpk

----- Original Message -----
From: "Bill Jones" <sneex@...>
To: <soaplite@yahoogroups.com>
Sent: Saturday, October 20, 2001 6:53 AM
Subject: [soaplite] (Perl) WWW-Authenticate: NTLM using Soap or Soap::Lite?


>
> Subject: (Perl) WWW-Authenticate: NTLM using Soap or Soap::Lite?
>
> Is there a way to perform NTLM WWW-Authentication via Soap or
> Soap::Lite?
>
> I am on Solaris 8 talking to IIS/5.0 w/WebServices; I've been
> trying (Perl) LWP::* with Soap::Lite; but I keep getting the
> following error:
>
> GET
>
http://207.203.95.95/bill/BrokerEmployee.asmx/ClassRoster?strBrokerID=ETB251
> &strClassReferenceNumber=138887&strTerm=20021 --> 401 Access Denied
> Connection: close
> Date: Sat, 20 Oct 2001 04:10:10 GMT
> Server: Microsoft-IIS/5.0
> WWW-Authenticate: Negotiate
> WWW-Authenticate: NTLM
> Content-Length: 3643
> Content-Type: text/html
> Content-Type: text-html; charset=Windows-1252
> Client-Date: Sat, 20 Oct 2001 04:08:53 GMT
> Client-Request-Num: 1
> Client-Warning: Unsupported authentication scheme 'ntlm'
> Title: You are not authorized to view this page
> X-Meta-ROBOTS: NOINDEX
>
> <HTML>
> <HEAD><TITLE>An Error Occurred</TITLE></HEAD>
> <BODY>
> <H1>An Error Occurred</H1>
> 401 Access Denied
> </BODY>
> </HTML>
>
> Also, I guess ultimately, I want to talk to it via SSL (if I ever
> get into production :(  Anyhow, any insiht, thoughts, or comments
> would be most welcome  :)
>
> Thx!
> -Sx- :]
>
>
>
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>

Messages 919 - 948 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