francis varkey

Ranch Hand
+ Follow
since Sep 13, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by francis varkey

Issue is solved with JAXB data binding
9 years ago
We have a cxf based jax ws code first web service deployed in Tomcat server . The return type of one of the operation in this service is List of a custom value object . We have created a proxy web service in jboss fuse and camel route with this proxy web service and real web service . Then we have created a client artifact using the proxy web service and trying to invoke the real web service through proxy web service . All the operation working fine except the one which is returning List of complex objects . In this case getting some Unmarshalling Error Unmarshalling Error: unexpected element (uri:"", local:"employeeVo"). Expected elements are <{}empName>,<{http://}salary>

Development environment

A ) Real web service

Tomcat 7 , cxf 2.6 ,Aegis, Java 6 ,Windows

B) Jboss Fuse

Fuse IDE 6.0.0 , Maven 3.05 , Java 6 , Windows

C) Web service Client

Artifact generated using java wsimport command

Code Snippets .

1)Real Web service interface

@WebService(targetNamespace = "", portName = "EmployeeServicePort", serviceName = "EmployeeServiceService")

@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)

public interface EmployeeService {

@WebResult(name = "retrieveEmployeeDetailsResponse", targetNamespace = "";)

@WebMethod(action = "retrieveEmployeeDetails", operationName = "retrieveEmployeeDetails")

EmployeeVos retrieveEmployeeDetails(@WebParam(name = "employeeVo", targetNamespace = "";)

EmployeeVo employeeVo)



2) Value object - Simple

@XmlRootElement(name="employeeVo",namespace = "";)


@XmlType(name = "EmployeeVo",propOrder={



},namespace = "";)

