This is very similar to the problem I'm having as well.
If I use Service serviceModel = new AnnotationServiceFactory().create(VehicleLookupServiceImpl.class); It complains about not having a setting for the array list that jaxb created. So I did some search and found some other with this same problem. one post said I need to use\ Service serviceModel = new JaxbServiceFactory().create(VehicleLookupServiceImpl.class); This give me 'could not marshal type' Is anybody using JaxB with xfire and making it work where JaxB is generating a List? -----Original Message----- From: Karl Palsson [mailto:[EMAIL PROTECTED] Sent: Thursday, November 30, 2006 9:01 AM To: [email protected] Subject: [xfire-user] XFIRE-509 again. "No write method for property" As per the comments on the bug, I've signed up to post here instead of on the bug... I get this too, I'm not sure what "full configuration" actually means in this context, but there's nothing private in the source, I'd happily include the setup. I'm using xfire 1.2.2, java 5. What I'm doing is generating a java service from a wsdl. The wsdl input message has an unbounded string, like so.... <xsd:complexType name="MailAnyStringRequest"> <xsd:sequence> <xsd:element name="EmailAddresses" type="xsd:string" maxOccurs="unbounded"/> <xsd:element name="Subject" type="xsd:string" /> <xsd:element name="Body" type="xsd:string" /> </xsd:sequence> </xsd:complexType> Wsdlgen (the ant task) nicely makes the emailaddresses into a nice List<String> for me. However, it doesn't generate a setter. (It merrily makes documentation telling me that JAXB is very clever, I don't need one, that the getter gives me a live list) However, without the setter, any consumer of this service can't set any email addresses. They get the soap fault in the headline, and in the bug. I'm sure JAXB is correct in that I don't need the setter in the normal server side java code, but, well, I never need to edit the RequestMessage stuff anyway, I tend to treat the RequestMessage as readonly really. But I would really like to allow clients to set data in the request object. I'm not using java clients, so the closing comment in the bug is irrelevant (as it should be) Cheers, Karl P "Full config" for what it's worth......... Generated MailAnyStringRequest.java (from the wsdl, with the xfire ant task wsdlgen) package com.industria.services.troubleticketing.mailer; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for MailAnyStringRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="MailAnyStringRequest"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="EmailAddresses" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/> * <element name="Subject" type="{http://www.w3.org/2001/XMLSchema}string"/> * <element name="Body" type="{http://www.w3.org/2001/XMLSchema}string"/> * </sequence> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MailAnyStringRequest", propOrder = { "emailAddresses", "subject", "body" }) public class MailAnyStringRequest { @XmlElement(name = "EmailAddresses", required = true) protected List<String> emailAddresses; @XmlElement(name = "Subject", required = true) protected String subject; @XmlElement(name = "Body", required = true) protected String body; /** * Gets the value of the emailAddresses property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the emailAddresses property. * * <p> * For example, to add a new item, do as follows: * <pre> * getEmailAddresses().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * [EMAIL PROTECTED] String } * * */ public List<String> getEmailAddresses() { if (emailAddresses == null) { emailAddresses = new ArrayList<String>(); } return this.emailAddresses; } //************************************ // This line manually added to make it work public void setEmailAddresses(List<String> emailAddresses) {this.emailAddresses = emailAddresses;} //************************************ /** * Gets the value of the subject property. * * @return * possible object is * [EMAIL PROTECTED] String } * */ public String getSubject() { return subject; } /** * Sets the value of the subject property. * * @param value * allowed object is * [EMAIL PROTECTED] String } * */ public void setSubject(String value) { this.subject = value; } /** * Gets the value of the body property. * * @return * possible object is * [EMAIL PROTECTED] String } * */ public String getBody() { return body; } /** * Sets the value of the body property. * * @param value * allowed object is * [EMAIL PROTECTED] String } * */ public void setBody(String value) { this.body = value; } } The server side config files are: webservices.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <!-- developers edit this to name the service. put any name you want, and point to the right class --> <bean id="test1" class="com.industria.ims.troubleticketing.mailer.MailerImpl" /> </beans> xfire-servelet.xml: (default I believe) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <!-- this file does NOT need to be changed by developers! --> <bean id="webAnnotations" class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations" /> <bean id="handlerMapping" class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"> <property name="typeMappingRegistry"> <ref bean="xfire.typeMappingRegistry" /> </property> <property name="xfire"> <ref bean="xfire" /> </property> <property name="webAnnotations"> <ref bean="webAnnotations" /> </property> </bean> <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="urlMap"> <map> <entry key="/"> <ref bean="handlerMapping" /> </entry> </map> </property> </bean> <import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/> <import resource="classpath:webservices.xml"/> </beans> Web-inf\web.xml (again, default I believe) <?xml version="1.0" encoding="UTF-8"?> <web-app> <!-- ******************************* --> <!-- this is the only part you need to change --> <display-name>Mailer2</display-name> <description>A service that handles mailing faults</description> <!-- down to here --> <!-- ******************************* --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:xfire-servlet.xml</param-value> </context-param> <servlet> <servlet-name>XFireServlet</servlet-name> <display-name>XFire Servlet</display-name> <servlet-class> org.codehaus.xfire.spring.XFireSpringServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>XFireServlet</servlet-name> <url-pattern>/servlet/XFireServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>XFireServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app> --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
