Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

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

The Yahoo! Groups Product Blog

Check it out!

Group Information

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

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 5035 - 5064 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#5035 From: "Gareth" <gsowww@...>
Date: Fri Dec 2, 2005 6:08 pm
Subject: Help with possibly an encoding problem...
gsowww
Send Email Send Email
 
Matching MySQL data encoding with SOAP data encoding?

If I add authentication data to a MySQL database directly on the
server side and then attempt to compare that data with data from XHTML
forms submitted via SOAP, then the data doesn't match - i.e. the
authentication all works fine at the server side, the only problem is
when the data arrives via SOAP from the web.

Is this an encoding problem?  I guess it would work fine if all the
data was submitted via SOAP (next thing to do), but it would be nice
to be able to work with the data both directly on the server as well
as via SOAP and the web.

Any quick fixes would be appreciated.

Thx in advance,


GSO
http://www.gsowww.uklinux.net/pub

#5036 From: "Young-Jun Oh" <yjo@...>
Date: Fri Dec 2, 2005 6:22 pm
Subject: Using regular perl module on SOAP server
nicejuny
Send Email Send Email
 
Hi All,

I try to call perl module in @INC from mod_soap perl module (on
Apache) but it looks like I'm not able to call outside perl modules
(which is Net::DNS from my example) Am I missing something? Thanks in
advance.

This is what I've done;

[ SOAP Client ]

#!/usr/bin/perl -w


use SOAP::Lite;


$soap_response = SOAP::Lite
  -> uri('http://server/Demo')
  -> proxy('http://server/SOAP')
  -> hi();

[ SOAP Server using Apache: Demo.pm]

package Demo;


use Net::DNS;

sub hi {
   $ret=Net::DNS->version;
   return "hello, world: $ret";
}

1;

[Apache httpd.conf]

# for mod_soap
<Location /SOAP>
         SetHandler perl-script
         PerlResponseHandler Apache2::SOAP
         PerlSetVar dispatch_to "/var/www/cgi-bin/RPC2/modules,
Module::Demo"
         PerlSetVar options "compress_threshold => 10000"
</Location>

#5037 From: "LoveLeen" <meet2pkw@...>
Date: Sun Dec 4, 2005 2:00 pm
Subject: APPLY JOBS/CALL 4 INTERVIEW/SEND MATRIMONY MSG & WIN MONTHLY GIFTS
meet2pkw
Send Email Send Email
 
::APPLY JOBS/CALL 4 INTERVIEW/SEND MATRIMONY MSG & WIN MONTHLY GIFTS::

Looking For Better Jobs/Employee??
*************************
-Apply Online/Call 4 Interview FREE And Win Monthly Gift
-Browse Interveiw Calls Free
-Employers Can Post 5 Jobs Free And Also Win Free Gifts
http://www.net4professionals.com


Looking For Bride/Groom
***********************

-Send Matrimony Messages FREE And Win Monthly Gift
-Browse Initiated Contacts Free
http://www.net4matrimonials.com

#5038 From: "jedijay007" <jayhilden@...>
Date: Thu Dec 8, 2005 12:29 am
Subject: HELP! connecting to .NET web services
jedijay007
Send Email Send Email
 
I just installed soap::lite for apache v.0.60.  I created a simple
hello world script in C# that I need to connect to using perl:


#################################################################
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace WebService1
{
	 [WebService(Namespace="http://gv-iis/nih/WebService1")]
	 public class Service1 : System.Web.Services.WebService
	 {
		 public Service1()
		 {
			 //CODEGEN: This call is required by the
ASP.NET Web Services Designer
			 InitializeComponent();
		 }

#region Component Designer generated code
...
...
#endregion


		 [WebMethod]
		 public string HelloWorld()
		 {
			 return "Hello World";
		 }
	 }
}
###############################################################

this is my perl script:
---------------------------------------------------------------
use SOAP::Lite +trace => [transport => \&follow_fault];

my $uri = "http://gv-iis/nih/WebService1";
my $proxy = "$uri/Service1.asmx";

my $soap = SOAP::Lite
    -> uri($uri)
    -> on_action( sub { join '/', $uri, $_[1] })
    -> proxy ($proxy);

my $result = $soap->HelloWorld()->result || die "unable to get
result";

print "returned: $result";

sub follow_fault {
    print '<pre>';
    print_r(\@_);
    print '</pre><br><hr><br>';
}
---------------------------------------------------------------

SOAP sucessfully connects to the web service but there is an error
in transport.  .NET returns a 500
(script) error, the EXACT SAME 500 error as
when I try to view the .asmx file in my web browser.

I am new to .NET so my problem could be there but I really could use
some direction.  Any suggestions would be greatly appreciated.

#5039 From: "naga_cit" <naga_cit@...>
Date: Thu Dec 8, 2005 3:05 am
Subject: Fwd: Sending multiple request...
naga_cit
Send Email Send Email
 
Any help?

--- In soaplite@yahoogroups.com, Nagarajan M <naga_cit@y...> wrote:

Hi,
How to send multiple request to the SOAP server from
the same client. I tried to invoking two methods using
threads..
Here is the sample code (auto dispatch is used) :
$object->method1(@args); # Running in thread 1
$object->method2(@args); # Running in thread 2
But the method2 executes only after method1 execution is done. But
I want both the methods call to be run in parellel.
Is there way I can make multiple request (simultaneously) from the
same client
by setting some flag on the soap object or by any other means...
Thanks in advance
Nagarajan


---------------------------------
  Enjoy this Diwali with Y! India Click here

--- End forwarded message ---

#5040 From: "jedijay007" <jayhilden@...>
Date: Thu Dec 8, 2005 8:40 pm
Subject: I'M SO CLOSE!!!!!
jedijay007
Send Email Send Email
 
I am trying to communicate with a .NET web service using soap::lite
for apache v0.60.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$soap = SOAP::Lite->new(
    uri => $uri,
    on_action => ( sub { join '/', "$uri", $_[1] }),
    proxy => $proxy);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am calling a HelloWorld method that takes in no parameters and
