You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jeremy Isikoff <ji...@yahoo.com> on 2007/07/27 00:44:46 UTC

Dependency Injection in JAXWS endpoint

I have an endpoint declaration like this in my beans.xml file, the trouble is the
implementing class needs to get hold of some other spring beans (mainly DAOs) so it can do its work.  How can I inject these in or get the application context from within this implementation class?  If this was a normal bean declaration id just inject the DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any clues?

<jaxws:endpoint 
id="reportingService" 
implementor="com.visualio.reportserver.webservices.ReportingServiceImpl" 
address="/ReportingService" 
/>

Jeremy M. Isikoff


       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

Re: Dependency Injection in JAXWS endpoint

Posted by Brad Harper <br...@gmail.com>.
Also, cfx:wsdl2java fails when the aspect is wired.  Sorry If you guys
already know this or If I've missed this topic in the list... just trying to
help and get help.

-b

On 7/26/07, Brad Harper <br...@gmail.com> wrote:
>
> When I remove my transaction advice:
> <aop:config>
>         <aop:advisor id="serviceTx" advice-ref="txAdvice"
> pointcut="execution(* *..service..*.*(..))" order="0"/>
>     </aop:config>
>
>
>     <tx:advice id="txAdvice">
>         <tx:attributes>
>             <tx:method name="find*" read-only="true"/>
>             <tx:method name="*"/>
>         </tx:attributes>
>     </tx:advice>
>
> the WSDLException above is resolved.  Can endpoints be transactional?
>
> On 7/26/07, Brad Harper <br...@gmail.com> wrote:
> >
> > I've tried wiring like you've shown:
> >
> >    <bean id="TestServiceImpl" class="
> > com.mycorp.service.thirdparty.TestServiceImpl">
> >         <property name="daoFactory">
> >             <ref bean="hibernateDAOFactory"/>
> >         </property>
> >     </bean>
> >
> >     <jaxws:endpoint
> >       id="testService"
> >       implementor="#TestServiceImpl"
> >       address="/testService" />
> >
> > I get odd service names displayed on the /services/
> >
> > $Proxy50Port<http://localhost:8080/gdservices/services/testService?wsdl>
> >
> > I also get a 500 error when attempting to view the wsdl ..
> >
> > javax.servlet.ServletException: org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
> > 	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:131)
> > 	org.apache.cxf.transport.servlet.CXFServlet.invoke
> >
> > (CXFServlet.java:261)
> > 	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java
> >
> > :803)
> > 	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> > 	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java
> > :77)
> >
> > *root cause*
> >
> > org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
> > 	org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:185)
> > 	org.apache.cxf.transport.servlet.ServletController.invoke
> >
> > (ServletController.java:127)
> > 	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
> > 	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
> > 	javax.servlet.http.HttpServlet.service
> >
> > (HttpServlet.java:690)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > 	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> > 	org.springframework.web.filter.OncePerRequestFilter.doFilter
> >
> > (OncePerRequestFilter.java:77)
> >
> > *root cause*
> >
> > javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid. Prefixed namespace bindings may not be empty.
> >
> >
> > 	com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> > 	com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> > 	org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:141)
> >
> >
> > 	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127)
> > 	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
> > 	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java
> >
> > :243)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > 	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> >
> > (OpenSessionInViewFilter.java:174)
> > 	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> >
> > Does this look like something with my configuration?  I'm using aop
> > transactions on the classes I'm trying to expose -- is this a bad practice?
> >
> > Thanks for your time.
> >
> > -bh
> >
> >
> > On 7/26/07, Mansour Raad < mraad@esri.com> wrote:
> > >
> > > Sorry....replace the implementor, not the id.
> > >
> > > Mansour
> > > :-)
> > >
> > > On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
> > >
> > > > Create a bean as follows:
> > > >
> > > > <bean id="reportingServiceImpl"
> > > > class="com.visualio.reportserver.webservices.ReportingServiceImpl">
> > > >   <!-- set properties here -->
> > > > </bean>
> > > >
> > > > Replace the jaxws:endpoint id with
> > > >
> > > >       id="#reportingServiceImpl"
> > > >
> > > > Mansour
> > > > :-)
> > > >
> > > > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
> > > >
> > > >> I have an endpoint declaration like this in my beans.xml file, the
> > > >> trouble is the
> > > >> implementing class needs to get hold of some other spring beans
> > > >> (mainly DAOs) so it can do its work.  How can I inject these in or
> > > >> get the application context from within this implementation
> > > >> class?  If this was a normal bean declaration id just inject the
> > > >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
> > > >> clues?
> > > >>
> > > >> <jaxws:endpoint
> > > >> id="reportingService"
> > > >> implementor="
> > > com.visualio.reportserver.webservices.ReportingServiceIm
> > > >> pl"
> > > >> address="/ReportingService"
> > > >> />
> > > >>
> > > >> Jeremy M. Isikoff
> > > >>
> > > >>
> > > >>
> > > >>
> > > _____________________________________________________________________
> > > >> _______________
> > > >> Be a better Heartthrob. Get better relationship answers from
> > > >> someone who knows. Yahoo! Answers - Check it out.
> > > >> http://answers.yahoo.com/dir/?link=list&sid=396545433
> > > >>
> > > >
> > > > Mansour
> > > > :-)
> > > >
> > > >
> > > >
> > >
> > > Mansour
> > > :-)
> > >
> > >
> > >
> > >
> >
>

