I have this method as one of the contracts in my web service -
java.lang.String removeUsers(java.lang.String sourceApp, java.lang.String userIDList)
The corresponding WSDL definitions look like (Auto-generated by Weblogic v10 Workshop from the service Java file) -
My question is - What value should I use for the <j2ee:param-type> element in the JAX-PRC mapping file webservices.xml file (bold-red in code below) for Java Arrays (The string Array I am using for the paramater of the method)?
I am using Eclipse IDE, Weblogic v10, JDK1.5 and manually writing the JAX-RPC mapping file (webservices.xml) to match to the WSDL. An EAR file is generated that I deploy on Linux based Weblogic v10 App server. I dont want to use client-gen just as yet. I have been coding webservice for couple of years now, but never had to code for String Arrays and such ... just domain objects may be.
I searched on the net, googled it - but everybody seems to be showing simple examples where they just pass and return a long or String ... no sample codes for advance data types!!
OK!! I found out the solution to this on my own. Below is the listing for others to refer if they are having similar issues -
The solution is that, the <j2ee:param-type> tag will contain the value:
But, within the jaxrpc mapping XML file, have this entry to define the String Array:
while the WSDL will have the mapping for this as:
and the Request definition for the method will be defined as:
You can similarly have Array of objects (domain objects) defined, but instead of java.lang.String, have the fully qualified class path for the domain class, like:
Hope somebody finds this useful - I had a hard time getting this information from the net, but did not find anything there.
This issue is faced if you use Eclipse (not BEA WorkShop with a WebService Project, which generates the mapping files automatically when you export the project as EAR for deployment), but do not have any tools like wstools, wsimport etc configured into your Maven/ANT within Eclipse and are stuck with writing the JAXRPC mapping file on your own and have complex objects like String/Object Arrays as the params.