int[] or Integer[] array is not working. - weblogic.developer.interest.webservices.general(Archived)

Hi there, I'm using wls 10.3 and some of my web services classes/methods (jax-rpc 1.1) used either an int[] or Integer[] array as both a parameter and return types. When I generate the wls client artifacts using jwsc ant task, the client stub method signature is different. Instead of seeing it as int[] or Integer[] - I'm seeing these class types. Below are the snippet of wls generated client stub classes.
1. public java.lang.Object[] findCustomersByIds(com.starcomsoft.ArrayOfint_Literal ids) throws java.rmi.RemoteExceptionc {..}
2. public java.lang.Object[] findCustomersByIds2(com.starcomsoft.ArrayOfJavaLangint_Literal ids) throws java.rmi.RemoteException {..}
Also below is the wls generated class that replace both the int[] and Integer[] array.
ArrayOfint_Literal.java and
ArrayOfJavaLangint_Literal.java
public class ArrayOfint_Literal implements java.io.Serializable {
private int[] _int;
public int[] getInt() {
return this._int;
}
public void setInt(int[] _int) {
this._int = _int;
}
}
public class ArrayOfJavaLangint_Literal implements java.io.Serializable {
private java.lang.Integer[] javaLangint;
public java.lang.Integer[] getJavaLangint() {
return this.javaLangint;
}
public void setJavaLangint(java.lang.Integer[] javaLangint) {
this.javaLangint = javaLangint;
}
}
This 2 classes seems to wrapped both the int[] and Integer[] array. Is this correct or not? I would expect that they would support this java types, because the old wls 7.2 supported it and we have no problem on our old web service application.
Your help is very much appreciated.

Related

Please help- How can I publish an object with irregular getter/setter metho

I'm encountering a problem with weblogic 9.2 web service. Here it is the description:
I have a java class which doesn't expose getter/setter method, Like this:
public class MyEntityList
implements Cloneable, Serializable
{
private Map subEntityMap;
public final Object[] toArray()
{
return subEntityMap.values().toArray();
}
public final Iterator subEntities()
{
return subEntityMap.values().iterator();
}
public final GFIBaseSubEntity getSubEntityByKey(String key)
{
if(key == null)
return null;
else
return (GFIBaseSubEntity)subEntityMap.get(key);
}
public final void setSubEntity(GFIBaseSubEntity entity)
{
subEntityMap.put(entity.getKey(), entity);
}
}
When I publish this object out, the web service engine will not parse the value in this object for it hasn't getter methods. But I do need the value in it, and I can't change the class for it's from external system. Can I define my own serializer class to process the MyEntityListin weblogic 9 or 10? Or is there any way to process this case?
Thanks in advance

rmi-iiop - passing objects

I would like to figure out how to pass a simple object to an ejb using the rmi-iiop.
Where I'm having the problem is in the C++ client, figuring out how to make the
client instantiate the object. I'm getting errors when I compile the C++ client.
The following is what the object looks like:
public final class Request1_0 implements Serializable {
// Number of shares really bought or sold.
public final String firstName;
public final String lastName;
public Request1_0(String first, String last) {
firstName = first;
lastName = last;
}
public String getFirstName() {
     return firstName;
}
public String getLastName() {
     return lastName;
}
}
We are using the java-to-idl to compile the java into idl and then Visibroker
to compile the C++ stubs from the idl.
"j patton" <jpatto#acxiom.com> writes:
Can you provide details of which version of WLS you are using and
which version of Visibroker (including patch level). Can you also post
the errors.
Thanks
andy
I would like to figure out how to pass a simple object to an ejb using the rmi-iiop.
Where I'm having the problem is in the C++ client, figuring out how to make the
client instantiate the object. I'm getting errors when I compile the C++ client.
The following is what the object looks like:
public final class Request1_0 implements Serializable {
// Number of shares really bought or sold.
public final String firstName;
public final String lastName;
public Request1_0(String first, String last) {
firstName = first;
lastName = last;
}
public String getFirstName() {
     return firstName;
}
public String getLastName() {
     return lastName;
}
}
We are using the java-to-idl to compile the java into idl and then Visibroker
to compile the C++ stubs from the idl.--

Primitive int[] and Integer[] array type not supported

