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): -
package samples.myquickstart.service.pojo;
-
-
import java.util.HashMap;
-
import java.util.Date;
-
import java.lang.reflect.Array;
-
-
public class GetStuffService {
-
...
-
public double getDouble() {
-
return 100.00;
-
}
-
public int getInt() {
-
return 100;
-
}
-
public String getStringTest() {
-
return "test";
-
}
-
-
public String getHello(String name) {
-
return "Hello,"+name;
-
}
-
-
public String[] getArray () {
-
return string_array;
-
}
-
-
// Does not work
-
public String[] setArray (String[] str_array) {
-
string_array = str_array;
-
return string_array;
-
}
-
-
// Does not work, tried also without "toString"
-
public String setArray1 (Array str_array) {
-
//string_array1 = str_array;
-
//return string_array1;
-
return str_array.toString();
-
}
-
-
// This works , but then I am limited to array of size 3
-
public String[] setArray2 (String str0, String str1, String str2) {
-
string_array[0] = str0;
-
string_array[1] = str1;
-
string_array[2] = str2;
-
return string_array;
-
}
-
-
-
}
-
Client (Perl with SOAP::Lite) : -
use SOAP::Lite;
-
use perl_axis_client;
-
-
-
my $service = "GetStuffService";
-
my $namespace = "http://myquickstart.samples/xsd";
-
my $proxy = getAxisConnection($service,$namespace);
-
-
...
-
my $str = $proxy->getStringTest();
-
if (callSuccess($str)) {
-
print $str->result."\n";
-
}
-
-
my $int = $proxy->getInt();
-
if (callSuccess($int)) {
-
print $int->result."\n";
-
}
-
...
-
my @test_array = ("Testingx","withx","newx","xxx");
-
my $hello = $proxy->setArray1(@test_array);
-
if (callSuccess($hello)) {
-
print "Get array1:".$hello->result."\n";
-
@res = $hello->paramsout;
-
#print "Res array size:".$#res."\n";
-
print "Res array1:@res\n";
-
}
-
-
@test_array = ("Testingy","withy","newy","yyy");
-
my $hello = $proxy->setArray2(@test_array);
-
if (callSuccess($hello)) {
-
print "Get array2:".$hello->result."\n";
-
@res = $hello->paramsout;
-
#print "Res array size:".$#res."\n";
-
print "Res array2:@res\n";
-
}
-
Thanks,
Rinat
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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:
|
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.
|
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,
|
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.
...
| |
by: Paul BE |
last post by:
Hi,
Can someone point me to a C# sample which calls an Axis2 XML Web Service?
Thanks !
|
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...
|
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.
|
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
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |