Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

soaplite · SOAP::Lite for Perl (soaplite.com)

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 1205
  • Category: Protocols
  • Founded: Jan 28, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 6019 - 6048 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#6019 From: "leegee23" <leegee23@...>
Date: Wed Sep 19, 2007 9:29 am
Subject: Help with Complex Types
leegee23
Send Email Send Email
 
I posted a problem earlier which turns out to boil down to complex
types. The code below works but outputs an element named 'c-gensym4'
and I can't find a way to make define that element name. Please help!

XML

<smiles xsi:type="namesp2:ArrayOfString">
<c-gensym4 xsi:type="xsd:string">data</c-gensym4>
</smiles>

Produced by

     SOAP::Data->name(
         smiles => \SOAP::Data->value(
             $data # produces element 'c-gensym6'
             # SOAP::Data->name("string" => $data ),
         )->type('string')
     )->type('ArrayOfString');

tia
Lee

#6020 From: "leegee23" <leegee23@...>
Date: Wed Sep 19, 2007 8:10 am
Subject: New User Question: nested SOAP::Data?
leegee23
Send Email Send Email
 
I'm having a few problems getting to grips with some software I've
inherited that uses SOAP::Lite.

A line reads

     $_ = SOAP::Data->name('smiles' => $val );

and seems to output

     <smiles xsi:type="xsd:string">data</smiles>

Problem is that I need that inner text node to be wrapped in a
further XML node, 'string':

     <smiles xsi:type="xsd:string"><string>data</string></smiles>

Please would some kind soul point me in the right direction? I'm
finding the verbosity of the documentation rather confusing.

Many thanks in anticipation
Lee

#6021 From: Eric Bridger <eric@...>
Date: Wed Sep 19, 2007 10:27 pm
Subject: Re: New User Question: nested SOAP::Data?
ebridger2004
Send Email Send Email
 
Nested XML can be produced by making use of references to SOAP::Data
objects.  Perhaps best illustrated by an example:

$_ = SOAP::Data->name( 'smiles' =>
	 \SOAP::Data->name('string' => $val) )
);

To create an element with no type try:

$_ = SOAP::Data->name( 'smiles' =>
	 \SOAP::Data->name('string' => $val) )->type('')
);

if I remember correctly.

Eric

On Sep 19, 2007, at 4:10 AM, leegee23 wrote:

> I'm having a few problems getting to grips with some software I've
> inherited that uses SOAP::Lite.
>
> A line reads
>
> $_ = SOAP::Data->name('smiles' => $val );
>
> and seems to output
>
> <smiles xsi:type="xsd:string">data</smiles>
>
> Problem is that I need that inner text node to be wrapped in a
> further XML node, 'string':
>
> <smiles xsi:type="xsd:string"><string>data</string></smiles>
>
> Please would some kind soul point me in the right direction? I'm
> finding the verbosity of the documentation rather confusing.
>
> Many thanks in anticipation
> Lee
>
>
>

#6022 From: Ian Harisay <imharisa@...>
Date: Thu Sep 20, 2007 5:47 pm
Subject: trying to provide a WSDL for my web service
imharisa@...
Send Email Send Email
 
I have a very simple test web service. I can call it successfully
without using the WSDL.  When I try to use the WSDL it throws an error.
I'm guessing there is something wrong with WSDL itself.  I sure could
use some help here.  I just don't see what I am doing wrong.

Thanks.

-- test service script --
#!/usr/bin/perl

use strict;
use Data::Dumper;
use SOAP::Lite;
use IO::File;

my $proxy = 'http://harisay.com/ws/ews/hello_service.cgi';
my $uri   = 'http://harisay.com/HelloService';

#-- call to web service without a WSDL
print SOAP::Lite
   ->uri($uri)
   ->proxy($proxy)
   ->sayHelloWorld()
   ->result;
print $/;

#-- call to web service using a WSDL.
my $service = SOAP::Lite
    ->service('http://harisay.com/wsdl/HelloService.wsdl');

print ref $service,$/;
#print Dumper($service);
print $service->sayHelloWorld();
print $/;

exit;
-- end script --

#6023 From: rahed <raherh@...>
Date: Thu Sep 20, 2007 8:13 pm
Subject: Re: Limiting which methods can be used.
raherh
Send Email Send Email
 
On 9/19/07, Bill Moseley <moseley@...> wrote:

>  I'm using this to dispatch to my classes in my mod_perl module:
>
>  my $server = SOAP::Transport::HTTP::Apache->dispatch_to(
>          $app_dir,
>          @module_list,
>      );
>
>  sub handler { $server->handler(@_) }
>
>  Now, the modules in @module_list get loaded and their methods are
>  exposed -- and then can be accessed by a SOAP client.
>
>  What I'm missing is how to define *which* methods should be made
>  available.  If the class is used outside of SOAP::Lite I'd like to make
>  all its methods available, but limit which methods can be called when
>  used by SOAP::Lite.

From SOAP::Server doc:

Alternately, when the value is a package-qualified name of a
subroutine or method, that specific routine is made available. This
allows the server to make selected methods available without opening
the entire package.


--
Radek

#6024 From: "Paul Gallagher" <gallagher.paul@...>
Date: Sun Sep 23, 2007 2:54 pm
Subject: Re: trying to provide a WSDL for my web service
paulpg_sg
Send Email Send Email
 
Hi Ian,

I think the problem is that SOAP::Lite assumes an input message
(although not required by the spec).

Try something like this ... seems to work:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="HelloService"
    targetNamespace="http://harisay.com/HelloService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://harisay.com/HelloService"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <message name="SayHelloWorldRequest"/>

    <message name="SayHelloWorldResponse">
       <part name="greeting" type="xsd:string"/>
    </message>

    <portType name="HelloPortType">
       <operation name="sayHelloWorld" parameterOrder="name">
          <input message="tns:SayHelloWorldRequest"
name="sayHelloWorldRequest" />
          <output message="tns:SayHelloWorldResponse"
name="sayHelloWorldResponse" />
       </operation>
    </portType>

    <binding name="HelloBinding" type="tns:HelloPortType">
       <soap:binding style="rpc"
          transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="sayHelloWorld">
          <soap:operation
             soapAction="http://harisay.com/HelloService#sayHelloWorld"/>

          <input name="sayHelloWorldRequest">
            <soap:body
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               namespace="http://harisay.com/HelloService"
               use="encoded" />
          </input>

          <output name="sayHelloWorldResponse">
             <soap:body
                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                namespace="http://harisay.com/HelloService"
                use="encoded"/>
          </output>
       </operation>
    </binding>

    <service name="Hello_Service">
       <documentation>WSDL File for HelloService</documentation>
       <port binding="tns:HelloBinding" name="HelloPort">
          <soap:address
             location="http://harisay.com/ws/ews/hello_service.cgi"/>
       </port>
    </service>

</definitions>



