473,813 Members | 4,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl client to AXIS2 with arrays

1 New Member
Hi,

I set up an Axis POJO service and perl cient using SOAP::Lite.
I am able to receive all simple types of return values (String, int, etc.) and also arrays (String[] in the POJO service).
The trouble begins when I try to pass a perl array from the client to the server.
I am not able to receieve it as String[] , only as parameters to a method, which means I need to know the size of the array I am sending which may vary.

Some code ...
Server (AXIS2 POJO):
Expand|Select|Wrap|Line Numbers
  1. package samples.myquickstart.service.pojo;
  2.  
  3. import java.util.HashMap;
  4. import java.util.Date;
  5. import java.lang.reflect.Array;
  6.  
  7. public class GetStuffService {
  8. ...
  9.     public double getDouble() {
  10.          return 100.00;
  11.     }
  12.     public int getInt() {
  13.          return 100;
  14.     }
  15.     public String getStringTest() {
  16.          return "test";
  17.     }
  18.  
  19.     public String getHello(String name) {
  20.          return "Hello,"+name;
  21.     }
  22.  
  23.     public String[] getArray () {
  24.         return string_array;
  25.     }
  26.  
  27.     // Does not work
  28.     public String[] setArray (String[] str_array) {
  29.         string_array = str_array;
  30.         return string_array;
  31.     }
  32.  
  33.     // Does not work, tried also without "toString"
  34.     public String setArray1 (Array str_array) {
  35.         //string_array1 = str_array;
  36.         //return string_array1;
  37.         return str_array.toString();
  38.     }
  39.  
  40.     // This works , but then I am limited to array of size 3
  41.     public String[] setArray2 (String str0, String str1, String str2) {
  42.         string_array[0] = str0;
  43.         string_array[1] = str1;
  44.         string_array[2] = str2;
  45.         return string_array;
  46.     }
  47.  
  48.  
  49. }
  50.  
Client (Perl with SOAP::Lite) :
Expand|Select|Wrap|Line Numbers
  1. use SOAP::Lite;
  2. use perl_axis_client;
  3.  
  4.  
  5. my $service = "GetStuffService";
  6. my $namespace = "http://myquickstart.samples/xsd";
  7. my $proxy = getAxisConnection($service,$namespace);
  8.  
  9. ...
  10. my $str = $proxy->getStringTest();  
  11. if (callSuccess($str)) {
  12.     print $str->result."\n";             
  13. }
  14.  
  15. my $int = $proxy->getInt();
  16. if (callSuccess($int)) {
  17.     print $int->result."\n";
  18. }
  19.  ...
  20. my @test_array = ("Testingx","withx","newx","xxx");
  21. my $hello = $proxy->setArray1(@test_array);
  22. if (callSuccess($hello)) {
  23.     print "Get array1:".$hello->result."\n";
  24.     @res = $hello->paramsout;
  25.     #print "Res array size:".$#res."\n";
  26.     print "Res array1:@res\n";
  27. }
  28.  
  29. @test_array = ("Testingy","withy","newy","yyy");
  30. my $hello = $proxy->setArray2(@test_array);
  31. if (callSuccess($hello)) {
  32.     print "Get array2:".$hello->result."\n";
  33.     @res = $hello->paramsout;
  34.     #print "Res array size:".$#res."\n";
  35.     print "Res array2:@res\n";
  36. }
  37.  
Thanks,
Rinat
Jan 14 '09 #1
1 3462
KevinADC
4,059 Recognized Expert Specialist
To me it looks like the problem is in the java(?) code. I don't know java, so I can only suggest you ask on a Java forum how to stringify your array properly.
Jan 14 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5774
by: John Smith | last post by:
Can someone point me to an example of how to implement and access the kind of object shown below? Most of the examples if found are an object that contains one other object. I need to create an object that contains a hash of sub-objects each sub-object is made up of a number of different objects and an array of an object type. Object1 contains scalars
0
3010
by: Vsevolod (Simon) Ilyushchenko | last post by:
Hi, I have succesfully connected from a dotnet client on Windows to a Perl service and was able to send basic data types and arrays back to Windows. However, I tried sending a two-dimensional array, and something went wrong. This is how I define the service in the client proxy:
2
15996
by: kelly | last post by:
Hi, I don't have a code to show you, what I need are references or algorithms so that I'm in a right track. By the way, thanks for introducing me the array or arrays. Now I can continue my script. Now I want to delete a line from a file. Line being the strings I got/saved to/from array of arrays.
6
2818
by: Vinit | last post by:
Hi I am passing an arraylist to a c#/.net webmethod from a perl client using soap:lite. The trace shows the elements in the xml request. The arraylist input in the webmethod however does not contain any values and is empty. It works fine with arrays....but NOT arraylists....does anyone know WHY? and HOW TO SOLVE THIS ISSUE? Regards,
1
2423
by: zaheermabbas | last post by:
Hello All, I have been following the release documentation of axis, i wanted the axis2.war by building the sources, i have downloaded the source, and as it is specified in the doc to build the sources through maven. I am running on Maven2.0.4 but my Build process is failing because of the following reason, *********************************************************************************************** + Error stacktraces are turned on. ...
2
2965
by: Paul BE | last post by:
Hi, Can someone point me to a C# sample which calls an Axis2 XML Web Service? Thanks !
1
2254
by: popemonica | last post by:
Hi Everybody! I´m trying to use a webservice made with axis2 from VB6. I have severals methods in the service. One of them doesn´t recive parameters when I invoke it and the result of the calling is ok, but when I invoke a method with one parameter I recive the following error: "Unexpected Subelement". I´m using Microsoft SOAP Toolkit 3.0 for calling the service. This is the code that I use: Dim clnt As New SoapClient30 Dim...
1
2292
by: dwilcoxen | last post by:
I am looking for an example of how to connect from a .Net Windows client to an Axis (Java) web service, and upload a binary file to it using SOAP with attachments, or MTOM, or whatever works. If anyone's done this or found a good reference please point me the right way. Thanks.
0
1513
by: Michael Janulaitis | last post by:
I created a simple hello world web service that works great with a .Net client, however; I am not able to access the service from a Java Axis2 client. I get the following error: The input stream for an incoming message is null
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10420
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9221
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.