|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
[CXF] deployment problemsHi all,
I have a provider implementation for a service, then i want deploy with a specified wsdl and every msg should call the invoke() method I deploy it and my specified wsdl if correctly displayed, but every msg sent to the service is threat as OneWay (an empty 200ok is sent every time... ) Here is the config: web.xml <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <context-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/beans.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <servlet> <servlet-name>CXFServlet</servlet-name> <display-name>CXF Servlet</display-name> <servlet-class> org.apache.cxf.transport.servlet.CXFServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>CXFServlet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> beans.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/> <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> <property name="inInterceptors"> <list> <ref bean="logInbound"/> </list> </property> <property name="outInterceptors"> <list> <ref bean="logOutbound"/> </list> </property> <property name="outFaultInterceptors"> <list> <ref bean="logOutbound"/> </list> </property> </bean> <jaxws:endpoint id="ese6ordine" serviceName="s:OrdineService" implementor="isi.esercitazione.java2wsdl.Server" address="/ordine" xmlns:s="http://www.rivenditore.org/Ordine"/> </beans> isi.esercitazione.java2wsdl.Server package isi.esercitazione.java2wsdl; import javax.xml.soap.MessageFactory; @ServiceMode(value=Mode.MESSAGE) @WebServiceProvider(serviceName = "OrdineService", portName = "OrdineInterfaceEndpoint", targetNamespace = "http://www.rivenditore.org/Ordine", wsdlLocation = "webapps/ese6/WEB-INF/ordini.wsdl") public class Server implements Provider<SOAPMessage>{ public SOAPMessage invoke(SOAPMessage req){ SOAPMessage res = null; try{ MessageFactory msgFac = MessageFactory.newInstance(); res = msgFac.createMessage(); SOAPFactory soapFac = SOAPFactory.newInstance(); SOAPBodyElement esito = res.getSOAPBody().addBodyElement(soapFac.createName("esito", "ele", "http://www.rivenditore.org/ordiniElements")); SOAPElement ok = esito.addChildElement("ok"); SOAPElement id = ok.addChildElement("idOrdine"); id.setTextContent("123456"); SOAPElement totale = ok.addChildElement("totale"); totale.setTextContent("123.45"); totale.addAttribute(soapFac.createName("valuta"), "USD"); } catch(SOAPException soapex){ System.out.println("Errore SOAP: " + soapex); soapex.printStackTrace(); } catch(Exception ex){ System.out.println("Errore SOAP: " + ex); ex.printStackTrace(); } return res; } } Any tip? Thx all, Lorenzo |
|
|
Re: [CXF] deployment problemsCouple questions: 1) What version of CXF? 2) What deployment environment? Tomcat? 3) What's logged to the servers logs? Looking at the code, if res = msgFac.createMessage(); throws an exception, the return is null and nothing would get written out. It might be best to wrapper the exceptions with a WebServiceException or SOAPFaultException and throw that so the proper exception handling could occur. Another note: Instead of creating all the logger beans and the Bus bean and configuring all the interceptors and such, it's probably easier to just do: <cxf:bus> <cxf:features> <cxf:logging/> </cxf:features> </cxf:bus> ns: xmlns:cxf="http://cxf.apache.org/core" spring validation info: http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd Certainly less verbose. :-) Dan On Friday 11 April 2008, Cencio wrote: > Hi all, > > I have a provider implementation for a service, then i want deploy > with a specified wsdl and every msg should call the invoke() method > > I deploy it and my specified wsdl if correctly displayed, but every > msg sent to the service is threat as OneWay (an empty 200ok is sent > every time... ) > > Here is the config: > > web.xml > > > <?xml version="1.0" encoding="ISO-8859-1"?> > > <!DOCTYPE web-app > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/dtd/web-app_2_3.dtd"> > <web-app> > <context-param> > <param-name>contextConfigLocation</param-name> > <param-value>WEB-INF/beans.xml</param-value> > </context-param> > > <listener> > <listener-class> > org.springframework.web.context.ContextLoaderListener > </listener-class> > </listener> > > <servlet> > <servlet-name>CXFServlet</servlet-name> > <display-name>CXF Servlet</display-name> > <servlet-class> > org.apache.cxf.transport.servlet.CXFServlet > </servlet-class> > <load-on-startup>1</load-on-startup> > </servlet> > > <servlet-mapping> > <servlet-name>CXFServlet</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > </web-app> > > > beans.xml > > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:jaxws="http://cxf.apache.org/jaxws" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd > http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> > > <import resource="classpath:META-INF/cxf/cxf.xml" /> > <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> > <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> > <bean id="logInbound" > class="org.apache.cxf.interceptor.LoggingInInterceptor"/> > <bean id="logOutbound" > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> > > <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> > <property name="inInterceptors"> > <list> > <ref bean="logInbound"/> > </list> > </property> > <property name="outInterceptors"> > <list> > <ref bean="logOutbound"/> > </list> > </property> > <property name="outFaultInterceptors"> > <list> > <ref bean="logOutbound"/> > </list> > </property> > </bean> > <jaxws:endpoint > id="ese6ordine" > serviceName="s:OrdineService" > implementor="isi.esercitazione.java2wsdl.Server" > address="/ordine" > xmlns:s="http://www.rivenditore.org/Ordine"/> > > </beans> > > > > > > > isi.esercitazione.java2wsdl.Server > > package isi.esercitazione.java2wsdl; > import javax.xml.soap.MessageFactory; > > @ServiceMode(value=Mode.MESSAGE) > @WebServiceProvider(serviceName = "OrdineService", > portName = "OrdineInterfaceEndpoint", > targetNamespace = "http://www.rivenditore.org/Ordine", > wsdlLocation = "webapps/ese6/WEB-INF/ordini.wsdl") > > public class Server implements Provider<SOAPMessage>{ > public SOAPMessage invoke(SOAPMessage req){ > > SOAPMessage res = null; > try{ > MessageFactory msgFac = MessageFactory.newInstance(); > res = msgFac.createMessage(); > SOAPFactory soapFac = SOAPFactory.newInstance(); > SOAPBodyElement esito = > res.getSOAPBody().addBodyElement(soapFac.createName("esito", "ele", > "http://www.rivenditore.org/ordiniElements")); > SOAPElement ok = esito.addChildElement("ok"); > SOAPElement id = ok.addChildElement("idOrdine"); > id.setTextContent("123456"); > SOAPElement totale = ok.addChildElement("totale"); > totale.setTextContent("123.45"); > totale.addAttribute(soapFac.createName("valuta"), "USD"); > > } > catch(SOAPException soapex){ > System.out.println("Errore SOAP: " + soapex); > soapex.printStackTrace(); > } > catch(Exception ex){ > System.out.println("Errore SOAP: " + ex); > ex.printStackTrace(); > } > > return res; > } > } > > > > > > > > Any tip? > > > Thx all, > Lorenzo -- J. Daniel Kulp Principal Engineer, IONA dkulp@... http://www.dankulp.com/blog |
|
|
Re: [CXF] deployment problemsapache-apache-cxf-2.0.4-incubator Yes, Tomcat Nothing on server logs.. Just a "Error reading XMLStreamReader on client side" for Request/Response operation. I try to writeOut the response just before the return, and it's fine. I also try to catch any error doing a "throw new WebServiceException(e);" but no message is going out.. Yes :D it's more clean and easy to read. thx for the tip, Thx Dan, if u need any other info or have any solution to test just tell Regards, Lorenzo On Friday 11 April 2008, Cencio wrote: > Hi all, > > I have a provider implementation for a service, then i want deploy > with a specified wsdl and every msg should call the invoke() method > > I deploy it and my specified wsdl if correctly displayed, but every > msg sent to the service is threat as OneWay (an empty 200ok is sent > every time... ) > > Here is the config: > > web.xml > > > <?xml version="1.0" encoding="ISO-8859-1"?> > > <!DOCTYPE web-app > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/dtd/web-app_2_3.dtd"> > <web-app> > <context-param> > <param-name>contextConfigLocation</param-name> > <param-value>WEB-INF/beans.xml</param-value> > </context-param> > > <listener> > <listener-class> > org.springframework.web.context.ContextLoaderListener > </listener-class> > </listener> > > <servlet> > <servlet-name>CXFServlet</servlet-name> > <display-name>CXF Servlet</display-name> > <servlet-class> > org.apache.cxf.transport.servlet.CXFServlet > </servlet-class> > <load-on-startup>1</load-on-startup> > </servlet> > > <servlet-mapping> > <servlet-name>CXFServlet</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > </web-app> > > > beans.xml > > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:jaxws="http://cxf.apache.org/jaxws" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd > http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> > > <import resource="classpath:META-INF/cxf/cxf.xml" /> > <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> > <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> > <bean id="logInbound" > class="org.apache.cxf.interceptor.LoggingInInterceptor"/> > <bean id="logOutbound" > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> > > <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> > <property name="inInterceptors"> > <list> > <ref bean="logInbound"/> > </list> > </property> > <property name="outInterceptors"> > <list> > <ref bean="logOutbound"/> > </list> > </property> > <property name="outFaultInterceptors"> > <list> > <ref bean="logOutbound"/> > </list> > </property> > </bean> > <jaxws:endpoint > id="ese6ordine" > serviceName="s:OrdineService" > implementor="isi.esercitazione.java2wsdl.Server" > address="/ordine" > xmlns:s="http://www.rivenditore.org/Ordine"/> > > </beans> > > > > > > > isi.esercitazione.java2wsdl.Server > > package isi.esercitazione.java2wsdl; > import javax.xml.soap.MessageFactory; > > @ServiceMode(value=Mode.MESSAGE) > @WebServiceProvider(serviceName = "OrdineService", > portName = "OrdineInterfaceEndpoint", > targetNamespace = "http://www.rivenditore.org/Ordine", > wsdlLocation = "webapps/ese6/WEB-INF/ordini.wsdl") > > public class Server implements Provider<SOAPMessage>{ > public SOAPMessage invoke(SOAPMessage req){ > > SOAPMessage res = null; > try{ > MessageFactory msgFac = MessageFactory.newInstance(); > res = msgFac.createMessage(); > SOAPFactory soapFac = SOAPFactory.newInstance(); > SOAPBodyElement esito = > res.getSOAPBody().addBodyElement(soapFac.createName("esito", "ele", > "http://www.rivenditore.org/ordiniElements")); > SOAPElement ok = esito.addChildElement("ok"); > SOAPElement id = ok.addChildElement("idOrdine"); > id.setTextContent("123456"); > SOAPElement totale = ok.addChildElement("totale"); > totale.setTextContent("123.45"); > totale.addAttribute(soapFac.createName("valuta"), "USD"); > > } > catch(SOAPException soapex){ > System.out.println("Errore SOAP: " + soapex); > soapex.printStackTrace(); > } > catch(Exception ex){ > System.out.println("Errore SOAP: " + ex); > ex.printStackTrace(); > } > > return res; > } > } > > > > > > > > Any tip? > > > Thx all, > Lorenzo -- J. Daniel Kulp Principal Engineer, IONA dkulp@apache.org http://www.dankulp.com/blog |
|
|
Re: [CXF] deployment problemsAgain with this issue:
This is my enpoint definition: <jaxws:endpoint id="ese6ordine" serviceName="s:OrdineService" implementor="isi.esercitazione.java2wsdl.Server" address="/ordine" WEB-INF/ordini.wsdl xmlns:s="http://www.rivenditore.org/Ordine" wsdlLocation = "WEB-INF/ordini.wsdl" /> If i remove the wsdlLocation, the wsdl is correctly generated and everything works fine (all calls are replyed with my message). If i leave, the http://localhost:8080/ese6/ordine?wsdl is correctly showign WEB-INF/ordini.wsdl but all calls are threat as oneway... if u need i can send the war and sources. Thx for any help, Lorenzo
|
|
|
Re: [CXF] deployment problemsTryed also with CXF 2.0.5.. same results.
Oh, in the last post i mess with copy/paste.. this is my endpoint definition: <jaxws:endpoint id="ese6ordine" serviceName="s:OrdineService" implementor="isi.esercitazione.java2wsdl.Server" address="/ordine" xmlns:s="http://www.rivenditore.org/Ordine" wsdlLocation = "WEB-INF/ordini.wsdl" /> Still stuck, thx, again Lorenzo
|
|
|
Re: [CXF] deployment problems [maybe bug?]Ok... it don't seems a configuration error...
In my wsdl i have 2 operation, a request/response and a Oneway. If i remove the Oneway it works!! If i add it all operations are threated as Oneway.. Seems a bug.. someone can try to reproduce it?
|
|
|
Re: [CXF] deployment problemsOn Monday 14 April 2008, Cencio wrote:
> If i remove the wsdlLocation, the wsdl is correctly generated and > everything works fine (all calls are replyed with my message). If i > leave, the http://localhost:8080/ese6/ordine?wsdl is correctly showign > WEB-INF/ordini.wsdl but all calls are threat as oneway... if u need i > can send the war and sources. If you could, that would be GREAT! Having a reproducable testcase makes it MUCH easier to figure out what's going on. You can send it directly to me at dan@... to avoid the apache spam filters that tend to rip of attachments. Dan > Thx for any help, > Lorenzo -- J. Daniel Kulp Principal Engineer, IONA dkulp@... http://www.dankulp.com/blog |
|
|
Re: [CXF] deployment problemsI got the testcase, thanks. Just to clarify, I need to uncomment the operation in the wsdl as well. That said, if I do that, it actually works for me with the 2.1 trunk. I get: [java] Invoking notifica... [java] Invoking submitOrdine... [java] submitOrdine.result=123456 That said, it's wrong. If I wireshark the actual wire transfer, the notifica operation is returning an empty soap message response. Thus, there is an issue. Actually, now that I think about it, there were a LOT of changes in the one-way stuff for 2.1 as the 2.1 JAX-WS TCK has a WHOLE bunch of new tests for one-ways that the 2.0 tck doesn't have. Thus, it may be working just because of those changes. I'll have to get a 2.0.x environment setup. That will take a bit longer, but I do want to get it properly working for 2.1 since we hope to release 2.1 later this week so that's actually going to be my priority for today. Dan On Monday 14 April 2008, Cencio1980 wrote: > Hi Dan, > > that's my testcase. > > As i told you in the last mail i found that removing OneWay operation > the request/response one now works. if i add it all operations works > as oneway. > > check build.xml for the tomcat path.. > > ant deploy <<< to deploy > ant run_Client <<< to run the client > > > > (edit > client/org/rivenditore/ordine/OrdineInterface_OrdineInterfaceEndpoint_ >Client.java uncomment the call for oneway operation to add it) > > > > Thx, Lorenzo -- J. Daniel Kulp Principal Engineer, IONA dkulp@... http://www.dankulp.com/blog |
|
|
Re: [CXF] deployment problemsThis is now fixed on trunk. I'll get another 2.1 snapshot out later today as there are several other fixes that need to get out to people to test as well. Dan On Monday 14 April 2008, Daniel Kulp wrote: > I got the testcase, thanks. > > > Just to clarify, I need to uncomment the operation in the wsdl as > well. > > > That said, if I do that, it actually works for me with the 2.1 trunk. > I get: > > [java] Invoking notifica... > [java] Invoking submitOrdine... > [java] submitOrdine.result=123456 > > That said, it's wrong. If I wireshark the actual wire transfer, the > notifica operation is returning an empty soap message response. > Thus, there is an issue. > > Actually, now that I think about it, there were a LOT of changes in > the one-way stuff for 2.1 as the 2.1 JAX-WS TCK has a WHOLE bunch of > new tests for one-ways that the 2.0 tck doesn't have. Thus, it may > be working just because of those changes. I'll have to get a 2.0.x > environment setup. That will take a bit longer, but I do want to get > it properly working for 2.1 since we hope to release 2.1 later this > week so that's actually going to be my priority for today. > > Dan > > On Monday 14 April 2008, Cencio1980 wrote: > > Hi Dan, > > > > that's my testcase. > > > > As i told you in the last mail i found that removing OneWay > > operation the request/response one now works. if i add it all > > operations works as oneway. > > > > check build.xml for the tomcat path.. > > > > ant deploy <<< to deploy > > ant run_Client <<< to run the client > > > > > > > > (edit > > client/org/rivenditore/ordine/OrdineInterface_OrdineInterfaceEndpoin > >t_ Client.java uncomment the call for oneway operation to add it) > > > > > > > > Thx, Lorenzo -- J. Daniel Kulp Principal Engineer, IONA dkulp@... http://www.dankulp.com/blog |
| Free embeddable forum powered by Nabble | Forum Help |