Re: Dependency Injection in JAXWS endpoint

Posted by godoloju <Ma...@zionsbank.com>.
This solved the problem for me as well (switching from endpoint to server) &
I learned about autowire!


Michael Lake-5 wrote:
> 
> Brad -
> 
> I'm also using spring aop for transactions and method interceptors on my 
> endpoint interface.
> instead of using the <jaxws:endpoint implementor="#yourclass" ...
> 
> try something like the following:
> 
>   <jaxws:server id="alternateServiceEndpointServer"
>                   
> serviceClass="com.example.endpoint.AlternateServiceEndpoint"
>                   address="/AlternateService">
> 
>         <jaxws:serviceBean>
>             <bean id="alternateServiceEndpointImpl"
>           class="com.example.endpoint.AlternateServiceEndpointImpl" 
> autowire="byName" />
>         </jaxws:serviceBean>       
> 
>     </jaxws:server>
> 
> I've tried it this way and it works for me. either that or my upgrading 
> to spring 2.0.5
> 
> 
> 
> Brad Harper wrote:
>> When I remove my transaction advice:
>> <aop:config>
>>        <aop:advisor id="serviceTx" advice-ref="txAdvice"
>> pointcut="execution(* *..service..*.*(..))" order="0"/>
>>    </aop:config>
>>
>>
>>    <tx:advice id="txAdvice">
>>        <tx:attributes>
>>            <tx:method name="find*" read-only="true"/>
>>            <tx:method name="*"/>
>>        </tx:attributes>
>>    </tx:advice>
>>
>> the WSDLException above is resolved.  Can endpoints be transactional?
>>
>> On 7/26/07, Brad Harper <br...@gmail.com> wrote:
>>>
>>> I've tried wiring like you've shown:
>>>
>>>    <bean id="TestServiceImpl" class="
>>> com.mycorp.service.thirdparty.TestServiceImpl">
>>>         <property name="daoFactory">
>>>             <ref bean="hibernateDAOFactory"/>
>>>         </property>
>>>     </bean>
>>>
>>>     <jaxws:endpoint
>>>       id="testService"
>>>       implementor="#TestServiceImpl"
>>>       address="/testService" />
>>>
>>> I get odd service names displayed on the /services/
>>>
>>> $Proxy50Port 
>>> <http://localhost:8080/gdservices/services/testService?wsdl>
>>>
>>> I also get a 500 error when attempting to view the wsdl ..
>>>
>>> javax.servlet.ServletException: 
>>> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
>>>    
>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:131) 
>>>
>>>     org.apache.cxf.transport.servlet.CXFServlet.invoke
>>> (CXFServlet.java:261)
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243) 
>>>
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java
>>> :803)
>>>    
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
>>>
>>>    
>>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) 
>>>
>>>
>>> *root cause*
>>>
>>> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
>>>    
>>> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:185) 
>>>
>>>     org.apache.cxf.transport.servlet.ServletController.invoke
>>> (ServletController.java:127)
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) 
>>>
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243) 
>>>
>>>     javax.servlet.http.HttpServlet.service
>>> (HttpServlet.java:690)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>    
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
>>>
>>>     org.springframework.web.filter.OncePerRequestFilter.doFilter
>>> (OncePerRequestFilter.java:77)
>>>
>>> *root cause*
>>>
>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: 
>>> Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: 
>>> The value of the attribute 
>>> "prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid. 
>>> Prefixed namespace bindings may not be empty.
>>>
>>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>    
>>> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:141) 
>>>
>>>
>>>    
>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127) 
>>>
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) 
>>>
>>>     org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java
>>> :243)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>    
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal 
>>>
>>> (OpenSessionInViewFilter.java:174)
>>>    
>>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) 
>>>
>>>
>>> Does this look like something with my configuration?  I'm using aop
>>> transactions on the classes I'm trying to expose -- is this a bad 
>>> practice?
>>>
>>> Thanks for your time.
>>>
>>> -bh
>>>
>>>
>>> On 7/26/07, Mansour Raad <mr...@esri.com> wrote:
>>> >
>>> > Sorry....replace the implementor, not the id.
>>> >
>>> > Mansour
>>> > :-)
>>> >
>>> > On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
>>> >
>>> > > Create a bean as follows:
>>> > >
>>> > > <bean id="reportingServiceImpl"
>>> > > class="com.visualio.reportserver.webservices.ReportingServiceImpl">
>>> > >   <!-- set properties here -->
>>> > > </bean>
>>> > >
>>> > > Replace the jaxws:endpoint id with
>>> > >
>>> > >       id="#reportingServiceImpl"
>>> > >
>>> > > Mansour
>>> > > :-)
>>> > >
>>> > > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
>>> > >
>>> > >> I have an endpoint declaration like this in my beans.xml file, the
>>> > >> trouble is the
>>> > >> implementing class needs to get hold of some other spring beans
>>> > >> (mainly DAOs) so it can do its work.  How can I inject these in or
>>> > >> get the application context from within this implementation
>>> > >> class?  If this was a normal bean declaration id just inject the
>>> > >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
>>> > >> clues?
>>> > >>
>>> > >> <jaxws:endpoint
>>> > >> id="reportingService"
>>> > >> 
>>> implementor="com.visualio.reportserver.webservices.ReportingServiceIm
>>> > >> pl"
>>> > >> address="/ReportingService"
>>> > >> />
>>> > >>
>>> > >> Jeremy M. Isikoff
>>> > >>
>>> > >>
>>> > >>
>>> > >> 
>>> _____________________________________________________________________
>>> > >> _______________
>>> > >> Be a better Heartthrob. Get better relationship answers from
>>> > >> someone who knows. Yahoo! Answers - Check it out.
>>> > >> http://answers.yahoo.com/dir/?link=list&sid=396545433
>>> > >>
>>> > >
>>> > > Mansour
>>> > > :-)
>>> > >
>>> > >
>>> > >
>>> >
>>> > Mansour
>>> > :-)
>>> >
>>> >
>>> >
>>> >
>>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Dependency-Injection-in-JAXWS-endpoint-tf4154573.html#a12563757
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Dependency Injection in JAXWS endpoint

