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 2675 - 2705 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#2675 From: "eamick" <eric-amick@...>
Date: Mon Jun 2, 2003 6:51 pm
Subject: “ characters in server response
eamick
Send Email Send Email
 
I'm trying to use ActiveState Perl 5.8.0 with SOAP::Lite 0.55, and
the data being returned by the server contains various non-ASCII
characters, e.g., “.  I get error messages when it tries to
encode the data in BASE64 for transmission.  Is there a way to
transmit these characters?  FWIW, it works fine with 5.6.1 and
SOAP::Lite 0.51.

#2676 From: "Byrne Reese" <breese@...>
Date: Mon Jun 2, 2003 11:25 pm
Subject: MIME CRLF interop bug with Axis...
byrnereese
Send Email Send Email
 
I wanted to post a patch to MIME::Entity which will resolve a long
standing interop bug between SOAP::Lite and Apache Axis. The problem
will be resolved permanently in the next SOAP::Lite/SOAP::MIME release
(so stay tuned).

[With any luck, this patch will actually be made to MIME::Entity - and
I working with the author of that toolkit to get it patched.]

In summary, the problem has to do with MIME::Entity's use of newline
characters exclusively as mime boundary delimitation -- when in fact
it should CRLFs. The fix is to MIME::Entity::print_body. If you need
to be interacting with Apache Axis services ASAP - add this to your
perl scripts:

BEGIN {

   sub MIME::Entity::print_body {
     my ($self, $out) = @_;
     $out = MIME::Entity::wraphandle($out || select); ### get a
printable output
     my ($type) = split '/', lc($self->mime_type);  ### handle by MIME type

     ### Multipart...
     if ($type eq 'multipart') {
       my $boundary = $self->head->multipart_boundary;

       ### Preamble:
       my $preamble = join('', @{ $self->preamble || $DefPreamble });
       $out->print("$preamble\n") if ($preamble ne '');

       ### Parts:
       my $part;
       foreach $part ($self->parts) {
	 # PATCHED!!!!! Added the '\r'
	 $out->print("--$boundary\r\n");
	 $part->print($out);
	 # PATCHED!!!!! Added the '\r'
	 $out->print("\r\n"); ### needed for next delim/close
       }
       # PATCHED!!!!! Added the '\r'
       $out->print("--$boundary--\r\n");

       ### Epilogue:
       my $epilogue = join('', @{ $self->epilogue || $DefEpilogue });
       if ($epilogue ne '') {
	 $out->print($epilogue);
	 # PATCHED!!!!! Added the '\r'
	 $out->print("\n") if ($epilogue !~ /\n\Z/);  ### be nice
       }
     }

     ### Singlepart type with parts...
     ###    This makes $ent->print handle message/rfc822 bodies
     ###    when parse_nested_messages('NEST') is on [idea by Marc
Rouleau].
     elsif ($self->parts) {
       my $need_sep = 0;
       my $part;
       foreach $part ($self->parts) {
	 $out->print("\n\n") if $need_sep++;
	 $part->print($out);
       }
     }

     ### Singlepart type, or no parts: output body...
     else {
       $self->bodyhandle ? $self->print_bodyhandle($out)
	 : MIME::Entity::whine "missing body; treated as empty";
     }
     1;
   }
}

#2677 From: Simon Fell <soap@...>
Date: Tue Jun 3, 2003 3:21 am
Subject: Re: MIME CRLF interop bug with Axis...
simonfell99
Send Email Send Email
 
Great!, in addition this should also fix interop problems with
PocketSOAPs SwA support.

Cheers
Simon
www.pocketsoap.com

On Mon, 02 Jun 2003 23:25:16 -0000, in soap you wrote:

>I wanted to post a patch to MIME::Entity which will resolve a long
>standing interop bug between SOAP::Lite and Apache Axis. The problem
>will be resolved permanently in the next SOAP::Lite/SOAP::MIME release
>(so stay tuned).
>
>[With any luck, this patch will actually be made to MIME::Entity - and
>I working with the author of that toolkit to get it patched.]
>
>In summary, the problem has to do with MIME::Entity's use of newline
>characters exclusively as mime boundary delimitation -- when in fact
>it should CRLFs. The fix is to MIME::Entity::print_body. If you need
>to be interacting with Apache Axis services ASAP - add this to your
>perl scripts:

#2678 From: "mayankanup" <mayankanup@...>
Date: Tue Jun 3, 2003 5:45 pm
Subject: passing arguments from client to server side
mayankanup
Send Email Send Email
 
Hi,

I want to pass two arguments to the server from the client side.
Further i want to save them in a text file at server side. Is there
any way to do this.
Thanks in advance.
Anup

#2679 From: "Bruno Grossmann" <samnrv@...>
Date: Wed Jun 4, 2003 4:26 pm
Subject: Generating a 'Map' itemized structure for SOAPRMI
samnrv
Send Email Send Email
 
Hello,

I need to generate the following structure to pass it to SOAPRMI. From this type
of data, SOAPRMI supposedly is able to generate a hash table. here is the code.
Any suggestion will be appreciated.

<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Body>
<m:echoMapArrayResponse xmlns:m='http://soapinterop.org/'>
<return id='id1' xsi:type='ns1:Array'
xmlns:ns1='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:n1='http://xml.apache.org/xml-soap' SOAP-ENC:arrayType='n1:Map[2]'>
<i xsi:type='ns2:Map' xmlns:ns2='http://xml.apache.org/xml-soap'>
<item>
<key xsi:type='xsd:int'>5</key>
<value xsi:type='xsd:string'>String Value</value>
</item>
<item>
<key xsi:type='xsd:string'>String Key</key>
<value xsi:type='xsd:timeInstant'>2003-06-02T14:43:23.005Z</value>
</item>
</i>
<i xsi:type='ns2:Map' xmlns:ns2='http://xml.apache.org/xml-soap'>
<item>
<key xsi:type='xsd:string'>>this is the second map</key>
<value xsi:type='xsd:boolean'>1</value>
</item>
<item>
<key xsi:type='xsd:string'>test</key>
<value xsi:type='xsd:float'>411.0</value>
</item>
</i>
</return>
</m:echoMapArrayResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

#2680 From: Damien Merenne <dam@...>
Date: Thu Jun 5, 2003 3:58 pm
Subject: Bug in IO::SessionSet
herisson_soc...
Send Email Send Email
 
Hello,

I ran into trouble creating a simple server use SOAP::Lite. This is the
code for the server:

#!/usr/bin/perl
use SOAP::Transport::TCP;

my $daemon = SOAP::Transport::TCP::Server
     -> new (LocalAddr => 'localhost', LocalPort => 4000, Listen => 5,
Reuse => 1, Timeout => 2)
     -> dispatch_to('Temperatures')
     ;
print "Contact to SOAP server at ", join(':', $daemon->sockhost,
$daemon->sockport), "\n";
$daemon->handle;


package Temperatures;

sub f2c {
     my ($class, $f) = @_;
     return 5/9*($f-32);
}

sub c2f {
     my ($class, $c) = @_;
     return 32+$c*9/5;
}

sub hello {
     my ($class, $c) = @_;
     print "hello\n";
     return "hello";
}


This will cause this error:
IO::Select->select() returned error: Illegal seek at
/usr/share/perl5/SOAP/Transport/TCP.pm line 207

IO::Select->select() is called in IO::SessionSet at line 123

The error is due to the fact that I add a timeout value to the socket.
I would like this so I can extend SOAP::Transport::TCP::Server to add a
hook in the handle method so that I can do some quick task if there are
nothing to do.


Regards


Damien

--
Damien Merenne <dam@...>

#2681 From: Manuel Streuhofer <manuel@...>
Date: Thu Jun 5, 2003 7:51 pm
Subject: ->service method
manuel@...
Send Email Send Email
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

i was wondering how i can use all the possibilities the ->proxy method
from SOAP::Lite is offering me like proxy => ['http' => '....'] or
timeout, while using the ->service method for accessing a wsdl-file.


thanks,
Manuel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+3589WrMH+JkBKdURAncBAJwLVEN9UKmKAG7Mznpa/ZTTueIzGgCgjU7H
dD/pH9rxXH3VYfj1SHZb+Bs=
=jlox
-----END PGP SIGNATURE-----

#2682 From: "perlmedian" <perlmedian@...>
Date: Thu Jun 5, 2003 9:07 pm
Subject: passing array/hash looking stuff from SOAP::Lite client to server
perlmedian
Send Email Send Email
 
I am trying to write and test a service I am writing in SOAP::Lite. I
have had a little exposure to SOAP::Lite as a client to .NET server.
But I want the data that's going to be passed to the server to be
distinguishable from each other.

Here's the code that works that I have so far (some of it may be
wrapped around):

### CLIENT code soap_client.pl
use strict;
use warnings;
use SOAP::Lite;

my $soap = SOAP::Lite->new(
	 uri => $URI, # urn:FileInfo
	 proxy => $PROXY, # server cgi file
);

my @stuff = qw(
	 src/accounting/Accounting.cc
	 src/products/Products.cc
	 include/calculator.h
	 );

# SOAP method (as defined on server)
my $files = SOAP::Data->name('files' => join "\n", @stuff )->type
('string')->uri($URI);
## I want to get rid of the join from the above
my $client = SOAP::Data->name('client' => 'IADB')->type('string')->uri
($URI);
my $release = SOAP::Data->name('release' => 'V3.4.5')->type('string')-
>uri($URI);
my $os = SOAP::Data->name('os' => 'NT 4')->type('string')->uri($URI);

my $response = $soap->getFileRevision($files, $client, $release, $os);

## response
if ($response->fault) {
	 print "ERROR CODE:", $response->faultcode, " ",
		 $response->faultstring, "\n";
} else {
	 print $response->result() , "\n\n";
}


########### SERVER CODE FileData.cgi
use strict;
use warnings;
use SOAP::Transport::HTTP;

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


package FileInfo;

sub getFileRevision {

my($self, @params) = @_;

open(FILE, ">", "/usr/log");

print FILE "@params";

close FILE;

return SOAP::Data->name('data')->value($params[0])->type('string')-
>uri('urn:FileInfo');

} ################################# END getFileRevision

###### END CODE

The @params are the values from the client but I want to be able to
access the values by name (client/release/etc.) also I want the files
to be an array (or XML equivelent) instead of a join array into a
string.

I am highly adept at using XML::Parser among other XML modules so XML
is not a problem.

Can anyone help me from the working above example? I am sure it would
be benifical to others to learn from this, as well as teach me what I
should be doing.

Thank you in advance,

#2683 From: Byrne Reese <breese@...>
Date: Thu Jun 5, 2003 9:56 pm
Subject: MIME::Tools 6 alpha released
byrnereese
Send Email Send Email
 
This [alpha] release of MIME::Tools was released to CPAN yesterday. I
have tested to make sure it fixes the interoperability bug with Apache
Axis' MIME parser.

http://www.cpan.org/modules/by-module/MIME/

To fix the bug you will need to first install the new version of
MIME::Tools, then you will need to put the following code in your perl
scripts:

BEGIN {
   $MIME::Entity::BOUNDARY_DELIMITER = "\r\n";
}

--
Byrne Reese
Developer Program Manager
Grand Central Communications

#2684 From: "michaelcano2003" <mcano@...>
Date: Fri Jun 6, 2003 10:04 pm
Subject: SOAP::Lite WSDL-Generator et. al
michaelcano2003
Send Email Send Email
 
Hi group,

My goal is to generate WSDL docs for my SOAP::Lite servers on
Solaris 5.6 using Perl 5.8 and Apache 1.3.

I followed the "HowTo-SOAPLite.txt" that comes with the WSDL-
Generator 0.02 distribution and most of it worked great.
I was able to configure Apache and write the hello world server and
it tested fine witht the local world_client.pl.

But, when I get to the WSDL generation part, and after copying the
code example verbatim, I get:
Class WorldFunctions not called at wsdl_gen.pl line 28

Anyone have any idea what's up with that?

I'd also be interested in any other tools out there that allow me to
create wsdl from my SOAP::Lite servers. I need to expose these
servers to a .NET client in VB. (The .NET 2003 tool wsdl.exe needs a
wsdl document to create a proxy object.)

Thanks!
-Mike

#2685 From: "michaelcano2003" <mcano@...>
Date: Fri Jun 6, 2003 11:36 pm
Subject: VB .NET client -> Perl SOAP:Lite server on Solaris
michaelcano2003
Send Email Send Email
 
Hi all,

I posted earlier on a WSDL generator question, but I should probably
just state my ultimate goal.