On 9/21/07, Ian Harisay <imharisa@...> wrote:
> I have a very simple test web service. I can call it successfully
> without using the WSDL.  When I try to use the WSDL it throws an error.
> I'm guessing there is something wrong with WSDL itself.  I sure could
> use some help here.  I just don't see what I am doing wrong.
>
> Thanks.
>
> -- test service script --
> #!/usr/bin/perl
>
> use strict;
> use Data::Dumper;
> use SOAP::Lite;
> use IO::File;
>
> my $proxy = 'http://harisay.com/ws/ews/hello_service.cgi';
> my $uri   = 'http://harisay.com/HelloService';
>
> #-- call to web service without a WSDL
> print SOAP::Lite
>  ->uri($uri)
>  ->proxy($proxy)
>  ->sayHelloWorld()
>  ->result;
> print $/;
>
> #-- call to web service using a WSDL.
> my $service = SOAP::Lite
>   ->service('http://harisay.com/wsdl/HelloService.wsdl');
>
> print ref $service,$/;
> #print Dumper($service);
> print $service->sayHelloWorld();
> print $/;
>
> exit;
> -- end script --
>
>
>
> Yahoo! Groups Links
>
>
>
>

#6025 From: "axis_2_user" <axis_2_user@...>
Date: Mon Oct 1, 2007 8:26 pm
Subject: Help
axis_2_user
Send Email Send Email
 
Hi All,

I am trying to connect to a web-service, implemented in Perl (uses
SOAP::Lite) and get back a text file as attachment; when i call the
service "getAnnotation".

I am not familiar with perl. I have pasted the two modules that are
the server side of the web-service. Can some one please take a look at
these files and let me know if they actually return a text file?

Your help would be highly appreciated.

Thanks

##################################################################

rsrcSOAP.pm

################################################################
#!/usr/local/bin/perl

package rsrcSOAP;

use SOAP::Lite +trace => [ fault => \&log_faults];
use MIME::Entity;
use DFGIEnv;
use dbi_oracle;
use TGIWeb;

use strict;
my $server = &TGIWeb::getServer('humoest');

sub log_faults {
   my @param = @_;
   open LOGFILE,">>/tmp/rsrcSOAP.log";
   print LOGFILE '*'x 80,"\nFault signal with ".scalar(@param)."
parameters\n";
   $,="\t";
   print LOGFILE '*'x 80,"\nParameters: ",@param,"\n";
   close LOGFILE;
}

sub log_methods {
   my @param = @_;
   open LOGFILE,">>/tmp/rsrcSOAP.log";
   print LOGFILE '*'x 80,"\nMethod signal with ".scalar(@param)."
parameters\n";
   $,="\t";
   print LOGFILE '*'x 80,"\nParameters: ",@param,"\n";
   close LOGFILE;
}