Posted by Brad Harper <br...@gmail.com>.
Currently, I don't think there is a solution.  The cxf dev team is looking
into the issue.

-bh

On 7/30/07, Zarar Siddiqi <za...@gmail.com> wrote:
>
>
> Hi,
>
> I'm in the exact same situation.  Do you mind sharing your solution? I'm
> also using AOP and Spring in the same manner.
>
> Thanks,
> Zarar
>
>
>
> Michael Lake-5 wrote:
> >
> > Brad -
> >
> > I'm also using spring aop for transactions and method interceptors on my
> > endpoint interface.
> > instead of using the <jaxws:endpoint implementor="#yourclass" ...
> >
> > try something like the following:
> >
> >   <jaxws:server id="alternateServiceEndpointServer"
> >
> > serviceClass="com.example.endpoint.AlternateServiceEndpoint"
> >                   address="/AlternateService">
> >
> >         <jaxws:serviceBean>
> >             <bean id="alternateServiceEndpointImpl"
> >           class="com.example.endpoint.AlternateServiceEndpointImpl"
> > autowire="byName" />
> >         </jaxws:serviceBean>
> >
> >     </jaxws:server>
> >
> > I've tried it this way and it works for me. either that or my upgrading
> > to spring 2.0.5
> >
> >
> >
> > Brad Harper wrote:
> >> When I remove my transaction advice:
> >> <aop:config>
> >>        <aop:advisor id="serviceTx" advice-ref="txAdvice"
> >> pointcut="execution(* *..service..*.*(..))" order="0"/>
> >>    </aop:config>
> >>
> >>
> >>    <tx:advice id="txAdvice">
> >>        <tx:attributes>
> >>            <tx:method name="find*" read-only="true"/>
> >>            <tx:method name="*"/>
> >>        </tx:attributes>
> >>    </tx:advice>
> >>
> >> the WSDLException above is resolved.  Can endpoints be transactional?
> >>
> >> On 7/26/07, Brad Harper <br...@gmail.com> wrote:
> >>>
> >>> I've tried wiring like you've shown:
> >>>
> >>>    <bean id="TestServiceImpl" class="
> >>> com.mycorp.service.thirdparty.TestServiceImpl">
> >>>         <property name="daoFactory">
> >>>             <ref bean="hibernateDAOFactory"/>
> >>>         </property>
> >>>     </bean>
> >>>
> >>>     <jaxws:endpoint
> >>>       id="testService"
> >>>       implementor="#TestServiceImpl"
> >>>       address="/testService" />
> >>>
> >>> I get odd service names displayed on the /services/
> >>>
> >>> $Proxy50Port
> >>> <http://localhost:8080/gdservices/services/testService?wsdl>
> >>>
> >>> I also get a 500 error when attempting to view the wsdl ..
> >>>
> >>> javax.servlet.ServletException:
> >>> org.apache.cxf.transport.http.WSDLQueryException:
> COULD_NOT_PROVIDE_WSDL
> >>>
> >>> org.apache.cxf.transport.servlet.ServletController.invoke(
> ServletController.java:131)
> >>>
> >>>     org.apache.cxf.transport.servlet.CXFServlet.invoke
> >>> (CXFServlet.java:261)
> >>>
> >>> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
> >>>
> >>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> >>>     javax.servlet.http.HttpServlet.service(HttpServlet.java
> >>> :803)
> >>>
> >>>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> (OpenSessionInViewFilter.java:174)
> >>>
> >>>
> >>> org.springframework.web.filter.OncePerRequestFilter.doFilter(
> OncePerRequestFilter.java:77)
> >>>
> >>>
> >>> *root cause*
> >>>
> >>> org.apache.cxf.transport.http.WSDLQueryException:
> COULD_NOT_PROVIDE_WSDL
> >>>
> >>> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(
> WSDLQueryHandler.java:185)
> >>>
> >>>     org.apache.cxf.transport.servlet.ServletController.invoke
> >>> (ServletController.java:127)
> >>>
> >>> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java
> :261)
> >>>
> >>>
> >>> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
> >>>
> >>>     javax.servlet.http.HttpServlet.service
> >>> (HttpServlet.java:690)
> >>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>
> >>>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> (OpenSessionInViewFilter.java:174)
> >>>
> >>>     org.springframework.web.filter.OncePerRequestFilter.doFilter
> >>> (OncePerRequestFilter.java:77)
> >>>
> >>> *root cause*
> >>>
> >>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> >>> Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException:
> >>> The value of the attribute
> >>> "prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid.
> >>> Prefixed namespace bindings may not be empty.
> >>>
> >>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> >>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> >>>
> >>> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(
> WSDLQueryHandler.java:141)
> >>>
> >>>
> >>>
> >>> org.apache.cxf.transport.servlet.ServletController.invoke(
> ServletController.java:127)
> >>>
> >>>
> >>> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java
> :261)
> >>>
> >>>     org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java
> >>> :243)
> >>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> >>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>
> >>>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> >>>
> >>> (OpenSessionInViewFilter.java:174)
> >>>
> >>> org.springframework.web.filter.OncePerRequestFilter.doFilter(
> OncePerRequestFilter.java:77)
> >>>
> >>>
> >>> Does this look like something with my configuration?  I'm using aop
> >>> transactions on the classes I'm trying to expose -- is this a bad
> >>> practice?
> >>>
> >>> Thanks for your time.
> >>>
> >>> -bh
> >>>
> >>>
> >>> On 7/26/07, Mansour Raad <mr...@esri.com> wrote:
> >>> >
> >>> > Sorry....replace the implementor, not the id.
> >>> >
> >>> > Mansour
> >>> > :-)
> >>> >
> >>> > On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
> >>> >
> >>> > > Create a bean as follows:
> >>> > >
> >>> > > <bean id="reportingServiceImpl"
> >>> > > class="com.visualio.reportserver.webservices.ReportingServiceImpl
> ">
> >>> > >   <!-- set properties here -->
> >>> > > </bean>
> >>> > >
> >>> > > Replace the jaxws:endpoint id with
> >>> > >
> >>> > >       id="#reportingServiceImpl"
> >>> > >
> >>> > > Mansour
> >>> > > :-)
> >>> > >
> >>> > > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
> >>> > >
> >>> > >> I have an endpoint declaration like this in my beans.xml file,
> the
> >>> > >> trouble is the
> >>> > >> implementing class needs to get hold of some other spring beans
> >>> > >> (mainly DAOs) so it can do its work.  How can I inject these in
> or
> >>> > >> get the application context from within this implementation
> >>> > >> class?  If this was a normal bean declaration id just inject the
> >>> > >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
> >>> > >> clues?
> >>> > >>
> >>> > >> <jaxws:endpoint
> >>> > >> id="reportingService"
> >>> > >>
> >>> implementor="com.visualio.reportserver.webservices.ReportingServiceIm
> >>> > >> pl"
> >>> > >> address="/ReportingService"
> >>> > >> />
> >>> > >>
> >>> > >> Jeremy M. Isikoff
> >>> > >>
> >>> > >>
> >>> > >>
> >>> > >>
> >>> _____________________________________________________________________
> >>> > >> _______________
> >>> > >> Be a better Heartthrob. Get better relationship answers from
> >>> > >> someone who knows. Yahoo! Answers - Check it out.
> >>> > >> http://answers.yahoo.com/dir/?link=list&sid=396545433
> >>> > >>
> >>> > >
> >>> > > Mansour
> >>> > > :-)
> >>> > >
> >>> > >
> >>> > >
> >>> >
> >>> > Mansour
> >>> > :-)
> >>> >
> >>> >
> >>> >
> >>> >
> >>>
> >>
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dependency-Injection-in-JAXWS-endpoint-tf4154573.html#a11884767
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Dependency Injection in JAXWS endpoint

