That worked. Thanks! So my next question is.... :-) If I want to be able to pass xsi:nill=true as an attribute I have to be able to bind the parameter to that namespace. How do I do that? Also the decleration for the xsi namespace is not at the top of the wsdl that is generated. Does it have to be?
Cheers, Aaron. -----Original Message----- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: Friday, 28 April 2006 1:15 PM To: [email protected] Subject: Re: [xfire-user] Controlling mapped name of service method parameters using commons attributes A couple things - You need to move your annotations to your service interface - You need to put a @WebService(endpointInterface="...MyService") on the implementation class - You need to make your exporter like so: <bean id="myService" class="org.codehaus.xfire.spring.remoting.XFireExporter"> ... <property name="serviceClass" value="com.mydomain.services.MyServiceImpl"/> </bean> Hope that helps! - Dan BLISHEN Aaron wrote: > Hi All, > > > I have setup Commons attributes to control the mapping of my service > method parameters. This is what I have: > > /** > * @@ WebService(name="MyService", > targetNamespace="http://services.mydomain.com") > * @@ org.codehaus.xfire.annotations.commons.soap.SOAPBinding(style = > 1) */ > > public class MyServiceImpl { > > /** > * > * @@WebMethod(operationName="myMethod") > * @@.myParam WebParam(name="myParam") > */ > void myMethod(Long myParam) {...} } > > > > Spring Configuration: > > <bean > class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> > <property name="urlMap"> > <map> > <entry key="/MyService"> > <ref bean="myService"/> > </entry> > </map> > </property> > </bean> > > <bean id="xfire.annotationServiceFactory" > class="org.codehaus.xfire.annotations.AnnotationServiceFactory"> > <constructor-arg index="0"> > <ref bean="xfire.commonsAnnotations"/> > </constructor-arg> > <constructor-arg index="1"> > <ref bean="xfire.transportManager"/> > </constructor-arg> > <constructor-arg index="2"> > <ref bean="xfire.aegisBindingProvider"/> > </constructor-arg> > </bean> > > <bean id="xfire.commonsAnnotations" > class="org.codehaus.xfire.annotations.commons.CommonsWebAttributes"/> > > > <bean id="annotatedServiceFactory" > class="org.codehaus.xfire.annotations.AnnotationServiceFactory"/> > > > <bean id="myService" > class="org.codehaus.xfire.spring.remoting.XFireExporter"> > <property name="style" value="wrapped"/> > <property name="namespace" > value="http://services.mydomain.com"/> > <property name="serviceFactory"> > <ref bean="xfire.annotationServiceFactory"/> > </property> > <property name="serviceBean" ref="myManager"/> > <property name="serviceInterface" > value="com.mydomain.services.MyService"/> > </bean> > > > > As with post http://archive.xfire.codehaus.org/user/msg01282.html I get > the exception: > > org.codehaus.xfire.annotations.AnnotationException: Service class cannot > be abstract > > I tried commenting out the serviceInterface as well adding the > serviceClass property. > <property name="serviceClass" > value="com.mydomain.services.MyServiceImpl"/> > > In both cases I get the exception: > > java.lang.IllegalArgumentException: > [com.mydomain.services.MyServiceImpl] is not an interface > at > org.springframework.aop.framework.AdvisedSupport.addInterface(AdvisedSup > port.java:209) > at > org.codehaus.xfire.spring.remoting.XFireExporter.getProxyForService(XFir > eExporter.java:53) > at > org.codehaus.xfire.spring.ServiceBean.afterPropertiesSet(ServiceBean.jav > a:163) > at > org.codehaus.xfire.spring.remoting.XFireExporter.afterPropertiesSet(XFir > eExporter.java:27) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac > tory.invokeInitMethods(AbstractAutowi > reCapableBeanFactory.java:1059) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac > tory.createBean(AbstractAutowireCapab > leBeanFactory.java:363) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab > stractBeanFactory.java:226) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab > stractBeanFactory.java:147) > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.re > solveReference(BeanDefinitionValueRes > olver.java:176) > ... > > How does this work when spring expects an interface but the annotations > have to be supplied on an impelementation? > > Cheers, > > Aaron. > > > > -----Original Message----- > From: Dan Diephouse [mailto:[EMAIL PROTECTED] > Sent: Friday, 7 April 2006 8:27 AM > To: [email protected] > Subject: Re: [xfire-user] Controlling mapped name of service methods > using aegis > > Hi, > This results because aegis is a binding and it doesn't actually control > the parameter naming. We're working on making this possible in 1.1, but > in the mean time you'll need to use JSR 181 annotations (see the user's > guide for both java 1.4 and java 5 instructions). > Cheers, > - Dan > > BLISHEN Aaron wrote: > > >> I am currently exposing a service to a rich client using xfire. >> Following the aegis binding section on the xfire website, I have an xml >> > > >> file named the same as my service interface (and deployed in the same >> location). I want to name the parameters that are passed into the >> method because when I pass <myParam xsi:nil="true"/> on the client >> side, I get a SAXException: The prefix "xsi" for attribute "xsi:nil" >> associated with an element type " myParam " is not bound. I have >> > tried > >> not passing xsi:nil="true" and I get a number format exception server >> side for parameter value "". >> >> I am assuming this is because the wsdl specifies: >> >> <xsd:element name="in0" type="xsd:long" nillable="true" minOccurs="1" >> maxOccurs="1" /> >> >> and not : >> >> <xsd:element name="myParam" type="xsd:long" nillable="true" >> minOccurs="1" maxOccurs="1" /> >> >> >> Is there anything I am missing with specifying the parameter names? >> >> So in my web archive I have: >> >> /WEB-INF/classes/ >> MyService.java >> MyServiceImpl.java >> MyService.aegis.xml >> >> The aegis xml file contains: >> >> <mappings> >> <mapping uri=http://services.mydomain.com" name="MyService"> >> <method name="myMethod"> >> <parameter index="0" mappedName="myParam" nillable="true"/> >> </method> >> </mapping> >> </mappings> >> >> ***************************** Disclaimer ***************************** >> >> The contents of this electronic message and any attachments are >> > intended only for the addressee and may contain privileged or > confidential information. They may only be used for the purposes for > which they were supplied. If you are not the addressee, you are notified > that any transmission, distribution, downloading, printing or > photocopying of the contents of this message or attachments is strictly > prohibited. The privilege of confidentiality attached to this message > and attachments is not waived, lost or destroyed by reason of mistaken > delivery to you. If you receive this message in error please notify the > sender by return e-mail or telephone. > >> Thank you. >> >> >> > > > -- > Dan Diephouse > (616) 971-2053 > Envoi Solutions LLC > http://netzooid.com > > ***************************** Disclaimer ***************************** > > The contents of this electronic message and any attachments are intended only for the addressee and may contain privileged or confidential information. They may only be used for the purposes for which they were supplied. If you are not the addressee, you are notified that any transmission, distribution, downloading, printing or photocopying of the contents of this message or attachments is strictly prohibited. The privilege of confidentiality attached to this message and attachments is not waived, lost or destroyed by reason of mistaken delivery to you. If you receive this message in error please notify the sender by return e-mail or telephone. > > Thank you. > -- Dan Diephouse Envoi Solutions http://envoisolutions.com http://netzooid.com/blog ***************************** Disclaimer ***************************** The contents of this electronic message and any attachments are intended only for the addressee and may contain privileged or confidential information. They may only be used for the purposes for which they were supplied. If you are not the addressee, you are notified that any transmission, distribution, downloading, printing or photocopying of the contents of this message or attachments is strictly prohibited. The privilege of confidentiality attached to this message and attachments is not waived, lost or destroyed by reason of mistaken delivery to you. If you receive this message in error please notify the sender by return e-mail or telephone. Thank you.
