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...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 1853 - 1882 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#1853 From: "Randy J. Ray" <rjray@...>
Date: Wed Sep 18, 2002 9:07 pm
Subject: Re: Header and URL question
rjray_perl
Send Email Send Email
 
On 2002.09.18 14:00 John Griffin wrote:

> This particular call expects no parameters just the method name
> 'listUploadMappings'.  Which brings me to my next question. Do I put the
> method name as the first parameter of the @other_args or do I need to do
> something else.

Actually, once you have the SOAP::Lite instance object, you can call the
method directly off of it, as if it were local code:

	 $soap->listUploadMappings($header)

SOAP::Lite recognized object derived from SOAP::Header in the parameter list,
and moves them to the proper place in the request envelope.

Randy
--
rjray@...        Linux: Because rebooting is for adding new hardware.

Any spammers auto-extracting addresses from this message will definitely want
to include uce@... and report@...

#1854 From: "hmenon_1999" <hmenon_1999@...>
Date: Thu Sep 19, 2002 1:50 pm
Subject: Attribute for header
hmenon_1999
Send Email Send Email
 
Hello

I am using SOAP::Lite to connect to a client that requires me to
first create a session and then use a session ID as part of the
header (But please take a look below)

The envelope needs to be like:

<SOAP-ENV:Header sessionid="2323.1223">
</SOAP-ENV:Header>
<SOAP-ENV:Body>
....
....
</SOAP-ENV:Body>

As shown above the sessionid is not a seperate header element, but an
attribute to the SOAP-ENV:Header element.

I am new to SOAP:Lite and is having some trouble generating such an
envelope. I am able to add new header elements with SOAP::Header, but
am not able to add an attribute to the main header element. Any help
would be greatly appreciated.

Thanks in advance
menon

#1855 From: "John Liu" <johnl@...>
Date: Thu Sep 19, 2002 2:56 pm
Subject: php associated array and perl soaplite hash
zhongjianliu
Send Email Send Email
 
I did a test,the php soap server returns
associated array in the form -
$res[$i] = array ( 'elem1' => $arr[0],
                    'elem2' => $arr[1],
                    'elem3' => $arr[2],
                    'elem4' => $arr[3]);

the WSDL file is similar to GoogleSearch.wsdl,
I tried to use soaplite to do the following
call -
my $result= SOAP::Lite
  -> service('http://services/mkbt.wsdl');
  -> myCall($sec, '123', 'johnl');

if(defined($result->{resultElements})) {
     print join "\n",
     "Found:",
     $result->{resultElements}->[0]->{elem1},
     $result->{resultElements}->[0]->{elem2} . "\n"
}

The error msg - Can't coerce array into hash.

A year ago, I can't figure this out.
Is any body find a way now to handle this?

thanks.

johnl

#1856 From: Eric Promislow <ericp@...>
Date: Thu Sep 19, 2002 5:14 pm
Subject: Re: Array of objects
ericpromislow
Send Email Send Email
 
Consider applying this patch.  I apply it manually, as the area
in question is different across versions 0.51, 0.52, and 0.55:

--- Lite.bak.pm Thu Apr  4 11:06:32 2002
+++ Lite.pm     Thu Apr  4 11:06:55 2002
@@ -1828,11 +1828,16 @@
        return defined $class && $class ne 'Array' ? bless($res => $class) :