Posted by Zarar Siddiqi <za...@gmail.com>.
Hi,

I'm in the exact same situation.  Do you mind sharing your solution? I'm
also using AOP and Spring in the same manner.  

Thanks,
Zarar



Michael Lake-5 wrote:
> 
> Brad -
> 
> I'm also using spring aop for transactions and method interceptors on my 
> endpoint interface.
> instead of using the <jaxws:endpoint implementor="#yourclass" ...
> 
> try something like the following:
> 
>   <jaxws:server id="alternateServiceEndpointServer"
>                   
> serviceClass="com.example.endpoint.AlternateServiceEndpoint"
>                   address="/AlternateService">
> 
>         <jaxws:serviceBean>
>             <bean id="alternateServiceEndpointImpl"
>           class="com.example.endpoint.AlternateServiceEndpointImpl" 
> autowire="byName" />
>         </jaxws:serviceBean>       
> 
>     </jaxws:server>
> 
> I've tried it this way and it works for me. either that or my upgrading 
> to spring 2.0.5
> 
> 
> 
> Brad Harper wrote:
>> When I remove my transaction advice:
>> <aop:config>
>>        <aop:advisor id="serviceTx" advice-ref="txAdvice"
>> pointcut="execution(* *..service..*.*(..))" order="0"/>
>>    </aop:config>
>>
>>
>>    <tx:advice id="txAdvice">
>>        <tx:attributes>
>>            <tx:method name="find*" read-only="true"/>
>>            <tx:method name="*"/>
>>        </tx:attributes>
>>    </tx:advice>
>>
>> the WSDLException above is resolved.  Can endpoints be transactional?
>>
>> On 7/26/07, Brad Harper <br...@gmail.com> wrote:
>>>
>>> I've tried wiring like you've shown:
>>>
>>>    <bean id="TestServiceImpl" class="
>>> com.mycorp.service.thirdparty.TestServiceImpl">
>>>         <property name="daoFactory">
>>>             <ref bean="hibernateDAOFactory"/>
>>>         </property>
>>>     </bean>
>>>
>>>     <jaxws:endpoint
>>>       id="testService"
>>>       implementor="#TestServiceImpl"
>>>       address="/testService" />
>>>
>>> I get odd service names displayed on the /services/
>>>
>>> $Proxy50Port 
>>> <http://localhost:8080/gdservices/services/testService?wsdl>
>>>
>>> I also get a 500 error when attempting to view the wsdl ..
>>>
>>> javax.servlet.ServletException: 
>>> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
>>>    
>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:131) 
>>>
>>>     org.apache.cxf.transport.servlet.CXFServlet.invoke
>>> (CXFServlet.java:261)
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243) 
>>>
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java
>>> :803)
>>>    
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
>>>
>>>    
>>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) 
>>>
>>>
>>> *root cause*
>>>
>>> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
>>>    
>>> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:185) 
>>>
>>>     org.apache.cxf.transport.servlet.ServletController.invoke
>>> (ServletController.java:127)
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) 
>>>
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243) 
>>>
>>>     javax.servlet.http.HttpServlet.service
>>> (HttpServlet.java:690)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>    
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
>>>
>>>     org.springframework.web.filter.OncePerRequestFilter.doFilter
>>> (OncePerRequestFilter.java:77)
>>>
>>> *root cause*
>>>
>>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: 
>>> Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: 
>>> The value of the attribute 
>>> "prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid. 
>>> Prefixed namespace bindings may not be empty.
>>>
>>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>>    
>>> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:141) 
>>>
>>>
>>>    
>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127) 
>>>
>>>    
>>> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) 
>>>
>>>     org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java
>>> :243)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>>    
>>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal 
>>>
>>> (OpenSessionInViewFilter.java:174)
>>>    
>>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) 
>>>
>>>
>>> Does this look like something with my configuration?  I'm using aop
>>> transactions on the classes I'm trying to expose -- is this a bad 
>>> practice?
>>>
>>> Thanks for your time.
>>>
>>> -bh
>>>
>>>
>>> On 7/26/07, Mansour Raad <mr...@esri.com> wrote:
>>> >
>>> > Sorry....replace the implementor, not the id.
>>> >
>>> > Mansour
>>> > :-)
>>> >
>>> > On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
>>> >
>>> > > Create a bean as follows:
>>> > >
>>> > > <bean id="reportingServiceImpl"
>>> > > class="com.visualio.reportserver.webservices.ReportingServiceImpl">
>>> > >   <!-- set properties here -->
>>> > > </bean>
>>> > >
>>> > > Replace the jaxws:endpoint id with
>>> > >
>>> > >       id="#reportingServiceImpl"
>>> > >
>>> > > Mansour
>>> > > :-)
>>> > >
>>> > > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
>>> > >
>>> > >> I have an endpoint declaration like this in my beans.xml file, the
>>> > >> trouble is the
>>> > >> implementing class needs to get hold of some other spring beans
>>> > >> (mainly DAOs) so it can do its work.  How can I inject these in or
>>> > >> get the application context from within this implementation
>>> > >> class?  If this was a normal bean declaration id just inject the
>>> > >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
>>> > >> clues?
>>> > >>
>>> > >> <jaxws:endpoint
>>> > >> id="reportingService"
>>> > >> 
>>> implementor="com.visualio.reportserver.webservices.ReportingServiceIm
>>> > >> pl"
>>> > >> address="/ReportingService"
>>> > >> />
>>> > >>
>>> > >> Jeremy M. Isikoff
>>> > >>
>>> > >>
>>> > >>
>>> > >> 
>>> _____________________________________________________________________
>>> > >> _______________
>>> > >> Be a better Heartthrob. Get better relationship answers from
>>> > >> someone who knows. Yahoo! Answers - Check it out.
>>> > >> http://answers.yahoo.com/dir/?link=list&sid=396545433
>>> > >>
>>> > >
>>> > > Mansour
>>> > > :-)
>>> > >
>>> > >
>>> > >
>>> >
>>> > Mansour
>>> > :-)
>>> >
>>> >
>>> >
>>> >
>>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Dependency-Injection-in-JAXWS-endpoint-tf4154573.html#a11884767
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Dependency Injection in JAXWS endpoint