sub getAllArrays {
   my $dbh = &auto_login('toga');
   my $results = &sql_get_all($dbh, 'select name from clonesets order
by lower(name)');
   my @list;
   foreach my $r (@$results) {
     push @list, $r->[0];
   }
   &db_logout($dbh);
   return \@list;
}

sub getLastUpdate {
#   my $dbh = &auto_login('toga');
#   &db_logout($dbh);
   return '12/01/2006';
#   in the future we will have a release_info table
}

sub getAnnotation {
   my $self = shift;
   my $my_array = shift;
   my @params = @_;

   my @my_data;
   my $dbh = &auto_login('toga');
   my ($cloneset_id, $taxon_id) = &sql_get_values($dbh,"select
cloneset_id, taxon_id from clonesets where upper(name) =
'".uc($my_array)."'");
   push @my_data, "# Array: $my_array Taxon:$taxon_id";
   push @my_data, '# Fields requested: ';
   my @fields;
   my $from  = "clones c";
   my $where = "c.cloneset_id=$cloneset_id";
   my $orderby = '';
   my $cnt = 0;
   my $fcnt = 0;
   foreach my $param (@params) {
     $fcnt++; push @my_data,"#    $fcnt. $param";
     if (uc($param) eq 'CLONE_ID') {
      push @fields, 'c.plate_id';
      $orderby = 'order by c.plate_id';
     }
     elsif (uc($param) eq 'REFSEQ_ACC') { #4
      $cnt++;
      push @fields, "x$cnt.acc";
      $from .= ", xref_link xl$cnt, xref x$cnt";
      $where .= " and c.id=xl$cnt.id and xl$cnt.xref_id=x$cnt.xref_id
and x$cnt.db=4";
     }
     elsif (uc($param) eq 'GENBANK_ACC') { #1
      $cnt++;
      push @fields, "x$cnt.acc";
      $from .= ", xref_link xl$cnt, xref x$cnt";
      $where .= " and c.id=xl$cnt.id and xl$cnt.xref_id=x$cnt.xref_id
and x$cnt.db=1";
     }
     elsif (uc($param) eq 'ENTREZ_ID') { #3
      $cnt++;
      push @fields, "x$cnt.acc";
      $from .= ", xref_link xl$cnt, xref x$cnt";
      $where .= " and c.id=xl$cnt.id and xl$cnt.xref_id=x$cnt.xref_id
and x$cnt.db=3";
     }
     elsif (uc($param) eq 'GENE_SYMBOL') { #7
      $cnt++;
      push @fields, "x$cnt.acc";
      $from .= ", xref_link xl$cnt, xref x$cnt";
      $where .= " and c.id=xl$cnt.id and xl$cnt.xref_id=x$cnt.xref_id
and x$cnt.db=7";
     }
     elsif (uc($param) eq 'GENE_TITLE') { #6
      $cnt++;
      push @fields, "x$cnt.acc";
      $from .= ", xref_link xl$cnt, xref x$cnt";
      $where .= " and c.id=xl$cnt.id and xl$cnt.xref_id=x$cnt.xref_id
and x$cnt.db=6";
     }
     elsif (uc($param) eq 'UNIGENE_ID') { #2
      $cnt++;
      push @fields, "x$cnt.acc";
      $from .= ", xref_link xl$cnt, xref x$cnt";
      $where .= " and c.id=xl$cnt.id and xl$cnt.xref_id=x$cnt.xref_id
and x$cnt.db=2";
     }
     elsif (uc($param) eq 'CHR') {
      push @fields, 'ch.chr_name';
      $from .= ', tc_links t, sequence s, hits h, chromosome ch' unless
    ($from =~ /chromosome ch/);
      $where .= " and c.id=t.id and t.link_type=1 and t.seq_id=s.seq_id
and s.seq_type=0 and s.taxon_id=$taxon_id and s.seq_id=h.seq_id and
h.ctg_id = ch.ctg_id and ch.taxon_id=$taxon_id and ch.iscurrent=1"
unless ($where =~ /ch.iscurrent/);
     }

     elsif (uc($param) eq 'TX_START') {
      push @fields, 'h.chr_lend';
      $from .= ', tc_links t, sequence s, hits h, chromosome ch' unless
($from =~ /chromosome ch/);
      $where .= " and c.id=t.id and t.link_type=1 and t.seq_id=s.seq_id
and s.seq_type=0 and s.taxon_id=$taxon_id and s.seq_id=h.seq_id and
h.ctg_id = ch.ctg_id and ch.taxon_id=$taxon_id and ch.iscurrent=1"
unless ($where =~ /ch.iscurrent/);
     }

     elsif (uc($param) eq 'TX_END') {
      push @fields, 'h.chr_rend';
      $from .= ', tc_links t, sequence s, hits h, chromosome ch' unless
($from =~ /chromosome ch/);
      $where .= " and c.id=t.id and t.link_type=1 and t.seq_id=s.seq_id
and s.seq_type=0 and s.taxon_id=$taxon_id and s.seq_id=h.seq_id and
h.ctg_id = ch.ctg_id and ch.taxon_id=$taxon_id and ch.iscurrent=1"
unless ($where =~ /ch.iscurrent/);
     }


     elsif (uc($param) eq 'STRAND') {
      push @fields, "case when (h.hit_lend<h.hit_rend) then '+' else
'-' end";
      $from .= ', tc_links t, sequence s, hits h, chromosome ch' unless
($from =~ /chromosome ch/);
      $where .= " and c.id=t.id and t.link_type=1 and t.seq_id=s.seq_id
and s.seq_type=0 and s.taxon_id=$taxon_id and s.seq_id=h.seq_id and
h.ctg_id = ch.ctg_id and ch.taxon_id=$taxon_id and ch.iscurrent=1"
unless ($where =~ /ch.iscurrent/);
     }


     else { # CDS_START, CDS_END, PROTEIN_ACC, CYTOBAND, SEQUENCE,
GO_TERMS, BIO_CARTA, KEGG, DESC
      push @fields,"'NA'";
     }
   }
   my $query = 'select '.(join(",",@fields))." from $from where $where
$orderby"; # and rownum<11
   my $results = &sql_get_all($dbh, $query);
   &db_logout($dbh);
   foreach my $r (@$results) {
     push @my_data, join("\t",@$r);
   }
   my $my_data = join("\n",@my_data);

   my $ent = MIME::Entity->build(
       'Id'          => "<$$>",
       'Type'        => 'text/plain',
       'Filename'    => "$my_array.txt",
       'Data'        => $my_data,
       'Disposition' => 'attachment',
       'Encoding'    => '8bit'
   );

   return SOAP::Data->name("file" => "$my_array"),$ent;
}

1;

##########################################################################


rsrc.cgi

######################################################################

#!/usr/local/bin/perl

use lib '/tgiweb/cgi-bin/tgi/SOAP/service';
use rsrcSOAP;
use SOAP::Transport::HTTP;

My::CGI::Handler
     -> dispatch_to('/tgiweb/cgi-bin/tgi/SOAP/service','rsrcSOAP')
     -> options({compress_threshold => 10000})
     -> handle()
;

BEGIN {
#####################################################################
package My::CGI::Handler;
use vars qw(@ISA);
@ISA = qw(SOAP::Transport::HTTP::CGI);
sub handle {
   my $pcount = scalar @_;
   my $self = shift;
   print STDERR "My::CGI::Handler => inside\n";
   print STDERR "My::CGI::Handler => content-type:
".$ENV{'SCRIPT_NAME'}."\n";
#   while (<>) {
#    print STDERR $_;
#   }
   return $self->SUPER::handle;
}
sub make_response {
   my $self = shift;
   my($code, $response) = @_;
   print STDERR "About to call My::CGI::Handler::make_response\n";
   return $self->SUPER::make_response($code, $response);
}
###############################################################
1;
}

#6026 From: "Chintana Wilamuna" <chintanaw@...>
Date: Tue Oct 2, 2007 5:59 am
Subject: [ANN] WSF/Perl initial release (bindings for a WS-* framework)
cwilamuna
Send Email Send Email
 
Hi,

An initial release of the bindings to WSF/C [1] is in CPAN [2].  This
initial release has the client side support only with WS-Addressing
and REST.  The WSF/Perl project page has more info about the mailing
list, bug tracker etc.. [3].

The official release of WSF/C has a linking problem in modules.  So a
"fixed" version is available here [4].  However this will be fixed in
the next release of WSF/C.

Apologies if this was intrusive, I thought it would be useful to
people in this group.

[1] http://wso2.org/projects/wsf/c
[2] http://tinyurl.com/3yzeja
[3] http://wso2.org/projects/wsf/perl
[4] http://ww2.wso2.org/~chintana/wso2-wsf-c-src-1.1.0.tar.gz

Bye,

     -Chintana

--
http://engwar.com/

#6027 From: Michael Ablassmeier <abi@...>
Date: Tue Oct 2, 2007 10:09 am
Subject: SOAP::Lite->service(WSDL) and cookie authentification
blssmr
Send Email Send Email
 
hi guys,

im currently working on accessing a service with SOAP::Lite. This service uses
cookie based authentification, so i need to pass a cookie_jar using the
HTTP::Cookies class in order to be able to call more than the login function.

The FAQ states something along the lines:

    my $soap->proxy('http://localhost/',
                     cookie_jar => HTTP::Cookies->new(ignore_discard => 1));

but im using the ->service method, as the webservice provides a WSDL File.
As far as i can see i cant pass cooke_jar to ->service, so i did something
like this:

	 my $COOKIE_FILE = '/tmp/bs-wsdl-cookies.txt';
	 my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1,
                                     file => $COOKIE_FILE,
                                     autosave=>1);

     $login = $service->login($loginName, $password, $newPassword, $mode);
     $service->transport->cookie_jar($cookie_jar);


this, does not work. It simply ignores the fact that there is a cookie on the
first call. If i call the above statements *twice*, like:

     $login = $service->login($loginName, $password, $newPassword, $mode);
     $service->transport->cookie_jar($cookie_jar);
     $login = $service->login($loginName, $password, $newPassword, $mode);
     $service->transport->cookie_jar($cookie_jar);

it works.

Anyone knows how i can pass the cookie_jar to the Transport layer *before*
communication starts, so i dont have to call the login method twice?

bye,
     - michael

#6028 From: "bolasnenhumda" <mario.silva@...>
Date: Tue Oct 2, 2007 4:16 pm
Subject: Document Literal Support
bolasnenhumda
Send Email Send Email
 
Hi all,

I've started to use SOAP::Lite, and I have a bunch of questions:

1 - The default style used by SOAP::Lite is RPC encoded. Is this the
only style available? Am I able to use, for example, Document/literal,
or document/literal encoded (Ok, this is hard to get knowing the
specification for this is not open -_-).

In case we have only RPC encoded style, is there any way to access
.Net web services, for example? What I mean is: is there a way of
accessing services which are not available in RPC encoded?

2 - Does SOAP::Lite generates automatically WSDL for us, based on our
available web services? I read that it doesn't, but the post was from
2001 ^_^. If not, do you know any perl module capable of doing it?

And that's all (for now :p)

Thanks in advance,
Mario

#6029 From: "oldfic4" <chris@...>
Date: Mon Oct 15, 2007 9:20 am
Subject: How do I add a namespace to the soap header
oldfic4
Send Email Send Email
 
How do get soaplite to add the xmlns:intf ns to get the soap envelope
to look as below?

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:intf="http://session.webservices.thefirm.uk">

Thanks

#6030 From: "bolasnenhumda" <bolasnenhumda@...>
Date: Tue Oct 2, 2007 12:15 pm
Subject: Document Literal Support
bolasnenhumda
Send Email Send Email
 
Hi all,

I'm starting now to use SOAP::Lite, and I have a bunch of questions:

1 - From what I read, the default encoding and style used in
SOAP::Lite are RPC encoded. Can I use other combinations, for example,
document literal or RPC Literal? Or even document literal wrapped (Ok,
this is hard, knowing that document literal wrapped is not an open
specification :|)?? If so, how do I do that?

This could be useful to interconnect SOAP::Lite with .net clients or
vice versa, for example.


2 - In case SOAP::Lite doesn't support any of other combinations, how
much time do you estimate a team composed by 2 Perl experts and 1
newbie (me :p) would take to develop the support to doc/lit? We have
no knowledge of SOAP::Lite internals. From what I read in SOAP::Lite
main page, the code is hard to maintain :(. Assume that we would work
on this 5 days per week. Just a prevision.

By the way, if we had to choose between doc/lit or RPC/lit, which one
do you think is best? I've been reading about this, and based on
http://msdn2.microsoft.com/en-us/library/ms996466.aspx, I think
doc/lit support is better, since I read that this is one of the most
used combinations together with RPC encoded. Anyway, I would
appreciate an opinion from you guys :)


3 - Is there a way of creating a WSDL file describing our services
using SOAP::Lite, or any other module? How do I do that?

And that's all (for now :p)

Thanks in advance,
Mario

#6031 From: "Edward Kawas" <edward.kawas@...>
Date: Mon Oct 15, 2007 6:48 pm
Subject: RE: Document Literal Support
kawas7
Send Email Send Email
 
Hi Mario,

> 3 - Is there a way of creating a WSDL file describing our
> services using SOAP::Lite, or any other module? How do I do that?
>
> And that's all (for now :p)

I use soap lite for my project. as far as i know, soap-lite does not create
wsdls for you.

Sorry, but i dont know the answers to the other questions.

Also, I am willing to give you a hand in creating doc/lit support, soley on
a coding basis.

>
> Thanks in advance,
> Mario
>

Eddie

#6032 From: "Edward Kawas" <edward.kawas@...>
Date: Mon Oct 15, 2007 6:54 pm
Subject: RE: How do I add a namespace to the soap header
kawas7
Send Email Send Email
 
Hi,

I think that you need to create your own serializer to gain access to the
envelope. you might want to refer to
http://cookbook.soaplite.com/#overriding%20serializer%20(server) to get an
idea.

Eddie

> -----Original Message-----
> From: soaplite@yahoogroups.com
> [mailto:soaplite@yahoogroups.com] On Behalf Of oldfic4
> Sent: Monday, October 15, 2007 2:20 AM
> To: soaplite@yahoogroups.com
> Subject: [soaplite] How do I add a namespace to the soap header
>
> How do get soaplite to add the xmlns:intf ns to get the soap
> envelope to look as below?
>
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/> "
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> <http://www.w3.org/2001/XMLSchema-instance> "
> xmlns:xsd="http://www.w3.org/2001/XMLSchema
> <http://www.w3.org/2001/XMLSchema> "
> xmlns:intf="http://session.webservices.thefirm.uk
> <http://session.webservices.thefirm.uk> ">
>
> Thanks
>
>
>
>
>

#6033 From: Graham Irvine <graham@...>
Date: Mon Oct 15, 2007 10:21 pm
Subject: Re: How do I add a namespace to the soap header
graham23sk
Send Email Send Email
 
oldfic4 wrote:
> How do get soaplite to add the xmlns:intf ns to get the soap envelope
> to look as below?
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:intf="http://session.webservices.thefirm.uk">
>
> Thanks
>
>
>
>

something like this will do it.

my $soap = SOAP::Lite->proxy($proxy);
$soap->serializer->soapversion("1.2");
     $soap->serializer->namespaces({
	 "http://schemas.xmlsoap.org/soap/envelope/"=>"soap",

"http://www.w3.org/2001/XMLSchema"=>"xsd",
	 "http://www.w3.org/2001/XMLSchema-instance"=>"xsi",
	 "http://session.webservices.thefirm.uk"=>"intf"});


You might have to pass an attribute to your soap method too
depending on how strict the doc literal server is.

something like

my $soapmethod=SOAP::Data->name($method)
                     ->attr({xmlns => $namespace});

#6034 From: Graham Irvine <graham@...>
Date: Mon Oct 15, 2007 10:23 pm
Subject: Re: Document Literal Support
graham23sk
Send Email Send Email
 
bolasnenhumda wrote:
> Hi all,
>
> I've started to use SOAP::Lite, and I have a bunch of questions:
>
> 1 - The default style used by SOAP::Lite is RPC encoded. Is this the
> only style available? Am I able to use, for example, Document/literal,
> or document/literal encoded (Ok, this is hard to get knowing the
> specification for this is not open -_-).
>

using the default methods unaltered with generate RPC encoded envelopes.
However this is Perl so you can manipulate those pretty easily to get it
to do whatever you want. Everything is available to be changed without
too much difficulty . Yes you will have to learn SOAP literal styles
more that just a point a clicker would have to but thats no bad thing.

Check out the soaplite website (or many previous posts here) for basic
examples that will get you started. There are basically two or three
techniques to construct your  data that you need to learn then you are
in business.

> In case we have only RPC encoded style, is there any way to access
> .Net web services, for example? What I mean is: is there a way of
> accessing services which are not available in RPC encoded?
>

yes . On the microssoft MSDN site there is help to work with SOAP::Lite.
However it is a lot easier to get Perl to work with .net than .net to
work with Perl as .net if very rigid in this as it is in everything.

> 2 - Does SOAP::Lite generates automatically WSDL for us, based on our
> available web services? I read that it doesn't, but the post was from
> 2001 ^_^. If not, do you know any perl module capable of doing it?

No you need to write or generate the WSDL yourself and get your soap
server endpoint (ideally) to return it. Again not as "quick" as a wizard
, but then you learn nothing by doing that and therefore dont understand
when it goes wrong or needs to go outside the box and be complex.
WSDL looks scarey but its really not when you simplify it and weed out
the bloated things that point and click software like to develop.

Once you have that done ..  you just need to expose it to clients to
discover.

A simple technique is do this. is before dispatching to the soap
services  put some thing like this in.

if ($ENV{REQUEST_METHOD} eq "GET") {
     if (lc($ENV{QUERY_STRING} || "") eq "wsdl")
     {
	 # user asked for WSDL.
         serve_wsdl();
     }
     else {
	 #anything else sent as a CGI GET
	 serve_html();
     }
}

sub serve_html
{
     require CGI;
     my $q = CGI->new();
     my $response = "You need to send me a SOAP request!";
     my $c = length($response);
     print $q->header(-type=>'text/plain',
		      -'Content-length'=>$c);

     print "$response";
}

sub serve_wsdl
{

     my $wsdlfile = $config{"WSDLFILE"};

     open (WSDL,$wsdlfile);
     read (WSDL,$wsdl,50000,0);
     close(WSDL);

     require CGI;
     my $q = CGI->new();

     my $c = length($wsdl);

     print $q->header(-type=>'text/xml',
		      -'Content-length'=>$c);
     print "$wsdl";
}


Then if you service proxy is

http://myserver/webservice/myservice

You can return the wsdl to users when they request

http://myserver/webservice/myserver?WSDL

which sort of mimics what .net servers do I beleive.

Make your WSDL by other means and store it to a file location which is
found in above case on path set by $config{"WSDLFILE"}.



>
> And that's all (for now :p)
>
> Thanks in advance,
> Mario
>
>

#6035 From: "chris" <chris@...>
Date: Wed Oct 17, 2007 5:00 pm
Subject: RE: How do I add a namespace to the soap header
oldfic4
Send Email Send Email
 

Thank you Graham - that worked perfectly.

 

From: soaplite@yahoogroups.com [mailto:soaplite@yahoogroups.com] On Behalf Of Graham Irvine
Sent: 15 October 2007 23:22
To: oldfic4
Cc: soaplite@yahoogroups.com
Subject: Re: [soaplite] How do I add a namespace to the soap header

 

oldfic4 wrote:
> How do get soaplite to add the xmlns:intf ns to get the soap envelope
> to look as below?
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:intf="http://session.webservices.thefirm.uk">
>
> Thanks
>
>
>
>

something like this will do it.

my $soap = SOAP::Lite->proxy($proxy);
$soap->serializer->soapversion("1.2");
$soap->serializer->namespaces({
"http://schemas.xmlsoap.org/soap/envelope/"=>"soap",

"http://www.w3.org/2001/XMLSchema"=>"xsd",
"http://www.w3.org/2001/XMLSchema-instance"=>"xsi",
"http://session.webservices.thefirm.uk"=>"intf"});

You might have to pass an attribute to your soap method too
depending on how strict the doc literal server is.

something like

my $soapmethod=SOAP::Data->name($method)
->attr({xmlns => $namespace});


#6036 From: "Paul Gallagher" <gallagher.paul@...>
Date: Thu Oct 18, 2007 1:01 am
Subject: Re: How do I add a namespace to the soap header
paulpg_sg
Send Email Send Email
 
Hi Chris. Yes, overridding the serializer is the trick. Example:

#!/usr/bin/perl -w
use strict;

#NB: SOAP::serializer->register_ns requires 0.65
use SOAP::Lite 0.65 +trace => 'debug';

my $soap = SOAP::Lite
	 ->proxy( 'http://localhost/blah/DummyService' );

my $serializer = $soap->serializer();
$serializer->register_ns( 'http://session.webservices.thefirm.uk', 'intf' );

my $som = $soap->test();

===> generates request:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:intf="http://session.webservices.thefirm.uk"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body><test xsi:nil="true" /></soap:Body></soap:Envelope>


On 10/15/07, oldfic4 <chris@...> wrote:
> How do get soaplite to add the xmlns:intf ns to get the soap envelope
> to look as below?
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:intf="http://session.webservices.thefirm.uk">
>
> Thanks
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

#6037 From: "khurrumi2002" <khurrumi2002@...>
Date: Fri Oct 19, 2007 11:39 pm
Subject: Help with SOAP::Lite and WCF web service
khurrumi2002
Send Email Send Email
 
Hi i am just exploring the SOAP Lite package and have been trying to
get a simple example to work but have been unsuccessful. I am trying
to get a simple WCF service in C# up and running and communicate with
it through a Perl client. Now i got the WCF web service running using
the following example:

http://bloggingabout.net/blogs/dennis/archive/2007/04/20/wcf-simple-
example.aspx

I took the C# code for the server and got my service running. I can
view the service basics at http://localhost:8080 and i can also
access the WSDL file through http://localhost:8080/?wsdl. Now i can
get my perl client to communicate properly if i change my service to
use RPC encoding. The perl script i used is:

--------------------------------------------
#!/usr/bin/perl -w
use strict;
use SOAP::Lite;

my $wsdl = 'http://localhost:8080/?wsdl';
print SOAP::Lite
     ->service($wsdl)
     ->HelloWorld('Rob');
--------------------------------------------

Now i want to use document literal encoding, which is the default for
a .Net web service. I looked at the following article to change
SOAP::Lite's default bahaviour:

http://msdn2.microsoft.com/en-us/library/ms995764.aspx

But i cant get it to work probably because i am not specifying the
correct URI, Proxy or the schema. Like i am not sure if i am able to
use the WSDL file or not.

The WSDL file that gets generated from my sample WCF service is shown
below but i am not sure what URLS that i need to extract to put into
my perl script. Could someone please guide me on what to do and how
to do it? I have looked at a couple of resources but they all seem to
discuss different things.

Any help would be greatly appreciated.

Thanks.

<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions name="HelloService"
targetNamespace="http://tempuri.org/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
wssecurity-utility-1.0.xsd"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://tempuri.org/"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:wsa10="http://www.w3.org/2005/08/addressing"
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
- <wsdl:types>
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
   <xsd:import schemaLocation="http://localhost:8080/?xsd=xsd0"
namespace="http://tempuri.org/" />
   <xsd:import schemaLocation="http://localhost:8080/?xsd=xsd1"
namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
   </xsd:schema>
   </wsdl:types>
- <wsdl:message name="HelloService_HelloWorld_InputMessage">
   <wsdl:part name="parameters" element="tns:HelloWorld" />
   </wsdl:message>
- <wsdl:message name="HelloService_HelloWorld_OutputMessage">
   <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
   </wsdl:message>
- <wsdl:portType name="HelloService">
- <wsdl:operation name="HelloWorld">
   <wsdl:input
wsaw:Action="http://tempuri.org/HelloService/HelloWorld"
message="tns:HelloService_HelloWorld_InputMessage" />
   <wsdl:output
wsaw:Action="http://tempuri.org/HelloService/HelloWorldResponse"
message="tns:HelloService_HelloWorld_OutputMessage" />
   </wsdl:operation>
   </wsdl:portType>
- <wsdl:binding name="BasicHttpBinding_HelloService"
type="tns:HelloService">
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="HelloWorld">
   <soap:operation
soapAction="http://tempuri.org/HelloService/HelloWorld"
style="document" />
- <wsdl:input>
   <soap:body use="literal" />
   </wsdl:input>
- <wsdl:output>
   <soap:body use="literal" />
   </wsdl:output>
   </wsdl:operation>
   </wsdl:binding>
- <wsdl:service name="HelloService">
- <wsdl:port name="BasicHttpBinding_HelloService"
binding="tns:BasicHttpBinding_HelloService">
   <soap:address location="http://localhost:8080/HelloService" />
   </wsdl:port>
   </wsdl:service>
   </wsdl:definitions>

#6038 From: "sarah1878carter" <sarah@...>
Date: Wed Oct 24, 2007 5:04 pm
Subject: Newbee needs help with perl soap lite service and c++ .net client. (hmh)
sarah1878carter
Send Email Send Email
 
I have tried just about everything I can think of to get this simple
soap service to work. I just can't make it work. It's my first time
trying this. It's my "hello world" version of my little project. I
have included the code I have so far below. It's all examples found
in the docs. If you can help, I would be ever so grateful.

I am using the Microsoft visual studio 2005 programming software,
visual c++, and the .net framework (managed code).

My c++ .net framework client is sending the two variables
successfully to the perl web service. The problem is that nothing is
returning. No matter how I tweak the code, nothing seems to work out
for me.

I see quite a few examples for c# but nothing for the c++ .net
framework. I am in such distress over this; I'm not sure what to do
with myself. I could really use a little rescuing.

Here is the code for the perl soap lite web service:

#!/usr/bin/perl -w -t
#!/usr/local/bin/perl -w -t

#define the path to this script
#http://www.htpad.com/cgi-bin/gamer/soapRelay.cgi

use SOAP::Transport::HTTP;

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

package Example1;
sub Add {
	 #get the two variables we sent to this soap server
	 my ($self, $temp1, $temp2) = @_ ;
	 #send a test email - data was sent correctly - email shows
both variables
	 &sendTheEmail($temp1, $temp2);
	 #return the result - does not return! - I do not know why
	 #I tried using the decimal type, the int type, and the string
type.
	 return SOAP::Data-> name('temp0')
		 -> type('decimal')
		 -> uri('urn:Example1')
		 -> value(42);
}



Here is the code for the c++ .net framework (managed code) client:

#include "stdafx.h"

#using <System.Web.Services.dll>
#using <System.Xml.dll>
#using <System.dll>

using namespace System::Diagnostics;
using namespace System::Xml::Serialization;
using namespace System;
using namespace System::Web::Services::Protocols;
using namespace System::Web::Services;

namespace MyMath
{

	 [System::Web::Services::WebServiceBindingAttribute
(Name="MyMathSoap",Namespace="urn:Example1")]
	 public ref class MyMath: public
System::Web::Services::Protocols::SoapHttpClientProtocol
	 {
	 public:

		 [System::Diagnostics::DebuggerStepThroughAttribute]
		 MyMath()
		 {
			 this->Url =
				 "http://www.htpad.com/cgi-
bin/gamer/soapRelay.cgi";
		 }


		 [System::Diagnostics::DebuggerStepThroughAttribute]

	 [System::Web::Services::Protocols::SoapDocumentMethodAttribute
("urn:Example1/Add",
			 RequestNamespace="urn:Example1",
			 ResponseNamespace="urn:Example1",

	 Use=System::Web::Services::Description::SoapBindingUse::Litera
l,

	 ParameterStyle=System::Web::Services::Protocols::SoapParameter
Style::Wrapped)]
		 int Add( int num1, int num2 )
		 {
			 array<Object^>^temp0 = {num1,num2};
			 array<Object^>^results = this->Invoke( "Add",
temp0 );
			 //I tried both lines below.
			 return  *dynamic_cast<int^>(results[0]);
			 //return (int) results[0];
		 }


		 [System::Diagnostics::DebuggerStepThroughAttribute]
		 System::IAsyncResult^ BeginAdd( int num1, int num2,
System::AsyncCallback^ callback, Object^ asyncState )
		 {
			 array<Object^>^temp1 = {num1,num2};
			 return this->BeginInvoke( "Add", temp1,
callback, asyncState );
		 }


		 [System::Diagnostics::DebuggerStepThroughAttribute]
		 int EndAdd( System::IAsyncResult^ asyncResult )
		 {
			 array<Object^>^results = this->EndInvoke(
asyncResult );
			 return  *dynamic_cast<int^>(results[ 0 ]);
		 }

	 }; //end of class
} //end of namespace

void main()
{
	 Console::WriteLine
		 ("start: hit enter");
	 Console::ReadLine();

	 Console::WriteLine
		 ("Calling the big SOAP Server to say hello");
	 MyMath::MyMath^ callMyMath = gcnew MyMath::MyMath();

	 //my soap service gets the two variables but does not return
a value. thus, the below line is always 0.
	 Console::WriteLine
		 ("The SOAP Server says: " + callMyMath->Add(14, 21));

	 Console::WriteLine
		 ("end: hit enter");
	 Console::ReadLine();
}

I would be ever so grateful for any help...:)