returns "Hello World!"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
my $response = $soap->HelloWorld();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When I turn off debugging the script just stops processing when it
tries to call the method, when I turn on debugging for transport I
get this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
POST http://172.20.140.116/prissmwebinterface/prissmweb.asmx HTTP/1.1
Accept: text/xml
Accept: multipart/*
Content-Length: 470
Content-Type: text/xml; charset=utf-8
SOAPAction: http://172.20.140.116/prissmwebinterface/HelloWorld

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Connection: close
Date: Thu, 08 Dec 2005 20:34:20 GMT
Server: Microsoft-IIS/5.0
Content-Length: 385
Content-Type: text/xml; charset=utf-8
Client-Date: Thu, 08 Dec 2005 20:34:20 GMT
Client-Peer: 172.20.140.116:80
Client-Response-Num: 1
X-AspNet-Version: 1.1.4322
X-Powered-By: ASP.NET

Hello World!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So the web service does indeed return hello world but for some reason
the script stops running.  I don't even get a chance to invoke:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
my $result = $response->result
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



I'm so close!!! Someone please help!  Thanks in advance.

#5041 From: "ssscottmo" <scottmo@...>
Date: Thu Dec 8, 2005 11:34 pm
Subject: How can you determine the name and type of rpc variables on the server side?
ssscottmo
Send Email Send Email
 
Hello,

I have spent alot of time and effort reading documentation, looking at
source code, googling and scanning the list archives but have not been
able to discover the answer.

While it is clear how to establish names and types for your function
parameters on the client side for interoperability with other soap
apis, I have not been able to discover how to extract that information
back from the request on the server side.

For example, lets say I wanted to submit a job which could have any
number of optional parameters.

I could do something like:

my @attrs = ();
push @attrs, SOAP::Data->type('string')->name('user')->value('scott');
push @attrs, SOAP::Data->type('int')->name('cpus')->value(12);
SOAP::Lite->uri($uri)->proxy($proxy)-jobSubmit(@attrs)->result;

I can see with a trace that the names and types are making it to the
server:

<?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:jobSubmit
xmlns:namesp1="http://www.clusterresources.com/Moab/WebServices"><user
xsi:type="xsd:string">scottmo</user><cpus
xsi:type="xsd:int">12</cpus></namesp1:jobStart></SOAP-ENV:Body></SOAP-ENV:Envelo\
pe>

The question is -- now how can I extract the names from the variables
programmatically on the server side without resorting to parsing the
body xml myself (i.e. the scottmo value has the name user and the type
string, etc.)?

I realize there would be ways to encode the name, values into strings,
or use perl data structures like hashes, etc, but I believe the way I
am attempting to use this would be the most direct way to use the SOAP
protocol and would enable a non-perl server to respond to a perl
client request in a straighforward manner.

Thank you for any help you can give me on this,

Scott Jackson

#5042 From: "Duncan Cameron" <duncan_cameron2002@...>
Date: Fri Dec 9, 2005 5:27 pm
Subject: Re: How can you determine the name and type of rpc variables on the server side?
duncan_camer...
Send Email Send Email
 
At 2005-12-08, 23:34:30 you wrote:

>Hello,
>
>I have spent alot of time and effort reading documentation, looking at
>source code, googling and scanning the list archives but have not been
>able to discover the answer.
>
>While it is clear how to establish names and types for your function
>parameters on the client side for interoperability with other soap
>apis, I have not been able to discover how to extract that information
>back from the request on the server side.
>
>For example, lets say I wanted to submit a job which could have any
>number of optional parameters.
>
>I could do something like:
>
>my @attrs = ();
>push @attrs, SOAP::Data->type('string')->name('user')->value('scott');
>push @attrs, SOAP::Data->type('int')->name('cpus')->value(12);
>SOAP::Lite->uri($uri)->proxy($proxy)-jobSubmit(@attrs)->result;
>
>I can see with a trace that the names and types are making it to the
>server:
>
><?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:Bo\
dy><namesp1:jobSubmit
>xmlns:namesp1="http://www.clusterresources.com/Moab/WebServices"><user
>xsi:type="xsd:string">scottmo</user><cpus
>xsi:type="xsd:int">12</cpus></namesp1:jobStart></SOAP-ENV:Body></SOAP-ENV:Envel\
ope>
>
>The question is -- now how can I extract the names from the variables
>programmatically on the server side without resorting to parsing the
>body xml myself (i.e. the scottmo value has the name user and the type
>string, etc.)?
>
>I realize there would be ways to encode the name, values into strings,
>or use perl data structures like hashes, etc, but I believe the way I
>am attempting to use this would be the most direct way to use the SOAP
>protocol and would enable a non-perl server to respond to a perl
>client request in a straighforward manner.
>
>Thank you for any help you can give me on this,
>
>Scott Jackson
>
See the section ACCESSING HEADERS AND ENVELOPE ON SERVER SIDE in the docs for
how to get hold of the SOAP envelope.
You can then use the SOAP::SOM methods to navigate through the child elements of
the jobSubmit element and pick out the name, type and value.

Something like this might be what you need

my $j = $som->match('/Envelope/Body/[1]');

for (my $i = 1; my $e = $j->dataof("[$i]"); $i++) {
     print $e->name , ' ', $e->type, ' ', $e->value, "\n";
};


Duncan

#5043 From: Scott Jackson <scottmo@...>
Date: Fri Dec 9, 2005 9:14 pm
Subject: Re: How can you determine the name and type of rpc variables on the server side?
ssscottmo
Send Email Send Email
 
> See the section ACCESSING HEADERS AND ENVELOPE ON SERVER SIDE in the docs for
how to get hold of the SOAP envelope.
> You can then use the SOAP::SOM methods to navigate through the child elements
of the jobSubmit element and pick out the name, type and value.
>
> Something like this might be what you need
>
> my $j = $som->match('/Envelope/Body/[1]');
>
> for (my $i = 1; my $e = $j->dataof("[$i]"); $i++) {
>     print $e->name , ' ', $e->type, ' ', $e->value, "\n";
> };

Duncan,

Thanks for the reference. In the section you referred me to I discovered
that I can get direct access to the envelope by inheriting from
SOAP::Server::Parameters. That was the key I was missing. Since all I
really needed in this instance were the names (and not the types), it
was a simple matter to extract the names and values with the 'method'
call on the SOAP::SOM object popped from the extended parameters.


package Moab::WebServices;

use Data::Dumper;
use Exporter;
@ISA    = qw(Exporter SOAP::Server::Parameters);
@EXPORT = qw
   (
   &jobStart
);

# Start a job
sub jobStart
{
     my $som = pop;

     my %args = %{$som->method};
     return "jobStart received: " . Data::Dumper->Dump([\%args]);
}

1;

####

I get a response like:

jobStart received: $VAR1 = {
           'NAME' => 'PBS.1234.0',
           'UNAME' => 'scottmo',
           'TASKLIST' => 'node01,node02',
           'WCTIME' => '12:00:00',
           'EXEC' => '/bin/hostname'
         };

####


Thank you so much for your help!

Scott

#5044 From: "parcelstring" <ben.crinion@...>
Date: Sat Dec 10, 2005 12:29 am
Subject: Upload a file using base64
parcelstring
Send Email Send Email
 
Hi

Im trying to upload a file to a XMLRPC::Lite using base64.

Im uploading the file from .NET and have got the file as an array of
bytes, this is serialised into the base64 type using the cookcomputing
xmlrpc library (www.xml-rpc.net).

Looking at a trace of the request being sent from my computer to the
server it all looks ok but when i get the value from the struct in the
server and write it to the logfile it writes garbage. Vim has real
problems opening the file because the contents are so weird.

Do i need to do something special with the base64 type?

Thanks
Ben Crinion

#5045 From: "sudhakar_jpr" <sudhakar_jpr@...>
Date: Mon Dec 12, 2005 11:59 am
Subject: how to use stubmaker
sudhakar_jpr
Send Email Send Email
 
HI all,  I m new to perl..can any body help me regarding stubmaker.pl,
I want to know how i use this stubmaker.pl..

can this is right approch that making a perl client thorugh stubmaker

waiting for relpy

thanks
Sudhakar Sharma

#5046 From: CristiAn Fuenzalida <cfuenzal.list@...>
Date: Mon Dec 12, 2005 4:16 pm
Subject: Problem with cookies
cfuenzal_perl
Send Email Send Email
 
Hello :-) ,

I'm using SOAP::Lite/Perl/0.65_6, and have a problem with cookies. I want to first call a login service which returns a key, and then call a function that return some values only if the user was succesfully logged in (if the client sent a valid key to the server using cookies). The server use cookies to return the key, but it looks like the client isn't recieving, storing or resending it. I said so, because when i dump the request from the client on the second service call, i don't see the headers for the cookies the server set, nor in the dump of the execution appears the cookies the client should set(see code below)

Does anybody have any idea about what's happening ?...



This is part of the Client code

  my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1, autosave=>1);
  my $soap = SOAP::Lite
    -> uri ('http://www.server.com/server',
             cookie_jar  => $cookie_jar
            )
    -> encoding('iso-8859-1')
    -> proxy('http://example.com/server.cgi');

   # First call
   my $som = $soap->login($email, $password);

   # Second call, so the cookies should be sent
   $som =  $soap->getTypes();


The server set the cookies using this function, where $r is the Apache request.
  $r->headers_out->add('Set-Cookie' => "key=$key; path=/;$domain$expires");

I also made a Dump of the SOM, and i noticed that the headers for the cookies are there inside the _request HTTP::Request object.
 => bless( {
             'client-response-num' => '1',
             'soapserver' => 'SOAP::Lite/Perl/0.65_6',
             'content-type' => 'text/xml; charset=iso-8859-1',
             'connection' => 'close',
             'date' => 'Mon, 12 Dec 2005 14:46:01 GMT',
             'server' => 'Apache',
             'set-cookie' => [
                               'key=59843KyV5Mlo7; path=/; expires=Sun, 12-Mar-06 14:46:09 GMT; domain=.example.com'
                             ],
             'client-date' => 'Mon, 12 Dec 2005 14:46:09 GMT',
              'content-length' => '660'
            }, 'HTTP::Headers' ),




The result of the first call is (using    'use SOAP::Lite +"debug"'  or 'use SOAP::Lite +"trace"' )
...
Content-Type: text/xml; charset=iso-8859-1
SOAPAction: "http://www.example.com/server#login"

<?xml version="1.0" encoding="iso-8859-1"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><namesp1:login xmlns:namesp1="http://www.server.com/server"><email xsi:type="xsd:string">cfuenzal@...</email><password xsi:type="xsd:string">pass</password></namesp1:login></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x8733bdc)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Connection: close

Date: Mon, 12 Dec 2005 15:18:46 GMT
Server: Apache
Content-Type: text/xml; charset=iso-8859-1
Client-Response-Num: 1
Set-Cookie: key=59843KyV5Mlo7; path=/; domain=.example.com;               <-- HERE IS THE COOKIE SENT FROM THE SERVER
SOAPServer: SOAP::Lite/Perl/0.65_6

<?xml version="1.0" encoding="iso-8859-1"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><namesp3:loginResponse xmlns:namesp3="http://www.server.com/server"><return_code xsi:type="xsd:integer">1</return_code><msg xsi:type="xsd:string">Logging OK</msg></namesp3:loginResponse></soap:Body></soap:Envelope>


And the second call has as result...


SOAPAction: "http://www.server.com/server#getTypes"

<?xml version="1.0" encoding="iso-8859-1"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><namesp2:getTypes xmlns:namesp2="http://www.server.com/server" xsi:nil="true" /></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x879adbc)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Connection: close
Server: Apache
Content-Length: 1063
Content-Type: text/xml; charset=iso-8859-1
Client-Response-Num: 1
SOAPServer: SOAP::Lite/Perl/0.65_6


Thanks in advance,

CristiAn.

#5047 From: Nagarajan M <naga_cit@...>
Date: Tue Dec 13, 2005 3:02 am
Subject: Multiple Request handling on HTTP::Daemon
naga_cit
Send Email Send Email
 
Hi ...
How to enable multiple request handling in the SOAP::HTTP::Daemon.
I have seen some of the modules in the CPAN, SOAP::HTTP::Daemon::ForkAfterProcessing, SOAP::HTTP::Daemon::ForkonAccept, But there is not link for that.
Is that under developement.
 
I desperately want to make my daemon to handle multiple requests simulatanesouly.  Help ...
 
Thanks for your time ...
 
- Nagarajan


Yahoo! India Matrimony: Find your partner now.

#5048 From: Richard Gregory <richard_n_gregory@...>
Date: Tue Dec 13, 2005 4:34 pm
Subject: Soap header UsernameToken Authenitcation
richard_n_gr...
Send Email Send Email
 
Hi,

I'm trying to write a SOAP:lite client for an Axis service which needs
authenticating with a
UsernameToken containing a username, password digest, nonce and timestamp. The
header (as
generated by a working axis client) should be of this form:

<soapenv:Header>
          <wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-s\
ecext-1.0.xsd"
soapenv:mustUnderstand="1">
             <wsse:UsernameToken>
                <wsse:Username>wss4j</wsse:Username>
                <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pro\
file-1.0#PasswordDigest">G97l0WOVZXKTtBKoFrJipS30dG4=</wsse:Password>
                <wsse:Nonce>FPMItH9S62hwtk0w6VWBmg==</wsse:Nonce>
                <wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut\
ility-1.0.xsd">2005-12-13T15:32:38.319Z</wsu:Created>
             </wsse:UsernameToken>
          </wsse:Security>
       </soapenv:Header>

I spent 2 days hunting round this list and the web in general trying to find a
way of doing this
with no success - just posts from other people having problems but nothing in
the way of guidance
as to how to do it. Therefore I'm wondering if this is actually possible with
SOAP:lite. If it is,
any help would be really appreciated.

Thanks in advance.

Richard.



___________________________________________________________
Yahoo! Exclusive Xmas Game, help Santa with his celebrity party -
http://santas-christmas-party.yahoo.net/

#5049 From: Peter Sinnott <psinnottie@...>
Date: Tue Dec 13, 2005 5:15 pm
Subject: Re: Soap header UsernameToken Authenitcation
psinno
Send Email Send Email
 
On Tue, Dec 13, 2005 at 04:34:03PM +0000, Richard Gregory wrote:
> Hi,
>
> I'm trying to write a SOAP:lite client for an Axis service which needs
authenticating with a
> UsernameToken containing a username, password digest, nonce and timestamp. The
header (as
> generated by a working axis client) should be of this form:
>

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/so\
apscenarios.asp

seems to have some examples that may be of use.


--
Our mission is to seamlessly build quality deliverables so that we may
synergistically pursue emerging solutions to set us apart from the competition

#5050 From: Richard Gregory <richard_n_gregory@...>
Date: Wed Dec 14, 2005 3:28 pm
Subject: Re: Soap header UsernameToken Authenitcation
richard_n_gr...
Send Email Send Email
 
Thanks for the link, Peter. I've pretty much got it solved, I think, but I just
have one small
problem, that is I can't figure out how to add the "wsse" prefix to the
UsernameToken element:

<soapenv:Header>
          <wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-s\
ecext-1.0.xsd"
soapenv:mustUnderstand="1">
             <UsernameToken>
                <wsse:Username>wss4j</wsse:Username>
                <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pro\
file-1.0#PasswordDigest">Cq22uI3TX3XASvn2kIQkU0ITA0s=</wsse:Password>
                <wsse:Nonce>i1UwBPCCWbUoI9Duh80D7w==</wsse:Nonce>
                <wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut\
ility-1.0.xsd">2005-12-09T10:09:19.656Z</wsu:Created>
             </UsernameToken>
          </wsse:Security>
       </soapenv:Header>

Here is the code of my client which generates the header.

my $wsse =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.x\
sd";
my $wsu =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.\
xsd";
my $passworddigest =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-\
1.0#PasswordDigest";

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
my $timestamp = sprintf "%4d-%02d-%02dT%02d:%02d:%02dZ\n",
$year+1900,$mon+1,$mday,$hour,$min,$sec;

my $username = "wss4j";
my $password = "security";
my $nonce = "4djRSlpeyWeGzcNgatneSA==";
my $digest = MIME::Base64::encode_base64(Digest::SHA1::sha1($nonce . $created .
$password), '');

my $header = SOAP::Header->name(Security => {
		 UsernameToken => {
		 Username => SOAP::Data->type('' => $username)->prefix('wsse'),
		 Password => SOAP::Data->type('' =>
$digest)->attr({'Type'=>$passworddigest})->prefix('wsse'),
		 Nonce => SOAP::Data->type('' => $nonce)->prefix('wsse'),
		 Created => SOAP::Data->type('' => $timestamp)->uri($wsu)->prefix('wsu')
		 }
})->uri($wsse)->prefix('wsse');

$header->mustUnderstand(1);

If I try to change it to:

my $header = SOAP::Header->name(Security => {
		 UsernameToken => {
		 Username => SOAP::Data->type('' => $username)->prefix('wsse'),
		 Password => SOAP::Data->type('' =>
$digest)->attr({'Type'=>$passworddigest})->prefix('wsse'),
		 Nonce => SOAP::Data->type('' => $nonce)->prefix('wsse'),
		 Created => SOAP::Data->type('' => $timestamp)->uri($wsu)->prefix('wsu')
		 }->prefix('wsse')
})->uri($wsse)->prefix('wsse');

I get a message "Can't call method "prefix" on unblessed reference at ....."

I feel like I'm really close here, so if anyone can help me out I'd be really
grteful. Sorry if
this is something really basic, but my only perl experience is trying to write
clients for my Axis
web servcies to test interoperability.

Thanks,

Richard.


--- Peter Sinnott <psinnottie@...> wrote:


---------------------------------
On Tue, Dec 13, 2005 at 04:34:03PM +0000, Richard Gregory wrote:
> Hi,
>
> I'm trying to write a SOAP:lite client for an Axis service which needs
authenticating with a
> UsernameToken containing a username, password digest, nonce and timestamp. The
header (as
> generated by a working axis client) should be of this form:
>

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/so\
apscenarios.asp

seems to have some examples that may be of use.


--
Our mission is to seamlessly build quality deliverables so that we may
synergistically pursue emerging solutions to set us apart from the competition


---------------------------------
   YAHOO! GROUPS LINKS


     Visit your group "soaplite" on the web.

     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.


---------------------------------






___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo!
Security Centre. http://uk.security.yahoo.com

#5051 From: Richard Gregory <richard_n_gregory@...>
Date: Wed Dec 14, 2005 3:29 pm
Subject: Re: Soap header UsernameToken Authenitcation
richard_n_gr...
Send Email Send Email
 
Thanks for the link, Peter. I've pretty much got it solved, I think, but I just
have one small
problem, that is I can't figure out how to add the "wsse" prefix to the
UsernameToken element:

<soapenv:Header>
          <wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-s\
ecext-1.0.xsd"
soapenv:mustUnderstand="1">
             <UsernameToken>
                <wsse:Username>wss4j</wsse:Username>
                <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pro\
file-1.0#PasswordDigest">Cq22uI3TX3XASvn2kIQkU0ITA0s=</wsse:Password>
                <wsse:Nonce>i1UwBPCCWbUoI9Duh80D7w==</wsse:Nonce>
                <wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut\
ility-1.0.xsd">2005-12-09T10:09:19.656Z</wsu:Created>
             </UsernameToken>
          </wsse:Security>
       </soapenv:Header>

Here is the code of my client which generates the header.

my $wsse =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.x\
sd";
my $wsu =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.\
xsd";
my $passworddigest =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-\
1.0#PasswordDigest";

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
my $timestamp = sprintf "%4d-%02d-%02dT%02d:%02d:%02dZ\n",
$year+1900,$mon+1,$mday,$hour,$min,$sec;

my $username = "wss4j";
my $password = "security";
my $nonce = "4djRSlpeyWeGzcNgatneSA==";
my $digest = MIME::Base64::encode_base64(Digest::SHA1::sha1($nonce . $created .
$password), '');

my $header = SOAP::Header->name(Security => {
UsernameToken => {
Username => SOAP::Data->type('' => $username)->prefix('wsse'),
Password => SOAP::Data->type('' =>
$digest)->attr({'Type'=>$passworddigest})->prefix('wsse'),
Nonce => SOAP::Data->type('' => $nonce)->prefix('wsse'),
Created => SOAP::Data->type('' => $timestamp)->uri($wsu)->prefix('wsu')
}
})->uri($wsse)->prefix('wsse');

$header->mustUnderstand(1);

If I try to change it to:

my $header = SOAP::Header->name(Security => {
UsernameToken => {
Username => SOAP::Data->type('' => $username)->prefix('wsse'),
Password => SOAP::Data->type('' =>
$digest)->attr({'Type'=>$passworddigest})->prefix('wsse'),
Nonce => SOAP::Data->type('' => $nonce)->prefix('wsse'),
Created => SOAP::Data->type('' => $timestamp)->uri($wsu)->prefix('wsu')
}->prefix('wsse')
})->uri($wsse)->prefix('wsse');

I get a message "Can't call method "prefix" on unblessed reference at ....."

I feel like I'm really close here, so if anyone can help me out I'd be really
grteful. Sorry if
this is something really basic, but my only perl experience is trying to write
clients for my Axis
web servcies to test interoperability.

Thanks,

Richard.


--- Peter Sinnott <psinnottie@...> wrote:


---------------------------------
On Tue, Dec 13, 2005 at 04:34:03PM +0000, Richard Gregory wrote:
> Hi,
>
> I'm trying to write a SOAP:lite client for an Axis service which needs
authenticating with a
> UsernameToken containing a username, password digest, nonce and timestamp. The
header (as
> generated by a working axis client) should be of this form:
>

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/so\
apscenarios.asp

seems to have some examples that may be of use.


--
Our mission is to seamlessly build quality deliverables so that we may
synergistically pursue emerging solutions to set us apart from the competition


---------------------------------
   YAHOO! GROUPS LINKS


     Visit your group "soaplite" on the web.

     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.


---------------------------------






___________________________________________________________
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars
online! http://uk.cars.yahoo.com/

#5052 From: "Andreas" <aschiffler@...>
Date: Wed Dec 14, 2005 9:52 pm
Subject: Example please - server/client with arrays
andreasschif...
Send Email Send Email
 
I am trying to implement a simple SOAP client/server and stumble on
parameter passing - in my case how do I read an array.

I am using Apache2::Soap via mod_perl. Basic no-parameter calling
works fine. Below is the source I wrote.




--------- httpd.conf ---------

<Location /soap>
  SetHandler perl-script
  PerlResponseHandler Apache2::SOAP
  PerlSetVar dispatch_to "/soap"
  PerlSetVar options "compress_threshold => 10000"
</Location>


--------- /soap/Calculator.pl ---------

package Calculator;

sub version {
  return "v1.0";
}

sub add {
  my @x = shift;
  my $y = 0;
  while(@x) {
   $y = $y + shift(@x);
  }
  return $y;
}

1;

-------- testsoap.pl ---------
use SOAP::Lite;

my $soap = SOAP::Lite
   -> uri('/Calculator')
   -> proxy('http://localhost/soap')
   -> on_fault(sub { my($soap, $res) = @_;
     die ref $res ? $res->faultdetail : $soap->transport->status, "\n";
   });

my $result = $soap -> version();
print $result->result;
print "\n";

my $result = $soap -> add(3,4);
print $result->result;
print "\n";

------- perl testsoap.pl --------

v1.0
0

#5053 From: vipin gupta <vipgup@...>
Date: Fri Dec 16, 2005 8:04 am
Subject: SSL SOAP::Transport::HTTP::Daemon Self-signed Certificates ???
vipgup
Send Email Send Email
 
Hi,
I have modified SOAP::Transport::HTTP::Daemon to be used with SSL as directed in previous group mails. I have added new patch to HTTP.pm so that it can support SSL for daemon by using HTTP::Daemon::SSL perl module.
I created self signed certificates for server authentication.
I am running a Soap HTTP daemon server at port 443. The server code is as shown below:

#**********************************************************************************
#*** SOAP Server
!/usr/bin/perl
use SOAP::Lite;
use SOAP::Transport::HTTP;
use IO::Socket::SSL;
use HTTP::Daemon::SSL;

SOAP::Transport::HTTP::Daemon
    -> new (ReuseAddr => 1, LocalAddr => '192.168.1.22', LocalPort => 443, Listen => 5, SSL_use_cert => 1,
        SSL_cert_file => '/usr/local/cvsw/server.crt', SSL_key_file => '/usr/local/cvsw/server.key')
    -> dispatch_to('cvs_service')
    -> handle;

package cvs_service;

sub getCvsConfig
{
        my $line = 1;
        my(@configFile);
        my $temp;
        if(!open(CONFIG, "/etc/cvsw.conf"))
        {
                qx{touch /etc/cvsw.conf};
                return "";
        }
        while($temp=<CONFIG>)
        {
                $configFile[$line]=$temp;
                $line++;
        }
        close(CONFIG);
        return @configFile;
}

## End of server code
#******************************************************************************************
#******************************************************************************************
#******************************************************************************************

The Client code is as follows:
#******************************************************************************************
#******************************************************************************************
## Client
#!/usr/bin/perl
use strict; # enforce variable declarations and quoting
use CGI qw(:standard);
use CGI::Cookie;
use Crypt::SSLeay;
use SOAP::Lite +trace => qw{trace debug};

$ENV{HTTPS_DEBUG} = 1;
$ENV{HTTPS_VERSION} = '23';

my $soap_response = SOAP::Lite
    -> uri('cvs_service')
    -> proxy("https://192.168.1.22")
    -> getCvsConfig();

if($soap_response->fault)
{
        print ($soap_response->faultcode,$soap_response->faultstring,$soap_response->faultdetail);
}
else
{
        print("Success");
}
#*******************************************************************************************
#*******************************************************************************************
#*******************************************************************************************
#*******************************************************************************************

  After running the server, when I run the client program in debug mode, it runs as shown below:

#*******************************************************************************************
#*******************************************************************************************
### Client output
#*******************************************************************************************


SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: getCvsConfig
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x8427168)
SOAP::Transport::HTTP::Client::send_receive: POST https://192.168.1.22 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Content-Length: 443
Content-Type: text/xml; charset=utf-8
SOAPAction: "cvs_service#getCvsConfig"

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:getCvsConfig xmlns:namesp1="cvs_service"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A

*** It waits here for some time, & comes out with 500 SSL read timeout response.......
******************************************************************************

I have tried debugging it , but couldn't found the reason for this kind of behaviour.

please help me if u can....

regards
Vipin








__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


#5054 From: jing han <jing_han_66@...>
Date: Fri Dec 16, 2005 7:15 pm
Subject: SOAP Lite cannot incorporate Apache2 ????
jing_han_66
Send Email Send Email
 
Hello,

Recently we move our project from RedHat 9.0 to Fedora
Core 4. I installed the newest SOAP-Lite tarball
SOAP-Lite-0.65_6.tar.gz and found that
SOAP::Transport::HTTP.pm still looking for
Apache/Constants.pm module.
The problem is Apache 2.0 and mod_perl 2.0 are
installed with Fedora Core 4 CDs, and I also found
that Apache 2.0 doesn't support Apache/Constants.pm
anymore.

It seems that SOAP Lite cannot incorporate Apache2. Is
this conclusion right?




jing


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#5055 From: jing han <jing_han_66@...>
Date: Mon Dec 19, 2005 4:01 pm
Subject: In Fedora Core 4 environment, soap lite looks for Apache.pm instead of Apache2.pm
jing_han_66
Send Email Send Email
 
Hello,

I meet a problem with SOAP::Transport::HTTP and
Apache2 in Fedora Core 4 environment.

I installed httpd-2.0.54-10.i386.rpm and
mod_perl-2.0.0-0.rc5.3.i386.rpm with Fedora Core 4
CDs. And then I downloaded and installed
perl-SOAP-Lite-0.60a-3.rhfc4.at.noarch.rpm.

I edited /etc/httpd/conf/httpd.conf to add our own
perl handler
as:

<Location /NM2Soap>
     setHandler perl-script
     perlHandler SOAPApache
</Location>


In SOAPApache module, I have: use
SOAP::Transport::HTTP;

I use a web services application to make a request to
my customized SOAPDaemon via SOAPApache. The request
is not successful. I go to /etc/httpd/logs/ directory
and check error_log message. The error_log message
looks like follows:

Client failed to resolve handler 'SOAPApache': Can't
locate Apache.pm in @INC.......... at
/usr/lib/perl5/vendor-perl5/5.8.6/SOAP/Transport/HTTP.pm
line 444 ............

I checked HTTP.pm file, line 444 is:

sub new {require Apache; require Apache::Constants;


How can I make SOAP::Transport::HTTP look for Apache2
instead of Apache?

Any answer will be greatly appreciated.



jing






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#5056 From: "Charlie Hills" <mug1134@...>
Date: Mon Dec 19, 2005 8:19 pm
Subject: Unable to connect VBS script to SOAP::Lite server
mug1134
Send Email Send Email
 
I've written a simple/test SOAP server which looks like this:

package wrapper;

use strict;
use SOAP::Lite;
use core;

sub test { shift @_; return SOAP::Data->name('handle', core::test(@_)); }

1;

core::test() does nothing more than warn("I'm here") and return a
number. It really is just a test. The client looks like this:

#!/usr/bin/perl

use strict;
use SOAP::Lite;
my $s = new SOAP::Lite(
   'proxy' => 'http://address:8007',
   'uri' => 'wrapper'
);
my $response = $s->test('apple');
print $response->result . "\n";

This works perfectly. It prints the value returned by core::test() and
"I'm here" appears in apache's error_log, as expected.

Trouble is, the VBScript client (using the low-level API as described
in the MSSOAP Toolkit documentation) dies a horrible death. The only
clue shows up in error_log:

Invalid URI in request POST  HTTP/1.1

The soap server uses Apache::SOAP via these httpd.conf entries:

   SetHandler perl-script
   PerlHandler Apache::SOAP
   PerlSetVar dispatch_to "wrapper"

When I use SOAP::Transport::HTTP::CGI then both the perl and VBS
clients work. The VBS client only seems to fail when I use this
method. I'm at a complete loss. I wish I was smarter.

Charlie

#5057 From: Jesse Brown <jbrown@...>
Date: Tue Dec 20, 2005 6:36 pm
Subject: Weird serialization when passing sub elements to SOAP::Data->value?
jbpostini
Send Email Send Email
 
This call...

   $client->call('check_login' =>
      SOAP::Data->name('auth' =>
        \SOAP::Data->name('email',=>'testemail'),
        \SOAP::Data->name('pword',=>'testpassword')
      )
   )->result;

Generates (cleaned up a bit):
<auth>
    <email xsi:type="xsd:string">testemail</email>
</auth>
<auth>
    <pword xsi:type="xsd:string">testpassword</pword>
</auth>

When what I want is:
   <auth>
     <email>testemail</email>
     <pword>testpassword</pword>
   </auth>

  (notice the two <auth> tags?!)

The difference on the server side is dramatic of course. With what is
happening, I get two hashrefs, one containing 'email' and one containing
'pword'. When I pass in the raw XML, I get what I should get, which is a
hashref containing 'email' and 'pword'.

I've tried passing the parameters in as hashrefs, listrefs, etc but so
far no luck. This really doesn't seem like proper behaviour! Help!

(I'm using SOAP::Lite 0.65_6)








-----------------------------------------------------------
This message may contain confidential and/or privileged
information. This information is intended to be read only
by the individual or entity to whom it is addressed. If
you are not the intended recipient, you are on notice that
any review, disclosure, copying, distribution or use of
the contents of this message is strictly prohibited. If
you have received this message in error, please notify the
sender immediately and delete or destroy any copy of this
message.

#5058 From: Scott Jackson <scottmo@...>
Date: Tue Dec 20, 2005 7:37 pm
Subject: Re: Weird serialization when passing sub elements to SOAP::Data->value?
ssscottmo
Send Email Send Email
 
Jesse,

I may be naive here, but at first glance it looks unusual for you to
have both a comma "," and a pair operator "=>" in a hash element such
as:
'email',=>'testemail'

I would think you would want one or the other such as:

'email', 'testemail'

or probably more appropriately

'email' =>'testemail'
.

Scott

On Tue, 2005-12-20 at 10:36 -0800, Jesse Brown wrote:
> This call...
>
>   $client->call('check_login' =>
>      SOAP::Data->name('auth' =>
>        \SOAP::Data->name('email',=>'testemail'),
>        \SOAP::Data->name('pword',=>'testpassword')
>      )
>   )->result;
>
> Generates (cleaned up a bit):
> <auth>
>    <email xsi:type="xsd:string">testemail</email>
> </auth>
> <auth>
>    <pword xsi:type="xsd:string">testpassword</pword>
> </auth>
>
> When what I want is:
>   <auth>
>     <email>testemail</email>
>     <pword>testpassword</pword>
>   </auth>
>
>  (notice the two <auth> tags?!)
>
> The difference on the server side is dramatic of course. With what is
> happening, I get two hashrefs, one containing 'email' and one containing
> 'pword'. When I pass in the raw XML, I get what I should get, which is a
> hashref containing 'email' and 'pword'.
>
> I've tried passing the parameters in as hashrefs, listrefs, etc but so
> far no luck. This really doesn't seem like proper behaviour! Help!
>
> (I'm using SOAP::Lite 0.65_6)
>
>
>
>
>
>
>
>
> -----------------------------------------------------------
> This message may contain confidential and/or privileged
> information. This information is intended to be read only
> by the individual or entity to whom it is addressed. If
> you are not the intended recipient, you are on notice that
> any review, disclosure, copying, distribution or use of
> the contents of this message is strictly prohibited. If
> you have received this message in error, please notify the
> sender immediately and delete or destroy any copy of this
> message.
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

#5059 From: Jesse Brown <jbrown@...>
Date: Tue Dec 20, 2005 7:53 pm
Subject: Re: Weird serialization when passing sub elements to SOAP::Data->value?
jbpostini
Send Email Send Email
 
It looks weird (was a typo), but removing it makes zero difference. (I
tried!)

The data generated is identical.


On Tue, 2005-12-20 at 12:37 -0700, Scott Jackson wrote:
> Jesse,
>
> I may be naive here, but at first glance it looks unusual for you to
> have both a comma "," and a pair operator "=>" in a hash element such
> as:
> 'email',=>'testemail'
>
> I would think you would want one or the other such as:
>
> 'email', 'testemail'
>
> or probably more appropriately
>
> 'email' =>'testemail'
> .
>
> Scott
>
> On Tue, 2005-12-20 at 10:36 -0800, Jesse Brown wrote:
> > This call...
> >
> >   $client->call('check_login' =>
> >      SOAP::Data->name('auth' =>
> >        \SOAP::Data->name('email',=>'testemail'),
> >        \SOAP::Data->name('pword',=>'testpassword')
> >      )
> >   )->result;
> >
> > Generates (cleaned up a bit):
> > <auth>
> >    <email xsi:type="xsd:string">testemail</email>
> > </auth>
> > <auth>
> >    <pword xsi:type="xsd:string">testpassword</pword>
> > </auth>
> >
> > When what I want is:
> >   <auth>
> >     <email>testemail</email>
> >     <pword>testpassword</pword>
> >   </auth>
> >
> >  (notice the two <auth> tags?!)
> >
> > The difference on the server side is dramatic of course. With what is
> > happening, I get two hashrefs, one containing 'email' and one containing
> > 'pword'. When I pass in the raw XML, I get what I should get, which is a
> > hashref containing 'email' and 'pword'.
> >
> > I've tried passing the parameters in as hashrefs, listrefs, etc but so
> > far no luck. This really doesn't seem like proper behaviour! Help!
> >
> > (I'm using SOAP::Lite 0.65_6)
> >
> >
> >
> >
> >
> >
> >
> >
> > -----------------------------------------------------------
> > This message may contain confidential and/or privileged
> > information. This information is intended to be read only
> > by the individual or entity to whom it is addressed. If
> > you are not the intended recipient, you are on notice that
> > any review, disclosure, copying, distribution or use of
> > the contents of this message is strictly prohibited. If
> > you have received this message in error, please notify the
> > sender immediately and delete or destroy any copy of this
> > message.
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>






-----------------------------------------------------------
This message may contain confidential and/or privileged
information. This information is intended to be read only
by the individual or entity to whom it is addressed. If
you are not the intended recipient, you are on notice that
any review, disclosure, copying, distribution or use of
the contents of this message is strictly prohibited. If
you have received this message in error, please notify the
sender immediately and delete or destroy any copy of this
message.

#5060 From: "jedijay007" <jayhilden@...>
Date: Tue Dec 20, 2005 9:53 pm
Subject: HELP: .NET dropping variables for methods.
jedijay007
Send Email Send Email
 
I am using soap::lite to call .NET methods, all of a sudden .NET will
not pickup any of the variables I pass to it.  If I call a method with
no variables it returns just fine, otherwise it spits back an error
saying that variable foo is required.

Here is my code:
###########################################################3
my $ns = "http://www.1234.com"; ##this should NOT end with a /
my $url = "http://123.123.123.123/test.asmx";

my ($soap, $result, $output);
$soap = SOAP::Lite
    -> uri($ns)
    -> on_action( sub { join '/', $ns, $_[1] })
    -> proxy ($url);

my $method = SOAP::Data->name('HelloWorldEcho')->attr( {xmlns => $ns});
my @params = (
    SOAP::Data->name('schema')->value('schema string')->type(''),
    SOAP::Data->name('deployment')->value('deployment string')->type(''),
    SOAP::Data->name('session')->value('session string')->type(''),
    SOAP::Data->name('input')->value('input string')->type('')
);

my $test = $soap->call($method => @params);
if ($test->fault) {
    print "faultcode = " . $test->faultcode .
       "<br> faultstring = " . $test->faultstring .
       "<br> faultactor = " . $test->faultactor .
       "<br> faultdetail = " . $test->faultdetail;
} else {
    print "the result is: " . $test->result;
}

#####################################################
There aren't any faults, it's just that the method doesn't recognize
that I passed it any variables.  With debugging on here is my request
header:

#####################################################
POST http://172.20.120.120/prissmwebinterface/prissmweb.asmx
Accept: text/xml
Accept: multipart/*
Content-Length: 585
Content-Type: text/xml; charset=utf-8
SOAPAction: http://www.ppdi.com/HelloWorldEcho

<?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:Body>
<HelloWorldEcho xmlns="http://www.ppdi.com">
<schema>schema string</schema>
<deployment>deployment string</deployment>
<session>session string</session>
<input>input string</input>
</HelloWorldEcho>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
################################################################

ANY HELP/SUGGESTIONS WOULD BE GREATLY APPRECIATED!!!!

THANKS IN ADVANCE,
JAY

#5061 From: "robin_keech1" <robin@...>
Date: Wed Dec 21, 2005 12:46 pm
Subject: Perl server -> .Net client. Can't parse response due to namespace?
robin_keech1
Send Email Send Email
 
Hi all,

I have written a SOAP server using SOAP::Lite. It has a wsdl file at http://dpg.dialogue.net/WAP_Soap.wsdl

I have tested the service with both perl and php clients. We have a new customer that is coding in .Net and having trouble integrating the method calls. The server logs show a method request and a result being sent back, but the client can't seem to get at the results. Initially they only received a string with "status", so I changed the wsdl to include a complex type as the return parameter. The actual perl server code just returns a hash.

The client has said that "the .Net framework cannot parse the XML being returned from the createSession SOAP call as one of the namespaces is declared within the node using the namespace.  .NET needs it to be declared before it is used or it throws an error."

Firstly, is this conclusion correct? Has anyone experienced a problem like this with .Net? And if it is, can anyone help with suggestions on suppressing/removing the namespace part.

So the SOAP body looks like:
 <SOAP-ENV:Body>
 <namesp35:createSessionResponse xmlns:namesp35="http://dpg.dialogue.net/WAP_Soap">
       <s-gensym283 xsi:type="xsd:string">status</s-gensym283>
       <s-gensym285 xsi:type="xsd:int">00</s-gensym285>
       <s-gensym287 xsi:type="xsd:string">sessionID</s-gensym287>
       <s-gensym289 xsi:type="xsd:string">42053C6A714211DA909B8DCE9602641D</s-gensym289>
       <s-gensym291 xsi:type="xsd:string">redirectURL</s-gensym291>
       <s-gensym293 xsi:type="xsd:string">http://myurl.com?s=42053C6A714211DA909B8DCE9602641D</s-gensym293>
 </namesp35:createSessionResponse>
 </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
 
But this won't work unless the namesp35 namespace is declared before it is used.  Taking out the section in bold should work, according to the customer.

The other thing I though it might be was not encoding the result hash as a correct SOAPata type object that matches the wsdl description. Or maybe I should be looking at overriding the serialiser.

As you can probably tell, I have no idea what to do to get this working. I don't have access to any .Net technology to play with. Any suggestions would be greatly appreciated.

Robin

#5062 From: Robin Keech <robin@...>
Date: Wed Dec 21, 2005 3:01 pm
Subject: Re: Perl server -> .Net client. Can't parse response due to namespace?
robin_keech1
Send Email Send Email
 
Thanks for your reply Brad,

I have used the SOAP data object to override the prefix and now get a soap response of:


<SOAP-ENV:Body>

<namesp1:createSessionResponse xmlns:namesp1="http://dpg.dialogue.net/WAP_Soap">

<createSessionResponse xmlns="http://dpg.dialogue.net/WAP_Soap">
    <status xsi:type="xsd:int">06</status>
    <sessionID xsi:null="1"/>
    <redirectURL xsi:null="1"/>
</createSessionResponse>

</namesp1:createSessionResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The code to do this is:

my $myRes = SOAP::Data->name("createSessionResponse" => \SOAP::Data->value(
              SOAP::Data->name("status" => $result_hash{'status'}),               SOAP::Data->name("sessionID" => $result_hash{'sessionID'}),
              SOAP::Data->name("redirectURL" => $result_hash{'redirectURL'})
              )
             )->attr({ xmlns => 'http://dpg.dialogue.net/WAP_Soap' });
$myRes->prefix('');    return($myRes);

Anyone got any ideas on how to get rid of the outer <namesp1:createSessionResponse> elements that are now being duplicated?

Thanks,

Robin


On Wed, 2005-12-21 at 08:20 -0500, Brad Miele wrote:
Robin,

I believe that there is something in the SOAP::Lite man page to this effect, or at least for working with .Net in general. for my web service, which was written solely for working with .Net clients, i dicovered that .Net didn't like the prefix stuff tha SOAP::Lite includes, an example of one of my responses is:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<LogoutResponse xmlns="http://blahblahblah/ClientLogin/">
<LogoutResult>0</LogoutResult>
<errorMessage>SUCCESS</errorMessage>
</LogoutResponse>
</soap:Body></soap:Envelope>

 I had to remove the gensym and namesp tags.

There *should* be a way to do this when you initialize SOAP::Lite, but i could never get it quite right, so i always end up hacking the .pm to correct it, if someone can show me an example of setting up the prefixes for .Net without hacking the module, that would be cool.

In any case robin, i hope this helps.

On 12/21/05, robin_keech1 <robin@...> wrote:
Hi all,

I have written a SOAP server using SOAP::Lite. It has a wsdl file at http://dpg.dialogue.net/WAP_Soap.wsdl

I have tested the service with both perl and php clients. We have a new customer that is coding in .Net and having trouble integrating the method calls. The server logs show a method request and a result being sent back, but the client can't seem to get at the results. Initially they only received a string with "status", so I changed the wsdl to include a complex type as the return parameter. The actual perl server code just returns a hash.

The client has said that "the .Net framework cannot parse the XML being returned from the createSession SOAP call as one of the namespaces is declared within the node using the namespace.  .NET needs it to be declared before it is used or it throws an error."

Firstly, is this conclusion correct? Has anyone experienced a problem like this with .Net? And if it is, can anyone help with suggestions on suppressing/removing the namespace part.

So the SOAP body looks like:
 <SOAP-ENV:Body>
 <namesp35:createSessionResponse xmlns:namesp35=" http://dpg.dialogue.net/WAP_Soap">
       <s-gensym283 xsi:type="xsd:string">status</s-gensym283>
       <s-gensym285 xsi:type="xsd:int">00</s-gensym285>
       <s-gensym287 xsi:type="xsd:string">sessionID</s-gensym287>
       <s-gensym289 xsi:type="xsd:string">42053C6A714211DA909B8DCE9602641D</s-gensym289>
       <s-gensym291 xsi:type="xsd:string">redirectURL</s-gensym291>
       <s-gensym293 xsi:type="xsd:string">http://myurl.com?s=42053C6A714211DA909B8DCE9602641D</s-gensym293>
 </namesp35:createSessionResponse>
 </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
 
But this won't work unless the namesp35 namespace is declared before it is used.  Taking out the section in bold should work, according to the customer.

The other thing I though it might be was not encoding the result hash as a correct SOAPata type object that matches the wsdl description. Or maybe I should be looking at overriding the serialiser.

As you can probably tell, I have no idea what to do to get this working. I don't have access to any .Net technology to play with. Any suggestions would be greatly appreciated.

Robin



YAHOO! GROUPS LINKS






--
Brad Miele                                                                                                                        
Technology Director                                                                                                                
IPNStock                                                                                                                          
(866) 476-7862 x902                                                                                                                
bmiele@...

#5063 From: "smurthy1857" <smurthy1857@...>
Date: Wed Dec 21, 2005 10:36 pm
Subject: Accessing .NET WSDL:: Can't call method "value" on an undefined value
smurthy1857
Send Email Send Email
 
I am a newbie to SOAPLite. Below is my code and I am getting
"Can't call method "value" on an undefined value at (eval 10) line
38.". Please help.

---

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


my $prop ="\<Properties>\

<Property><Name>_AssemblyFile</Name><Value>abc.Agent.dll</Value></Prop
erty>\

<Property><Name>_AssemblyType</Name><Value>abc.Agent.ExternalProcessAg
ent</Value></Property>\
  <Property><Name>_EPId</Name><Value>2001</Value></Property>\
  <Property><Name>_Action</Name><Value>Initialize</Value></Property>\
         </Properties>";

my $status = SOAP::Data->type(string=>'');
my $reason= SOAP::Data->type(string=>'');
my $inputData=SOAP::Data->type(int=>'');
my $propertiesStr =SOAP::Data->type(string=>"none");


my $soap =  SOAP::Lite
           -> service('http://myiisserver:8080/abc/Task.asmx?wsdl')
           -> Process($propertiesStr,$status, $reason,$inputData);

#5064 From: vipin gupta <vipgup@...>
Date: Thu Dec 22, 2005 9:19 am
Subject: Patch for HTTP::Daemon::SSL
vipgup
Send Email Send Email
 
Hi,
Using SOAP::Lite-0.65, I have writted client & server using SOAP::Lite & SOAP::Transport::HTTP::Daemon for my  application. The things worked fine with plain text communication. For SSL, I installed HTTP::Daemon::SSL for SSL support for HTTP Daemon. But with SSL, The client was getting timed out after SSL handshake is complete.
 After spending hours in trying to sort out SSL timeout problem, I came to know that the problem lies in HTTP::Daemon::SSL. There is a call to "sysread" for reading the client request after SSL handshake. This call tries to read 2048 bytes of data from client. If the client is sending less than 2k data, server waits there & don't come out of sysread call. While client is waiting for response from server, server  gets stuck in sysread call, which ultimately results in SSL timeout.
 
I have written a patch to solve this problem with HTTP::Daemon::SSL.
 
cd /usr/lib/perl5/site_perl/5.6.0/HTTP/Daemon
diff SSL.pm.orig SSL.pm
 
172,173c172,195
<       my $n = sysread($self, $_[0], 2048, length($_[0]));
<        print STDERR sprintf("sysread() just \$n=%s\n",(defined $n?$n:'undef')) if $DEBUG;
---
>#################################################################
>##################### Patch starts here #########################
>       my ($x,$n);
>       my $lent=1;
>       while($lent<=2048)
>       {
>               eval {
>                       local $SIG{ALRM} = sub{die "alarm\n"};
>                       alarm(1);
>                       $n = sysread($self,$x,1);
>                       alarm(0);
>                       $_[0] = "$_[0]"."$x";
>                       $lent++;
>               };
>               if($@)
>               {
>
>                       last;
>               }
>       }
>       $n=$lent;
>##################### Patch ends here #########################
>#################################################################
>       print STDERR sprintf("sysread() just \$n=%s\n",(defined $n?$n:'undef')) if $DEBUG;
 
 
After adding this patch, My SSL Daemon & SSL soap client are communicating properly.
I hope this will help & save your time.
 
Cheers
Vipin


Vipin Gupta 
Scientific Officer-C
2-277 S Mod Labs- D Block,
Computer Division, B.A.R.C.

Mumbai-400094
vipin@... 
Ph.  9821017677(M), 022-25595411(0)
(MOD LAB EXTEN. 25411)

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Messages 5035 - 5064 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