I'm very new to VB .NET and have used Perl on unix for many years.
I'd like to create a Perl SOAP::Lite web service on a Solaris
machine and a VB.NET client on a Windows XP Pro box. I'm using
Visual Studio .NET 2003.

Any adivce, docs, code would be greatly appreciated. Even if it's
just a "Hello World" example that would suffice.

Thanks!
-Mike

#2686 From: Alasdair Allan <aa@...>
Date: Sat Jun 7, 2003 6:27 pm
Subject: OSCON'03 BOF
dr_aallan
Send Email Send Email
 
All,

Well I've (finally) gotten round to requesting a BOF slot at OSCON, since
web services is such a timely issue I doubt we're going to have any problems
getting a slot, so...

Paul has already volunteered to kick the session off with a (brief) talk,
I'll leave it up to him decide what he wants to talk about.

Do we have any more volunteers for presentations? Or discussion topics?
Someone with a couple of overheads and an idea they want to chew over
perhaps?

I'll sort out some PC projection equipment (I can probably get some money
out of someones budget for it) so we can do demos, show each other code,
and do the (now traditional) powerpoint presentations.

Cheers,
Alasdair.
--
Dr. A. Allan, School of Physics, University of Exeter

#2687 From: Alasdair Allan <aa@...>
Date: Sat Jun 7, 2003 6:49 pm
Subject: Re: OSCON'03 BOF
dr_aallan
Send Email Send Email
 
> I'll sort out some PC projection equipment (I can probably get some money
> out of someones budget for it) so we can do demos, show each other code,
> and do the (now traditional) powerpoint presentations.

Okay, I just contacted the people O'Reilly point at to do AV rental from,
and they want $350 for the kit and $75 for a technician to sit around in
the back and make sure we don't steal the kit.

Personally I think thats an outrageous price for some AV kit for an hour,
but there you go, thats capitalism I guess.

Anyone want to split the cost of the AV kit? or volunteer to bring a
projector with them?

Al.
--
Dr. A. Allan, School of Physics, University of Exeter

#2688 From: Dave Kimberley <dave_kimberley@...>
Date: Mon Jun 9, 2003 9:39 am
Subject: Performance problem with soaplite
dave_kimberley
Send Email Send Email
 
I am using the following code to process a SOAP message that contains
2500 Employees and it runs very slowly, with small numbers of Employees
there is not a problem.

Here is the relevant code:

...

my $MessageDetail;
printf("%d: Getting message detail\n", time() - $t);
($MessageDetail, $TicketBook) = $soap->GetMessageDetail(\$TicketBook,
\$MessageID);
printf("%d: Got message detail\n", time() - $t);
my $MessageDetailSOM = $soap->call;
printf("%d: Got message detail SOM\n", time() - $t);
for (my $i = 1; my $Employee =
$MessageDetailSOM->match("//GovTalkMessage/Body/DigitalMail/MessageBody/CodingNo\
ticeP9/[$i]");
$i++)
{
      printf("%d: In loop at start %d\n", time() - $t, $i);
      if ($Employee->dataof()->name eq 'Employee')
      {
          my $p9;

          ($p9->{'NINO'}, $p9->{'Suffix'}) =
nino_split(trim($Employee->valueof('NINO')));
          $p9->{'membno'} = trim($Employee->valueof('WorksNumber'));
          if ($p9->{'membno'} =~ /([0-9]*)/)
          {
              $p9->{'membno'} = $1;
          }
          else
          {
              $p9->{'membno'} = '';
          }
          $p9->{'EffectiveDate'} = trim($Employee->valueof('EffectiveDate'));
          $p9->{'Name'} = trim($Employee->valueof('Name/Forename'));
          ($p9->{'Title'}, $p9->{'Initials'}, $p9->{'Surname'}) =
name_split($p9->{'Name'});
          my $tax = $Employee->dataof('CodingUpdate/TaxCode');
          $p9->{'TaxCode'} = tax_code_expand(trim($tax->value));
          if ($p9->{'TaxCode'} =~ m/^(D0|NT)$/)
          {
              $p9->{'Week1Month1Indicator'} = 1;
          }
          else
          {
              $p9->{'Week1Month1Indicator'} =
$tax->attr->{'Week1Month1Indicator'};
              if (defined $p9->{'Week1Month1Indicator'})
              {
                  if ($p9->{'Week1Month1Indicator'} eq 'X')
                  {
                      $p9->{'Week1Month1Indicator'} = 1;
                  }
                  else
                  {
                      print 'ERROR: Unrecognized Week1Month1Indicator = '
. $p9->{'Week1Month1Indicator'} . "\n";
                      $p9->{'Week1Month1Indicator'} = 0;
                  }
              }
              else
              {
                  $p9->{'Week1Month1Indicator'} = 0;
              }
          }
          ProcessP9($p9);
      }
      printf("%d: In loop at end %d\n", time() - $t, $i);
}

...

Here are the times in seconds:

13: Getting message detail
60: Got message detail
60: Got message detail SOM
95: In loop at start 1
95: In loop at end 1
130: In loop at start 2
130: In loop at end 2

The times indicate that the majority of the time is spent doing the
match in the for statement. Is there a better way of doing this?

Thanks

Dave

#2689 From: "kedsbarve" <kedsbarve@...>
Date: Mon Jun 9, 2003 3:33 pm
Subject: Re: SOAP::Lite WSDL-Generator et. al
kedsbarve
Send Email Send Email
 
Hi Michael:

I have successfully implemented a Perl Soap/Lite server (Apache 2 and
Solaris 8/Aix 4) and all VB/.Net clients, via WSDL endpoint access.
It works great!!

Foll: are the steps:

1. Use the WSDL::Generator module to generate the WSDL. It does a
decent job. But you have to modify it by hand to get it working
properly.

Following is a small snapshot of my wsdl (modified by hand):

=============== WSDL starts ================================

<?xml version="1.0"?>
<definitions name="ldapControl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://10.21.24.28:8000/ldapControl.wsdl"
xmlns:tns="http://10.21.24.28:8000/ldapControl.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd1="http://10.21.24.28:8000">
<types>
    <xsd:schema elementFormDefault="qualified"
targetNamespace="http://10.21.24.28:8000">
                        <xsd:element name="userView">
                            <xsd:complexType>
                              <xsd:sequence>
                                 <xsd:element maxOccurs="1"
minOccurs="0" name="username" type="xsd:string" />
                                 <xsd:element maxOccurs="1"
minOccurs="0" name="attributes" type="xsd:string" />
                              </xsd:sequence>
                            </xsd:complexType>
                         </xsd:element>
                         <xsd:element name="userViewResponse">
                            <xsd:complexType>
                              <xsd:sequence>
                                 <xsd:element maxOccurs="1"
minOccurs="0" name="userViewResult" type="xsd:string" />
                              </xsd:sequence>
                            </xsd:complexType>
                         </xsd:element>

</xsd:schema>
</types>
<message name="userViewRequest">
		 <part name="parameters" element="xsd1:userView"/>
	 </message>
	 <message name="userViewResponse">
		 <part name="parameters"
element="xsd1:userViewResponse"/>
</message>
<portType name="ldapControlPortType">
<operation name="userView">
	 <input message="tns:userViewRequest" />
	 <output message="tns:userViewResponse" />
</operation>
<binding name="ldapControlSoapBinding" type="tns:ldapControlPortType">
		 <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
		 <operation name="userView">
				 <soap:operation style="document"
soapAction="http://10.21.24.28:8000/ldapControl#userView"/>
				 <input>
					 <soap:body use="literal"/>
				 </input>
				 <output>
					 <soap:body use="literal"/>
				 </output>
		 </operation>
</binding>
<service name="ldapControl">
		 <documentation>
			 LDAP Control module
		 </documentation>
	 <port name="ldapControlSoapPort"
binding="tns:ldapControlSoapBinding">
	 <soap:address
location="http://10.21.24.28:8000/webperl/ldap.pl"/>
	 </port>
</service>

</definitions>

=============== WSDL ends =========================

2. Contents of ldap.pl (the proxy script)
-----------------------------------------

#!/opt/freeware/bin/perl

use lib("your module lib path");
use ldapControl;          # my perl module
use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
     -> on_action(sub {return})
     -> dispatch_to('module lib path','ldapControl')
     -> handle;

3. In my ldapControl perl module (imp. things to remember)
----------------------------------------------------------
eg:

sub userView {
         my ($class, $username, $attributes) = @_;
blah blah...


*** returning a string with value = "hello world" ***
return SOAP::Data->name('userViewResult')->type('string')->value
("hello World")->uri($uriNameSpace);

}

1;
------------------

'userViewResult' as defined in the WSDL
return type is 'string'
retutn string value is "Hello World"
uriNameSpace is 'http://10.21.24.28:8000' as defined in the WSDL.


I have tested it against all possible clients and this works great!!
Hope this is helpful!!

Cheers!
Kedar

#2690 From: "kedsbarve" <kedsbarve@...>
Date: Mon Jun 9, 2003 3:56 pm
Subject: Re: VB .NET client -> Perl SOAP:Lite server on Solaris
kedsbarve
Send Email Send Email
 
Hi Michael:

1. Normal VB client code to access WSDL using SOAP/Lite server on
Solaris:

I am using MS Soap toolkit 2.0/3.0

Download MS Soap toolkit 3.0:
------------------------------
http://www.microsoft.com/downloads/details.aspx?FamilyId=C943C0DD-
CEEC-4088-9753-86F052EC8450&displaylang=en

or search on MSDN

=====
Dim sc, wsdl
Set sc = CreateObject("MSSOAP.SoapClient30")

wsdl = "http://10.21.24.28:8000/wsdl/ldapControl.wsdl"
sc.mssoapinit wsdl

Dim v

v = sc.userView("kbarve", "cn,mail")

MsgBox v

======

2. Using C# (.net)
-------------------

. Create a Web Reference to the WSDL URL. Using Visual Studio .NET

private void Form1_Load(object sender, System.EventArgs e)
{
	 String str;
	 ldapControl x = new WebReference1.ldapControl();
	 str = x.userView("user", "attributes");
	 Console.WriteLine(str);
}


