cancel
Showing results for 
Search instead for 
Did you mean: 

how to deploy a web service with complex java type?

Former Member
0 Kudos

Hi all,

I create a simple Java class, and implement a simple method like following:


   public ArrayList retureList(){
        ArrayList list = new ArrayList();
        list.add("str1");
        list.add("str2");
        return list;
    }

I want to create a webservice about this method. so I create VI -> Web service definition -> web service configuration.

At last, when I want to deploy the generated .ear file to the J2EE server , I got a error :

2005-4-22 16:37:12 /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,6,main]] ERROR:

[005]Deployment aborted

Settings

SDM host : vm6

SDM port : 51018

URL to deploy : file:/E:/TMP/temp44279DummyWebServices.ear

Result

=> deployment aborted : file:/E:/TMP/temp44279DummyWebServices.ear

Aborted: development component 'DummyWebServices'/'sap.com'/'localhost'/'2005.04.22.16.29.52':

Caught exception during application deployment from SAP J2EE Engine's deploy service:

com.sap.engine.services.deploy.server.utils.DSRemoteException: Cannot deploy application sap.com/DummyWebServices.. Reason: Webservices deployment exception! The reason is: Error occured, trying to generate web services deployment files for application sap.com/DummyWebServices. . The error refers to application: none, jar: , web service: .; nested exception is: java.rmi.RemoteException: class com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices deployment exception! The reason is: Error occured, trying to generate web services deployment files for application sap.com/DummyWebServices. . The error refers to application: none, jar: , web service: .; nested exception is: java.rmi.RemoteException: class com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occured, deploying web service DummyWS2, application sap.com/DummyWebServices. . Additional info: ; nested exception is: java.rmi.RemoteException: class com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices deployment exception! The reason is: Unable to generate complex types. The error refers to application: sap.com/DummyWebServices, jar: DummyWebServices.wsar, web service: DummyWS2.; nested exception is: java.rmi.RemoteException: class com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices deployment exception! The reason is: Unable to generate complex types. The error refers to application: sap.com/DummyWebServices, jar: DummyWebServices.wsar, web service: DummyWS2.; nested exception is: java.rmi.RemoteException: class com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Unable to generate complex types. Additional info: not available; nested exception is: java.rmi.RemoteException: class java.lang.NullPointerException: Methods getMessage() and getLocalizedMessage() of java.lang.NullPointerException returned NULL.Please check, why the original exception was thrown with message NULL.

(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

Deployment exception : The deployment of at least one item aborted

It seems that this error occurs because my method return a ArrayList which is a complex Java type.

So anyone knows how to solve this problem?

Thanks a lot.

Deyang

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For my knowledge ....complex types are not supported.

Regards, VIP

Answers (3)

Answers (3)

Former Member
0 Kudos

Deyang,

Trying to create a web service that returns a Collection doesn't seem to be possible in Netweaver. The reason for this is that languages other than Java have difficulty in mapping Collections, amongst others, to their own native equivalents.

There is a discussion on the subject here you may find useful:

http://forum.capescience.com/showthreaded.php?Cat=&Board=webservices&Number=147&page=0&view=collapse...

The short answer is to use Arrays instead, so in your example simply return a String[] instead of your ArrayList. It is also possible to create a value object e.g. Employee containing multiple fields and return an Array of Employees e.g. public Employee[] returnlist()...

Hope this helps

Steve

Former Member
0 Kudos

Hi Siddhesh,

Thanks for your answer. But I think this is not the right thing I am looking for...

Anyway, Thank you verymuch.

Best regards

Deyang

former_member185954
Active Contributor
0 Kudos

Hi,

I don't know much about Java, however you may check the below link...

http://help.sap.com/saphelp_erp2004/helpdata/en/6c/4b70595ec54fdc82af7ca1c8ab23ec/frameset.htm

Its an example, it might give some hints.

Regards,

Siddhesh