#6039 From: "ntang_work" <nicholastang@...>
Date: Wed Oct 24, 2007 5:09 pm
Subject: Caching WSDL files...
ntang_work
Send Email Send Email
 
I've written a quick test soap script and it seems to work but parsing
the WSDL takes forever (and by that I mean over 1 minute per run, the
WSDL file is 14000 lines long).

So I tried using the cache_dir option, and it does write out a cache
file, which appears to just be a perl module.  But it still takes just
as long.

So *then* I tried calling the perl module directly.  Now it's fast,
but it doesn't seem to keep state, so after I log in, it forgets that
I'm logged in when I try to run commands.


Here's an abbreviated version of the first script, that's slow but works:

#!/usr/bin/perl -w

use SOAP::Lite;
use HTTP::Cookies;
use Getopt::Long;

# Optionally, set default inline username and password here - I
recommend a read-only account!
my $username = '';
my $password = '';

GetOptions (
   "username=s" => \$username,
   "password=s" => \$password,
   "server=s"   => \@servers,
   "vserver=s"  => \@vservers,
   "service=s"  => \@services,
);

my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
1, file => '/tmp/nscookies');

print "\nParsing the Netscaler wsdl... (this can take a while...)\n";
my $soap = SOAP::Lite
   -> cache_dir("/tmp")
   -> service('file:./NSConfig.wsdl.orig')
   -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
   ;