$res;

   } elsif ($name =~ /^\{$SOAP::Constants::NS_ENC\}Struct$/ ||
!$schemaclass->can($method) && (ref $children || defined $class && $value =~
/^\s*$/)) {
-    my $res = {};
        $self->hrefs->{$id} = $res if defined $id;
-    %$res = map {$self->decode_object($_)} @{$children || []};
-    return defined $class && $class ne 'SOAPStruct' ? bless($res => $class) :
$res;
-
+    if (@{$children} > 1 && $children->[0]->[0] eq $children->[1]->[0]) {
+        my $res = [];
+        @$res = map { scalar(($self->decode_object($_))[1]) }
@{$children || []};
+        return defined $class && $class ne 'Array' ? bless($res => $class) :
$res;
+    } else {
+        my $res = {};
+        %$res = map {$self->decode_object($_)} @{$children || []};
+        return defined $class && $class ne 'Struct' ? bless($res =>
$class) : $res;

+    }
      } else {
        my $res;
        if ($schemaclass->can($method)) {

- Eric

>    Date: Wed, 18 Sep 2002 12:28:35 -0000
>    From: "fb_lawmaker" <fb_lawmaker@...>
> Subject: Array of objects
>
> hi,
>
> i've got a little problem with an returned array of objects ...
>
> my code:
> --------
> use Data::Dumper;
> use SOAP::Lite +trace => qw(debug);
>
> my $WebService = SOAP::Lite->service('file:service.wsdl');
> my @result = $WebService->HelloWorld;
>
> print Dumper @result;
> ---------------------
>
> the call of the webservice works and it gets all values (for example
> 3 objects) but there is just one array/hash-element in the @result-
> variable ...
> how can i get the other ones ?
>
> the returned-soap-packt of the webservice:
> ------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <ArrayOfTestclass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://tempuri.org/">
>   <testclass>
>     <testvar1>x0t1</testvar1>
>     <testvar2>x0t2</testvar2>
>   </testclass>
>   <testclass>
>     <testvar1>x1t1</testvar1>
>     <testvar2>x1t2</testvar2>
>   </testclass>
>   <testclass>
>     <testvar1>x2t1</testvar1>
>     <testvar2>x2t2</testvar2>
>   </testclass>
> </ArrayOfTestklasse>
> ------------------------------------------
>
>
> thanks
> fb

#1857 From: "Randy J. Ray" <rjray@...>
Date: Thu Sep 19, 2002 7:47 pm
Subject: Re: Attribute for header
rjray_perl
Send Email Send Email
 
On 2002.09.19 06:50 hmenon_1999 wrote:

> I am using SOAP::Lite to connect to a client that requires me to
> first create a session and then use a session ID as part of the
> header (But please take a look below)
>
> The envelope needs to be like:
>
> <SOAP-ENV:Header sessionid="2323.1223">
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
> ....
> ....
> </SOAP-ENV:Body>
>
> As shown above the sessionid is not a seperate header element, but an
> attribute to the SOAP-ENV:Header element.

This actually goes against the SOAP specification. The writers of the server
should be taken to task for this, and required to implement this as a header
child-element. A strict validating parser will not accept this attribute for
Header.

Randy
--
rjray@...        Linux: Because rebooting is for adding new hardware.

Any spammers auto-extracting addresses from this message will definitely want
to include uce@... and report@...

#1858 From: Teifke Sascha ZFF FW-EI <Sascha.Teifke@...>
Date: Fri Sep 20, 2002 9:16 am
Subject: Soaplite beginners question
Sascha.Teifke@...
Send Email Send Email
 
Hello List,

I'm a beginner in using the SoapLite Module and I am trying ot work with the

tutorial found on http://perl.com/lpi/a/2001/01/soap.html (Quick Start with
SOAP, Author Paul Kulchenko)

I've written the following:

================8<================
#Server: server.pl
#!c:/perl/bin/perl.exe

use SOAP::Transport::HTTP;
use Demo;

my $daemon = SOAP::Transport::HTTP::Daemon
   -> new ( LocalAddr => 'myhostname', LocalPort => 8080 )
   -> dispatch_to('c:/inetpub/wwwroot/soap/')
;
print "Contact to SOAP server at ", $daemon->url, "\n";
$daemon->handle;

================8<================
#Demo.pm
package Demo;

sub hi {
     return "hello, world";
}

sub bye {
     return "goodbye, cruel world";
}

1;
================8<================
#Remote Client:
use SOAP::Lite;

$soap_response = SOAP::Lite
   -> uri('http://192.168.0.1:8080')
   -> proxy('http://192.168.0.1:8080')
   -> hi()
   -> result;

print $soap_response;
================8<================

The Server starts the right way, displaying the desired Message:

** "Contact to SOAP server at http://hostname:8080/"

While starting the client on a remote client the client quits leaving the
error "Use of unitialiezd value in print at client.pl line 21" ( this
is "print $soap_response;")

At the Server Console I can see the following Message:
Use of unitialiezed value in string eq at c:/perl/site/lib/SOAP/Lite.pm line
370.
Use of unitialiezed value in string eq at c:/perl/site/lib/SOAP/Lite.pm line
370.
Use of unitialiezed value in string eq at c:/perl/site/lib/SOAP/Lite.pm line
370.
Cannot marshall URI::http referance at C:/perl/site/lib/SOAP/Lite.pm line
1141

What is wrong?

Thank you in advance.






Mit freundlichen Grüßen / With best regards

Sascha Teifke
**********************************************************
ZF Friedrichshafen AG | 88038 Friedrichshafen | Abt. FW-EI

Fon:  +49 (0) 7541 77 - 3330
Mobil: +49 (0) 7541 77 - 91 3330
Fax: +49 (0) 7541 77 - 90 3330
Email:  mailto:sascha.teifke@...
Internet: http://www.zf.com
Intranet: http://web.zff.zf-group.de/kst635
**********************************************************

#1859 From: "john_griffin12" <jgriffin@...>
Date: Fri Sep 20, 2002 1:33 pm
Subject: Header element
john_griffin12
Send Email Send Email
 
Anyone know how to get this in the header

   <element a=xxx b=xxx c=xxx></element>

I tried:
$header = SOAP::Header->new(name => 'element')
   		                 ->attr(a => 'xxx',
      		                        b => 'xxx',
                      		        c => 'xxx');

but it doesn't work. Data dumper shows this:

$VAR1 = bless( {
                  '_value' => [
                                'xxx',
                                'b',
                                'xxx',
                                'c',
                                'xxx'
                              ],
                  '_signature' => [],
                  '_name' => 'element',
                  '_attr' => 'a'
                }, 'SOAP::Header' );

and that's not what I'm looking for.  Help!!!

#1860 From: "Randy J. Ray" <rjray@...>
Date: Fri Sep 20, 2002 8:43 pm
Subject: Re: Header element
rjray_perl
Send Email Send Email
 
On 2002.09.20 06:33 john_griffin12 wrote:
> Anyone know how to get this in the header
>
>   <element a=xxx b=xxx c=xxx></element>
>
> I tried:
> $header = SOAP::Header->new(name => 'element')
>    		                ->attr(a => 'xxx',
>       		                       b => 'xxx',
>                       		       c => 'xxx');
>
> but it doesn't work. Data dumper shows this:
>
> $VAR1 = bless( {
>                  '_value' => [
>                                'xxx',
>                                'b',
>                                'xxx',
>                                'c',
>                                'xxx'
>                              ],
>                  '_signature' => [],
>                  '_name' => 'element',
>                  '_attr' => 'a'
>                }, 'SOAP::Header' );

The attr() method takes a hash reference, not a hash. If I've used a hash/list
in previous responses, I apologize for any confusion. What happened was it
took the "a" as the value for attr, and the rest of the list as the overall
value for the element (see the manual page section on SOAP::Data for the
semantics of the methods).

Instead, do this:

    $header = SOAP::Header->new(name => 'element')
                          ->attr({ a => 'xxx',
        	                          b => 'xxx',
                                   c => 'xxx' });

Randy
--
rjray@...        Linux: Because rebooting is for adding new hardware.

Any spammers auto-extracting addresses from this message will definitely want
to include uce@... and report@...

#1861 From: "john_griffin12" <jgriffin@...>
Date: Mon Sep 23, 2002 8:25 pm
Subject: Unresolved prefix
john_griffin12
Send Email Send Email
 
Thatnks for everyone's help with the header problem.  I've got it
working now but here's the next one.

error msg:
Unresolved prefix 'ns2' for attribute value 'ns2:contact'

value returned (partial):
<SOAP-ENV:Body>
     <ns1:getContactResponse xmlns:ns1="urn:PersonService" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
	 <return xmlns:ns2="" xsi:type="ns2:contact">
	 <firstName xsi:type="xsd:string">Anthony</firstName>
	 <mobile xsi:type="xsd:string" xsi:null="true"/>
...

I'm assuming this means that I have to write a de-serialization
routine for this data type 'contact' or is it that the ns2 namespace
value may not be defined in the wsdl file.  If the answer involves a
new routine can some one give me a brief rundown on writing on or
point me to a good explanation. The SOAP::Lite docs are sketchy under
the serializer section.

In java this would be accessed as a bean if that helps(and it works).

Thanks in advance.

J.G.

#1862 From: Paul Kulchenko <paulclinger@...>
Date: Mon Sep 23, 2002 10:32 pm
Subject: Re: Unresolved prefix
paulclinger
Send Email Send Email
 
Hi John,

> error msg:
> Unresolved prefix 'ns2' for attribute value 'ns2:contact'

>  <return xmlns:ns2="" xsi:type="ns2:contact">

As far as I remember XML Namespaces specification doesn't allow to
have empty namespace names, unless they are default names (in other
words, xmlns:foo="" is not allowed, while xmlns="" is fine).
SOAP::Lite shouldn't allow you to generate this attribute, unless you
do it manually. Such message cannot be properly processed, hence the
error message. If you associate "contact" type with some namespace,
you can then map it to the type deserializer (see
exmaples/customschema.pl for example). Hope it helps.

Best wishes, Paul.

--- john_griffin12 <jgriffin@...> wrote:
> Thatnks for everyone's help with the header problem.  I've got it
> working now but here's the next one.
>
> error msg:
> Unresolved prefix 'ns2' for attribute value 'ns2:contact'
>
> value returned (partial):
> <SOAP-ENV:Body>
>     <ns1:getContactResponse xmlns:ns1="urn:PersonService" SOAP-
> ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>  <return xmlns:ns2="" xsi:type="ns2:contact">
>  <firstName xsi:type="xsd:string">Anthony</firstName>
>  <mobile xsi:type="xsd:string" xsi:null="true"/>
> ...
>
> I'm assuming this means that I have to write a de-serialization
> routine for this data type 'contact' or is it that the ns2
> namespace
> value may not be defined in the wsdl file.  If the answer involves
> a
> new routine can some one give me a brief rundown on writing on or
> point me to a good explanation. The SOAP::Lite docs are sketchy
> under
> the serializer section.
>
> In java this would be accessed as a bean if that helps(and it
> works).
>
> Thanks in advance.
>
> J.G.
>
>
> ------------------------ 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!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

#1863 From: quinn@...
Date: Mon Sep 23, 2002 11:27 pm
Subject: Adding methods on the client side?
quinn_weaver
Send Email Send Email
 
O.K., I don't know if this is considered Horribly Bad Practice, but...

I'm working on some classes where I want some of the methods (maybe
just new) to run on a server via SOAP, but I want others (say, the
business logic) to be defined and run on the client side.