Hope this helps. Also I would recommend using the Altova XMLSpy
editor, its a good tool or also you can use the .NET WebService
studio client application (download from: http://www.gotdotnet.com)


Hope this helps!!!

Cheers!
Kedar





--- In soaplite@yahoogroups.com, "michaelcano2003" <mcano@s...> wrote:
> Hi all,
>
> I posted earlier on a WSDL generator question, but I should
probably
> just state my ultimate goal.
>
> I'm very new to VB .NET and have used Perl on unix for many years.
> I'd like to create a Perl SOAP::Lite web service on a Solaris
> machine and a VB.NET client on a Windows XP Pro box. I'm using
> Visual Studio .NET 2003.
>
> Any adivce, docs, code would be greatly appreciated. Even if it's
> just a "Hello World" example that would suffice.
>
> Thanks!
> -Mike

#2691 From: Byrne Reese <breese@...>
Date: Mon Jun 9, 2003 4:43 pm
Subject: Re: Performance problem with soaplite
byrnereese
Send Email Send Email
 
I would say... yes.

I think your client code could be improved by parsing out the array
once, and then looping over it. The way your client code is written,
each iteration of the loop will cause the entire XML document to be
parsed/traversed looking for the ith element. To remedy, try a loop
structure like this:

my $i++;
for my $Employee
($som->valueof('//GovTalkMessage/Body/DigitalMail/MessageBody/CodingNoticeP9"))
{
   $i++;
   # Do stuff here
}

The primary difference here is that the array is constructed once when
the array is initialized, and then an iterator (or cursor) is simply
moved along the list nodes for each iteration. It should be more
efficient. If not, let me know...

On Mon, 2003-06-09 at 02:39, Dave Kimberley wrote:
> I am using the following code to process a SOAP message that contains
> 2500 Employees and it runs very slowly, with small numbers of
> Employees
> there is not a problem.
>
> Here is the relevant code:
>
> ...
>
> my $MessageDetail;
> printf("%d: Getting message detail\n", time() - $t);
> ($MessageDetail, $TicketBook) = $soap->GetMessageDetail(\$TicketBook,
> \$MessageID);
> printf("%d: Got message detail\n", time() - $t);
> my $MessageDetailSOM = $soap->call;
> printf("%d: Got message detail SOM\n", time() - $t);
> for (my $i = 1; my $Employee =
>
$MessageDetailSOM->match("//GovTalkMessage/Body/DigitalMail/MessageBody/CodingNo\
ticeP9/[$i]");
> $i++)
> {
>      printf("%d: In loop at start %d\n", time() - $t, $i);
>      if ($Employee->dataof()->name eq 'Employee')
>      {
>          my $p9;
>
>          ($p9->{'NINO'}, $p9->{'Suffix'}) =
> nino_split(trim($Employee->valueof('NINO')));
>          $p9->{'membno'} = trim($Employee->valueof('WorksNumber'));
>          if ($p9->{'membno'} =~ /([0-9]*)/)
>          {
>              $p9->{'membno'} = $1;
>          }
>          else
>          {
>              $p9->{'membno'} = '';
>          }
>          $p9->{'EffectiveDate'} =
> trim($Employee->valueof('EffectiveDate'));
>          $p9->{'Name'} = trim($Employee->valueof('Name/Forename'));
>          ($p9->{'Title'}, $p9->{'Initials'}, $p9->{'Surname'}) =
> name_split($p9->{'Name'});
>          my $tax = $Employee->dataof('CodingUpdate/TaxCode');
>          $p9->{'TaxCode'} = tax_code_expand(trim($tax->value));
>          if ($p9->{'TaxCode'} =~ m/^(D0|NT)$/)
>          {
>              $p9->{'Week1Month1Indicator'} = 1;
>          }
>          else
>          {
>              $p9->{'Week1Month1Indicator'} =
> $tax->attr->{'Week1Month1Indicator'};
>              if (defined $p9->{'Week1Month1Indicator'})
>              {
>                  if ($p9->{'Week1Month1Indicator'} eq 'X')
>                  {
>                      $p9->{'Week1Month1Indicator'} = 1;
>                  }
>                  else
>                  {
>                      print 'ERROR: Unrecognized Week1Month1Indicator =
> '
> . $p9->{'Week1Month1Indicator'} . "\n";
>                      $p9->{'Week1Month1Indicator'} = 0;
>                  }
>              }
>              else
>              {
>                  $p9->{'Week1Month1Indicator'} = 0;
>              }
>          }
>          ProcessP9($p9);
>      }
>      printf("%d: In loop at end %d\n", time() - $t, $i);
> }
>
> ...
>
> Here are the times in seconds:
>
> 13: Getting message detail
> 60: Got message detail
> 60: Got message detail SOM
> 95: In loop at start 1
> 95: In loop at end 1
> 130: In loop at start 2
> 130: In loop at end 2
>
> The times indicate that the majority of the time is spent doing the
> match in the for statement. Is there a better way of doing this?
>
> Thanks
>
> Dave
>
>
>                         Yahoo! Groups Sponsor
>
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
Byrne Reese
Developer Program Manager
Grand Central Communications

#2692 From: Byrne Reese <breese@...>
Date: Mon Jun 9, 2003 4:54 pm
Subject: Re: SOAP::Lite WSDL-Generator et. al
byrnereese
Send Email Send Email
 
On Fri, 2003-06-06 at 15:04, michaelcano2003 wrote:
> I'd also be interested in any other tools out there that allow me to
> create wsdl from my SOAP::Lite servers. I need to expose these
> servers to a .NET client in VB. (The .NET 2003 tool wsdl.exe needs a
> wsdl document to create a proxy object.)

I know this doesn't help you now, but a project is currently underway to
produce WSDL tools for SOAP::Lite... more details on this project will
be released soon. The goal of the project is to achieve the same level
of support and ease-of-use that is enjoyed by users of .NET and Axis. No
rewriting of WSDL will be necessary!

--
Byrne Reese
Developer Program Manager
Grand Central Communications

#2693 From: Alasdair Allan <aa@...>
Date: Mon Jun 9, 2003 5:03 pm
Subject: Re: SOAP::Lite WSDL-Generator et. al
dr_aallan
Send Email Send Email
 
> I know this doesn't help you now, but a project is currently underway to
> produce WSDL tools for SOAP::Lite... more details on this project will
> be released soon.

Really? Is there a timescale? This is something that would seriously help
me out... since I'm heavily using ithreads, I'm using Perl 5.8.0, which
means that I've got the AUTOLOAD bug, which means that WSDL::Generator
doesn't work.

> The goal of the project is to achieve the same level of support and
> ease-of-use that is enjoyed by users of .NET and Axis. No rewriting of
> WSDL will be necessary!

This would be (more than) nice, interoperability with Axis is prety much a
priority for me since I'm a sole Perl voice in a wilderness of Java.

Al.

PS. Don't suppose you'll be at OSCON and willing to talk about this in
     the SOAP::Lite BOF? ;)

#2694 From: "Pierre Denis" <pdenis@...>
Date: Tue Jun 10, 2003 8:57 am
Subject: RE: SOAP::Lite WSDL-Generator et. al
pdenis@...
Send Email Send Email
 
>
> But, when I get to the WSDL generation part, and after copying the
> code example verbatim, I get:
> Class WorldFunctions not called at wsdl_gen.pl line 28
>
> Anyone have any idea what's up with that?

Hi Mike,

If you are using Perl 5.8, that may explain why. I know it sounds silly, but
perl 5.8 has a buggy implementation of UNIVERSAL::AUTOLOAD which is used in
Class::Hook used by WSDL::Generator

This will be fixed next version of perl.

Regards

Pierre Denis
opensource.fotango.com

#2695 From: Dave Kimberley <dave_kimberley@...>
Date: Tue Jun 10, 2003 9:06 am
Subject: Re: Performance problem with soaplite
dave_kimberley
Send Email Send Email
 
Byrne Reese wrote:
  > I would say... yes.
  >
  > I think your client code could be improved by parsing out the array
  > once, and then looping over it. The way your client code is written,
  > each iteration of the loop will cause the entire XML document to be
  > parsed/traversed looking for the ith element. To remedy, try a loop
  > structure like this:
  >
  > my $i++;
  > for my $Employee
($som->valueof('//GovTalkMessage/Body/DigitalMail/MessageBody/CodingNoticeP9"))
{
  >   $i++;
  >   # Do stuff here
  > }
  >
  > The primary difference here is that the array is constructed once when
  > the array is initialized, and then an iterator (or cursor) is simply
  > moved along the list nodes for each iteration. It should be more
  > efficient. If not, let me know...
  >

I tried the loop statement as:

for my $Employee
($som->valueof('//GovTalkMessage/Body/DigitalMail/MessageBody/CodingNoticeP9/Emp\
loyee"))


This means I get each Employee as a perl data structure rather than a
SOM object so I then cannot use dataof or attr so I cannot access the
attributes? The following code no longer works:

  > my $tax = $Employee->dataof('CodingUpdate/TaxCode');
  > $p9->{'TaxCode'} = tax_code_expand(trim($tax->value));
  > if ($p9->{'TaxCode'} =~ m/^(D0|NT)$/)
  > {
  >     $p9->{'Week1Month1Indicator'} = 1;
  > }
  > else
  > {
  >     $p9->{'Week1Month1Indicator'} = $tax->attr->{'Week1Month1Indicator'};

I can use:

my $p9->{'TaxCode'} = $Employee->{'CodingUpdate'} -> {'TaxCode');

but I cannot access the Week1Month1Indicator attribute.

The loop construct I had was the only one I could get to work that
allowed me to access attributes.

Any ideas how I can access attributes and get reasonable performance in
parsing the loop?

Thanks

Dave

#2696 From: "ggib23" <ggib23@...>
Date: Tue Jun 10, 2003 8:25 pm
Subject: Error Trying to parse out Header info
ggib23
Send Email Send Email
 
I am trying to pull info from the Header, at the server level,
however I keep getting the following soap fault:

<?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><SOAP-
ENV:Fault><faultcode xsi:type="xsd:string">SOAP-
ENV:Server</faultcode><faultstring xsi:type="xsd:string">Can't locate
object method "dataof" via package "HELLO GEORGE" (perhaps you forgot
to load "HELLO GEORGE"?)
at /home/bmaccion/apache/htdocs/richard/echo.pl line 33.
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Can anyone tell me what I'm doing wrong?
Here is client side source code:
use SOAP::Lite +trace => "all";

$PHRASE =  "HELLO GEORGE";

my $soap = SOAP::Lite
    ->readable(1)
    ->uri('Echo')
    ->proxy('http://crmdev.hilton.com:9010/richard/echo.pl');


my $som = $soap->echo(
       SOAP::Data->name("whatToEcho" => "$PHRASE"));


print "The response from the server was:\n".$som->result."\n";

1;


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


Here is the Server side code:
use SOAP::Transport::HTTP;
use Debug;
use Logging;
use hilton::Message;

Debug::Init( "Gdebug" );
Debug::Suffix( ".dbg" );
Debug::On();

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



package Echo;
use strict;

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

sub echo
{
my $self = shift;
my $envelope = pop;
my $str = $envelope->dataof("//echo/whatToEcho")->value;
return $str;
}

1;


Thanks in advance,

Greg Gibson

#2697 From: Byrne Reese <breese@...>
Date: Tue Jun 10, 2003 8:31 pm
Subject: Re: Error Trying to parse out Header info
byrnereese
Send Email Send Email
 
Just a quick shot in the dark, but I believe you need to wrap your
package declaration in a BEGIN block.

Try:

BEGIN{
   package Echo;
   use strict;

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

   sub echo
   {
     my $self = shift;
     my $envelope = pop;
     my $str = $envelope->dataof("//echo/whatToEcho")->value;
     return $str;
   }
   1;
}

This looks familiar - did you grab this off of builder.com? :)

On Tue, 2003-06-10 at 13:25, ggib23 wrote:
> I am trying to pull info from the Header, at the server level,
> however I keep getting the following soap fault:
>
> <?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><SOAP-
> ENV:Fault><faultcode xsi:type="xsd:string">SOAP-
> ENV:Server</faultcode><faultstring xsi:type="xsd:string">Can't locate
> object method "dataof" via package "HELLO GEORGE" (perhaps you forgot
> to load "HELLO GEORGE"?)
> at /home/bmaccion/apache/htdocs/richard/echo.pl line 33.
> </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> Can anyone tell me what I'm doing wrong?
> Here is client side source code:
> use SOAP::Lite +trace => "all";
>
> $PHRASE =  "HELLO GEORGE";
>
> my $soap = SOAP::Lite
>    ->readable(1)
>    ->uri('Echo')
>    ->proxy('http://crmdev.hilton.com:9010/richard/echo.pl');
>
>
> my $som = $soap->echo(
>       SOAP::Data->name("whatToEcho" => "$PHRASE"));
>
>
> print "The response from the server was:\n".$som->result."\n";
>
> 1;
>
>
> #################################################################
>
>
> Here is the Server side code:
> use SOAP::Transport::HTTP;
> use Debug;
> use Logging;
> use hilton::Message;
>
> Debug::Init( "Gdebug" );
> Debug::Suffix( ".dbg" );
> Debug::On();
>
> SOAP::Transport::HTTP::CGI
>   -> dispatch_to('Echo')
>   -> handle;
>
>
>
> package Echo;
> use strict;
>
> use vars qw(@ISA);
> @ISA = qw(SOAP::Server::Parameters);
>
> sub echo
> {
> my $self = shift;
> my $envelope = pop;
> my $str = $envelope->dataof("//echo/whatToEcho")->value;
> return $str;
> }
>
> 1;
>
>
> Thanks in advance,
>
> Greg Gibson
>
>
>
>                         Yahoo! Groups Sponsor
>
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
Byrne Reese
Developer Program Manager
Grand Central Communications

#2698 From: Adhamh Findlay <afindlay@...>
Date: Wed Jun 11, 2003 4:32 pm
Subject: WSDL, and multiref problem
adhamhcf
Send Email Send Email
 
Hello,


So, I'm new to SOAP...

I have written a Java application that provides a SOAP server. (Its a
WebObjects application, but that shouldn't matter...)

I seem to be having a multiref issue of the type that has been discussed
here before.  I've found these discussions useful, but not able to solve my
issue.

I have a server that defines a method/operation that returns a java Vector.
I've written a really simple SOAP::Lite script that uses wdsl.  This script
does return all the objects I want (Dumper shows this), but I can't access
the results that are behind the mutliRef key.

I have read the information at
http://www.majordojo.com/archives/cat_soaplite.html come close to a solution
but I can still only get one object back.  Here is the script:


#!/usr/bin/perl -w
use SOAP::Lite;
use Data::Dumper;
my $WSDL =
"http://myhost.somedomain.com:4220/cgi-bin/WebObjects/Waldo.woa/ws/PersonSer
vice?wsdl";
my $NS =
"http://myhost.somedomain.com:4220/cgi-bin/WebObjects/Waldo.woa/ws/PersonSer
vice";
my $HOST =
"http://myhost.somedomain.com:4220/cgi-bin/WebObjects/Waldo.woa/ws/PersonSer
vice";

my $search = SOAP::Lite
     ->readable(1)
     ->xmlschema('http://www.w3.org/2001/XMLSchema')
     ->on_action( sub { return'""';})
     #See comments below
     #->maptype({getPersonByNameRequest => $NS})
     ->proxy($HOST)
     ->uri($NS);

my $method = SOAP::Data->name('getPersonByName')
     ->uri($NS);

my $params = SOAP::Data
     ->type('getPersonByNameRequest')
     #->uri($NS)
     #->maptype({getPersonByNameRequest => $NS)
     ->name('in0' =>
     #if I add a \ before the SOAP::Data line below then I get a
     #serialization exception.
     #I tried to fix this by using maptype as above, but I still get the
     #exception.
     #\SOAP::Data->value(SOAP::Data->name('in0' =>
     #"jim")->type('xsd:string')));
    SOAP::Data->value(SOAP::Data->name('in0' => "jim")->type('xsd:string')));

my $results = $search->call($method => $params);
print Dumper($results->result);


The output of Dumper showed me that the other object(s) I am interested in
are hidden behind a multiRef key, that I can't seem to get back.  I also had
tcpflow running and it to show me that all the data I am interested in is
returned in XML format to may script/client.  I have attached both these
outputs (dumper.txt, tcpflow.txt).

Additionally, I have attached the file soaplitexml.  This file shows the
various xml that is being sent to my soap server.

I have also attached my WSDL that the application is generating.

I just can't tell what I am still doing wrong.  Any help would be greatly
appreciated!


Thanks,

Adhamh

#2699 From: Adhamh Findlay <afindlay@...>
Date: Wed Jun 11, 2003 5:15 pm
Subject: WDSL and multiRef problem
adhamhcf
Send Email Send Email
 
Sorry if this is a repeat....

Hello,

So, I'm new to SOAP...

I have written a Java application that provides a SOAP server. (Its a
WebObjects application, but that shouldn't matter...)

I seem to be having a multiref issue of the type that has been discussed
here before.  I've found these discussions useful, but not able to solve my
issue.

I have a server that defines a method/operation that returns a java Vector.
I've written a really simple SOAP::Lite script that uses wdsl.  This script
does return all the objects I want (Dumper shows this), but I can't access
the results that are behind the mutliRef key.

I have read the information at
http://www.majordojo.com/archives/cat_soaplite.html come close to a solution
but I can still only get one object back.  Here is the script:


#!/usr/bin/perl -w
use SOAP::Lite;
use Data::Dumper;
my $WSDL =
"http://myhost.somedomain.com:4220/cgi-bin/WebObjects/Waldo.woa/ws/PersonSer
vice?wsdl";
my $NS =
"http://myhost.somedomain.com:4220/cgi-bin/WebObjects/Waldo.woa/ws/PersonSer
vice";
my $HOST =
"http://myhost.somedomain.com:4220/cgi-bin/WebObjects/Waldo.woa/ws/PersonSer
vice";

my $search = SOAP::Lite
     ->readable(1)
     ->xmlschema('http://www.w3.org/2001/XMLSchema')
     ->on_action( sub { return'""';})
     #See comments below
     #->maptype({getPersonByNameRequest => $NS})
     ->proxy($HOST)
     ->uri($NS);

my $method = SOAP::Data->name('getPersonByName')
     ->uri($NS);

my $params = SOAP::Data
     ->type('getPersonByNameRequest')
     #->uri($NS)
     #->maptype({getPersonByNameRequest => $NS)
     ->name('in0' =>
     #if I add a \ before the SOAP::Data line below then I get a
     #serialization exception.
     #I tried to fix this by using maptype as above, but I still get the
     #exception.
     #\SOAP::Data->value(SOAP::Data->name('in0' =>
     #"jim")->type('xsd:string')));
    SOAP::Data->value(SOAP::Data->name('in0' => "jim")->type('xsd:string')));

my $results = $search->call($method => $params);
print Dumper($results->result);


The output of Dumper showed me that the other object(s) I am interested in
are hidden behind a multiRef key, that I can't seem to get back.  I also had
tcpflow running and it to show me that all the data I am interested in is
returned in XML format to may script/client.  I have attached both these
outputs (dumper.txt, tcpflow.txt).

Additionally, I have attached the file soaplitexml.  This file shows the
various xml that is being sent to my soap server.

I have also attached my WSDL that the application is generating.

I just can't tell what I am still doing wrong.  Any help would be greatly
appreciated!


Thanks,

Adhamh

#2700 From: Brian Gilman <gilmanb@...>
Date: Thu Jun 12, 2003 3:31 am
Subject: FW: At my wits end.
bshilzzle
Send Email Send Email
 
Hello,

     My name is Brian Gilman. I am currently writing a book on XML and
BioInformatics for O'Reilly that includes a section on SOAP::Lite and Apache
Axis toolkits.

     I am also the Inventor of a BioInformatics Toolkit called OmniGene. This
is a toolkit that exposes Bioinformatics services as web services. I am
trying to write a simple Client for our analysis engine. The method
signature in java is:

      public JobInfo submitJob(int taskID, ParameterInfo[] parameters,
DataHandler[] files);

     This is serialized into the SOAP messages: request and response attached
and shown below.

     I have read through the perdoc/your book/ and a few hundred other
resources and do not quite know how to write the code to talk to this
service. I would like to put this into the book but cannot due to this
roadblock.

     Here is what I understand so far:

     In order to do attachments I use SOAP::MIME. I wrote the following code
to handle this (please forgive the really bad Perl coding as this is not my
native tongue):

     if(@Files){
     foreach my $file (@Files){
         my $fileCounter++;

         my $ent = build MIME::Entity
         Type => "text/plain",
         Encoding => "binary",
         Path => $file,
         'Content-Id' =>'<File' . $fileCounter  . '>',
         Disposition => "attachment";

         push(@fileHolder, $ent);
     }
     }

     I pass this to a SOAP::Lite object using the ->parts(@fileHolder)
method.

     Now here's where I get lost:

     I need to construct an array of objects called ParameterInfo and pass
them to my service. How do I do this in SOAP::Lite? I've looked into
SOAP::Data objects and they look promising but, I'm not sure how to get the
SOAP::Lite toolkit to encode these as a Java Map (well in this case Axis
serialized Map?). Do I need to make my own serializer here?

     I would really appreciate your help!

                             Best,

                                 Brian Gilman




==============
Listen Port: 9090
Target Host: localhost
Target Port: 8080
==== Request ====
POST /axis/servlet/AxisServlet HTTP/1.0

Content-Type: multipart/related; type="text/xml";
start="<97C2115D38FF77499E2CA04BB838E901>";
boundary="----=_Part_0_7089827.1055376896680"

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.1RC2

Host: localhost

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 3796





------=_Part_0_7089827.1055376896680

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

Content-Transfer-Encoding: binary

Content-Id: <97C2115D38FF77499E2CA04BB838E901>



<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
   <ns1:submitJob
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="Analysis">
    <arg0 xsi:type="xsd:int">0</arg0>
    <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
     <item href="#id0"/>
     <item href="#id1"/>
    </arg1>
    <arg2 href="#id2"/>
   </ns1:submitJob>
   <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:ParmInfo"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="Analysis">
    <attributes href="#id3"/>
    <description xsi:type="xsd:string">input file 1</description>
    <inputFile xsi:type="xsd:boolean">true</inputFile>
    <label xsi:type="xsd:string"></label>
    <name xsi:type="xsd:string">-f1</name>
    <outputFile xsi:type="xsd:boolean">false</outputFile>
    <value xsi:type="xsd:string">test1.txt</value>
   </multiRef>
   <multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <key xsi:type="xsd:string">test1.txt</key>
     <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
xmlns:ns4="Analysis"/>
    </item>
    <item>
     <key xsi:type="xsd:string">test2.txt</key>
     <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
xmlns:ns5="Analysis"/>
    </item>
   </multiRef>
   <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <attributes href="#id4"/>
    <description xsi:type="xsd:string">input file 2</description>
    <inputFile xsi:type="xsd:boolean">true</inputFile>
    <label xsi:type="xsd:string"></label>
    <name xsi:type="xsd:string">-f2</name>
    <outputFile xsi:type="xsd:boolean">false</outputFile>
    <value xsi:type="xsd:string">test2.txt</value>
   </multiRef>
   <multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <key xsi:type="xsd:string">MODE</key>
     <value xsi:type="xsd:string">IN</value>
    </item>
    <item>
     <key xsi:type="xsd:string">TYPE</key>
     <value xsi:type="xsd:string">FILE</value>
    </item>
   </multiRef>
   <multiRef id="id4" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <key xsi:type="xsd:string">MODE</key>
     <value xsi:type="xsd:string">IN</value>
    </item>
    <item>
     <key xsi:type="xsd:string">TYPE</key>
     <value xsi:type="xsd:string">FILE</value>
    </item>
   </multiRef>
  </soapenv:Body>
</soapenv:Envelope>

------=_Part_0_7089827.1055376896680

Content-Type: text/plain

Content-Transfer-Encoding: binary

Content-Id: <519D4713CAC92D0A55F7F849680F1D56>



>Test1
aaaaaaaaggggggtttttttttccccccc


------=_Part_0_7089827.1055376896680

Content-Type: text/plain

Content-Transfer-Encoding: binary

Content-Id: <4D580598F9E5C89FA1FD17407BADABF5>



>Test2
aaaaaaaatttttttggggggggggggggggccccccccccc


------=_Part_0_7089827.1055376896680--

==== Response ====
HTTP/1.1 200 OK

Set-Cookie: JSESSIONID=DAA82FFC4487D346BC5FFF90B8278066; Path=/axis

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

Date: Thu, 12 Jun 2003 00:14:58 GMT

Server: Apache Coyote/1.0

Connection: close



<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
   <ns1:submitJobResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="Analysis">
    <submitJobReturn xsi:type="ns1:JobInfo">
     <dateCompleted xsi:type="xsd:dateTime" xsi:nil="true"/>
     <dateSubmitted
xsi:type="xsd:dateTime">2003-06-12T00:14:57.876Z</dateSubmitted>
     <inputFileName xsi:type="xsd:string"></inputFileName>
     <jobNumber xsi:type="xsd:int">0</jobNumber>
     <parameterInfo xsi:type="xsd:string"><?xml version="1.0"
encoding="UTF-8"?>

<ANALYSISPARAMETERS>
   <PARAMETER name="-f1"
value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_test1.txt&q
uot;>
     <DESCRIPTION>input file 1</DESCRIPTION>
     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
     <ATTRIBUTE
key="LABEL"></ATTRIBUTE></PARAMETER>
   <PARAMETER name="-f2"
value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_test2.txt&q
uot;>
     <DESCRIPTION>input file 2</DESCRIPTION>
     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
     <ATTRIBUTE
key="LABEL"></ATTRIBUTE></PARAMETER></ANALYSISPA
RAMETERS>
</parameterInfo>
     <parameterInfoArray xsi:type="soapenc:Array"
soapenc:arrayType="ns1:ParmInfo[2]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <item>
       <attributes xsi:type="ns2:Map"
xmlns:ns2="http://xml.apache.org/xml-soap">
        <item>
         <key xsi:type="xsd:string">MODE</key>
         <value xsi:type="xsd:string">IN</value>
        </item>
        <item>
         <key xsi:type="xsd:string">TYPE</key>
         <value xsi:type="xsd:string">FILE</value>
        </item>
        <item>
         <key xsi:type="xsd:string">LABEL</key>
         <value xsi:type="xsd:string"></value>
        </item>
       </attributes>
       <description xsi:type="xsd:string">input file 1</description>
       <inputFile xsi:type="xsd:boolean">true</inputFile>
       <label xsi:type="xsd:string"></label>
       <name xsi:type="xsd:string">-f1</name>
       <outputFile xsi:type="xsd:boolean">false</outputFile>
       <value
xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_t
est1.txt</value>
      </item>
      <item>
       <attributes xsi:type="ns3:Map"
xmlns:ns3="http://xml.apache.org/xml-soap">
        <item>
         <key xsi:type="xsd:string">MODE</key>
         <value xsi:type="xsd:string">IN</value>
        </item>
        <item>
         <key xsi:type="xsd:string">TYPE</key>
         <value xsi:type="xsd:string">FILE</value>
        </item>
        <item>
         <key xsi:type="xsd:string">LABEL</key>
         <value xsi:type="xsd:string"></value>
        </item>
       </attributes>
       <description xsi:type="xsd:string">input file 2</description>
       <inputFile xsi:type="xsd:boolean">true</inputFile>
       <label xsi:type="xsd:string"></label>
       <name xsi:type="xsd:string">-f2</name>
       <outputFile xsi:type="xsd:boolean">false</outputFile>
       <value
xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_t
est2.txt</value>
      </item>
     </parameterInfoArray>
     <resultFileName xsi:type="xsd:string" xsi:nil="true"/>
     <status xsi:type="xsd:string">Not Started</status>
     <taskID xsi:type="xsd:int">0</taskID>
     <userId xsi:type="xsd:string"></userId>
    </submitJobReturn>
   </ns1:submitJobResponse>
  </soapenv:Body>
</soapenv:Envelope>
==============


--
Brian Gilman <gilmanb@...>
Group Leader Medical & Population Genetics Dept.
MIT/Whitehead Inst. Center for Genome Research
One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
phone +1 617  252 1069 / fax +1 617 252 1902

------ End of Forwarded Message

#2701 From: Byrne Reese <breese@...>
Date: Thu Jun 12, 2003 3:13 pm
Subject: Re: FW: At my wits end.
byrnereese
Send Email Send Email
 
The method signature you provide is helpful, but without knowing
anything about the underlying data structures it is difficult to tell
you what you need to do. A custom serializer will certainly make things
easier for you, but I am not sure if you want to go into that level of
detail in your book. But who knows, maybe you do. :)

The SOAP::MIME stuff looks good...

As for constructing the ARRAY of objects, one can easily do that using
SOAP::Data objects as you have already indicated, but again, what does
the ParameterInfo and DataHandler objects "look like?"

On Wed, 2003-06-11 at 20:31, Brian Gilman wrote:
> Hello,
>
>     My name is Brian Gilman. I am currently writing a book on XML and
> BioInformatics for O'Reilly that includes a section on SOAP::Lite and
> Apache
> Axis toolkits.
>
>     I am also the Inventor of a BioInformatics Toolkit called
> OmniGene. This
> is a toolkit that exposes Bioinformatics services as web services. I
> am
> trying to write a simple Client for our analysis engine. The method
> signature in java is:
>
>      public JobInfo submitJob(int taskID, ParameterInfo[] parameters,
> DataHandler[] files);
>
>     This is serialized into the SOAP messages: request and response
> attached
> and shown below.
>
>     I have read through the perdoc/your book/ and a few hundred other
> resources and do not quite know how to write the code to talk to this
> service. I would like to put this into the book but cannot due to this
> roadblock.
>
>     Here is what I understand so far:
>
>     In order to do attachments I use SOAP::MIME. I wrote the following
> code
> to handle this (please forgive the really bad Perl coding as this is
> not my
> native tongue):
>
>     if(@Files){
>     foreach my $file (@Files){
>         my $fileCounter++;
>
>         my $ent = build MIME::Entity
>         Type => "text/plain",
>         Encoding => "binary",
>         Path => $file,
>         'Content-Id' =>'<File' . $fileCounter  . '>',
>         Disposition => "attachment";
>
>         push(@fileHolder, $ent);
>     }
>     }
>
>     I pass this to a SOAP::Lite object using the ->parts(@fileHolder)
> method.
>
>     Now here's where I get lost:
>
>     I need to construct an array of objects called ParameterInfo and
> pass
> them to my service. How do I do this in SOAP::Lite? I've looked into
> SOAP::Data objects and they look promising but, I'm not sure how to
> get the
> SOAP::Lite toolkit to encode these as a Java Map (well in this case
> Axis
> serialized Map?). Do I need to make my own serializer here?
>
>     I would really appreciate your help!
>
>                             Best,
>
>                                 Brian Gilman
>
>
>
>
> ==============
> Listen Port: 9090
> Target Host: localhost
> Target Port: 8080
> ==== Request ====
> POST /axis/servlet/AxisServlet HTTP/1.0
>
> Content-Type: multipart/related; type="text/xml";
> start="<97C2115D38FF77499E2CA04BB838E901>";
> boundary="----=_Part_0_7089827.1055376896680"
>
> Accept: application/soap+xml, application/dime, multipart/related,
> text/*
>
> User-Agent: Axis/1.1RC2
>
> Host: localhost
>
> Cache-Control: no-cache
>
> Pragma: no-cache
>
> SOAPAction: ""
>
> Content-Length: 3796
>
>
>
>
>
> ------=_Part_0_7089827.1055376896680
>
> Content-Type: text/xml; charset=UTF-8
>
> Content-Transfer-Encoding: binary
>
> Content-Id: <97C2115D38FF77499E2CA04BB838E901>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Body>
>   <ns1:submitJob
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns1="Analysis">
>    <arg0 xsi:type="xsd:int">0</arg0>
>    <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>     <item href="#id0"/>
>     <item href="#id1"/>
>    </arg1>
>    <arg2 href="#id2"/>
>   </ns1:submitJob>
>   <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns2:ParmInfo"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns2="Analysis">
>    <attributes href="#id3"/>
>    <description xsi:type="xsd:string">input file 1</description>
>    <inputFile xsi:type="xsd:boolean">true</inputFile>
>    <label xsi:type="xsd:string"></label>
>    <name xsi:type="xsd:string">-f1</name>
>    <outputFile xsi:type="xsd:boolean">false</outputFile>
>    <value xsi:type="xsd:string">test1.txt</value>
>   </multiRef>
>   <multiRef id="id2" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <item>
>     <key xsi:type="xsd:string">test1.txt</key>
>     <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
> xmlns:ns4="Analysis"/>
>    </item>
>    <item>
>     <key xsi:type="xsd:string">test2.txt</key>
>     <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
> xmlns:ns5="Analysis"/>
>    </item>
>   </multiRef>
>   <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <attributes href="#id4"/>
>    <description xsi:type="xsd:string">input file 2</description>
>    <inputFile xsi:type="xsd:boolean">true</inputFile>
>    <label xsi:type="xsd:string"></label>
>    <name xsi:type="xsd:string">-f2</name>
>    <outputFile xsi:type="xsd:boolean">false</outputFile>
>    <value xsi:type="xsd:string">test2.txt</value>
>   </multiRef>
>   <multiRef id="id3" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <item>
>     <key xsi:type="xsd:string">MODE</key>
>     <value xsi:type="xsd:string">IN</value>
>    </item>
>    <item>
>     <key xsi:type="xsd:string">TYPE</key>
>     <value xsi:type="xsd:string">FILE</value>
>    </item>
>   </multiRef>
>   <multiRef id="id4" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <item>
>     <key xsi:type="xsd:string">MODE</key>
>     <value xsi:type="xsd:string">IN</value>
>    </item>
>    <item>
>     <key xsi:type="xsd:string">TYPE</key>
>     <value xsi:type="xsd:string">FILE</value>
>    </item>
>   </multiRef>
> </soapenv:Body>
> </soapenv:Envelope>
>
> ------=_Part_0_7089827.1055376896680
>
> Content-Type: text/plain
>
> Content-Transfer-Encoding: binary
>
> Content-Id: <519D4713CAC92D0A55F7F849680F1D56>
>
>
>
> >Test1
> aaaaaaaaggggggtttttttttccccccc
>
>
> ------=_Part_0_7089827.1055376896680
>
> Content-Type: text/plain
>
> Content-Transfer-Encoding: binary
>
> Content-Id: <4D580598F9E5C89FA1FD17407BADABF5>
>
>
>
> >Test2
> aaaaaaaatttttttggggggggggggggggccccccccccc
>
>
> ------=_Part_0_7089827.1055376896680--
>
> ==== Response ====
> HTTP/1.1 200 OK
>
> Set-Cookie: JSESSIONID=DAA82FFC4487D346BC5FFF90B8278066; Path=/axis
>
> Content-Type: text/xml; charset=utf-8
>
> Date: Thu, 12 Jun 2003 00:14:58 GMT
>
> Server: Apache Coyote/1.0
>
> Connection: close
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Body>
>   <ns1:submitJobResponse
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns1="Analysis">
>    <submitJobReturn xsi:type="ns1:JobInfo">
>     <dateCompleted xsi:type="xsd:dateTime" xsi:nil="true"/>
>     <dateSubmitted
> xsi:type="xsd:dateTime">2003-06-12T00:14:57.876Z</dateSubmitted>
>     <inputFileName xsi:type="xsd:string"></inputFileName>
>     <jobNumber xsi:type="xsd:int">0</jobNumber>
>     <parameterInfo xsi:type="xsd:string"><?xml
> version="1.0"
> encoding="UTF-8"?>
>
> <ANALYSISPARAMETERS>
>   <PARAMETER name="-f1"
> value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
> rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_test1.txt&q
> uot;>
>     <DESCRIPTION>input file 1</DESCRIPTION>
>     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
>     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
>     <ATTRIBUTE
> key="LABEL"></ATTRIBUTE></PARAMETER>
>   <PARAMETER name="-f2"
> value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
> rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_test2.txt&q
> uot;>
>     <DESCRIPTION>input file 2</DESCRIPTION>
>     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
>     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
>     <ATTRIBUTE
> key="LABEL"></ATTRIBUTE></PARAMETER></ANALYSISPA
> RAMETERS>
> </parameterInfo>
>     <parameterInfoArray xsi:type="soapenc:Array"
> soapenc:arrayType="ns1:ParmInfo[2]"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>      <item>
>       <attributes xsi:type="ns2:Map"
> xmlns:ns2="http://xml.apache.org/xml-soap">
>        <item>
>         <key xsi:type="xsd:string">MODE</key>
>         <value xsi:type="xsd:string">IN</value>
>        </item>
>        <item>
>         <key xsi:type="xsd:string">TYPE</key>
>         <value xsi:type="xsd:string">FILE</value>
>        </item>
>        <item>
>         <key xsi:type="xsd:string">LABEL</key>
>         <value xsi:type="xsd:string"></value>
>        </item>
>       </attributes>
>       <description xsi:type="xsd:string">input file 1</description>
>       <inputFile xsi:type="xsd:boolean">true</inputFile>
>       <label xsi:type="xsd:string"></label>
>       <name xsi:type="xsd:string">-f1</name>
>       <outputFile xsi:type="xsd:boolean">false</outputFile>
>       <value
> xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
> ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_t
> est1.txt</value>
>      </item>
>      <item>
>       <attributes xsi:type="ns3:Map"
> xmlns:ns3="http://xml.apache.org/xml-soap">
>        <item>
>         <key xsi:type="xsd:string">MODE</key>
>         <value xsi:type="xsd:string">IN</value>
>        </item>
>        <item>
>         <key xsi:type="xsd:string">TYPE</key>
>         <value xsi:type="xsd:string">FILE</value>
>        </item>
>        <item>
>         <key xsi:type="xsd:string">LABEL</key>
>         <value xsi:type="xsd:string"></value>
>        </item>
>       </attributes>
>       <description xsi:type="xsd:string">input file 2</description>
>       <inputFile xsi:type="xsd:boolean">true</inputFile>
>       <label xsi:type="xsd:string"></label>
>       <name xsi:type="xsd:string">-f2</name>
>       <outputFile xsi:type="xsd:boolean">false</outputFile>
>       <value
> xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
> ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_t
> est2.txt</value>
>      </item>
>     </parameterInfoArray>
>     <resultFileName xsi:type="xsd:string" xsi:nil="true"/>
>     <status xsi:type="xsd:string">Not Started</status>
>     <taskID xsi:type="xsd:int">0</taskID>
>     <userId xsi:type="xsd:string"></userId>
>    </submitJobReturn>
>   </ns1:submitJobResponse>
> </soapenv:Body>
> </soapenv:Envelope>
> ==============
>
>
> --
> Brian Gilman <gilmanb@...>
> Group Leader Medical & Population Genetics Dept.
> MIT/Whitehead Inst. Center for Genome Research
> One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
> phone +1 617  252 1069 / fax +1 617 252 1902
>
> ------ End of Forwarded Message
>
>
>                         Yahoo! Groups Sponsor
>
>
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
Byrne Reese
Developer Program Manager
Grand Central Communications

#2702 From: Brian Gilman <gilmanb@...>
Date: Thu Jun 12, 2003 4:00 pm
Subject: Re: FW: At my wits end.
bshilzzle
Send Email Send Email
 
On 6/12/03 11:13 AM, "Byrne Reese" <breese@...> wrote:

Hey Byrne,

     I've gotten a lot farther this morning! I read an article at:

     http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread

     Which helped me understand how SOAP::Lite handles complex data
structures. But, I've hit two more walls:

     1) SOAP::Lite encodes arrays using it's own arrayType
         apache axis barfs on this

     2) Attachments don't work! or at least apache Axis dies when I try to
use them.

     As for your questions about DataHandler: It get's serialized into a SOAP
attachment

     Does it matter what ParameterInfo looks like in Java? Here's the SOAP
structure that I want to build with corresponding SOAP::Lite code:

<SOAP-ENV:Body><namesp1:submitJob xmlns:namesp1="Analysis"><name
xsi:type="xsd:int">0</name><parameters xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="xsd:ur-type[2]"><item><description
xsi:type="xsd:string">input1</description><inputFile
xsi:type="xsd:boolean">true</inputFile><label xsi:type="xsd:string"/><name
xsi:type="xsd:string">-f1</name><outputFile
xsi:type="xsd:boolean">false</outputFile><value
xsi:type="xsd:string">/Users/gilmanb/mysql.html</value></item><item><descrip
tion xsi:type="xsd:string">input1</description><inputFile
xsi:type="xsd:boolean">true</inputFile><label xsi:type="xsd:string"/><name
xsi:type="xsd:string">-f2</name><outputFile
xsi:type="xsd:boolean">false</outputFile><value
xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/build.xml</value>
</item></parameters></namesp1:submitJob></SOAP-ENV:Body>

Here's the SOAP::Lite code that generates this:

my $soap = SOAP::Lite
     ->uri("Analysis")
     ->on_action(sub {return "Analysis"})
     ->proxy("http://localhost:9090/axis/servlet/AxisServlet")
     #->parts([$ent1, $ent2])
     ->submitJob(SOAP::Data->name("name" => 0)
         ->type("xsd:int"),
           SOAP::Data->name("parameters" =>[

                            \SOAP::Data->value(SOAP::Data->name("description"
=> "input1"),
                                 SOAP::Data->name("inputFile" =>
"true")->type("xsd:boolean"),
                                 SOAP::Data->name("label" => ""),
                                 SOAP::Data->name("name" => "-f1"),
                                 SOAP::Data->name("outputFile" =>
"false")->type("xsd:boolean"),
                                 SOAP::Data->name("value" => $file1)),

                            \SOAP::Data->value(SOAP::Data->name("description"
=> "input1"),
                                 SOAP::Data->name("inputFile" =>
"true")->type("xsd:boolean"),
                                 SOAP::Data->name("label" => ""),
                                 SOAP::Data->name("name" => "-f2"),
                                 SOAP::Data->name("outputFile" =>
"false")->type("xsd:boolean"),
                                 SOAP::Data->name("value" => $file2))
                           ])


         );


Now here's what Apache Axis generates:

     I've cut and pasted this so that the superfluous stuff has been left
out.

       <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
     <item href="#id0"/>
     <item href="#id1"/>
    </arg1>
  <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:ParmInfo"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="Analysis">
    <attributes href="#id3"/>
    <description xsi:type="xsd:string">input file 1</description>
    <inputFile xsi:type="xsd:boolean">true</inputFile>
    <label xsi:type="xsd:string"></label>
    <name xsi:type="xsd:string">-f1</name>
    <outputFile xsi:type="xsd:boolean">false</outputFile>
    <value xsi:type="xsd:string">test1.txt</value>
   </multiRef>
   <multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <key xsi:type="xsd:string">test1.txt</key>
     <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
xmlns:ns4="Analysis"/>
    </item>
    <item>
     <key xsi:type="xsd:string">test2.txt</key>
     <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
xmlns:ns5="Analysis"/>
    </item>
   </multiRef>
   <multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <attributes href="#id4"/>
    <description xsi:type="xsd:string">input file 2</description>
    <inputFile xsi:type="xsd:boolean">true</inputFile>
    <label xsi:type="xsd:string"></label>
    <name xsi:type="xsd:string">-f2</name>
    <outputFile xsi:type="xsd:boolean">false</outputFile>
    <value xsi:type="xsd:string">test2.txt</value>
   </multiRef>
   <multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <key xsi:type="xsd:string">MODE</key>
     <value xsi:type="xsd:string">IN</value>
    </item>
    <item>
     <key xsi:type="xsd:string">TYPE</key>
     <value xsi:type="xsd:string">FILE</value>
    </item>
   </multiRef>
   <multiRef id="id4" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item>
     <key xsi:type="xsd:string">MODE</key>
     <value xsi:type="xsd:string">IN</value>
    </item>
    <item>
     <key xsi:type="xsd:string">TYPE</key>
     <value xsi:type="xsd:string">FILE</value>
    </item>
   </multiRef>



Now the problem is that SOAP::Lite has decided to use the following
arrayType attribute:

     SOAP-ENC:arrayType="xsd:ur-type[2]

     I need this:

     SOAP-ENC:arrayType"namesp1:ParmInfo[2]

     Apache seems to choke on the "xsd:ur-type[2]"

     I'm thinking that I need a custom serializer here but, I don't have a
clue where to start!

     Also, do you know if SOAP::Lite supports DIME? Or if there's a DIME
library I can use? If so, where can I find it?

     I've attached the ParameterInfo class per your request.

                 Thanks for the help!!

> The method signature you provide is helpful, but without knowing
> anything about the underlying data structures it is difficult to tell
> you what you need to do. A custom serializer will certainly make things
> easier for you, but I am not sure if you want to go into that level of
> detail in your book. But who knows, maybe you do. :)
>
> The SOAP::MIME stuff looks good...
>
> As for constructing the ARRAY of objects, one can easily do that using
> SOAP::Data objects as you have already indicated, but again, what does
> the ParameterInfo and DataHandler objects "look like?"
>
> On Wed, 2003-06-11 at 20:31, Brian Gilman wrote:
>> Hello,
>>
>>     My name is Brian Gilman. I am currently writing a book on XML and
>> BioInformatics for O'Reilly that includes a section on SOAP::Lite and
>> Apache
>> Axis toolkits.
>>
>>     I am also the Inventor of a BioInformatics Toolkit called
>> OmniGene. This
>> is a toolkit that exposes Bioinformatics services as web services. I
>> am
>> trying to write a simple Client for our analysis engine. The method
>> signature in java is:
>>
>>      public JobInfo submitJob(int taskID, ParameterInfo[] parameters,
>> DataHandler[] files);
>>
>>     This is serialized into the SOAP messages: request and response
>> attached
>> and shown below.
>>
>>     I have read through the perdoc/your book/ and a few hundred other
>> resources and do not quite know how to write the code to talk to this
>> service. I would like to put this into the book but cannot due to this
>> roadblock.
>>
>>     Here is what I understand so far:
>>
>>     In order to do attachments I use SOAP::MIME. I wrote the following
>> code
>> to handle this (please forgive the really bad Perl coding as this is
>> not my
>> native tongue):
>>
>>     if(@Files){
>>     foreach my $file (@Files){
>>         my $fileCounter++;
>>
>>         my $ent = build MIME::Entity
>>         Type => "text/plain",
>>         Encoding => "binary",
>>         Path => $file,
>>         'Content-Id' =>'<File' . $fileCounter  . '>',
>>         Disposition => "attachment";
>>
>>         push(@fileHolder, $ent);
>>     }
>>     }
>>
>>     I pass this to a SOAP::Lite object using the ->parts(@fileHolder)
>> method.
>>
>>     Now here's where I get lost:
>>
>>     I need to construct an array of objects called ParameterInfo and
>> pass
>> them to my service. How do I do this in SOAP::Lite? I've looked into
>> SOAP::Data objects and they look promising but, I'm not sure how to
>> get the
>> SOAP::Lite toolkit to encode these as a Java Map (well in this case
>> Axis
>> serialized Map?). Do I need to make my own serializer here?
>>
>>     I would really appreciate your help!
>>
>>                             Best,
>>
>>                                 Brian Gilman
>>
>>
>>
>>
>> ==============
>> Listen Port: 9090
>> Target Host: localhost
>> Target Port: 8080
>> ==== Request ====
>> POST /axis/servlet/AxisServlet HTTP/1.0
>>
>> Content-Type: multipart/related; type="text/xml";
>> start="<97C2115D38FF77499E2CA04BB838E901>";
>> boundary="----=_Part_0_7089827.1055376896680"
>>
>> Accept: application/soap+xml, application/dime, multipart/related,
>> text/*
>>
>> User-Agent: Axis/1.1RC2
>>
>> Host: localhost
>>
>> Cache-Control: no-cache
>>
>> Pragma: no-cache
>>
>> SOAPAction: ""
>>
>> Content-Length: 3796
>>
>>
>>
>>
>>
>> ------=_Part_0_7089827.1055376896680
>>
>> Content-Type: text/xml; charset=UTF-8
>>
>> Content-Transfer-Encoding: binary
>>
>> Content-Id: <97C2115D38FF77499E2CA04BB838E901>
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> <soapenv:Body>
>>   <ns1:submitJob
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:ns1="Analysis">
>>    <arg0 xsi:type="xsd:int">0</arg0>
>>    <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>>     <item href="#id0"/>
>>     <item href="#id1"/>
>>    </arg1>
>>    <arg2 href="#id2"/>
>>   </ns1:submitJob>
>>   <multiRef id="id0" soapenc:root="0"
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xsi:type="ns2:ParmInfo"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:ns2="Analysis">
>>    <attributes href="#id3"/>
>>    <description xsi:type="xsd:string">input file 1</description>
>>    <inputFile xsi:type="xsd:boolean">true</inputFile>
>>    <label xsi:type="xsd:string"></label>
>>    <name xsi:type="xsd:string">-f1</name>
>>    <outputFile xsi:type="xsd:boolean">false</outputFile>
>>    <value xsi:type="xsd:string">test1.txt</value>
>>   </multiRef>
>>   <multiRef id="id2" soapenc:root="0"
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>>    <item>
>>     <key xsi:type="xsd:string">test1.txt</key>
>>     <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
>> xmlns:ns4="Analysis"/>
>>    </item>
>>    <item>
>>     <key xsi:type="xsd:string">test2.txt</key>
>>     <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
>> xmlns:ns5="Analysis"/>
>>    </item>
>>   </multiRef>
>>   <multiRef id="id1" soapenc:root="0"
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>>    <attributes href="#id4"/>
>>    <description xsi:type="xsd:string">input file 2</description>
>>    <inputFile xsi:type="xsd:boolean">true</inputFile>
>>    <label xsi:type="xsd:string"></label>
>>    <name xsi:type="xsd:string">-f2</name>
>>    <outputFile xsi:type="xsd:boolean">false</outputFile>
>>    <value xsi:type="xsd:string">test2.txt</value>
>>   </multiRef>
>>   <multiRef id="id3" soapenc:root="0"
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>>    <item>
>>     <key xsi:type="xsd:string">MODE</key>
>>     <value xsi:type="xsd:string">IN</value>
>>    </item>
>>    <item>
>>     <key xsi:type="xsd:string">TYPE</key>
>>     <value xsi:type="xsd:string">FILE</value>
>>    </item>
>>   </multiRef>
>>   <multiRef id="id4" soapenc:root="0"
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>>    <item>
>>     <key xsi:type="xsd:string">MODE</key>
>>     <value xsi:type="xsd:string">IN</value>
>>    </item>
>>    <item>
>>     <key xsi:type="xsd:string">TYPE</key>
>>     <value xsi:type="xsd:string">FILE</value>
>>    </item>
>>   </multiRef>
>> </soapenv:Body>
>> </soapenv:Envelope>
>>
>> ------=_Part_0_7089827.1055376896680
>>
>> Content-Type: text/plain
>>
>> Content-Transfer-Encoding: binary
>>
>> Content-Id: <519D4713CAC92D0A55F7F849680F1D56>
>>
>>
>>
>>> Test1
>> aaaaaaaaggggggtttttttttccccccc
>>
>>
>> ------=_Part_0_7089827.1055376896680
>>
>> Content-Type: text/plain
>>
>> Content-Transfer-Encoding: binary
>>
>> Content-Id: <4D580598F9E5C89FA1FD17407BADABF5>
>>
>>
>>
>>> Test2
>> aaaaaaaatttttttggggggggggggggggccccccccccc
>>
>>
>> ------=_Part_0_7089827.1055376896680--
>>
>> ==== Response ====
>> HTTP/1.1 200 OK
>>
>> Set-Cookie: JSESSIONID=DAA82FFC4487D346BC5FFF90B8278066; Path=/axis
>>
>> Content-Type: text/xml; charset=utf-8
>>
>> Date: Thu, 12 Jun 2003 00:14:58 GMT
>>
>> Server: Apache Coyote/1.0
>>
>> Connection: close
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>> <soapenv:Body>
>>   <ns1:submitJobResponse
>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:ns1="Analysis">
>>    <submitJobReturn xsi:type="ns1:JobInfo">
>>     <dateCompleted xsi:type="xsd:dateTime" xsi:nil="true"/>
>>     <dateSubmitted
>> xsi:type="xsd:dateTime">2003-06-12T00:14:57.876Z</dateSubmitted>
>>     <inputFileName xsi:type="xsd:string"></inputFileName>
>>     <jobNumber xsi:type="xsd:int">0</jobNumber>
>>     <parameterInfo xsi:type="xsd:string"><?xml
>> version="1.0"
>> encoding="UTF-8"?>
>>
>> <ANALYSISPARAMETERS>
>>   <PARAMETER name="-f1"
>> value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
>> rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_test1.txt&q
>> uot;>
>>     <DESCRIPTION>input file 1</DESCRIPTION>
>>     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
>>     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
>>     <ATTRIBUTE
>> key="LABEL"></ATTRIBUTE></PARAMETER>
>>   <PARAMETER name="-f2"
>> value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
>> rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_test2.txt&q
>> uot;>
>>     <DESCRIPTION>input file 2</DESCRIPTION>
>>     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
>>     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
>>     <ATTRIBUTE
>> key="LABEL"></ATTRIBUTE></PARAMETER></ANALYSISPA
>> RAMETERS>
>> </parameterInfo>
>>     <parameterInfoArray xsi:type="soapenc:Array"
>> soapenc:arrayType="ns1:ParmInfo[2]"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>>      <item>
>>       <attributes xsi:type="ns2:Map"
>> xmlns:ns2="http://xml.apache.org/xml-soap">
>>        <item>
>>         <key xsi:type="xsd:string">MODE</key>
>>         <value xsi:type="xsd:string">IN</value>
>>        </item>
>>        <item>
>>         <key xsi:type="xsd:string">TYPE</key>
>>         <value xsi:type="xsd:string">FILE</value>
>>        </item>
>>        <item>
>>         <key xsi:type="xsd:string">LABEL</key>
>>         <value xsi:type="xsd:string"></value>
>>        </item>
>>       </attributes>
>>       <description xsi:type="xsd:string">input file 1</description>
>>       <inputFile xsi:type="xsd:boolean">true</inputFile>
>>       <label xsi:type="xsd:string"></label>
>>       <name xsi:type="xsd:string">-f1</name>
>>       <outputFile xsi:type="xsd:boolean">false</outputFile>
>>       <value
>> xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
>> ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_t
>> est1.txt</value>
>>      </item>
>>      <item>
>>       <attributes xsi:type="ns3:Map"
>> xmlns:ns3="http://xml.apache.org/xml-soap">
>>        <item>
>>         <key xsi:type="xsd:string">MODE</key>
>>         <value xsi:type="xsd:string">IN</value>
>>        </item>
>>        <item>
>>         <key xsi:type="xsd:string">TYPE</key>
>>         <value xsi:type="xsd:string">FILE</value>
>>        </item>
>>        <item>
>>         <key xsi:type="xsd:string">LABEL</key>
>>         <value xsi:type="xsd:string"></value>
>>        </item>
>>       </attributes>
>>       <description xsi:type="xsd:string">input file 2</description>
>>       <inputFile xsi:type="xsd:boolean">true</inputFile>
>>       <label xsi:type="xsd:string"></label>
>>       <name xsi:type="xsd:string">-f2</name>
>>       <outputFile xsi:type="xsd:boolean">false</outputFile>
>>       <value
>> xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
>> ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_t
>> est2.txt</value>
>>      </item>
>>     </parameterInfoArray>
>>     <resultFileName xsi:type="xsd:string" xsi:nil="true"/>
>>     <status xsi:type="xsd:string">Not Started</status>
>>     <taskID xsi:type="xsd:int">0</taskID>
>>     <userId xsi:type="xsd:string"></userId>
>>    </submitJobReturn>
>>   </ns1:submitJobResponse>
>> </soapenv:Body>
>> </soapenv:Envelope>
>> ==============
>>
>>
>> --
>> Brian Gilman <gilmanb@...>
>> Group Leader Medical & Population Genetics Dept.
>> MIT/Whitehead Inst. Center for Genome Research
>> One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
>> phone +1 617  252 1069 / fax +1 617 252 1902
>>
>> ------ End of Forwarded Message
>>
>>
>>                         Yahoo! Groups Sponsor
>>
>>
>>
>> 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.

--
Brian Gilman <gilmanb@...>
Group Leader Medical & Population Genetics Dept.
MIT/Whitehead Inst. Center for Genome Research
One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
phone +1 617  252 1069 / fax +1 617 252 1902

#2703 From: Byrne Reese <breese@...>
Date: Thu Jun 12, 2003 4:14 pm
Subject: Re: FW: At my wits end.
byrnereese
Send Email Send Email
 
On Thu, 2003-06-12 at 09:00, Brian Gilman wrote:
>     I've gotten a lot farther this morning! I read an article at:
>
>     http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread

I love it when people read articles I write. :)

>     Which helped me understand how SOAP::Lite handles complex data
> structures. But, I've hit two more walls:
>
>     1) SOAP::Lite encodes arrays using it's own arrayType
>         apache axis barfs on this

Yes - it does, you have to either write your own serializer, or manually
build the SOAP::Data structure. I have attached a server-side stub of
the WS-I Supplier Interop Demo written in Perl - it only implements two
methods, but it does show how to compose arrays of complex types that
Axis can understand. <attached file: ISupplier.pm>

>
>     2) Attachments don't work! or at least apache Axis dies when I try to
> use them.

Correct - you will need to download and install MIME::tools version
6.106 alpha. Then you will need to enter the following code into your
script:

BEGIN {
   $MIME::Entity::BOUNDARY_DELIMITER = "\r\n";
}

That will fix the SOAP::Lite and Axis MIME interop bug. Soon this will
be fixed in a new version of SOAP::Lite...

>
>     As for your questions about DataHandler: It get's serialized into a SOAP
> attachment
>
>     Does it matter what ParameterInfo looks like in Java? Here's the SOAP
> structure that I want to build with corresponding SOAP::Lite code:

Try looking at my ISupplier.pm sample code and see if that helps... if
not, let me know and we can go from there.

> <SOAP-ENV:Body><namesp1:submitJob xmlns:namesp1="Analysis"><name
> xsi:type="xsd:int">0</name><parameters xsi:type="SOAP-ENC:Array"
> SOAP-ENC:arrayType="xsd:ur-type[2]"><item><description
> xsi:type="xsd:string">input1</description><inputFile
> xsi:type="xsd:boolean">true</inputFile><label xsi:type="xsd:string"/><name
> xsi:type="xsd:string">-f1</name><outputFile
> xsi:type="xsd:boolean">false</outputFile><value
> xsi:type="xsd:string">/Users/gilmanb/mysql.html</value></item><item><descrip
> tion xsi:type="xsd:string">input1</description><inputFile
> xsi:type="xsd:boolean">true</inputFile><label xsi:type="xsd:string"/><name
> xsi:type="xsd:string">-f2</name><outputFile
> xsi:type="xsd:boolean">false</outputFile><value
> xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/build.xml</value>
> </item></parameters></namesp1:submitJob></SOAP-ENV:Body>
>
> Here's the SOAP::Lite code that generates this:
>
> my $soap = SOAP::Lite
>     ->uri("Analysis")
>     ->on_action(sub {return "Analysis"})
>     ->proxy("http://localhost:9090/axis/servlet/AxisServlet")
>     #->parts([$ent1, $ent2])
>     ->submitJob(SOAP::Data->name("name" => 0)
>         ->type("xsd:int"),
>           SOAP::Data->name("parameters" =>[
>
>                            \SOAP::Data->value(SOAP::Data->name("description"
> => "input1"),
>                                 SOAP::Data->name("inputFile" =>
> "true")->type("xsd:boolean"),
>                                 SOAP::Data->name("label" => ""),
>                                 SOAP::Data->name("name" => "-f1"),
>                                 SOAP::Data->name("outputFile" =>
> "false")->type("xsd:boolean"),
>                                 SOAP::Data->name("value" => $file1)),
>
>                            \SOAP::Data->value(SOAP::Data->name("description"
> => "input1"),
>                                 SOAP::Data->name("inputFile" =>
> "true")->type("xsd:boolean"),
>                                 SOAP::Data->name("label" => ""),
>                                 SOAP::Data->name("name" => "-f2"),
>                                 SOAP::Data->name("outputFile" =>
> "false")->type("xsd:boolean"),
>                                 SOAP::Data->name("value" => $file2))
>                           ])
>
>
>         );
>
>
> Now here's what Apache Axis generates:
>
>     I've cut and pasted this so that the superfluous stuff has been left
> out.
>
>       <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>     <item href="#id0"/>
>     <item href="#id1"/>
>    </arg1>
>  <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns2:ParmInfo"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns2="Analysis">
>    <attributes href="#id3"/>
>    <description xsi:type="xsd:string">input file 1</description>
>    <inputFile xsi:type="xsd:boolean">true</inputFile>
>    <label xsi:type="xsd:string"></label>
>    <name xsi:type="xsd:string">-f1</name>
>    <outputFile xsi:type="xsd:boolean">false</outputFile>
>    <value xsi:type="xsd:string">test1.txt</value>
>   </multiRef>
>   <multiRef id="id2" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <item>
>     <key xsi:type="xsd:string">test1.txt</key>
>     <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
> xmlns:ns4="Analysis"/>
>    </item>
>    <item>
>     <key xsi:type="xsd:string">test2.txt</key>
>     <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
> xmlns:ns5="Analysis"/>
>    </item>
>   </multiRef>
>   <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <attributes href="#id4"/>
>    <description xsi:type="xsd:string">input file 2</description>
>    <inputFile xsi:type="xsd:boolean">true</inputFile>
>    <label xsi:type="xsd:string"></label>
>    <name xsi:type="xsd:string">-f2</name>
>    <outputFile xsi:type="xsd:boolean">false</outputFile>
>    <value xsi:type="xsd:string">test2.txt</value>
>   </multiRef>
>   <multiRef id="id3" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <item>
>     <key xsi:type="xsd:string">MODE</key>
>     <value xsi:type="xsd:string">IN</value>
>    </item>
>    <item>
>     <key xsi:type="xsd:string">TYPE</key>
>     <value xsi:type="xsd:string">FILE</value>
>    </item>
>   </multiRef>
>   <multiRef id="id4" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>    <item>
>     <key xsi:type="xsd:string">MODE</key>
>     <value xsi:type="xsd:string">IN</value>
>    </item>
>    <item>
>     <key xsi:type="xsd:string">TYPE</key>
>     <value xsi:type="xsd:string">FILE</value>
>    </item>
>   </multiRef>
>
>
>
> Now the problem is that SOAP::Lite has decided to use the following
> arrayType attribute:
>
>     SOAP-ENC:arrayType="xsd:ur-type[2]
>
>     I need this:
>
>     SOAP-ENC:arrayType"namesp1:ParmInfo[2]
>
>     Apache seems to choke on the "xsd:ur-type[2]"
>
>     I'm thinking that I need a custom serializer here but, I don't have a
> clue where to start!
>
>     Also, do you know if SOAP::Lite supports DIME? Or if there's a DIME
> library I can use? If so, where can I find it?
>
>     I've attached the ParameterInfo class per your request.
>
>                 Thanks for the help!!
>
> > The method signature you provide is helpful, but without knowing
> > anything about the underlying data structures it is difficult to tell
> > you what you need to do. A custom serializer will certainly make things
> > easier for you, but I am not sure if you want to go into that level of
> > detail in your book. But who knows, maybe you do. :)
> >
> > The SOAP::MIME stuff looks good...
> >
> > As for constructing the ARRAY of objects, one can easily do that using
> > SOAP::Data objects as you have already indicated, but again, what does
> > the ParameterInfo and DataHandler objects "look like?"
> >
> > On Wed, 2003-06-11 at 20:31, Brian Gilman wrote:
> >> Hello,
> >>
> >>     My name is Brian Gilman. I am currently writing a book on XML and
> >> BioInformatics for O'Reilly that includes a section on SOAP::Lite and
> >> Apache
> >> Axis toolkits.
> >>
> >>     I am also the Inventor of a BioInformatics Toolkit called
> >> OmniGene. This
> >> is a toolkit that exposes Bioinformatics services as web services. I
> >> am
> >> trying to write a simple Client for our analysis engine. The method
> >> signature in java is:
> >>
> >>      public JobInfo submitJob(int taskID, ParameterInfo[] parameters,
> >> DataHandler[] files);
> >>
> >>     This is serialized into the SOAP messages: request and response
> >> attached
> >> and shown below.
> >>
> >>     I have read through the perdoc/your book/ and a few hundred other
> >> resources and do not quite know how to write the code to talk to this
> >> service. I would like to put this into the book but cannot due to this
> >> roadblock.
> >>
> >>     Here is what I understand so far:
> >>
> >>     In order to do attachments I use SOAP::MIME. I wrote the following
> >> code
> >> to handle this (please forgive the really bad Perl coding as this is
> >> not my
> >> native tongue):
> >>
> >>     if(@Files){
> >>     foreach my $file (@Files){
> >>         my $fileCounter++;
> >>
> >>         my $ent = build MIME::Entity
> >>         Type => "text/plain",
> >>         Encoding => "binary",
> >>         Path => $file,
> >>         'Content-Id' =>'<File' . $fileCounter  . '>',
> >>         Disposition => "attachment";
> >>
> >>         push(@fileHolder, $ent);
> >>     }
> >>     }
> >>
> >>     I pass this to a SOAP::Lite object using the ->parts(@fileHolder)
> >> method.
> >>
> >>     Now here's where I get lost:
> >>
> >>     I need to construct an array of objects called ParameterInfo and
> >> pass
> >> them to my service. How do I do this in SOAP::Lite? I've looked into
> >> SOAP::Data objects and they look promising but, I'm not sure how to
> >> get the
> >> SOAP::Lite toolkit to encode these as a Java Map (well in this case
> >> Axis
> >> serialized Map?). Do I need to make my own serializer here?
> >>
> >>     I would really appreciate your help!
> >>
> >>                             Best,
> >>
> >>                                 Brian Gilman
> >>
> >>
> >>
> >>
> >> ==============
> >> Listen Port: 9090
> >> Target Host: localhost
> >> Target Port: 8080
> >> ==== Request ====
> >> POST /axis/servlet/AxisServlet HTTP/1.0
> >>
> >> Content-Type: multipart/related; type="text/xml";
> >> start="<97C2115D38FF77499E2CA04BB838E901>";
> >> boundary="----=_Part_0_7089827.1055376896680"
> >>
> >> Accept: application/soap+xml, application/dime, multipart/related,
> >> text/*
> >>
> >> User-Agent: Axis/1.1RC2
> >>
> >> Host: localhost
> >>
> >> Cache-Control: no-cache
> >>
> >> Pragma: no-cache
> >>
> >> SOAPAction: ""
> >>
> >> Content-Length: 3796
> >>
> >>
> >>
> >>
> >>
> >> ------=_Part_0_7089827.1055376896680
> >>
> >> Content-Type: text/xml; charset=UTF-8
> >>
> >> Content-Transfer-Encoding: binary
> >>
> >> Content-Id: <97C2115D38FF77499E2CA04BB838E901>
> >>
> >>
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <soapenv:Envelope
> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> >> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >> <soapenv:Body>
> >>   <ns1:submitJob
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xmlns:ns1="Analysis">
> >>    <arg0 xsi:type="xsd:int">0</arg0>
> >>    <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> >>     <item href="#id0"/>
> >>     <item href="#id1"/>
> >>    </arg1>
> >>    <arg2 href="#id2"/>
> >>   </ns1:submitJob>
> >>   <multiRef id="id0" soapenc:root="0"
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xsi:type="ns2:ParmInfo"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >> xmlns:ns2="Analysis">
> >>    <attributes href="#id3"/>
> >>    <description xsi:type="xsd:string">input file 1</description>
> >>    <inputFile xsi:type="xsd:boolean">true</inputFile>
> >>    <label xsi:type="xsd:string"></label>
> >>    <name xsi:type="xsd:string">-f1</name>
> >>    <outputFile xsi:type="xsd:boolean">false</outputFile>
> >>    <value xsi:type="xsd:string">test1.txt</value>
> >>   </multiRef>
> >>   <multiRef id="id2" soapenc:root="0"
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> >>    <item>
> >>     <key xsi:type="xsd:string">test1.txt</key>
> >>     <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
> >> xmlns:ns4="Analysis"/>
> >>    </item>
> >>    <item>
> >>     <key xsi:type="xsd:string">test2.txt</key>
> >>     <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
> >> xmlns:ns5="Analysis"/>
> >>    </item>
> >>   </multiRef>
> >>   <multiRef id="id1" soapenc:root="0"
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> >>    <attributes href="#id4"/>
> >>    <description xsi:type="xsd:string">input file 2</description>
> >>    <inputFile xsi:type="xsd:boolean">true</inputFile>
> >>    <label xsi:type="xsd:string"></label>
> >>    <name xsi:type="xsd:string">-f2</name>
> >>    <outputFile xsi:type="xsd:boolean">false</outputFile>
> >>    <value xsi:type="xsd:string">test2.txt</value>
> >>   </multiRef>
> >>   <multiRef id="id3" soapenc:root="0"
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> >>    <item>
> >>     <key xsi:type="xsd:string">MODE</key>
> >>     <value xsi:type="xsd:string">IN</value>
> >>    </item>
> >>    <item>
> >>     <key xsi:type="xsd:string">TYPE</key>
> >>     <value xsi:type="xsd:string">FILE</value>
> >>    </item>
> >>   </multiRef>
> >>   <multiRef id="id4" soapenc:root="0"
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> >>    <item>
> >>     <key xsi:type="xsd:string">MODE</key>
> >>     <value xsi:type="xsd:string">IN</value>
> >>    </item>
> >>    <item>
> >>     <key xsi:type="xsd:string">TYPE</key>
> >>     <value xsi:type="xsd:string">FILE</value>
> >>    </item>
> >>   </multiRef>
> >> </soapenv:Body>
> >> </soapenv:Envelope>
> >>
> >> ------=_Part_0_7089827.1055376896680
> >>
> >> Content-Type: text/plain
> >>
> >> Content-Transfer-Encoding: binary
> >>
> >> Content-Id: <519D4713CAC92D0A55F7F849680F1D56>
> >>
> >>
> >>
> >>> Test1
> >> aaaaaaaaggggggtttttttttccccccc
> >>
> >>
> >> ------=_Part_0_7089827.1055376896680
> >>
> >> Content-Type: text/plain
> >>
> >> Content-Transfer-Encoding: binary
> >>
> >> Content-Id: <4D580598F9E5C89FA1FD17407BADABF5>
> >>
> >>
> >>
> >>> Test2
> >> aaaaaaaatttttttggggggggggggggggccccccccccc
> >>
> >>
> >> ------=_Part_0_7089827.1055376896680--
> >>
> >> ==== Response ====
> >> HTTP/1.1 200 OK
> >>
> >> Set-Cookie: JSESSIONID=DAA82FFC4487D346BC5FFF90B8278066; Path=/axis
> >>
> >> Content-Type: text/xml; charset=utf-8
> >>
> >> Date: Thu, 12 Jun 2003 00:14:58 GMT
> >>
> >> Server: Apache Coyote/1.0
> >>
> >> Connection: close
> >>
> >>
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <soapenv:Envelope
> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> >> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >> <soapenv:Body>
> >>   <ns1:submitJobResponse
> >> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> xmlns:ns1="Analysis">
> >>    <submitJobReturn xsi:type="ns1:JobInfo">
> >>     <dateCompleted xsi:type="xsd:dateTime" xsi:nil="true"/>
> >>     <dateSubmitted
> >> xsi:type="xsd:dateTime">2003-06-12T00:14:57.876Z</dateSubmitted>
> >>     <inputFileName xsi:type="xsd:string"></inputFileName>
> >>     <jobNumber xsi:type="xsd:int">0</jobNumber>
> >>     <parameterInfo xsi:type="xsd:string"><?xml
> >> version="1.0"
> >> encoding="UTF-8"?>
> >>
> >> <ANALYSISPARAMETERS>
> >>   <PARAMETER name="-f1"
> >>
value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
> >>
rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_test1.txt&q
> >> uot;>
> >>     <DESCRIPTION>input file 1</DESCRIPTION>
> >>     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
> >>     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
> >>     <ATTRIBUTE
> >> key="LABEL"></ATTRIBUTE></PARAMETER>
> >>   <PARAMETER name="-f2"
> >>
value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
> >>
rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_test2.txt&q
> >> uot;>
> >>     <DESCRIPTION>input file 2</DESCRIPTION>
> >>     <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
> >>     <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
> >>     <ATTRIBUTE
> >>
key="LABEL"></ATTRIBUTE></PARAMETER></ANALYSISPA
> >> RAMETERS>
> >> </parameterInfo>
> >>     <parameterInfoArray xsi:type="soapenc:Array"
> >> soapenc:arrayType="ns1:ParmInfo[2]"
> >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> >>      <item>
> >>       <attributes xsi:type="ns2:Map"
> >> xmlns:ns2="http://xml.apache.org/xml-soap">
> >>        <item>
> >>         <key xsi:type="xsd:string">MODE</key>
> >>         <value xsi:type="xsd:string">IN</value>
> >>        </item>
> >>        <item>
> >>         <key xsi:type="xsd:string">TYPE</key>
> >>         <value xsi:type="xsd:string">FILE</value>
> >>        </item>
> >>        <item>
> >>         <key xsi:type="xsd:string">LABEL</key>
> >>         <value xsi:type="xsd:string"></value>
> >>        </item>
> >>       </attributes>
> >>       <description xsi:type="xsd:string">input file 1</description>
> >>       <inputFile xsi:type="xsd:boolean">true</inputFile>
> >>       <label xsi:type="xsd:string"></label>
> >>       <name xsi:type="xsd:string">-f1</name>
> >>       <outputFile xsi:type="xsd:boolean">false</outputFile>
> >>       <value
> >>
xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
> >>
ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_t
> >> est1.txt</value>
> >>      </item>
> >>      <item>
> >>       <attributes xsi:type="ns3:Map"
> >> xmlns:ns3="http://xml.apache.org/xml-soap">
> >>        <item>
> >>         <key xsi:type="xsd:string">MODE</key>
> >>         <value xsi:type="xsd:string">IN</value>
> >>        </item>
> >>        <item>
> >>         <key xsi:type="xsd:string">TYPE</key>
> >>         <value xsi:type="xsd:string">FILE</value>
> >>        </item>
> >>        <item>
> >>         <key xsi:type="xsd:string">LABEL</key>
> >>         <value xsi:type="xsd:string"></value>
> >>        </item>
> >>       </attributes>
> >>       <description xsi:type="xsd:string">input file 2</description>
> >>       <inputFile xsi:type="xsd:boolean">true</inputFile>
> >>       <label xsi:type="xsd:string"></label>
> >>       <name xsi:type="xsd:string">-f2</name>
> >>       <outputFile xsi:type="xsd:boolean">false</outputFile>
> >>       <value
> >>
xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
> >>
ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_t
> >> est2.txt</value>
> >>      </item>
> >>     </parameterInfoArray>
> >>     <resultFileName xsi:type="xsd:string" xsi:nil="true"/>
> >>     <status xsi:type="xsd:string">Not Started</status>
> >>     <taskID xsi:type="xsd:int">0</taskID>
> >>     <userId xsi:type="xsd:string"></userId>
> >>    </submitJobReturn>
> >>   </ns1:submitJobResponse>
> >> </soapenv:Body>
> >> </soapenv:Envelope>
> >> ==============
> >>
> >>
> >> --
> >> Brian Gilman <gilmanb@...>
> >> Group Leader Medical & Population Genetics Dept.
> >> MIT/Whitehead Inst. Center for Genome Research
> >> One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
> >> phone +1 617  252 1069 / fax +1 617 252 1902
> >>
> >> ------ End of Forwarded Message
> >>
> >>
> >>                         Yahoo! Groups Sponsor
> >>
> >>
> >>
> >> To unsubscribe from this group, send an email to:
> >> soaplite-unsubscribe@yahoogroups.com
> >>
> >>
> >>
> >> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
Byrne Reese <breese@...>
Grand Central Communications

#2705 From: Alasdair Allan <aa@...>
Date: Fri Jun 13, 2003 2:28 pm
Subject: OSCON'03 Web Services, Perl and SOAP::Lite BOF
dr_aallan
Send Email Send Email
 
All,

We just had our BOF accepted, details as follows...

   Title: Web Services, Perl and SOAP::Lite
   Start time: 7:00pm
   End time: 8:00pm
   Date: Wednesday, July 09
   Venue: Portland Marriott Downtown
   Location/Room: Salon D

Suggestions, and volunteers to talk abotu stuff to me soon(ish) please.

Cheers,
Al.

Messages 2675 - 2705 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