You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2009/10/05 18:46:31 UTC
[jira] Resolved: (CXF-2027) Problem in getting CXF output in
particular format
[ https://issues.apache.org/jira/browse/CXF-2027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp resolved CXF-2027.
------------------------------
Resolution: Invalid
Fix Version/s: Invalid
This really isn't a JIRA issue. It's more of a users@ question.
Specifically, this is definitely something where you would be strongly encouraged to switch to JAX-RS and the JAXB provider there.
> Problem in getting CXF output in particular format
> --------------------------------------------------
>
> Key: CXF-2027
> URL: https://issues.apache.org/jira/browse/CXF-2027
> Project: CXF
> Issue Type: Improvement
> Components: Configuration, Core, JAX-WS Runtime
> Environment: Jboss,Spring Framework,CXF
> Reporter: kishore
> Priority: Critical
> Fix For: Invalid
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> Hi ,
> Im having a problem in Output
> Sources:
> public class User
> {
> @XmlAttribute
> private int id;
>
> @XmlElement(name='Email')
> private String name;
>
> @XmlAttribute
> private String email;
>
> @XmlElemnt(Marks)
> private Marks marks;
> }
> public class Marks
> {
> @XmlAttribute
> private int id;
> @XmlAttribute
> private String aggregate;
> @XmlElemnt(Total)
> private String totalMarks;
> }
> Service:
> import javax.jws.WebService;
> import javax.xml.bind.annotation.XmlAccessType;
> import javax.xml.bind.annotation.XmlAccessorType;
> import javax.xml.bind.annotation.XmlElement;
> import javax.xml.bind.annotation.XmlType;
> import org.codehaus.jra.Get;
> import org.codehaus.jra.HttpResource;
> @WebService()
> public interface SampleService {
> @Get
> @HttpResource(location="/details")
>
> public List<User> getUserDetailsWithMarks();
> }
> ServiceImpl:
> import java.util.List;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import javax.jws.WebService;
> import javax.jws.soap.SOAPBinding;
> import javax.jws.soap.SOAPBinding.ParameterStyle;
> import javax.jws.soap.SOAPBinding.Style;
> import javax.jws.soap.SOAPBinding.Use;
> public class SampleServiceImpl implements SampleService {
> @Override
> public List<User> getUserDetailsWithMarks() {
>
> User user=new User();
> user.setId(1000);
> user.setName("ONE");
> user.setEmail("Sample@one.com");
> Marks marks=new Marks();
> marks.setAggregate("77%");
> marks.setId(999);
> marks.setTotalMarks("1777");
> user.setMarks(marks);
> }
> }
> Configuration:
> <bean id="sampleService"
> class="SampleServiceImpl">
>
> </bean>
> <jaxws:endpoint id="sampleServiceID"
> implementor="#sampleService"
> address="/SampleService"
> bindingUri="http://apache.org/cxf/binding/http">
> <jaxws:serviceFactory>
> <bean class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
> <property name="wrapped" value="true" />
> </bean>
> </jaxws:serviceFactory>
>
> </jaxws:endpoint>
> Im Getting output like this
> <ns1:getUserDetailsWithMarksResponse>
> <ns1:User id="1000" email='Sample@one.com'>
> <name>ONE</name>
> <ns1:Marks id="999" aggregate="77%">
> <Total>77/100</total>
> </ns1:Marks>
> </ns1:User>
> </ns1:getUserDetailsWithMarksResponse>
> But i need output like this :
> <User id="1000" email="Sample@One.com">
> <name>ONE</name>
> <Marks id='999' aggregate="77%">1777</Marks>
> </User>
>
>
>
>
>
>
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.