$cookies->save;

print "Ok, done!  Logging in.\n";
my $login = $soap->login($username,$password);
ref_output($login);
print "\n";

foreach my $service (@services) {
   print "SERVICE $service\n";
   my $result = $soap->getservice($service);
   ref_output($result);
   print "\n";
}

sub ref_output {
   my $ref = shift @_;
   while ( my ($key,$value) = each %$ref ) {
     if ( $key =~ /(List|soThreshold|PolicyName|monitorName)/ ) {
       foreach (@$value) {
         print "  $key:\n";
         ref_output($_);
       }
     }
     else {
       print "    $key: $value\n";
     }
   }
}


That works fine.

Here's what I tried to do w/ the resulting cached perl module:

#!/usr/bin/perl -w

use SOAP::Lite;
use HTTP::Cookies;
use Getopt::Long;
use lib qw(/tmp);
use NSConfigService;

# Optionally, set default inline username and password here - I
recommend a read-only account!
my $username = '';
my $password = '';

my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
1, file => '/tmp/nscookies');

my $soap = NSConfigService;

print "Ok, done!  Logging in.\n";
my $login = $soap->login($username,$password);
#  my $login = NSConfigService->login($username,$password);
ref_output($login);
print "\n";

foreach my $service (@services) {
   print "SERVICE $service\n";
#  my $result = NSConfigService->getservice($service);
   my $result = $soap->getservice($service);
   ref_output($result);
   print "\n";
}

sub ref_output {
   my $ref = shift @_;
   while ( my ($key,$value) = each %$ref ) {
     if ( $key =~ /(List|soThreshold|PolicyName|monitorName)/ ) {
       foreach (@$value) {
         print "  $key:\n";
         ref_output($_);
       }
     }
     else {
       print "    $key: $value\n";
     }
   }
}



The output from the second version reads as follows:

[root@cc17-10 test-netscaler]# ./nsshow2.pl --service cc80-10-http

Ok, done!  Logging in.
     rc: 0
     message: Done

SERVICE cc80-10-http
     rc: 1027
     message: Not logged in or connection timed out

[root@cc17-10 test-netscaler]#



Any ideas as to what I can do to either a.) get the first version
working quickly, or b.) get the second version to work?


Thanks!
Nicholas

#6040 From: "Nicholas Tang" <nicholastang@...>
Date: Wed Oct 24, 2007 6:16 pm
Subject: Re: Caching WSDL files...
ntang_work
Send Email Send Email
 
ARGH.  I apologize.  Figures - after wrestling with it for 2 hours, I
figure it out 10 minutes after emailing the list.


my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
1, file => '/tmp/nscookies', autosave => 1);

my $soap = NSConfigService
   -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
   ;


I didn't realize you could pass all of the standard SOAP::LITE
options.  Once I did that, and used the cookie_jar, it worked.
Whoops.