Hi there,
I have a stateless ejb exposed as webservice using jax-rpc 1.1 and one of my methods accepts a parameter of int[] array. When I run the wls clientgen ant task and I look at the generated client stub for that webservice the parameter is no longer int[] but this one "com.starcomsoft.ArrayOfJavaLangint_Literal". Below is a snippet of client stub code produced by wls clientgen.
public class CustomerWS_Stub
extends weblogic.wsee.jaxrpc.StubImpl
implements com.starcomsoft.pp.customer.jws.CustomerWS, /**/java.io.Serializable
{
public CustomerWS_Stub(weblogic.wsee.wsdl.WsdlPort port,
weblogic.wsee.jaxrpc.ServiceImpl service)
throws javax.xml.rpc.ServiceException
{
super(port, com.starcomsoft.pp.customer.jws.CustomerWS.class, service);
}
/**
* Operation Name : {http://www.starcomsoft.com}findAddresses1 */
public java.lang.Object[] findAddresses1(com.starcomsoft.ArrayOfint_Literal idSet) throws java.rmi.RemoteException {
java.util.ArrayList _args = new java.util.ArrayList();
_args.add(idSet);
try {
java.lang.Object result = invoke("findAddresses1", _args.toArray());
return (java.lang.Object[])_result;
} catch (javax.xml.rpc.JAXRPCException wlsexception) {
throw new java.rmi.RemoteException(_wls_exception.getMessage(), wlsexception.getLinkedCause());
} catch (javax.xml.rpc.soap.SOAPFaultException wlsexception) {
throw new java.rmi.RemoteException(_soapFault2String(_wls_exception), wlsexception);
} catch (java.lang.Throwable wlsexception) {
throw new java.rmi.RemoteException(_wls_exception.getMessage(), wlsexception);
}
}
And here is my webservice class:
#SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL,
     parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
#Stateless(mappedName = "CustomerBeanWS")
#WebService(name = "CustomerWS",
               serviceName = "CustomerWSService",
               targetNamespace = "http://www.starcomsoft.com")
public class CustomerWSImpl implements CustomerEJBRemote, CustomerEJBLocal {
     #WebMethod()
     #TransactionAttribute(TransactionAttributeType.REQUIRED)
     public List<Address> findAddresses1(int[] idSet) {
          AddressDAO dao = new AddressDAO();
          List<Address> addrList = dao.loadAddresses(idSet);
          return addrList;
     }
}
I also tried using Integer[] type but the same type is produced - that is "com.starcomsoft.ArrayOfJavaLangint_Literal".
I'm stuck and your help is very much appreciated.

Problem implementing web service with jax-ws 2.0 in weblogic 10

Hi, I need an urgent help in implementing a stateless session bean as a web service using jax-ws 2.0 implemtation with methods that accepts java class and returns a java class also instead of your simple java types like String or int. Below is my use case or sample code.
I have a statelss session bean (as a service facade) called BusinessService with 3 methods:
public class BusinessServiceImpl implements BusinessService {
public public Customer getCustomer(CustomerSearchCriteria criteria) throws BusinessException;
public Order getOrder(OrderSearchCriteria crteria) throws BusinessException
public List<Order> getCustomerOrders(CustomerSearchCriteria criteria) throws BusinessException;
}
I have several java classes, namely:
public class Customer {
private int id;
private String name;
private Address address;
... all fields has the standard get/setter methods
}
public class Address {
private int id;
private String address1;
private String address2;
private String city;
private String state;
private String zipCode;
... all fields has the standard get/setter methods
}
public class Order {
private int id;
private Customer customer;
private Address shippingAddress;
private Address billingAddress;
private Date orderDate;
private List<OrderDetail> items
... all fields has the standard get/setter methods
}
public class OrderDetail {
private int id;
private int qty;
private Item item;
private double price;
... all fields has the standard get/setter methods
}
public class CustomerSearchCriteria implememts SearchCriteria {
private int id;
private int type;
private String code;
private SearchCriteria orderCriteria;
... etc (more fields)
... all fields has the standard get/setter methods
}
public class OrderSearchCriteria implements SearchCriteria {
private int id;
private Date orderDate1;
private Date orderDate2;
... etc (more fields)
... all fields has the standard get/setter methods
}
I need to properly annote the BusinessServiceImpl class or the BusinessService interface to properly expose this one. Note we also need to throw our own custom exception called BusinessException and all methods accepts a java class as parameters and return a java class or a List of java class objects. And also I need to properly annote the other java classes - Customer, Order, OrderDetail, Address, SearchCriteria (Customer or Order) using jaxb 2.0 annotation in order for my stateless session bean work properly. Also I need a sample ant build.xml to properly compile, build and generate the jee artifacts and package it as an ear file. I hope this use case is simple and explicit enough for you understand my need.
Thank you for your help and time

Generate SDO classes doesn't work in JDeveloper

Hi,
What I would like to do: I would like to call a Java service from a BPEL process.
The way I do it is by encapsulating my java service in a stateless session EJB which I try to expose through an SDO interface. Like that, I expect to be able to use this service with the EJB adapter in BPEL.
I have an issue with JDeveloper to generate my SDO interfaces.
If I have 2 simple classes :
<pre>public class User {  
private String name;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}</pre>
and
<pre>public class UserAccess {
public User getUserById(int id) {
return new User();
}
}</pre>
I use the Create Service Interface... feature on UserAccess, and I doesn't generate the class UserSDO... Why is that ? Can you help please ?
Laurent

Categories

Resources