One way to achieve this is to cram subroutine references into the
object's namespace at run time:

   Class::method_name = sub { "..." };

I'm wondering whether anyone else has felt this need, and whether
they've come up with some more elegant way of doing it.  I'd also be
interested to hear overall critiques:  Does this seem like a reasonable
thing to do?  Am I violating some design rule of SOAP in even thinking
about it?

If my approach is the best we can come up with, maybe I'll make a nice
CPAN module to abstract over this functionality (so you can write up
your client-side method definitions in a file, use a magic module, and
have them loaded into the class's name space--maybe at compile time).

Cheers,
--Q

PS:  Now that I'm on the list, I'd like to thank Paul for making such
a great package.  For such a complex problem domain, it provides a
wonderfully simple interface.  Yay Paul!

#1864 From: "Ron Murphy" <rmurphy@...>
Date: Tue Sep 24, 2002 1:06 am
Subject: Multitasking SOAP server dispatch?
rmurphy1960
Send Email Send Email
 
Hi,
 
I want to use an existing CLI process written in Perl, to handle concurrent SOAP requests.  There is centralized state information that lives in my CLI process, that needs to be available to all "sessions" (a web GUI session).  So, a pure stateless CGI-like solution on the CLI side won't suffice. 
 
There are actually both centralized state to be shared by all session, plus state that might be maintained on behalf of a particular session, as long as that session remains (e.g. while a web GUI page is still open and has not timed out).
 
Can SOAP::Lite be used in this way, with either threading or forked server process models?
 
Thanks
Ron

#1865 From: Paul Kulchenko <paulclinger@...>
Date: Tue Sep 24, 2002 2:12 am
Subject: Re: Adding methods on the client side?
paulclinger
Send Email Send Email
 
Hi Quinn,

> One way to achieve this is to cram subroutine references into the
> object's namespace at run time:
>
>   Class::method_name = sub { "..." };
While it's possible to do the way you described there is no need to
do that in most cases. SOAP::Lite supports direct (when you
explicitly specify the method name) and indirect invocation (when
autodispatch mode is used). In both cases only methods that don't
exist locally will be called, but it's possible to override this
behaviour using SOAP:: prefix (in which case remote methods will be
accessed even if local twins are defined).

Still I don't see why you can't do it your way ;)