Posted by Michael Lake <mi...@musictoday.com>.
Brad -

I'm also using spring aop for transactions and method interceptors on my 
endpoint interface.
instead of using the <jaxws:endpoint implementor="#yourclass" ...

try something like the following:

  <jaxws:server id="alternateServiceEndpointServer"
                  
serviceClass="com.example.endpoint.AlternateServiceEndpoint"
                  address="/AlternateService">

        <jaxws:serviceBean>
            <bean id="alternateServiceEndpointImpl"
          class="com.example.endpoint.AlternateServiceEndpointImpl" 
autowire="byName" />
        </jaxws:serviceBean>       

    </jaxws:server>

I've tried it this way and it works for me. either that or my upgrading 
to spring 2.0.5



Brad Harper wrote:
> When I remove my transaction advice:
> <aop:config>
>        <aop:advisor id="serviceTx" advice-ref="txAdvice"
> pointcut="execution(* *..service..*.*(..))" order="0"/>
>    </aop:config>
>
>
>    <tx:advice id="txAdvice">
>        <tx:attributes>
>            <tx:method name="find*" read-only="true"/>
>            <tx:method name="*"/>
>        </tx:attributes>
>    </tx:advice>
>
> the WSDLException above is resolved.  Can endpoints be transactional?
>
> On 7/26/07, Brad Harper <br...@gmail.com> wrote:
>>
>> I've tried wiring like you've shown:
>>
>>    <bean id="TestServiceImpl" class="
>> com.mycorp.service.thirdparty.TestServiceImpl">
>>         <property name="daoFactory">
>>             <ref bean="hibernateDAOFactory"/>
>>         </property>
>>     </bean>
>>
>>     <jaxws:endpoint
>>       id="testService"
>>       implementor="#TestServiceImpl"
>>       address="/testService" />
>>
>> I get odd service names displayed on the /services/
>>
>> $Proxy50Port 
>> <http://localhost:8080/gdservices/services/testService?wsdl>
>>
>> I also get a 500 error when attempting to view the wsdl ..
>>
>> javax.servlet.ServletException: 
>> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
>>     org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:131) 
>>
>>     org.apache.cxf.transport.servlet.CXFServlet.invoke
>> (CXFServlet.java:261)
>>     org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243) 
>>
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java
>> :803)
>>     org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
>>
>>     org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) 
>>
>>
>> *root cause*
>>
>> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
>>     org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:185) 
>>
>>     org.apache.cxf.transport.servlet.ServletController.invoke
>> (ServletController.java:127)
>>     org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) 
>>
>>     org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243) 
>>
>>     javax.servlet.http.HttpServlet.service
>> (HttpServlet.java:690)
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>     org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) 
>>
>>     org.springframework.web.filter.OncePerRequestFilter.doFilter
>> (OncePerRequestFilter.java:77)
>>
>> *root cause*
>>
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: 
>> Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: 
>> The value of the attribute 
>> "prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid. 
>> Prefixed namespace bindings may not be empty.
>>
>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>     com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
>>     org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:141) 
>>
>>
>>     org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127) 
>>
>>     org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) 
>>
>>     org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java
>> :243)
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>     org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal 
>>
>> (OpenSessionInViewFilter.java:174)
>>     org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) 
>>
>>
>> Does this look like something with my configuration?  I'm using aop
>> transactions on the classes I'm trying to expose -- is this a bad 
>> practice?
>>
>> Thanks for your time.
>>
>> -bh
>>
>>
>> On 7/26/07, Mansour Raad <mr...@esri.com> wrote:
>> >
>> > Sorry....replace the implementor, not the id.
>> >
>> > Mansour
>> > :-)
>> >
>> > On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
>> >
>> > > Create a bean as follows:
>> > >
>> > > <bean id="reportingServiceImpl"
>> > > class="com.visualio.reportserver.webservices.ReportingServiceImpl">
>> > >   <!-- set properties here -->
>> > > </bean>
>> > >
>> > > Replace the jaxws:endpoint id with
>> > >
>> > >       id="#reportingServiceImpl"
>> > >
>> > > Mansour
>> > > :-)
>> > >
>> > > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
>> > >
>> > >> I have an endpoint declaration like this in my beans.xml file, the
>> > >> trouble is the
>> > >> implementing class needs to get hold of some other spring beans
>> > >> (mainly DAOs) so it can do its work.  How can I inject these in or
>> > >> get the application context from within this implementation
>> > >> class?  If this was a normal bean declaration id just inject the
>> > >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
>> > >> clues?
>> > >>
>> > >> <jaxws:endpoint
>> > >> id="reportingService"
>> > >> 
>> implementor="com.visualio.reportserver.webservices.ReportingServiceIm
>> > >> pl"
>> > >> address="/ReportingService"
>> > >> />
>> > >>
>> > >> Jeremy M. Isikoff
>> > >>
>> > >>
>> > >>
>> > >> 
>> _____________________________________________________________________
>> > >> _______________
>> > >> Be a better Heartthrob. Get better relationship answers from
>> > >> someone who knows. Yahoo! Answers - Check it out.
>> > >> http://answers.yahoo.com/dir/?link=list&sid=396545433
>> > >>
>> > >
>> > > Mansour
>> > > :-)
>> > >
>> > >
>> > >
>> >
>> > Mansour
>> > :-)
>> >
>> >
>> >
>> >
>>
>


