on 01-04-2007 6:46 PM
I have written a web service in java which returns an array of user defined objects. When I test this web service using Netweaver's Developer Studio, Enterprise Portal perspective for Wsdl check, it all works fine.
I'm able to add this web service into VC but when I try to run it's test service (execute) I get an error "Portal request failed could not execute web service operation".
I tried out another web service which returns just a user defined object, this works fine in VC , problem occurs when I try to return an array of objects.
any help will be really appreciated
Thanks
Hi,
VC Does support Array as input an output ports.
I have created and tested many Web services that return an array of element and get an array of elements.
Please look at the pasted source code:
<b>example one:</b>
public class RetrunStringArray {
public String[] retrunStringArray(String[] output){
return output ;
}
}
<b>Example 2:</b>
Person object:
import java.util.*;
public class Person {
String name = "";
String lastName = "" ;
int phoneNumber ;
Date dateOfBirth ;
public Person(){}
public void addPerson(String n, String ln, int ph, Date dBirth){
this.name = n ;
this.lastName = ln;
this.phoneNumber = ph ;
this.dateOfBirth = dBirth ;
}
/**
@return
*/
public Date getDateOfBirth() {
return dateOfBirth;
}
/**
@return
*/
public String getLastName() {
return lastName;
}
/**
@return
*/
public String getName() {
return name;
}
/**
@return
*/
public int getPhoneNumber() {
return phoneNumber;
}
/**
@param date
*/
public void setDateOfBirth(Date date) {
dateOfBirth = date;
}
/**
@param string
*/
public void setLastName(String string) {
lastName = string;
}
/**
@param string
*/
public void setName(String string) {
name = string;
}
/**
@param i
*/
public void setPhoneNumber(int i) {
phoneNumber = i;
}
<b>Example 2 this is the end point class:</b>
public class Persons {
public Persons(){}
public Person[] addPersons(Person[] p){
Person[] pArray= new Person[10] ;
for(int i=0;i < p.length ; i++){
Person p1 = new Person();
p1.addPerson(p<i>.name,p<i>.lastName,p<i>.phoneNumber,p<i>.dateOfBirth);
pArray<i> = p1 ;
}
return pArray;
}
}
If this does not help you can contact me directly at :
[Email removed by moderator]
Regards,
Asaf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Actually even I could get it working with arrays.
Now I'm trying to get it working with HashMap. When I test my web service with wsnavigator it gets the expected result but at VC it fails. I get portal request fail on testing the web service.
Does Vc support Java Collection classes like ArrayList and HashMap.
Thanks
Hi
Please take a look at the following link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/ef155b51754d7dad8bbc1dffb67c8d/content.htm
VC does not support Array structure.
You have to change the input/return type so that the values can be passed back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zeenie,
Try to reduce the depth of your structure. So if your array is made up of say A objects which in turn are made up of B objects and so on and so on then try getting rid of one level or two.
Regards,
Allen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See the Visual Composer WIKI FAQ:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario
I have already checked the link you have mentioned. Although it states that VC complains if the return type is an array, I have got a web service WeatherForcast which does return a user defined array and in-turn has an array within which works fine.
So still not sure if arrays are supported by VC now, if yes is there a particular format in which it expects the array content in the WSDL to be.
Thanks
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.