> CPAN module to abstract over this functionality (so you can write
> up
> your client-side method definitions in a file, use a magic module,
> and
> have them loaded into the class's name space--maybe at compile
> time).
I don't think I got this one, so I may be answering the wrong
question ;). Could you elaborate?

Best wishes, Paul.

--- quinn@... wrote:
> O.K., I don't know if this is considered Horribly Bad Practice,
> but...
>
> I'm working on some classes where I want some of the methods (maybe
> just new) to run on a server via SOAP, but I want others (say, the
> business logic) to be defined and run on the client side.
>
> One way to achieve this is to cram subroutine references into the
> object's namespace at run time:
>
>   Class::method_name = sub { "..." };
>
> I'm wondering whether anyone else has felt this need, and whether
> they've come up with some more elegant way of doing it.  I'd also
> be
> interested to hear overall critiques:  Does this seem like a
> reasonable
> thing to do?  Am I violating some design rule of SOAP in even
> thinking
> about it?
>
> If my approach is the best we can come up with, maybe I'll make a
> nice
> CPAN module to abstract over this functionality (so you can write
> up
> your client-side method definitions in a file, use a magic module,
> and
> have them loaded into the class's name space--maybe at compile
> time).
>
> Cheers,
> --Q
>
> PS:  Now that I'm on the list, I'd like to thank Paul for making
> such
> a great package.  For such a complex problem domain, it provides a
> wonderfully simple interface.  Yay Paul!
>
>
> ------------------------ 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!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

#1866 From: "Chris" <chris@...>
Date: Tue Sep 24, 2002 10:44 am
Subject: Re: Adding methods on the client side?
marceusx
Send Email Send Email
 
Well you can move this to compile time by wrapping it into a BEGIN
block ...

but I think traditionally you would use a wrapper object
that dispatches some of it's methods to the SOAP handler and handles the
business logic locally.

> O.K., I don't know if this is considered Horribly Bad Practice, but...
>
> I'm working on some classes where I want some of the methods (maybe
> just new) to run on a server via SOAP, but I want others (say, the
> business logic) to be defined and run on the client side.
>
> One way to achieve this is to cram subroutine references into the
> object's namespace at run time:
>
>   Class::method_name = sub { "..." };
>
> I'm wondering whether anyone else has felt this need, and whether
> they've come up with some more elegant way of doing it.  I'd also be
> interested to hear overall critiques:  Does this seem like a reasonable
> thing to do?  Am I violating some design rule of SOAP in even thinking
> about it?
>

-Chris

#1867 From: quinn@...
Date: Tue Sep 24, 2002 11:07 pm
Subject: Re: Adding methods on the client side?
quinn_weaver
Send Email Send Email
 
On Mon, Sep 23, 2002 at 07:12:55PM -0700, Paul Kulchenko wrote:

> Hi Quinn,
>
> > One way to achieve this is to cram subroutine references into the
> > object's namespace at run time:
> >
> >   Class::method_name = sub { "..." };
> While it's possible to do the way you described there is no need to
> do that in most cases. SOAP::Lite supports direct (when you
> explicitly specify the method name) and indirect invocation (when
> autodispatch mode is used). In both cases only methods that don't
> exist locally will be called, but it's possible to override this
> behaviour using SOAP:: prefix (in which case remote methods will be
> accessed even if local twins are defined).

OK, I get it now.  All I do is define the client-side methods on the
client (e.g. by writing and use'ing a module whose package name is the
name of the class the SOAP service exposes).  Then the local code will
work just as I desired.  Ah, much better. :)

> Still I don't see why you can't do it your way ;)

Nope, I like this one better... see below.

> > CPAN module to abstract over this functionality (so you can write
> > up
> > your client-side method definitions in a file, use a magic module,
> > and
> > have them loaded into the class's name space--maybe at compile
> > time).
> I don't think I got this one, so I may be answering the wrong
> question ;). Could you elaborate?

Actually, I was just wishing for the functionality you described above,
where all you have to do is define a module on the client side.  I was
thinking you'd have to do some kind of magic to make that work, but
evidently you don't.  Cool. :)

I guess this is because autodispatch uses AUTOLOAD, so that SOAP never
even gets involved unless the method is undefined.

Thanks for clearing this up, and thanks again for SOAP::Lite. :)

#1868 From: "arnaud_sahuguet" <sahuguet@...>
Date: Wed Sep 25, 2002 6:23 pm
Subject: sending raw XML as the result
arnaud_sahuguet
Send Email Send Email
 
Hi,

Is there a way to send raw XML as the result of a service?
From the SOAP::Lite documentation, the only way seems to use SOAP::Data  to
create elements one by one.

regards,

Arnaud

#1869 From: "mrdamnfrenchy" <mrdamnfrenchy@...>
Date: Thu Sep 26, 2002 12:52 pm
Subject: Re: sending raw XML as the result
mrdamnfrenchy
Send Email Send Email
 
--- In soaplite@y..., "arnaud_sahuguet" <sahuguet@l...> wrote:
> Is there a way to send raw XML as the result of a service?
> From the SOAP::Lite documentation, the only way seems to use
> SOAP::Data  to create elements one by one.

No, just return the XML string as a string. SOAP::Lite will encode the
< and the & appropriately.

The only issue is if you use XML::Lite::Parser (instead of
XML::Parser), the & and < are not decoded by SOAP::Lite on
reception. This is inconsistent and should probably be fixed.

-Mathieu

#1870 From: "malory_d" <malory_d@...>
Date: Thu Sep 26, 2002 5:29 pm
Subject: Retrieve soap envelope on the server.
malory_d
Send Email Send Email
 
Hi,

I know this is documented, but for some reason, I can't seem to
retrieve the soap envelope as specified in the documentation.

I am running the server as a mod_soap server using apache and
mod_perl.

When I pop a parameter from the parameter list, it just returns the
last parameter that I passed to the function.

I have tried to inherit my class from SOAP::Server::Parameters class,
but that does not seem to work either.

I'd really appreciate it if you could provide me with an example and
also if you could provide me with an example of how I could print the
envelope in it's raw form on the server.

Here is my code snapshot.

@ISA = qw(SOAP::Server::Parameters);
use strict;

use soap::htUser;


sub new {
	 return bless {}=>shift;
}
sub login {

         my $envelope = pop;
	 my($s,$uname,$pass) = @_;
	 my $val = $envelope->valueof('//soap::htUser');
         #does not work
	 warn($val);
}

#1871 From: Byrne Reese <breese@...>
Date: Thu Sep 26, 2002 6:34 pm
Subject: Re: sending raw XML as the result
byrnereese
Send Email Send Email
 
Yeah - I did this in a service I wrote around Amazon's REST based
service. Check out:

http://majordojo.com/amazon_query/

http://majordojo.com/amazon_query/amazon_query.txt

Specifically:

     my $content = _fetch($url);
     $content =~ s/\<\?xml.*\?\>\n?//; # strip the <?xml blah?>
     $content =~ s/\<\!.*\>\n?//;      # strip <!DOCTYPE blah>
     return SOAP::Data->type('xml' => $content);


On Wed, 2002-09-25 at 11:23, arnaud_sahuguet wrote: Hi,

Is there a way to send raw XML as the result of a service?
>From the SOAP::Lite documentation, the only way seems to use
SOAP::Data  to create elements one by one.

regards,

Arnaud



Yahoo! Groups Sponsor
ADVERTISEMENT


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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

--
:/ byrne

Program Manager
Grand Central Communications
breese@...

#1872 From: "Weidong Wang" <wwang@...>
Date: Fri Sep 27, 2002 11:02 pm
Subject: Changing endpoint from a full wsdl file
weidong
Send Email Send Email
 
I need to write client code that uses a wsdl file to start talking to a server. The response from the server will carry new post URI for the next call to post to. For example, the WSDL gives the following endpoint:
 
 
and the response contains a link http://temp.org/soap/accounts and this is the URI I need to post to.
 
Looking through the old archive, I found a response from Paul a while ago after doing such change for tModel WSDL file, and the saying that it is hard to do it for the full WSDL where the service endpoint is specified already.
 
I tried to use proxy() to set it, it does not work. How can this be done?
 
Here is a breif of my code:
 
$soap = SOAP::Lite->serivice($wsdlfile);
$result = $soap->Func(); // first call
...
# parse the result to get the new URI
$soap->proxy($newProxyURI);
$result = $soap->Func(); // 2nd call
 
Thanks.
 
Weidong
 
 

#1873 From: "Randy J. Ray" <rjray@...>
Date: Fri Sep 27, 2002 11:35 pm
Subject: Re: Changing endpoint from a full wsdl file
rjray_perl
Send Email Send Email
 
On 2002.09.27 16:02 Weidong Wang wrote:
> I need to write client code that uses a wsdl file to start talking to a
> server. The response from the server will carry new post URI for the next
> call to post to. For example, the WSDL gives the following endpoint:
>
>     http://temp.org/soap
>
> and the response contains a link http://temp.org/soap/accounts and this is
> the URI I need to post to.

The problem is that the WSDL parsing code creates wrapper routines for each of
the operations defined in the WSDL file. These wrappers explicitly set the URI
before making the call, from within the wrappers themselves. So manually
setting the URI is lost. And I can't offer a solution that wouldn't involve a
big hack to SOAP::Lite, which I lack the time for at this point :-). Sorry.