Apologies, but hopefully it'll help the next person that gets confused.  :)

Nicholas

#6041 From: Lev Lvovsky <lists2@...>
Date: Thu Oct 25, 2007 11:37 pm
Subject: POST & Host lines in http request
levl289
Send Email Send Email
 
Is there any way to split up the http request created by the
SOAP::Lite package so that instead of an http header like this:

POST https://foo.com/bar1/bar2.extension HTTP/1.1

we get something like:

POST: /bar1/bar2.extension HTTP/1.1
Host: foo.com

The server which I'm now submitting our SOAP query to doesn't like
the first format anymore, and insists on the second.

Thanks!
-lev

#6042 From: "Jimmy Zhang" <jzhang2004@...>
Date: Fri Oct 26, 2007 12:39 am
Subject: [ANN] VTD-XML 2.2
jzhang_ximpl...
Send Email Send Email
 
I am proud to announce the the release of version 2.2 of VTD-XML, the
next generation open source XML parsers/indexer/slicer/editor. This
release significantly expands VTD-XML's ability to slice, split, edit
and incrementally update the XML documents. To this end, we introduce
the concept of namespace-compensated element fragment. This release
also adds VTD+XML index writing capability to the VTD Navigator class.
Other enhancements in this release include index size pre-computation,
support for HTTP get, and some bug fixes.



To download the latest release, please go to
http://sourceforge.net/project/showfiles.php?group_id=110612.

#6043 From: "Nicholas Tang" <nicholastang@...>
Date: Wed Oct 31, 2007 2:20 pm
Subject: Re: Caching WSDL files...
ntang_work
Send Email Send Email
 
Here's what I ended up doing, which is working beautifully and is a
lot more "clever"...

#!/usr/bin/perl -w

use HTTP::Cookies;
use Getopt::Long;
use lib qw(/usr/local/bin);
use SOAP::Lite;

my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
1, autosave => 1);

# Optionally, set default inline username and password here - I
recommend a read-only account!
my $username = '';
my $password = '';
my $debug = 0;
my $soap;

eval {
   require NSConfigService;
};
if ($@) {
   print "\nNo cache file found!  Parsing the Netscaler wsdl... (this
can take a while...)\n";
   $soap = SOAP::Lite
     -> cache_dir("/usr/local/bin")
     -> service('file:./NSConfig.wsdl')
     -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
     ;
}
else {
   import NSConfigService;
   $soap = NSConfigService
     -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
     ;
}

GetOptions (
   "username=s" => \$username,
   "password=s" => \$password,
);


etc. etc. etc.

On 10/24/07, Nicholas Tang <nicholastang@...> wrote:
> ARGH.  I apologize.  Figures - after wrestling with it for 2 hours, I
> figure it out 10 minutes after emailing the list.
>
>
> my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 =>
> 1, file => '/tmp/nscookies', autosave => 1);
>
> my $soap = NSConfigService
>   -> proxy('http://10.50.0.1/soap/', cookie_jar=>$cookies)
>   ;
>
>
> I didn't realize you could pass all of the standard SOAP::LITE
> options.  Once I did that, and used the cookie_jar, it worked.
> Whoops.
>
> Apologies, but hopefully it'll help the next person that gets confused.  :)
>
> Nicholas
>

#6044 From: "t_elia" <electra@...>
Date: Thu Nov 1, 2007 9:08 am
Subject: pod and complex type specification
t_elia
Send Email Send Email
 
I have created successfully my first simple wsdl from perl code using
pod::wsdl. However i am having a difficult time to figure out how to
include complex types in the pod definition above a function. For
example how do i specify hashes as input and output parameters? Do i
need a deserializer? Is their an example/documentation except the one
found in pod/wsdl.pm from cpan? Can you provide me with an example on
how to proceed?

Thank you

#6045 From: Lev Lvovsky <lists2@...>
Date: Thu Nov 1, 2007 5:59 pm
Subject: Re: POST & Host lines in http request
levl289
Send Email Send Email
 
Replying to my own post here, perhaps this is a developer question
(not sure if the developer of SOAP::Lite is on this list):

It seems that according to this w3.org link: http://www.w3.org/
Protocols/rfc2616/rfc2616-sec14.html

the 'Host:' header is a requirement of HTTP 1.1.  I see that the
SOAP::Lite module is hardcoding version '1.1' in the HTTP request,
however is not setting the 'Host:' header.  Additionally, the "POST"
part of the request contains the whole URL which should be split up
between these two header fields.

