Supprot for wrapped/unwrapped styles in Mapped convention for JSON

2009-07-03 Thread Chaitanya
Hi, 

I have a JAX-RS method which takes an Employee object as a param. Employee 
class is given below.

@XmlRootElement
public class Employee {
private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}

Unmarshalling of the JSON

{employee:{name:abc}}

works fine and gives an Employee object, but if the JSON input is

{name:abc} 

unmarshalling fails.

Does CXF support both wrapped and unwrapped styles in Mapped convention for 
JSON?
If yes what should be done to make the second case work?

Thank you
Chaithanya.

Re: Integrating JAX-RS runtime into DOSGi

2009-07-03 Thread David Bosschaert
Hi all,

2009/6/20 Sergey Beryozkin sbery...@progress.com:
 Hi,
  ... snip/ ...
 There's something else David is thinking of doing shortly, possibly next
 week or so. At the moment one has to configure DOSGI properties on the
 individual service basis, either from the code or from the xml. David is
 thinking of introducing wildcards such that for ex a given set of
 (dosgi) properties can apply to a potentially unlimited number of
 services - that will scale in terms of configuration dramatically. David
 is traveling but he will clarify as soon as he can.

 For now I did not add the support for a jaxrs.resource property Aaron
 and yourself talked about - this would be a non-standard property anyway
 and may be you can live for now with using the DOSGI props. You'll be
 abale to move all the dosgi properties away from your Activators once
 David finishes his work on supporting wildcards.

Just to let you know that an initial version of this is now on trunk.
You can find some documentation about it here: http://tr.im/qKlc

If you find this useful, let me know!

Cheers,

David


Re: How to add wsdl extension for SOAP/JMS.

2009-07-03 Thread liucong

Hi,
   I am writing a plugin for xjc.
   First I just modify the cxf-xjc-ts and cxf-xjc-ts-test, and make it 
work with the -Xwsdlextension, not -Xts. The pom file is also changed. 
And it works rightly.
   Then I copy the modified projects into cxf-xjc-wsdlextension and 
cxf-xjc-wsdlextension-test, and make the cxf-xjc-ts the same with the 
subversion.

   It failed. The exception is:
   [INFO] 


[INFO] Building Apache CXF XJC WSDL Extension Plugin Tests
[INFO]task-segment: [install]
[INFO] 


[INFO] [cxf-xml2fastinfoset:xml2fastinfoset {execution: xml2fastinfoset}]
[INFO] [jaxb2:xjc {execution: default}]
[INFO] Generating source...
[INFO] 


[ERROR] BUILD ERROR
[INFO] 


[INFO] unrecognized parameter -Xwsdlextension

   What's wrong? Do I need to do more configuration for ths xjc plugin?

thanks!

Daniel Kulp wrote:

Liu,

I think for stuff that are simple (basically, complexTypes with 
simpleContent and simpleType object), you cannot extend 
TExtensibilityElementImpl.   Instead, you would need to make it implement 
ExtensibilityElement interface and add the QName and required fields and such.   


Dan


On Wed July 1 2009 12:18:15 pm liucong wrote:
  

Hi,

I do a simple experiment about the design sugguest by Dan.
First, I use jaxb, not xjc. I think they have the principle.

The schema like this[1]:
xs:element name=deliveryMode type=soapjms:deliveryModeType /
xs:complexType name=deliveryModeType
xs:simpleContent
xs:extension base=xs:string
/xs:extension
/xs:simpleContent
/xs:complexType

The generated class for DeliveryModeType like this[2]:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = deliveryModeType, propOrder = {
value
})
public class DeliveryModeType{

@XmlValue
protected String value;

/**
 * Gets the value of the value property.
 *
 * @return
 * possible object is
 * {...@link String }
 *
 */
public String getValue() {
return value;
}

/**
 * Sets the value of the value property.
 *
 * @param value
 * allowed object is
 * {...@link String }
 *
 */
public void setValue(String value) {
this.value = value;
}

public boolean isSetValue() {
return (this.value!= null);
}
}

The DeliveryModeType doesn't extend TExtensibilityElementImpl. So I just
modify the class and make it look like this[3]:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = deliveryModeType, propOrder = {
value
})
public class DeliveryModeType extends TExtensibilityElementImpl{

@XmlValue
protected String value;

/**
 * Gets the value of the value property.
 *
 * @return
 * possible object is
 * {...@link String }
 *
 */
public String getValue() {
return value;
}

/**
 * Sets the value of the value property.
 *
 * @param value
 * allowed object is
 * {...@link String }
 *
 */
public void setValue(String value) {
this.value = value;
}

public boolean isSetValue() {
return (this.value!= null);
}
}

Then when I publish a service, I get an exception[4]
Creating Service {http://cxf.apache.org/jms_greeter}JMSGreeterService
from WSDL: file:./wsdl/jms_greeter.wsdl
Exception in thread main javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:275)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
at
org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl
.java:84) at javax.xml.ws.Endpoint.publish(Endpoint.java:47)
at demo.jms_greeter.server.Server.init(Server.java:30)
at demo.jms_greeter.server.Server.main(Server.java:34)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Failed to create service.
at
org.apache.cxf.wsdl11.WSDLServiceFactory.init(WSDLServiceFactory.java:93)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFro
mWSDL(ReflectionServiceFactoryBean.java:317) at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServi
ceModel(ReflectionServiceFactoryBean.java:437) at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflecti
onServiceFactoryBean.java:195) at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFac
toryBean.java:163) at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
tractWSDLBasedEndpointFactory.java:100) at