Randy
--
rjray@...        Linux: Because rebooting is for adding new hardware.

Any spammers auto-extracting addresses from this message will definitely want
to include uce@... and report@...

#1874 From: Paul Kulchenko <paulclinger@...>
Date: Sat Sep 28, 2002 1:49 am
Subject: Re: Changing endpoint from a full wsdl file
paulclinger
Send Email Send Email
 
Hi Weidong,

Randy is right. if WSDL doesn't include an endpoint, then manual call
will make the trick:

my $service = SOAP::Lite
   ->
service('http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl');

$service->proxy('http://foo/'); # <<<
print $service->getQuote('MSFT'), "\n";

If WSDL includes the endpoint, you can overwrite the endpoint()
method to return the endpoint you want:

sub SOAP::Lite::endpoint { return shift if @_ > 1; 'http://foo/' }

That's the shortest solution I can come up with. Let me know if it
doesn't work for you.

Best wishes, Paul.

--- "Randy J. Ray" <rjray@...> wrote:
> On 2002.09.27 16:02 Weidong Wang wrote:
> > I need to write client code that uses a wsdl file to start
> talking to a
> > server. The response from the server will carry new post URI for
> the next
> > call to post to. For example, the WSDL gives the following
> endpoint:
> >
> >     http://temp.org/soap
> >
> > and the response contains a link http://temp.org/soap/accounts
> and this is
> > the URI I need to post to.
>
> The problem is that the WSDL parsing code creates wrapper routines
> for each of
> the operations defined in the WSDL file. These wrappers explicitly
> set the URI
> before making the call, from within the wrappers themselves. So
> manually
> setting the URI is lost. And I can't offer a solution that wouldn't
> involve a
> big hack to SOAP::Lite, which I lack the time for at this point
> :-). Sorry.
>
> Randy
> --
> rjray@...        Linux: Because rebooting is for adding
> new hardware.
>
> Any spammers auto-extracting addresses from this message will
> definitely want
> to include uce@... and report@...
>
> ------------------------ 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!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

#1875 From: "Sheth, Niraj " <niraj_sheth@...>
Date: Sat Sep 28, 2002 1:18 pm
Subject: Denied access to method (mod_perl+SOAP::Lite)
niraj_sheth@...
Send Email Send Email
 
Hi,

I am getting "Denied access to method" error message.

httpd.conf
=======
-----------------><----------------

PerlRequire /Volumes/app/dev/codebase/perl/start_up.pl

PerlModule Apache::Reload
<Location /soap>
#    PerlInitHandler Apache::Reload
#    PerlSetVar ReloadDebug On
#    PerlSetVar ReloadAll Off
     SetHandler perl-script
     PerlHandler SOAP::Apache
</Location>
-----------------><----------------

SOAP::Apache
===========
package SOAP::Apache;

use strict;
use SOAP::Transport::HTTP;

#SOAP::Lite->soapversion(1.2);
my $server = SOAP::Transport::HTTP::Apache
   -> serializer(MySerializer->new)
   -> dispatch_to('/Volumes/app/dev/codebase/perl/modules');

$server->serializer->xmlschema(2001);
print "SOAP xml schema: " . $server->serializer->xmlschema . "\n";

sub handler { $server->handler(@_) }

BEGIN {
     package MySerializer; @MySerializer::ISA = 'SOAP::Serializer';

     sub envelope {
         print STDERR "($$) $ENV{REMOTE_USER}: envelope called with $_[1],
$_[2] at " . localtime() . "\n";
         UNIVERSAL::isa($_[2] => 'SOAP::Data')
                 ? do { (my $method = $_[2]->name) =~ s/Request$/Response/;
                         $_[2]->name($method) }
                 : $_[2] =~ s/Request$/Response/
                 if $_[1] =~ /^(?:method|response)$/;

         $_[2] = SOAP::Data->name($_[2])
                 ->encodingStyle("http://schemas.xmlsoap.org/soap/encoding/")
                 if $_[1] =~ /^(?:method|response)$/;

         shift->SUPER::envelope(@_);
     }
}

1;

-----------------><----------------

In dir /Volumes/app/dev/codebase/perl/modules I have A.pm, B.pm, C.pm etc ..
and B and C has "use A;" while A.pm has "use B;" and "use C;" (@INC and "use
lib" are set in start_up.pl)


Now it works for few times first but will fail after that with Denied access
to method error.
Any Idea?? Does anyone has experience similiar problem?

First I thought it's Apache::Reload, but I commented out from httpd.conf
(still I have "use Apache::Reload;" in all modules though).

Thanks,
-Niraj

My set-up is
mod_perl(latest 1.2x)
perl 5.6.1
SOAP::Lite(latest)
Solaris 2.8



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.

#1876 From: "Weidong Wang" <wwang@...>
Date: Sat Sep 28, 2002 2:53 pm
Subject: Re: Changing endpoint from a full wsdl file
weidong
Send Email Send Email
 
Thanks, Paul and Randy.

> If WSDL includes the endpoint, you can overwrite the endpoint()
> method to return the endpoint you want:
>
> sub SOAP::Lite::endpoint { return shift if @_ > 1; 'http://foo/' }
>
> That's the shortest solution I can come up with. Let me know if it
> doesn't work for you.

Paul, I tried it. I can put it anywhere in my code or library. When running,
Perl will complain that SOAP::Lite::endpoint is redefined, but then it will use
the new endpoint in this call.

But it seems to me that having this sub will affect all WSDL calls, correct? In
my app, I need to use multiple WSDL files for making different service calls. I
suppose the existence of this sub will make all wrapper functions generated by
service() call to use the new endpoint.

It seesm to me if we can dynamically redefine this sub as needed and rerun
service() call (much more overhead of course), we might be able to get around
it?

I will look into having the tModel kind of WSDL file.

Thanks.

Weidong

#1877 From: "Sheth, Niraj " <niraj_sheth@...>
Date: Sat Sep 28, 2002 5:10 pm
Subject: RE: Denied access to method (mod_perl+SOAP::Lite)
niraj_sheth@...
Send Email Send Email
 
After little bit more reading thru mailing list.. I got it working with
following line ..

dispatch_to('/Volumes/app/dev/codebase/perl/modules', '[\w:]+');

but not as  ..
http://guide.soaplite.com/#service dispatch (different services on one
server)