Re: Dependency Injection in JAXWS endpoint

Posted by Brad Harper <br...@gmail.com>.
When I remove my transaction advice:
<aop:config>
        <aop:advisor id="serviceTx" advice-ref="txAdvice"
pointcut="execution(* *..service..*.*(..))" order="0"/>
    </aop:config>


    <tx:advice id="txAdvice">
        <tx:attributes>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="*"/>
        </tx:attributes>
    </tx:advice>

the WSDLException above is resolved.  Can endpoints be transactional?

On 7/26/07, Brad Harper <br...@gmail.com> wrote:
>
> I've tried wiring like you've shown:
>
>    <bean id="TestServiceImpl" class="
> com.mycorp.service.thirdparty.TestServiceImpl">
>         <property name="daoFactory">
>             <ref bean="hibernateDAOFactory"/>
>         </property>
>     </bean>
>
>     <jaxws:endpoint
>       id="testService"
>       implementor="#TestServiceImpl"
>       address="/testService" />
>
> I get odd service names displayed on the /services/
>
> $Proxy50Port <http://localhost:8080/gdservices/services/testService?wsdl>
>
> I also get a 500 error when attempting to view the wsdl ..
>
> javax.servlet.ServletException: org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
> 	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:131)
> 	org.apache.cxf.transport.servlet.CXFServlet.invoke
> (CXFServlet.java:261)
> 	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java
> :803)
> 	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> 	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
>
> *root cause*
>
> org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
> 	org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:185)
> 	org.apache.cxf.transport.servlet.ServletController.invoke
> (ServletController.java:127)
> 	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
> 	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
> 	javax.servlet.http.HttpServlet.service
> (HttpServlet.java:690)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> 	org.springframework.web.filter.OncePerRequestFilter.doFilter
> (OncePerRequestFilter.java:77)
>
> *root cause*
>
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid. Prefixed namespace bindings may not be empty.
>
> 	com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> 	com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
> 	org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:141)
>
> 	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127)
> 	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
> 	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java
> :243)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> (OpenSessionInViewFilter.java:174)
> 	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
>
> Does this look like something with my configuration?  I'm using aop
> transactions on the classes I'm trying to expose -- is this a bad practice?
>
> Thanks for your time.
>
> -bh
>
>
> On 7/26/07, Mansour Raad <mr...@esri.com> wrote:
> >
> > Sorry....replace the implementor, not the id.
> >
> > Mansour
> > :-)
> >
> > On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
> >
> > > Create a bean as follows:
> > >
> > > <bean id="reportingServiceImpl"
> > > class="com.visualio.reportserver.webservices.ReportingServiceImpl">
> > >   <!-- set properties here -->
> > > </bean>
> > >
> > > Replace the jaxws:endpoint id with
> > >
> > >       id="#reportingServiceImpl"
> > >
> > > Mansour
> > > :-)
> > >
> > > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
> > >
> > >> I have an endpoint declaration like this in my beans.xml file, the
> > >> trouble is the
> > >> implementing class needs to get hold of some other spring beans
> > >> (mainly DAOs) so it can do its work.  How can I inject these in or
> > >> get the application context from within this implementation
> > >> class?  If this was a normal bean declaration id just inject the
> > >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
> > >> clues?
> > >>
> > >> <jaxws:endpoint
> > >> id="reportingService"
> > >> implementor="com.visualio.reportserver.webservices.ReportingServiceIm
> > >> pl"
> > >> address="/ReportingService"
> > >> />
> > >>
> > >> Jeremy M. Isikoff
> > >>
> > >>
> > >>
> > >> _____________________________________________________________________
> > >> _______________
> > >> Be a better Heartthrob. Get better relationship answers from
> > >> someone who knows. Yahoo! Answers - Check it out.
> > >> http://answers.yahoo.com/dir/?link=list&sid=396545433
> > >>
> > >
> > > Mansour
> > > :-)
> > >
> > >
> > >
> >
> > Mansour
> > :-)
> >
> >
> >
> >
>