Any comments, input, etc?

thanks!
-lev


On Oct 25, 2007, at 4:37 PM, Lev Lvovsky wrote:

> Is there any way to split up the http request created by the
> SOAP::Lite package so that instead of an http header like this:
>
> POST https://foo.com/bar1/bar2.extension HTTP/1.1
>
> we get something like:
>
> POST: /bar1/bar2.extension HTTP/1.1
> Host: foo.com
>
> The server which I'm now submitting our SOAP query to doesn't like
> the first format anymore, and insists on the second.
>
> Thanks!
> -lev
>

#6046 From: Dave Howorth <dhoworth@...>
Date: Fri Nov 2, 2007 10:34 am
Subject: Re: POST & Host lines in http request
dhoworth@...
Send Email Send Email
 
Lev Lvovsky wrote:
> Replying to my own post here, perhaps this is a developer question
> (not sure if the developer of SOAP::Lite is on this list):
>
> It seems that according to this w3.org link: http://www.w3.org/
> Protocols/rfc2616/rfc2616-sec14.html
>
> the 'Host:' header is a requirement of HTTP 1.1.  I see that the
> SOAP::Lite module is hardcoding version '1.1' in the HTTP request,
> however is not setting the 'Host:' header.  Additionally, the "POST"
> part of the request contains the whole URL which should be split up
> between these two header fields.
>
> Any comments, input, etc?

> On Oct 25, 2007, at 4:37 PM, Lev Lvovsky wrote:
>
>> Is there any way to split up the http request created by the
>> SOAP::Lite package so that instead of an http header like this:
>>
>> POST https://foo.com/bar1/bar2.extension HTTP/1.1
>>
>> we get something like:
>>
>> POST: /bar1/bar2.extension HTTP/1.1
>> Host: foo.com
>>
>> The server which I'm now submitting our SOAP query to doesn't like
>> the first format anymore, and insists on the second.

I'm not an expert on HTTP but nobody else has answered so here's my 2p
worth ...

FWIW, my reading of the spec agrees with you and your server
implementation: "A client MUST include a Host header field in all
HTTP/1.1 request messages". But as I say, I'm no expert.

So if we accept for a moment that there's a problem, the next question
is whose problem? SOAP::Transport::HTTP uses LWP's HTTP::Request and
HTTP::Headers packages, so is it driving them incorrectly or are they
broken? Looking at their POD, I see examples that don't have Host
headers and I don't see any examples that do!

So it may be worth rephrasing your question and asking it on the
<libwww@...> mailing list.

Cheers, Dave

#6047 From: "parimal_b2000" <parimal_b2000@...>
Date: Thu Nov 8, 2007 6:32 am
Subject: How to pass array argument to java webservice from perl client using SOAP::LITE?
parimal_b2000
Send Email Send Email
 
Hi All,

I want to pass an array argument to the java webservice from perl
client using SOAP::LITE package.

The web method declaration in java is like this
publishSimpleMetric(Arraylist<String> appinfo,Arraylist<String>
metricinfo,String seperator);

Now i tried to call the web service from perl client as follows
Code: ( perl )

	 #!/usr/local/UD/perl/bin/perl -w
	  use SOAP::Lite +trace => 'debug';


@appinfo=("F76B9A80-72E0-11DC-8817-001320CAE428","12512D6A-72E6-11DC-A17E-001320\
CAE428","12776304-72E6-11DC-A17E-001320CAE428");

       @metricinfo=("response_time|0","servcer_count|1000");

       $seperator="|";



       my $result =  SOAP::Lite

           -> uri('http://www.soaplite.com/Demo')

           ->
proxy('http://172.30.0.99:8080/websvc/services/testPublishMetric')

           -> publishSimpleMetric(@appinfo,@metricinfo,$seperato  r);



       unless ($result->fault) {

               print "RESULT: ".$result->result();

         } else {

           print "ERROR:";

           print $result->faultcode();

           print $result->faultdetail();

           print "\n";

         }


but following error occured
Code: ( xml )


       SOAP::Transport::HTTP::Client::send_receive: POST
http://172.30.0.99:8080/websvc/services/testPublishMetric

       Accept: text/xml

       Accept: multipart/*

       Content-Length: 908

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

       SOAPAction: "http://www.soaplite.com/Demo#testPublishMetric"



       <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Bod\
y><namesp1:testPublishMetric
xmlns:namesp1="http://www.soaplite.com/Demo"><c-gensym3
xsi:type="xsd:string">F76B9A80-72E0-11DC-8817-001320CAE428</c-gensym3><c-gensym5
xsi:type="xsd:string">12512D6A-72E6-11DC-A17E-001320CAE428</c-gensym5><c-gensym7
xsi:type="xsd:string">12776304-72E6-11DC-A17E-001320CAE428</c-gensym7><c-gensym9
xsi:type="xsd:string">response_time|0</c-gensym9><c-gensym11
xsi:type="xsd:string">servcer_count|1000</c-gensym11><c-gensym13
xsi:type="xsd:string">|</c-gensym13></namesp1:testPublishMetric></SOAP-ENV:Body>\
</SOAP-ENV:Envelope>

       SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500
Internal Server Error

       Connection: close

       Date: Wed, 07 Nov 2007 09:06:09 GMT

       Server: Apache-Coyote/1.1

       Content-Type: text/xml;charset=UTF-8

       Client-Date: Sat, 10 Nov 2007 20:48:45 GMT

       Client-Response-Num: 1



       <?xml version='1.0' encoding='UTF-8'?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><soap:Fault><fa\
ultcode>soap:Server</faultcode><faultstring>Index:
3, Size: 3</faultstring></soap:Fault></soap:Body></soap:Envelope>

       ERROR:soap:Server



Please let me know if any one knows the solution for this.Thanks in
advance

- Parimal

#6048 From: "lormidorido" <ragnar@...>
Date: Thu Nov 15, 2007 1:50 am
Subject: Problems accessing Headers and Envelope Server Side
lormidorido
Send Email Send Email
 
Hi All,

I have been trying to access headers and envelope in my soap handler
without success. For some reason I do not seem to get the SOAP::SOM
object.

Maybe someone of you can spot any mistake/s with my setup.

I have following setup

in httpd.conf:

<Location /ides_soap>
     SetHandler perl-script
     PerlHandler Apache::SOAP
     PerlSetVar
dispatch_to "IDES::new_matter,IDES::update_matter,IDES::get_matter_sta
tus"
     PerlSetVar options "compress_threshold => 10000"
</Location>

in IDES.pm (the handler):

package IDES;

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

sub new_matter {

   shift;
   my $som_object = pop;

   .
   .
   .

... and so on.

the variable $som_object contains my last parameter rather than the
SOAP::SOM object. Any ideas? Do you require any further info on my
setup? All help greatly appreciated!

Regards,
Ragnar

Messages 6019 - 6048 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