dispatch_to('/Volumes/app/dev/codebase/perl/modules', 'Demo');

Anyway got working...

-Niraj

-----Original Message-----
From: Sheth, Niraj
Sent: Saturday, September 28, 2002 9:18 AM
To: soaplite@yahoogroups.com
Subject: [soaplite] Denied access to method (mod_perl+SOAP::Lite)


Hi,

I am getting "Denied access to method" error message.

httpd.conf
=======
-----------------><----------------

PerlRequire /Volumes/app/dev/codebase/perl/start_up.pl

PerlModule Apache::Reload
<Location /soap>
#    PerlInitHandler Apache::Reload
#    PerlSetVar ReloadDebug On
#    PerlSetVar ReloadAll Off
     SetHandler perl-script
     PerlHandler SOAP::Apache
</Location>
-----------------><----------------

SOAP::Apache
===========
package SOAP::Apache;

use strict;
use SOAP::Transport::HTTP;

#SOAP::Lite->soapversion(1.2);
my $server = SOAP::Transport::HTTP::Apache
   -> serializer(MySerializer->new)
   -> dispatch_to('/Volumes/app/dev/codebase/perl/modules');

$server->serializer->xmlschema(2001);
print "SOAP xml schema: " . $server->serializer->xmlschema . "\n";

sub handler { $server->handler(@_) }

BEGIN {
     package MySerializer; @MySerializer::ISA = 'SOAP::Serializer';

     sub envelope {
         print STDERR "($$) $ENV{REMOTE_USER}: envelope called with $_[1],
$_[2] at " . localtime() . "\n";
         UNIVERSAL::isa($_[2] => 'SOAP::Data')
                 ? do { (my $method = $_[2]->name) =~ s/Request$/Response/;
                         $_[2]->name($method) }
                 : $_[2] =~ s/Request$/Response/
                 if $_[1] =~ /^(?:method|response)$/;

         $_[2] = SOAP::Data->name($_[2])
                 ->encodingStyle("http://schemas.xmlsoap.org/soap/encoding/")
                 if $_[1] =~ /^(?:method|response)$/;

         shift->SUPER::envelope(@_);
     }
}

1;

-----------------><----------------

In dir /Volumes/app/dev/codebase/perl/modules I have A.pm, B.pm, C.pm etc ..
and B and C has "use A;" while A.pm has "use B;" and "use C;" (@INC and "use
lib" are set in start_up.pl)


Now it works for few times first but will fail after that with Denied access
to method error.
Any Idea?? Does anyone has experience similiar problem?

First I thought it's Apache::Reload, but I commented out from httpd.conf
(still I have "use Apache::Reload;" in all modules though).

Thanks,
-Niraj

My set-up is
mod_perl(latest 1.2x)
perl 5.6.1
SOAP::Lite(latest)
Solaris 2.8



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.


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/

#1878 From: Paul Kulchenko <paulclinger@...>
Date: Sat Sep 28, 2002 9:19 pm
Subject: RE: Denied access to method (mod_perl+SOAP::Lite)
paulclinger
Send Email Send Email
 
Hi Niraj,

--- "Sheth, Niraj " <niraj_sheth@...> wrote:
> After little bit more reading thru mailing list.. I got it working
> with following line ..
>
> dispatch_to('/Volumes/app/dev/codebase/perl/modules', '[\w:]+');
This is not secure. Check SERVICE DEPLOYMENT. STATIC AND DYNAMIC and
SECURITY sections in SOAP::Lite doc:
http://theoryx5.uwinnipeg.ca/CPAN/data/SOAP-Lite/SOAP/Lite.html

> but not as  ..
> http://guide.soaplite.com/#service dispatch (different services on
> one server)
>
> dispatch_to('/Volumes/app/dev/codebase/perl/modules', 'Demo');
In your case it probably should be

dispatch_to('/Volumes/app/dev/codebase/perl/modules', 'A', 'B', 'C');

Best wishes, Paul.

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

#1879 From: "Gregory C. Harfst" <gch@...>
Date: Sat Sep 28, 2002 10:43 pm
Subject: persistent server-side state
gch@...
Send Email Send Email
 
Hello,

     I want to write a TCP server that
     maintains persistent state on the
     server.  For example, I want to
     dispatch to a module:

package ORNet::DBServer;

use strict;

my $foo = 1;

sub inc {
     return $foo++;
}