Re: Dependency Injection in JAXWS endpoint

Posted by Brad Harper <br...@gmail.com>.
I've tried wiring like you've shown:

   <bean id="TestServiceImpl" class="
com.mycorp.service.thirdparty.TestServiceImpl">
        <property name="daoFactory">
            <ref bean="hibernateDAOFactory"/>
        </property>
    </bean>

    <jaxws:endpoint
      id="testService"
      implementor="#TestServiceImpl"
      address="/testService" />

I get odd service names displayed on the /services/

$Proxy50Port <http://localhost:8080/gdservices/services/testService?wsdl>

I also get a 500 error when attempting to view the wsdl ..

javax.servlet.ServletException:
org.apache.cxf.transport.http.WSDLQueryException:
COULD_NOT_PROVIDE_WSDL
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:131)
	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)

*root cause*

org.apache.cxf.transport.http.WSDLQueryException: COULD_NOT_PROVIDE_WSDL
	org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:185)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127)
	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)

*root cause*

javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException:
The value of the attribute
"prefix="xmlns",localpart="ns2",rawname="xmlns:ns2"" is invalid.
Prefixed namespace bindings may not be empty.
	com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
	com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)
	org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHandler.java:141)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:127)
	org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261)
	org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:243)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)

Does this look like something with my configuration?  I'm using aop
transactions on the classes I'm trying to expose -- is this a bad practice?