Re: How to add wsdl extension for SOAP/JMS.

2009-07-03 Thread Willem Jiang

Hi,

It looks like the xjc pulgin just loads the extensions once, so you need 
to add all the xjc extensions dependencies into each xjc extension test pom.

  dependencies
dependency
groupIdorg.apache.cxf/groupId
artifactIdcxf-xjc-dv/artifactId
version${project.version}/version
/dependency
dependency
groupIdorg.apache.cxf/groupId
artifactIdcxf-xjc-ts/artifactId
version${project.version}/version
/dependency
dependency
groupIdorg.apache.cxf/groupId
artifactIdcxf-xjc-wsdlextension/artifactId
version${project.version}/version
/dependency
/dependencies

Willem

liucong wrote:

yeah.
The pom file in the cxf-xjc-wsdlextension:
project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;

   modelVersion4.0.0/modelVersion
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-xjc-wsdlextension/artifactId
   packagingjar/packaging
   version2.3.0-SNAPSHOT/version
   nameApache CXF XJC WSDL Extension Plugin/name
   urlhttp://cxf.apache.org/url

   parent
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-parent/artifactId
   version2.3.0-SNAPSHOT/version
   relativePath../../../parent/pom.xml/relativePath
   /parent

   properties
   maven.test.skiptrue/maven.test.skip
   /properties

   dependencies
   dependency
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-common-utilities/artifactId
   version${project.version}/version
   /dependency
   dependency
   groupIdcom.sun.xml.bind/groupId
   artifactIdjaxb-xjc/artifactId
   /dependency
   dependency
   groupIdcom.sun.xml.bind/groupId
   artifactIdjaxb-impl/artifactId
   /dependency
   dependency
   groupIdcommons-lang/groupId
   artifactIdcommons-lang/artifactId
   /dependency
   /dependencies

   scm
   
connectionscm:svn:http://svn.apache.org/repos/asf/cxf/trunk/common/xjc/wsdlextension/connection 

   
developerConnectionscm:svn:https://svn.apache.org/repos/asf/cxf/trunk/common/xjc/wsdlextension/developerConnection 


   /scm

/project

The pom file in the cxf-xjc-wsdlextension-test is:
project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;

   modelVersion4.0.0/modelVersion
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-xjc-wsdlextension-test/artifactId
   packagingjar/packaging
   version2.3.0-SNAPSHOT/version
   nameApache CXF XJC WSDL Extension Plugin Tests/name
   urlhttp://cxf.apache.org/url

   parent
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-parent/artifactId
   version2.3.0-SNAPSHOT/version
   relativePath../../../parent/pom.xml/relativePath
   /parent

   dependencies

   dependency
   groupIdjavax.xml.bind/groupId
   artifactIdjaxb-api/artifactId
   /dependency
   dependency
   groupIdcom.sun.xml.bind/groupId
   artifactIdjaxb-impl/artifactId
   /dependency
   dependency
   groupIdcom.sun.xml.bind/groupId
   artifactIdjaxb-xjc/artifactId
   /dependency
   dependency
   groupIdjunit/groupId
   artifactIdjunit/artifactId
   scopetest/scope
   /dependency
   dependency
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-common-utilities/artifactId
   version${project.version}/version
   /dependency
   dependency
  groupIdcommons-lang/groupId
  artifactIdcommons-lang/artifactId
   /dependency
   /dependencies

   build
   plugins
   plugin
   groupIdorg.codehaus.mojo/groupId
   artifactIdjaxb2-maven-plugin/artifactId
   version1.2/version
   executions
   execution
   goals
   goalxjc/goal
   /goals
   /execution
   /executions
   configuration
   
outputDirectory${basedir}/target/generated/src/test/java/outputDirectory 

   
schemaDirectory${basedir}/src/test/resources/schemas/configuration/schemaDirectory 


   arguments-Xwsdlextension/arguments
   extensiontrue/extension
   quiettrue/quiet
   /configuration

   dependencies
   dependency
   groupIdorg.apache.cxf/groupId
   

[hudson] CXF-Trunk-JDK16 job disabled

2009-07-03 Thread Jukka Zitting
Hi CXF developers,

I've disabled the CXF-Trunk-JDK16 Hudson job [1] since the last three
builds [2,3,4] all got stuck for hours while executing
org.apache.cxf.javascript.AnyTest and had to be manually killed to
avoid blocking the build queue.

I'm not sure whether this is a CXF or a Hudson issue. Can you please
check whether the build is supposed to work, and feel free to
re-enable the Hudson job (clear the Disable Build option in the job
configuration) once it's back to normal.

[1] http://hudson.zones.apache.org/hudson/job/CXF-Trunk-JDK16/
[2] http://hudson.zones.apache.org/hudson/job/CXF-Trunk-JDK16/95/
[3] http://hudson.zones.apache.org/hudson/job/CXF-Trunk-JDK16/94/
[4] http://hudson.zones.apache.org/hudson/job/CXF-Trunk-JDK16/93/

BR,

Jukka Zitting