public class EmployeeVo {

public EmployeeVo(){


@XmlElement(name="empName",nillable=false,required=true,namespace = "";)

private String empName;

@XmlElement(name="salary",nillable=false,required=true,namespace = "";)

private Double salary;

// getters & setters


3) Value object - Complex

@XmlRootElement(name="emplooyeVos",namespace = "";)


@XmlType(name = "EmployeeVos",propOrder={"employeeVo"},namespace = "";)

public class EmployeeVos {

@XmlElement(name = "employeeVo", namespace = "", required = true)

private List<EmployeeVo> employeeVo;

public EmployeeVos(){}

public EmployeeVos(List<EmployeeVo> employeeVo){

this.employeeVo =employeeVo;


public List<EmployyeVo> getEmployeeVo() {

return employeeVo;


public void setEmployeeVo(

List<EmployeeVo> employeeVo) {

this.employeeVo = employeeVo;


4) Camel route

<route >

<from uri="cxf:http://localhost:9080/employeeProxy?serviceClass=com.sample.service.EmployeeService"/>

<to uri="cxf:http://localhost:8080/MyTest/services/employeeService?serviceClass=com.sample.service.EmployeeService"/>


5) Invoking service ( Artifact is generated from http://localhost:9080/employeeProxy?wsdl)

Getting error Unmarshalling Error: unexpected element (uri:"", local:"employeeVo"). Expected elements are <{}empName>,<{http://}salary>
9 years ago
Hi All,
We have a web service with JAX-WS ,CXF and Aegis . The return type of one operation in this service is a List of custom user defined (say List<Student>) objects. ,But while calling this operation from a camel route ,getting Unmarshalling Error:

at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall([129:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall([129:org.apache.cxf.cxf-rt-databinding-jaxb:2.7.10]
at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage([128:org.apache.cxf.cxf-api:2.7.10]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept([128:org.apache.cxf.cxf-api:2.7.10]
at org.apache.cxf.endpoint.ClientImpl.onMessage([128:org.apache.cxf.cxf-api:2.7.10]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal([137:org.apache.cxf.cxf-rt-transports-http:2.7.10]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$[137:org.apache.cxf.cxf-rt-transports-http:2.7.10]
at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$[128:org.apache.cxf.cxf-api:2.7.10]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask([:1.6.0_11]
at java.util.concurrent.ThreadPoolExecutor$[:1.6.0_11]
at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$[128:org.apache.cxf.cxf-api:2.7.10]
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:

Thanks for your help
9 years ago
Dear All,
My web service is enabled with https. Now I am trying to generate client for this secured service using wsimport . I have generate keys for both server and client. I am not able to generate client using wsimport for htttps wsdl . Where I have to mention the client key while generating client stub?

Can you please tell the complete step for mutual authentication ?

10 years ago
Thank you for reply .
As per the documentation ,
not good to use array wrapper elements using the convention ArrayOfXXX. Then how can be send list of objects . I was thinking to use array of value object (java bean).

eg :MyVo[] myvo
10 years ago
Hi Surendra,
This also not working for me. Is it working for you ? . I am using bottom up approach . Any specific schema validation limitation in code- first approach ?

10 years ago
I am having the same issue in JAX-WS and apache cxf bottom-up web service . Any suggestions will be a big help.
10 years ago
Can some one provide solutions ?
10 years ago
I mean no change in the generated wsdl.

- <xsd:complexType name="MyVo">
- <xsd:sequence>
<xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string" />


I am using jdk1.6.0_11.
10 years ago
I tried this also ,but nothing happening.
10 years ago
Hi All,
I am developing web services using jax-ws and apache cxf with code first approach . I want to enable schema validation in my service . For this I have configured the cxf configuration file as follows

<jaxws:endpoint id="testService"
<ref bean="jaxws-and-aegis-service-factory"/>
<entry key="schema-validation-enabled" value="true"/>



public interface TestService {

String test(MyVo myVo) ;



@XmlType(name = "MyVo")
public class MyVo {

@XmlElement(name = "name", required = true)
private String name;

............. // getter and setter



But after deploying the service wsdl looks like

- <xsd:complexType name="MyVo">
- <xsd:sequence>
<xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string" />


As per documentation minOccurs should be 1 (because of required=true ) .

Also I am able to call service without setting name attribute in MyVo object . No error is coming from server.

Please advice .

Thanks in advance

10 years ago
Hi ,
I am trying to develop some web services using jax-ws and apace cxf. I need to invoke these services from different languages like JAVA/PHP/.Net etc. I am having some doubts regarding parameters inside in the operations. I tried different approaches .

1) Passing a value object in operation as a parameter
2)Using HashMap as a parameter
3)Using ArrayList as a parameter.
4)Passing required number of string arguments (in this case 7 String parameters and one byte array ) .

I have developed one Java client using wsimport command. By using this client the fourth option is working . In the second and third options the client is generating some type like String2AnyElement for HashMap and ArrayList. How I can I put values in these types of data structure ? While trying first option there was some compilation problem also.

I went through jax-ws tutorial also, there I could see some limited data types support only

Can some one suggest best approach for designing my operations . It should be access from different platforms and different client generations tools like CXF,AXIS etc.


10 years ago
Hi ,
Thanks . I went to this url . I am using code first approach . Will it work in this scenario also ?

Thank You
10 years ago
Hi All,
We are using JAX-WS and apache CXF for developing web service. Our application is spring based web application and deployed in tomcat server. Now we have to encrypt our web services . What are different ways to achieve this ?

Thank You
10 years ago
Hi ,
I am trying to implement a scheduler using quartz in spring3. The requirement is need to take value of cron expression should read from database. While trying this I am getting following exception.

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cronTrigger' defined in class path resource [Spring-Quartz.xml]: Cannot resolve reference to bean 'constructCronExpression' while setting bean property 'cronExpression'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'constructCronExpression' is defined


1) Spring-Quartz.xml

<beans xmlns=""

<bean id="runMeTask" class="test.RunMeTask" />
<!-- <bean id="constructCronExpression" class="test.CustomCronExpression" /> -->

<!-- Spring Quartz -->
<bean name="runMeJob" class="org.springframework.scheduling.quartz.JobDetailBean">

<property name="jobClass" value="test.RunMeJob" />

<property name="jobDataAsMap">
<entry key="runMeTask" value-ref="runMeTask" />


<bean id="runMeJob"
<property name="targetObject" ref="runMeTask" />
<property name="targetMethod" value="printMe" />

<!-- Simple Trigger, run every 5 seconds -->
<bean id="simpleTrigger"

<property name="jobDetail" ref="runMeJob" />
<property name="repeatInterval" value="5000" />
<property name="startDelay" value="1000" />


<!-- Cron Trigger, run every 5 seconds -->
<bean id="cronTrigger"

<property name="jobDetail" ref="runMeJob" />
<!-- <property name="cronExpression" value="0/5 * * * * ?" /> -->
<property name="cronExpression" ref="constructCronExpression"/>


<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<ref bean="runMeJob" />

<property name="triggers">
<ref bean="simpleTrigger" />


package test;

public class RunMeTask {
public void printMe() {
System.out.println("Spring 3 + Quartz 1.8.6 ~");

package test;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class RunMeJob extends QuartzJobBean {
private RunMeTask runMeTask;

public void setRunMeTask(RunMeTask runMeTask) {
this.runMeTask = runMeTask;

protected void executeInternal(JobExecutionContext context)
throws JobExecutionException {



package test;


public class App
public static void main( String[] args ) throws Exception
new ClassPathXmlApplicationContext("Spring-Quartz.xml");

package test;
import org.springframework.context.annotation.Bean;

import org.springframework.context.annotation.Configuration;

public class CustomCronExpression{

public String constructCronExpression() {
String cronExpression = "0/5 * * * * ?"; //Contruct Cron Expression from the request
return cronExpression ;


Thank You

11 years ago