Thanks for your time.

-bh


On 7/26/07, Mansour Raad <mr...@esri.com> wrote:
>
> Sorry....replace the implementor, not the id.
>
> Mansour
> :-)
>
> On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:
>
> > Create a bean as follows:
> >
> > <bean id="reportingServiceImpl"
> > class="com.visualio.reportserver.webservices.ReportingServiceImpl">
> >   <!-- set properties here -->
> > </bean>
> >
> > Replace the jaxws:endpoint id with
> >
> >       id="#reportingServiceImpl"
> >
> > Mansour
> > :-)
> >
> > On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
> >
> >> I have an endpoint declaration like this in my beans.xml file, the
> >> trouble is the
> >> implementing class needs to get hold of some other spring beans
> >> (mainly DAOs) so it can do its work.  How can I inject these in or
> >> get the application context from within this implementation
> >> class?  If this was a normal bean declaration id just inject the
> >> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any
> >> clues?
> >>
> >> <jaxws:endpoint
> >> id="reportingService"
> >> implementor="com.visualio.reportserver.webservices.ReportingServiceIm
> >> pl"
> >> address="/ReportingService"
> >> />
> >>
> >> Jeremy M. Isikoff
> >>
> >>
> >>
> >> _____________________________________________________________________
> >> _______________
> >> Be a better Heartthrob. Get better relationship answers from
> >> someone who knows. Yahoo! Answers - Check it out.
> >> http://answers.yahoo.com/dir/?link=list&sid=396545433
> >>
> >
> > Mansour
> > :-)
> >
> >
> >
>
> Mansour
> :-)
>
>
>
>

Re: Dependency Injection in JAXWS endpoint

Posted by Mansour Raad <mr...@esri.com>.
Sorry....replace the implementor, not the id.

Mansour
:-)

On Jul 26, 2007, at 6:49 PM, Mansour Raad wrote:

> Create a bean as follows:
>
> <bean id="reportingServiceImpl"  
> class="com.visualio.reportserver.webservices.ReportingServiceImpl">
>   <!-- set properties here -->
> </bean>
>
> Replace the jaxws:endpoint id with
>
> 	id="#reportingServiceImpl"
>
> Mansour
> :-)
>
> On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:
>
>> I have an endpoint declaration like this in my beans.xml file, the  
>> trouble is the
>> implementing class needs to get hold of some other spring beans  
>> (mainly DAOs) so it can do its work.  How can I inject these in or  
>> get the application context from within this implementation  
>> class?  If this was a normal bean declaration id just inject the  
>> DAOs but I dont know what to do with a Jaxws:endpoint bean?  Any  
>> clues?
>>
>> <jaxws:endpoint
>> id="reportingService"
>> implementor="com.visualio.reportserver.webservices.ReportingServiceIm 
>> pl"
>> address="/ReportingService"
>> />
>>
>> Jeremy M. Isikoff
>>
>>
>>
>> _____________________________________________________________________ 
>> _______________
>> Be a better Heartthrob. Get better relationship answers from  
>> someone who knows. Yahoo! Answers - Check it out.
>> http://answers.yahoo.com/dir/?link=list&sid=396545433
>>
>
> Mansour
> :-)
>
>
>

Mansour
:-)




Re: Dependency Injection in JAXWS endpoint

Posted by Mansour Raad <mr...@esri.com>.
Create a bean as follows:

<bean id="reportingServiceImpl"  
class="com.visualio.reportserver.webservices.ReportingServiceImpl">
   <!-- set properties here -->
</bean>

Replace the jaxws:endpoint id with

	id="#reportingServiceImpl"

Mansour
:-)

On Jul 26, 2007, at 6:44 PM, Jeremy Isikoff wrote:

> I have an endpoint declaration like this in my beans.xml file, the  
> trouble is the
> implementing class needs to get hold of some other spring beans  
> (mainly DAOs) so it can do its work.  How can I inject these in or  
> get the application context from within this implementation class?   
> If this was a normal bean declaration id just inject the DAOs but I  
> dont know what to do with a Jaxws:endpoint bean?  Any clues?
>
> <jaxws:endpoint
> id="reportingService"
> implementor="com.visualio.reportserver.webservices.ReportingServiceImp 
> l"
> address="/ReportingService"
> />
>
> Jeremy M. Isikoff
>
>
>
> ______________________________________________________________________ 
> ______________
> Be a better Heartthrob. Get better relationship answers from  
> someone who knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545433
>

Mansour
:-)