1;

     So $foo should be incremented by
     1 on the server each time inc() is
     called from any client.

     This works when I use use autodispatch
     on the client.  It doesn't work when
     I use OO-style on the client.

     Can somebody tell me what's going on
     here?

   Thanks,
   Greg Harfst

#1880 From: Sean.Meisner@...
Date: Mon Sep 30, 2002 4:15 pm
Subject: RE: persistent server-side state
Sean.Meisner@...
Send Email Send Email
 
Hi Greg,

You really haven't provided enough code to do more than
guess at the problem.

But, at a guess, I wonder if you are using object_by_reference
here.  If not, you probably should.

Cheers,

Sean


> -----Original Message-----
> From: Gregory C. Harfst [mailto:gch@...]
> Sent: Saturday, September 28, 2002 6:44 PM
> To: soaplite@yahoogroups.com
> Subject: [soaplite] persistent server-side state
>
>
>
>   Hello,
>
>     I want to write a TCP server that
>     maintains persistent state on the
>     server.  For example, I want to
>     dispatch to a module:
>
> package ORNet::DBServer;
>
> use strict;
>
> my $foo = 1;
>
> sub inc {
>     return $foo++;
> }
>
>
> 1;
>
>     So $foo should be incremented by
>     1 on the server each time inc() is
>     called from any client.
>
>     This works when I use use autodispatch
>     on the client.  It doesn't work when
>     I use OO-style on the client.
>
>     Can somebody tell me what's going on
>     here?
>
>   Thanks,
>   Greg Harfst
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Plan to Sell a Home?
> http://us.click.yahoo.com/J2SnNA/y.lEAA/MVfIAA/W6uqlB/TM
> --------------------------------------------------------------
> -------~->
>
> 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/

#1881 From: Keanan Smith <KSmith@...>
Date: Mon Sep 30, 2002 4:31 pm
Subject: RE: persistent server-side state
KSmith@...
Send Email Send Email
 
The problem with keeping server-side state is that HTTP requests are by
definition stateless, if you need to maintain state, you'll have to do it
externally, or through some 'special' means (Like the Apache:: modules) if
your service is created via CGI, you have an entirely new copy of the
iterpreter, (Hence no way to maintain state between invocations, without
doing it yourself)

To really have any kind of reasonable way to do what you want (I'm assuming
you want a 'general' state rather than a session-dependant state, because it
would be easy enough to tuck your session-dependant state into objects that
get passed with each call) You'll need to keep track of it server-side, and
it will have to be proof against race conditions (Where multiple calls hit
the server at the same moment)

So:

one way to keep state is to dump it all out to a file and make sure you
flock it (Thereby insuring only one of your services has access to it at a
time)

Another is to use a database (Pretty common, great for long-term flexibility
and interactivity)

Another is to use mod_perl and keep your 'state' somewhere safe (Like in the
server namespace or something)

In any case, there's no "quick and dirty" way to do what you want to simply.

-----Original Message-----
From: Gregory C. Harfst [mailto:gch@...]
Sent: Saturday, September 28, 2002 4:44 PM
To: soaplite@yahoogroups.com
Subject: [soaplite] persistent server-side state



   Hello,

     I want to write a TCP server that
     maintains persistent state on the
     server.  For example, I want to
     dispatch to a module:

package ORNet::DBServer;

use strict;

my $foo = 1;

sub inc {
     return $foo++;
}


1;

     So $foo should be incremented by
     1 on the server each time inc() is
     called from any client.

     This works when I use use autodispatch
     on the client.  It doesn't work when
     I use OO-style on the client.

     Can somebody tell me what's going on
     here?

   Thanks,
   Greg Harfst




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/

#1882 From: "vinograd" <vinograd@...>
Date: Tue Oct 1, 2002 12:20 am
Subject: How to specify namespace for the method name tag
vinograd
Send Email Send Email
 
Hello,
I need to generate the following request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <test2 xmlns="http://test.com/webservices/">
       <p1>string</p1>
       <p2>string</p2>
     </test2>
   </soap:Body>
</soap:Envelope>

My current code is:

   print SOAP::Lite
     -> service('http://www.test.com/webservices/test.asmx?WSDL')
     -> xmlschema('http://www.w3.org/2001/XMLSchema')
     -> envprefix('soap')
     -> test2(SOAP::Data->name("p1" => 'param1'), SOAP::Data->name
("p2" => 'param2'));

It generates the following request:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<test2 xmlns="">
<p1 xsi:type="xsd:string">param1</p1>
<p2 xsi:type="xsd:string">param2</p2>
</test2>
</soap:Body>
</soap:Envelope>


The only thing that's missign is the namespace specification for
test2.
I get this:
<test2 xmlns="">
instead of this:
<test2 xmlns="http://test.com/webservices/">

I tried adding -> uri('http://test.com/webservices/') like this:
print SOAP::Lite
     -> service('http://www.merchantgear.com/webservices/test.asmx?
WSDL')
     -> xmlschema('http://www.w3.org/2001/XMLSchema')
     -> envprefix('soap')
     -> uri('http://merchantgear.com/webservices/')
     -> test2(SOAP::Data->name("p1" => 'param1'), SOAP::Data->name
("p2" => 'param2'));

But it didn't help.

What do I need to do to specify namespace for the method name tag?
Thanks,
Ilya

Messages 1853 - 1882 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