Re: wsdl2Java compiler error w/customer binding
org.w3._2001.xmlschema.Adapter1 is generated by wsdl2java tool or wrote by yourself ? Jim On Thu, Apr 10, 2008 at 6:24 AM, [EMAIL PROTECTED] wrote: I've followed the documentation pertaining to a customer binding for wsdl2java. Specifically, replacing the XMLGregorianCalendar with java.util.Date. The command I'm using is as follows: ./wsdl2java.bat -d s:\\cxf-client\\src -compile -client -b quoteBrokerBinding.ml http://cmathrusxp:8080/QuoteService_r1.6/services/QuoteBroker?wsdl My binding file is as follows: jaxws:bindings wsdlLocation= http://cmathrusxp:8080/QuoteService_r1.6/services/QuoteBroker?wsdl; xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:jxb=http://java.sun.com/xml/ns/jaxb; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; jaxws:bindings node=wsdl:definitions/wsdl:types/xs:[EMAIL PROTECTED]'http://quoting.it.sybase.com' ] jxb:globalBindings xmlns:jxb=http://java.sun.com/xml/ns/jaxb; xmlns:xs=http://www.w3.org/2001/XMLSchema; jxb:javaType name=java.util.Date xmlType=xs:dateTime parseMethod=org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime printMethod=org.apache.cxf.tools.common.DataTypeAdapter.printDateTime/ /jxb:globalBindings /jaxws:bindings /jaxws:bindings And when I run the wsdl2java command I get the following error: s:\cxf-client\src\com\sybase\it\quoting\QuoteLineitemDTO.java:10: package org.w3._2001.xmlschema does not exist import org.w3._2001.xmlschema.Adapter1; I've looked at the generated source and there is an Adapter1.java file located in S:\cxf-client\src\org\w3\_2001\xmlschema So things appear to be genereating but the error seems to be coming from the -compile option. Is there something I need to do to get past this or should I simply manually build? Thanks... Chris Mathrusse [EMAIL PROTECTED] Sybase, Inc One Sybase Drive Dublin, CA 94568 (925) 236-5553
Re: WSDL2Java does not generate the setter method of a List of objects
Hi , what is your wsdl ? Cheers Jim Ma On 3/6/08, Landslide [EMAIL PROTECTED] wrote: If I have a class of Contact which has an instance variable of ListAddress addresses = new ArrayListAddress(); on my server side implementation, using the tool of WSDL2Java generates the getter method: public ListAddress getAddresses() { if (addresses == null) { addresses = new ArrayListAddress(); } return this.addresses; } but it does not generate the setter method: public void setAddresses(ListAddress addresses) { this.addresses = addresses; } I am using CXF 2.0.4. -- View this message in context: http://www.nabble.com/WSDL2Java-does-not-generate-the-setter-method-of-a-List-of-objects-tp15872563p15872563.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WSDL2Java error when using jaxb:serializable/ binding customization
I tried it in command line and it works. I notice this error message : Caused by: java.net.URISyntaxException: Illegal character in path at index 53: file: [...path-to-project ommitted...]/src/main/test/test.wsdl. Is there any strange character in this path ? On 3/5/08, Jesse McLaughlin [EMAIL PROTECTED] wrote: Hi Jim, I tried modifying my WSDL as suggested. However this produces the exact same error as before. The preamble to my WSDL now looks like: ?xml version=1.0 encoding=utf-8? definitions targetNamespace=http://www.test.com/TestService/; xmlns:tns=http://www.test.com/TestService/; xmlns:test=http://www.test.com/test; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns=http://schemas.xmlsoap.org/wsdl/; types xsd:schema xsd:import schemaLocation=types.xsd namespace=http://www.test.com/test/ /xsd:schema /types ... And the error output looks the same as before: [java] wsdl2java -verbose -client -b bindings.xml -d [...path-to-project ommitted...]/src/main/java [...path-to-project ommitted...]/src/main/test/test.wsdl [java] wsdl2java - Apache CXF (incubator) 2.0.4-incubator [java] WSDLToJava Error : java.lang.RuntimeException: Fail to create wsdl definition file: [...path-to-project ommitted...]/src/main/test/test.wsdl [java] org.apache.cxf.tools.common.ToolException: java.lang.RuntimeException: Fail to create wsdl definition file: [...path-to-project ommitted...]/src/main/test/test.wsdl [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:237) [java] at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171) [java] Caused by: java.lang.RuntimeException: Fail to create wsdl definition file: [...path-to-project ommitted...]/src/main/test/test.wsdl [java] at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.customize(JAXWSDefinitionBuilder.java:130) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:123) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:229) [java] ... 3 more [java] Caused by: java.lang.RuntimeException: Failed to Resolve types.xsd [java] at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.CustomizedWSDLLocator.getImportInputSource(CustomizedWSDLLocator.java:129) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.buildCustomizedDefinition(JAXWSDefinitionBuilder.java:178) [java] at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.customize(JAXWSDefinitionBuilder.java:125) [java] ... 5 more [java] Caused by: java.net.URISyntaxException: Illegal character in path at index 53: file: [...path-to-project ommitted...]/src/main/test/test.wsdl [java] at java.net.URI$Parser.fail(URI.java:2816) [java] at java.net.URI$Parser.checkChars(URI.java:2989) [java] at java.net.URI$Parser.parseHierarchical(URI.java:3073) [java] at java.net.URI$Parser.parse(URI.java:3021) [java] at java.net.URI.init(URI.java:578) [java] at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.CustomizedWSDLLocator.getImportInputSource(CustomizedWSDLLocator.java:113) [java] ... 16 more Is this being caused by a bug somewhere in WSDL2Java? As before, it all works OK if the binding file is not passed in. Thanks, Jesse. jim ma wrote: Some elements are missing in your wsdl. Can you modify your wsdl like this and try it again ? ?xml version=1.0 encoding=utf-8? definitions targetNamespace=http://www.test.com/TestService/; xmlns:tns=http://www.test.com/TestService/; xmlns:test=http://www.test.com/test; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns=http://schemas.xmlsoap.org/wsdl/; wsdl:types xsd:schema xsd:import schemaLocation=types.xsd namespace= http
Re: WSDL2Java error when using jaxb:serializable/ binding customization
Go ahead, Jesse. Wsdl2java tool will use different class to process customization(binding file), so we need to process the URI contains spaces before it invokes JAXWSDefinitionBuilder class. Cheers Jim Ma On Wed, Mar 5, 2008 at 10:56 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Cool. Thanks Ian. I changed my setup so as to avoid any spaces in the full project path, and everything started working as expected. So I take it this means there is a bug there... ie. you can't have spaces in your project path if you want to use a binding customization such as this (where as normally, leaving out the binding file, spaces pose no issue). Unless there are any objections, or unless a similar bug has already been logged, I'll add this one into JIRA. Cheers, Jesse. ianroberts wrote: Jesse McLaughlin wrote: Hi Jim, No, there's no strange characters in the full path. There are spaces, but that's about as strange as it gets. You can't have spaces in a java.net.URI, they have to be escaped as %20. I'm not sure whose responsibility it is to do this though... Ian -- Ian Roberts | Department of Computer Science [EMAIL PROTECTED] | University of Sheffield, UK -- View this message in context: http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15852009.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WSDL2Java error when using jaxb:serializable/ binding customization
Hi Jesse, Can you also paste the error stacktrace for the details? Thanks Jim Ma On Tue, Mar 4, 2008 at 5:42 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Thanks for the suggestion Dan. Now I am getting a different error from WSDL2Java. I tried the following exact binding file based on what you suggested: jxb:bindings version=1.0 xmlns:jxb=http://java.sun.com/xml/ns/jaxb; xmlns:xs=http://www.w3.org/2001/XMLSchema; jxb:bindings schemaLocation=types.xsd node=/xs:schema jxb:globalBindings jxb:serializable/ /jxb:globalBindings /jxb:bindings /jxb:bindings And the error I get is: WSDLToJava Error : java.lang.RuntimeException: Fail to create wsdl definition [...path-to-project ommitted...]/src/main/test/test.wsdl This must be a fairly common case, but I can't find any way to make it work (and I have tried a few variations). Is there any further help out there on this issue? Thanks and regards, Jesse. dkulp wrote: It should just be something like: jxb:bindings version=1.0 xmlns:jxb=http://java.sun.com/xml/ns/jaxb; xmlns:xs=http://www.w3.org/2001/XMLSchema; jxb:bindings schemaLocation=MySchema.xsd node=/xs:schema jaxb:globalBindings jaxb:serializable/ /jaxb:globalBindings /jxb:bindings /jxb:bindings Dan On Monday 03 March 2008, Jesse McLaughlin wrote: Thanks Jim. I've figured out why it didn't work for me. It seems that this binding file won't work because I am importing my type definitions (which are in a seperate xsd file) as opposed to including them inline in the WSDL document itself. Here's what the preamble of my WSDL looks like: ?xml version=1.0 encoding=utf-8? definitions targetNamespace=http://www.test.com/TestService/; xmlns:tns=http://www.test.com/TestService/; xmlns:test=http://www.test.com/test; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns=http://schemas.xmlsoap.org/wsdl/; import namespace=http://www.test.com/test; location=types.xsd/ ... I verified this by removing the import and in-lining my types, and everything works. My problem is that I don't know how to construct a binding file that works when an import is used. Do I now need to specify a schemaLocation attribute? If so, what is the value? And what would be the proper value for the node attribute on the jaxb:bindings element in this case? Could someone provide an example of a binding file that would work? Thanks, Jesse. jim ma wrote: Hi Jesse, I just tried this binding file with hello_world.wsdl and it works. Can you check if there is some typo/error in your wsdl and make sure the xpath expression is right for your wsdl . Cheers Jim Ma On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Hi there, I am trying to use CXF to generate a JAXB client from a WSDL, and I want all the generated objects to implement java.io.Serializable. To do this, I pass the following bindings file to WSDL2Java, using the -b option: ?xml version=1.0 encoding=UTF-8? jaxws:bindings node=wsdl:definitions/wsdl:types/xsd:schema xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; jaxb:globalBindings jaxb:serializable/ /jaxb:globalBindings /jaxws:bindings When I run WSDL2Java, it gives me the following error: WSDLToJava Error : Could not find any node with the XPath expression: //wsdl:definitions/wsdl:types/xsd:schema The client is generated normally if I don't pass this file. I am using CXF 2.0.4 with JDK5 on OS X. Note that I have read on JIRA that since CXF 2.0.3, neither the wsdlLocation nor schemaLocation attributes are required when doing this sort of customization (https://issues.apache.org/jira/browse/CXF-1094). Does anyone know what I am doing wrong here or why it does not work? Thanks, Jesse. -- View this message in context: http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializ able-%3E-binding-customization-tp15786637p15786637.html Sent from the cxf-user mailing list archive at Nabble.com. -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog -- View this message in context: http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15823617.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WSDL2Java error when using jaxb:serializable/ binding customization
[java] Mar 4, 2008 2:28:06 PM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin [java] INFO: Found 1 frontends in default plugin. [java] Mar 4, 2008 2:28:06 PM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin [java] INFO: Loading jaxws frontend from default plugin. [java] Mar 4, 2008 2:28:06 PM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin [java] INFO: Found 1 databindings in default plugin. [java] Mar 4, 2008 2:28:06 PM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin [java] INFO: Loading jaxb databinding from default plugin. [java] WSDLToJava Error : java.lang.RuntimeException: Fail to create wsdl definition file:[...path-to-project ommitted...]/src/main/test/test.wsdl Is there some way to get the stack trace information? Cheers, Jesse. jim ma wrote: Hi Jesse, Can you also paste the error stacktrace for the details? Thanks Jim Ma On Tue, Mar 4, 2008 at 5:42 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Thanks for the suggestion Dan. Now I am getting a different error from WSDL2Java. I tried the following exact binding file based on what you suggested: jxb:bindings version=1.0 xmlns:jxb=http://java.sun.com/xml/ns/jaxb; xmlns:xs=http://www.w3.org/2001/XMLSchema; jxb:bindings schemaLocation=types.xsd node=/xs:schema jxb:globalBindings jxb:serializable/ /jxb:globalBindings /jxb:bindings /jxb:bindings And the error I get is: WSDLToJava Error : java.lang.RuntimeException: Fail to create wsdl definition [...path-to-project ommitted...]/src/main/test/test.wsdl This must be a fairly common case, but I can't find any way to make it work (and I have tried a few variations). Is there any further help out there on this issue? Thanks and regards, Jesse. dkulp wrote: It should just be something like: jxb:bindings version=1.0 xmlns:jxb=http://java.sun.com/xml/ns/jaxb; xmlns:xs=http://www.w3.org/2001/XMLSchema; jxb:bindings schemaLocation=MySchema.xsd node=/xs:schema jaxb:globalBindings jaxb:serializable/ /jaxb:globalBindings /jxb:bindings /jxb:bindings Dan On Monday 03 March 2008, Jesse McLaughlin wrote: Thanks Jim. I've figured out why it didn't work for me. It seems that this binding file won't work because I am importing my type definitions (which are in a seperate xsd file) as opposed to including them inline in the WSDL document itself. Here's what the preamble of my WSDL looks like: ?xml version=1.0 encoding=utf-8? definitions targetNamespace=http://www.test.com/TestService/; xmlns:tns=http://www.test.com/TestService/; xmlns:test=http://www.test.com/test; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns=http://schemas.xmlsoap.org/wsdl/; import namespace=http://www.test.com/test; location=types.xsd/ ... I verified this by removing the import and in-lining my types, and everything works. My problem is that I don't know how to construct a binding file that works when an import is used. Do I now need to specify a schemaLocation attribute? If so, what is the value? And what would be the proper value for the node attribute on the jaxb:bindings element in this case? Could someone provide an example of a binding file that would work? Thanks, Jesse. jim ma wrote: Hi Jesse, I just tried this binding file with hello_world.wsdl and it works. Can you check if there is some typo/error in your wsdl and make sure the xpath expression is right for your wsdl . Cheers Jim Ma On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Hi there, I am trying to use CXF to generate a JAXB client from a WSDL, and I want all the generated objects to implement java.io.Serializable. To do this, I pass the following bindings file to WSDL2Java, using the -b option: ?xml version=1.0 encoding=UTF-8? jaxws:bindings node=wsdl:definitions/wsdl:types/xsd:schema xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; jaxb:globalBindings jaxb:serializable/ /jaxb:globalBindings /jaxws:bindings When I run WSDL2Java, it gives me the following error: WSDLToJava Error : Could not find any node with the XPath expression: //wsdl:definitions/wsdl:types/xsd:schema
Re: Stub generation and WSDLs
Hi, The wsdl is required because not all the informations are generated in the stub code . For example, you can not find the port address information in stub code. Regards Jim Ma On Wed, Mar 5, 2008 at 12:25 AM, John-M Baker [EMAIL PROTECTED] wrote: Hello, Why does the stubs generated contain both a URL to the service: public final static QName SERVICE = new QName(http://service.ws.websso.db.com;, Query); public final static QName QuerySOAP11PortHttps = new QName(http://service.ws.websso.db.com;, QuerySOAP11port_https); But also requires the WSDL (passed in the constructor)? Surely the WSDL has been used to generate the stubs, and once it has the service URL, the WSDL is now unrequired? John Baker -- Web SSO IT Infrastructure Deutsche Bank London URL: http://websso.cto.gt.intranet.db.com --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.
Re: WSDL2Java error when using jaxb:serializable/ binding customization
Hi Jesse, I just tried this binding file with hello_world.wsdl and it works. Can you check if there is some typo/error in your wsdl and make sure the xpath expression is right for your wsdl . Cheers Jim Ma On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Hi there, I am trying to use CXF to generate a JAXB client from a WSDL, and I want all the generated objects to implement java.io.Serializable. To do this, I pass the following bindings file to WSDL2Java, using the -b option: ?xml version=1.0 encoding=UTF-8? jaxws:bindings node=wsdl:definitions/wsdl:types/xsd:schema xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; jaxb:globalBindings jaxb:serializable/ /jaxb:globalBindings /jaxws:bindings When I run WSDL2Java, it gives me the following error: WSDLToJava Error : Could not find any node with the XPath expression: //wsdl:definitions/wsdl:types/xsd:schema The client is generated normally if I don't pass this file. I am using CXF 2.0.4 with JDK5 on OS X. Note that I have read on JIRA that since CXF 2.0.3, neither the wsdlLocation nor schemaLocation attributes are required when doing this sort of customization (https://issues.apache.org/jira/browse/CXF-1094). Does anyone know what I am doing wrong here or why it does not work? Thanks, Jesse. -- View this message in context: http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15786637.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Does CXF Support Interfaces as Web Params?
Kohsuke Kawaguchi's blog talked about this , you can get some information from this link: http://weblogs.java.net/blog/kohsuke/archive/2006/06/jaxb_and_interf.html On Wed, Feb 27, 2008 at 9:25 AM, Glen Mazza [EMAIL PROTECTED] wrote: I think the answer is no, neither CXF nor GlassFish Metro support interfaces as parameters. It's either a JAX-WS or JAXB rule, I'm not certain. Glen Am Dienstag, den 26.02.2008, 15:07 -0800 schrieb Ayush Gupta: In my web service, there is a method which takes an interface as its parameter, instead of a concrete class. Reference code is at the bottom of this email. When I run the client, I get an exception Caused by: javax.xml.bind.JAXBException: com.passenger.test.ComplexObjectInterfaceis not known to this context. Further investigation and digging through the CXF code bought me to JAXBUtils. getValidClass(Class? cls) which is called while building the JAXBContext. The code in JAXBUtils. getValidClass explicitly excludes inclusion of any interfaces! I also tried setting the XmlJavaTypeAdapter on the interface but that didn't work. So, does CXF Support Interfaces as Web Params? I'd appreciate anyone throwing some light on this! Thanks -ayush Web Service Interface: public interface TestServiceInterface { public void testMethod(MyInterface param); } Parameter Interface: public interface MyInterface{ String getText(); void setText(String t); } Parameter concrete class: public class MyClass implements MyInterface { private String text; public String getText() { return text; } public void setText(String t) { this.text = t; } } Client: Service service = Service.create(SERVICE_NAME); service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, ENDPOINT_ADDRESS); TestServiceInterface serviceInterface = service.getPort(TestServiceInterface.class); serviceInterface. testMethod(new MyClass());
Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy'
Hi Monica, How did you get this wsdl ? Is this wsdl generated with CXF java to wsdl tool ? Since the generated wsdl is an invalid wsdl , cxf wsdl to java tool is failed to generate code for it. I think the problem is in wsdl generation, so we need to know if the right classes is loaded in jaxb context during java to wsdl execution. Regards Jim Monica Ferrero wrote: Hi Jim, I'm not sure I follow you. I can't see any wsdl to java log... The logging.properties in ${CXF_HOME}/etc/logging.properties indicate the output is taking to the console. Even if I activate the file appender there is no information about the 'Classes known to this context' there. If I run the wsdl to java in verbose mode, I get a bit more information (see below), but no what we are looking for... Thanks, Monica [exec] Loading FrontEnd jaxws ... [exec] Loading DataBinding jaxb ... [exec] command xmlns=http://cxf.apache.org/Xutil/Command; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http:/ /cxf.apache.org/Xutil/Command http://cxf.apache.org/schema/xutil/command.xsd; [exec] option name=verbose/ [exec] option name=packagenamecom.aaa.bbb.myservice/option [exec] option name=bindingbindingsPD.xjb/option [exec] argument name=wsdlurlMyService.wsdl/argument [exec] /command [exec] wsdl2java -verbose -p com.aaa.bbb.myservice -b bindingsPD.xjb MyService.wsdl [exec] wsdl2java - Apache CXF (incubator) 2.0.3-incubator [exec] [exec] [exec] WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' [exec] [exec] org.apache.cxf.tools.common.ToolException: Thrown by JAXB : undefined element declaration 'ns1:orderBy' [exec] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:34) [exec] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:245) [exec] at com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:61) [exec] at com.sun.xml.xsom.impl.parser.ParserContext$2.error(ParserContext.java:188) [exec] at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:166) [exec] at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:103) [exec] at com.sun.xml.xsom.impl.parser.DelayedRef.resolve(DelayedRef.java:91) [exec] at com.sun.xml.xsom.impl.parser.DelayedRef.run(DelayedRef.java:66) [exec] at com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:126) [exec] at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:172) [exec] at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:488) [exec] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:197) [exec] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:209) [exec] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:504) [exec] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:183) [exec] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:229) [exec] at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) [exec] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102) [exec] at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171) [exec] Caused by: org.xml.sax.SAXParseException: undefined element declaration 'ns1:orderBy' [exec] at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:162) [exec] ... 14 more Inactive hide details for Jim Ma ---09/01/2008 02:18:56---Hi Monica,Jim Ma ---09/01/2008 02:18:56---Hi Monica, From: Jim Ma [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 09/01/2008 02:18 Subject: Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' Hi Monica, Forget to mention . Search it in java to wsdl 's log . Regards Jim Monica Ferrero wrote: Hi Jim, Changed the logging level to FINE as you indicated and run the wsdl to java on my wsdl, but there is no such a message in there as Classes known to this context:. I've search for classes and context as well and there is nothing on those lines. There are some exceptions that I'm not sure there are relevant. I add here the last one before the error. Thanks for your help, Monica [exec] 08-Jan-2008 10:19:57 com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory get [exec] FINE: Using optimized Accessor for com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding$UnderscoreBinding com.sun.tools.xjc.re ader.xmlschema.bindinfo.BIGlobalBinding.getUnderscoreBinding() and void com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.setUnderscore Binding(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding$UnderscoreBinding) [exec] 08-Jan-2008 10
Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy'
Hi Monica, Forget to mention . Search it in java to wsdl 's log . Regards Jim Monica Ferrero wrote: Hi Jim, Changed the logging level to FINE as you indicated and run the wsdl to java on my wsdl, but there is no such a message in there as Classes known to this context:. I've search for classes and context as well and there is nothing on those lines. There are some exceptions that I'm not sure there are relevant. I add here the last one before the error. Thanks for your help, Monica [exec] 08-Jan-2008 10:19:57 com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory get [exec] FINE: Using optimized Accessor for com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding$UnderscoreBinding com.sun.tools.xjc.re ader.xmlschema.bindinfo.BIGlobalBinding.getUnderscoreBinding() and void com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.setUnderscore Binding(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding$UnderscoreBinding) [exec] 08-Jan-2008 10:19:57 com.sun.xml.bind.v2.runtime.reflect.opt.Injector inject [exec] FINE: Unable to inject com/sun/tools/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute$JaxbAccessorF_collectionType [exec] java.lang.reflect.InvocationTargetException [exec] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [exec] at java.lang.reflect.Method.invoke(Method.java:597) [exec] at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:125) [...] [exec] at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171) [exec] Caused by: java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: com/sun/tools/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute$JaxbAccessorF_collectionType [exec] at java.lang.ClassLoader.defineClass1(Native Method) [exec] at java.lang.ClassLoader.defineClass(ClassLoader.java:620) [exec] at java.lang.ClassLoader.defineClass(ClassLoader.java:465) [exec] ... 84 more Inactive hide details for Jim Ma ---08/01/2008 02:56:05---Hi Monica,Jim Ma ---08/01/2008 02:56:05---Hi Monica, From: Jim Ma [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 08/01/2008 02:56 Subject: Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' Hi Monica, You can change the log level to FINE (modify the log configuration file under ${CXF_HOME}/etc/logging.properties) to see if the OrderBy classes added to JAXB Context when you run java2wsdl tool . Search Classes known to this context: in the log file to see if this class is known to JAXB. Regards Jim Monica Ferrero wrote: Hi Jim, Thank you for your reply. Item and OrderBy are generated by JAXB from a schema.xsd file. I have followed your advice to see if it behaves any different but I still get the same error. The Item and therefore OrderBy classes belong to a different JAXB context: com.aaa.bbb.zzz.jaxb, but not sure if/how to indicate this? Thanks for your help, Monica Inactive hide details for Jim Ma ---07/01/2008 02:22:26---Hi ,Jim Ma ---07/01/2008 02:22:26---Hi , From: Jim Ma [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 07/01/2008 02:22 Subject: Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' Hi , From the error message , I think this is caused by the inner class OrderBy is not loaded into JAXB context . Can you modify this class as a outer class and try it again ? I will look it further to see if the JAXB can not load the inner static class . Thanks Jim Monica Ferrero wrote: Hi! I'm getting this error: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' when trying to generate java stubs from the wsdl. This is my original service: @WebService(endpointInterface = com.aaa.bbb.ccc.MyService) public interface MyService { [...] @WebResult(name=MyList) @WebMethod MyList getItems( @WebParam(name=listId) int listId); [...] } the MyList class: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = {items}) @XmlRootElement(name = myList) public class MyList { @XmlElement(required = true) private ListItem items; public ListItem getItems() { if (items == null) { items = new ArrayListItem(); } return items; } public void setItems(ListItem items) { this.items = items; } } The Item is a JAXB generated file from a schema: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = { attributesPD, orderBy }) @XmlRootElement
Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy'
Hi Monica, You can change the log level to FINE (modify the log configuration file under ${CXF_HOME}/etc/logging.properties) to see if the OrderBy classes added to JAXB Context when you run java2wsdl tool . Search Classes known to this context: in the log file to see if this class is known to JAXB. Regards Jim Monica Ferrero wrote: Hi Jim, Thank you for your reply. Item and OrderBy are generated by JAXB from a schema.xsd file. I have followed your advice to see if it behaves any different but I still get the same error. The Item and therefore OrderBy classes belong to a different JAXB context: com.aaa.bbb.zzz.jaxb, but not sure if/how to indicate this? Thanks for your help, Monica Inactive hide details for Jim Ma ---07/01/2008 02:22:26---Hi ,Jim Ma ---07/01/2008 02:22:26---Hi , From: Jim Ma [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 07/01/2008 02:22 Subject: Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' Hi , From the error message , I think this is caused by the inner class OrderBy is not loaded into JAXB context . Can you modify this class as a outer class and try it again ? I will look it further to see if the JAXB can not load the inner static class . Thanks Jim Monica Ferrero wrote: Hi! I'm getting this error: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' when trying to generate java stubs from the wsdl. This is my original service: @WebService(endpointInterface = com.aaa.bbb.ccc.MyService) public interface MyService { [...] @WebResult(name=MyList) @WebMethod MyList getItems( @WebParam(name=listId) int listId); [...] } the MyList class: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = {items}) @XmlRootElement(name = myList) public class MyList { @XmlElement(required = true) private ListItem items; public ListItem getItems() { if (items == null) { items = new ArrayListItem(); } return items; } public void setItems(ListItem items) { this.items = items; } } The Item is a JAXB generated file from a schema: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = { attributesPD, orderBy }) @XmlRootElement(name = item) public class Item { @XmlElement(name = attributes, required = true) protected AttributesPD attributesPD; protected Item.OrderBy orderBy; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = token) protected String id; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = token) protected String createdBy; @XmlAttribute @XmlSchemaType(name = date) protected XMLGregorianCalendar creationDate; public AttributesPD getAttributesPD() { return attributesPD; } public void setAttributesPD(AttributesPD value) { this.attributesPD = value; } public Item.OrderBy getOrderBy() { return orderBy; } public void setOrderBy(Item.OrderBy value) { this.orderBy = value; } public String getId() { return id; } public void setId(String value) { this.id = value; } public String getCreatedBy() { return createdBy; } public void setCreatedBy(String value) { this.createdBy = value; } public XMLGregorianCalendar getCreationDate() { return creationDate; } public void setCreationDate(XMLGregorianCalendar value) { this.creationDate = value; } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = { orderedAttributeRef }) public static class OrderBy { @XmlElement(required = true) protected ListOrderedAttributeRefType orderedAttributeRef; public ListOrderedAttributeRefType getOrderedAttributeRef() { if (orderedAttributeRef == null) { orderedAttributeRef = new ArrayListOrderedAttributeRefType(); } return this.orderedAttributeRef; } } } The wsdl generated by cxf: ?xml version=1.0 encoding=utf-8? wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=http://myservice.bbb.aaa.com/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=MyServiceImplService targetNamespace=http://myservice.bbb.aaa.com/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:tns=http://www.aaa.com/AaaOtherService; attributeFormDefault=unqualified elementFormDefault=qualified targetNamespace=http://www.aaa.com/AaaOtherService; [...] xs:element name=item
Re: Generated code returns java.lang.Object instead of void
Change the operation to one-way MEP,, you can get the void return : wsdl:portType name=Simple wsdl:operation name=Update wsdl:input message=ws:Update / /wsdl:operation /wsdl:portType mattrpav wrote: I'm not sure I am following you. I'm looking to have the generated code return 'void' for the operation, and not the java.lang.Object. The WSDL is defined to return an empty wrapped response, not an object of any type.
Re: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy'
Hi , From the error message , I think this is caused by the inner class OrderBy is not loaded into JAXB context . Can you modify this class as a outer class and try it again ? I will look it further to see if the JAXB can not load the inner static class . Thanks Jim Monica Ferrero wrote: Hi! I'm getting this error: WSDLToJava Error : Thrown by JAXB : undefined element declaration 'ns1:orderBy' when trying to generate java stubs from the wsdl. This is my original service: @WebService(endpointInterface = com.aaa.bbb.ccc.MyService) public interface MyService { [...] @WebResult(name=MyList) @WebMethod MyList getItems( @WebParam(name=listId) int listId); [...] } the MyList class: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = {items}) @XmlRootElement(name = myList) public class MyList { @XmlElement(required = true) private ListItem items; public ListItem getItems() { if (items == null) { items = new ArrayListItem(); } return items; } public void setItems(ListItem items) { this.items = items; } } The Item is a JAXB generated file from a schema: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = { attributesPD, orderBy }) @XmlRootElement(name = item) public class Item { @XmlElement(name = attributes, required = true) protected AttributesPD attributesPD; protected Item.OrderBy orderBy; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = token) protected String id; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = token) protected String createdBy; @XmlAttribute @XmlSchemaType(name = date) protected XMLGregorianCalendar creationDate; public AttributesPD getAttributesPD() { return attributesPD; } public void setAttributesPD(AttributesPD value) { this.attributesPD = value; } public Item.OrderBy getOrderBy() { return orderBy; } public void setOrderBy(Item.OrderBy value) { this.orderBy = value; } public String getId() { return id; } public void setId(String value) { this.id = value; } public String getCreatedBy() { return createdBy; } public void setCreatedBy(String value) { this.createdBy = value; } public XMLGregorianCalendar getCreationDate() { return creationDate; } public void setCreationDate(XMLGregorianCalendar value) { this.creationDate = value; } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = , propOrder = { orderedAttributeRef }) public static class OrderBy { @XmlElement(required = true) protected ListOrderedAttributeRefType orderedAttributeRef; public ListOrderedAttributeRefType getOrderedAttributeRef() { if (orderedAttributeRef == null) { orderedAttributeRef = new ArrayListOrderedAttributeRefType(); } return this.orderedAttributeRef; } } } The wsdl generated by cxf: ?xml version=1.0 encoding=utf-8? wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=http://myservice.bbb.aaa.com/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=MyServiceImplService targetNamespace=http://myservice.bbb.aaa.com/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:tns=http://www.aaa.com/AaaOtherService; attributeFormDefault=unqualified elementFormDefault=qualified targetNamespace=http://www.aaa.com/AaaOtherService; [...] xs:element name=item xs:complexType xs:sequence xs:element ref=tns:attributes/ xs:element minOccurs=0 name=orderBy xs:complexType xs:sequence xs:element maxOccurs=unbounded name=orderedAttributeRef type=tns:orderedAttributeRefType/ /xs:sequence /xs:complexType /xs:element /xs:sequence xs:attribute name=id type=xs:token/ xs:attribute name=createdBy type=xs:token/ xs:attribute name=creationDate type=xs:date/ /xs:complexType /xs:element [...] /xs:schema xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://myservice.bbb.aaa.com/; xmlns:ns1=http://www.aaa.com/AaaOtherService; attributeFormDefault=unqualified
Re: Multiple services in same Spring config
There is a dataBinding configuration in jaxws.xsd which used to parse the jaxws:** tag: https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd But it has not been implemented . I will get it fixed today or tomorrow. Use jaxws:dataBinding tag , you can configure the Aegis databinding to Endpoint directly and you do not need to add the aegis databinding to ServiceFactory. Regards Jim SBixby wrote: My project has multiple web services in the same configuration; we divide up our services into different interface/class combinations depending on the type of service. (I’m sure others do too?) I finally realized what I was missing with the Aegis configuration – a jaxws:serviceFactory tag within the :endpoint tag. So I added the :serviceFactory tag to all of my :endpoint’s. Now, however, there’s actually only one service available – that of the first :endpoint in the configuration; all other URL’s point to the same exact service. I figured that meant I needed to have multiple service factories, so I did this; the JaxWsServiceFactoryBean bean tag, repeated once for each service, with only the beanId changed. This doesn’t make sense to me; is there another way to do this such that each bean gets it’s own instance of a factory?
Re: java2wsdl question
It is warning message not error . You do not need to provide them . Java2wsdl can generate wsdl and the wrapper bean for this class. Regards Jim yulinxp wrote: Here is the SEI. I use cxf 2.0.3 when I run java2wsdl, why it always asks for RequestWrapper ResponseWrapper. Do I need to provide RequestWrapper and ResponseWrapper? package demo.spring; import javax.jws.WebService; @WebService public interface HelloWorld { public void sayHi( java.lang.String text ); } binjava2wsdl demo.spring.HelloWorld Dec 26, 2007 3:30:23 PM org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper getWrapperClass WARNING: Can not load wrapper class demo.spring.jaxws.SayHi, please check the @RequestWrapper or @ResponseWrapper and also check the class is in your classpath Dec 26, 2007 3:30:23 PM org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper getWrapperClass WARNING: Can not load wrapper class demo.spring.jaxws.SayHiResponse, please check the @RequestWrapper or @ResponseWrapper and also check the class is in your classpath
Re: Wsdl2java package usage
Hi Nathan, Wsdl2java can not merge the ObjectFactory to the previously generated class. We need to provide a warning message or an option before overwrite the generated code. I think you can use wsdl2java -pnamespce=package to map the different namespace to different package . for example: wsdl2java -porg.apache.cxf.schema1=com.foo.bar1 -porg.apache.cxf.schema2=com.cxf.foo.bar1 Hope this can help you . Regards Jim Silberman, Nathan wrote: When using wsdl2java, I had been specifying the destination packages for several services to be the same package: com.foobar lets say. This is not problematic for all classes except one: ObjectFactory. The methods in objectFactory are only those of the last wsdl to be generated to java code. The consequence of this is that objectFactory is missing most of the element helper methods. Has anybody else run into this issue? If so, is there another solution other than having each wsdl2java output be sent to a different package? (The consequence of multiple output packages is that you end up with duplicate classes for wsdls that share types) Nathan
Re: Asyc with status
Hi , AFAIK you can not do it . There is no any response that client can receive until the operation is done . I think you can create another service to get updates of the current status . You can query status from the this this service when you show the information on the status bar. Is it feasible for your application ? Jim setty wrote: Hi, I have successfully tested the hello world sample to work with the async polling approach. I am trying to find information on how I can get updates from the polling call to get current status of the service request. The request I am creating would require a few minutes to run (processing over a very large database). I want to show on a status bar in the UI as processing is being done. Is this possible with the Response metaphor?
Re: Invocation of init method failed; nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.
It is definitely an issue in Aegis databinding. TypeCreator is failed to cast a generic type which added in TypeClassInfo to Class object . I have filled a JIRA issue for this : https://issues.apache.org/jira/browse/CXF-1309 Jim Jayakumar wrote: Created the sample using the aegis binding configured in spring. TypeClassInfo class return the generic Type as javax.xml.ws.Holderjava.lang.String which throws the below error. It is a bug or do am i missing any annotation? anyway to work it out. @javax.jws.WebService (targetNamespace=http://example.com/;) @javax.xml.ws.BindingType(value = http://www.w3.org/2003/05/soap/bindings/HTTP/;) @SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.BARE) public interface IExample { @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public IResponseParameter getExample(@WebParam(name = parameters) IRequestParameter a, @WebParam(name = C, header=true, mode=Mode.INOUT) HolderString c); } Dec 16, 2007 10:58:15 AM EST Warning HTTP BEA-101162 User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'example1': Invocation of init method failed; nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'example1': Invocation of init method failed; nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1174) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) Truncated. see log file for complete stacktrace java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl at org.apache.cxf.aegis.type.AbstractTypeCreator.createHolderType(AbstractTypeCreator.java:146) at org.apache.cxf.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:112) at org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:448) at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:257) at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:218) Truncated. see log file for complete stacktrace Dec 16, 2007 10:58:15 AM EST Error Deployer BEA-149231 Unable to set the activation state to true for the application '_appsdir_CXF203_dir'. weblogic.application.ModuleException: at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:950) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60) Truncated. see log file for complete stacktrace java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl at org.apache.cxf.aegis.type.AbstractTypeCreator.createHolderType(AbstractTypeCreator.java:146) at org.apache.cxf.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:112) at org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:448) at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:257) at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:218) Truncated. see log file for complete stacktrace Thanks Jay
Re: Interceptor configuration not working
Hi , You can set the log level to FINE [1] to see if this interceptor is really added to the interceptor chain . [1] http://cwiki.apache.org/CXF20DOC/debugging.html Regards Jim Thorsten Jungblut wrote: Hi, i'm using CXF in Tomcat 6.0. I deployed a simple JAX-WS Webservice along with CXF and tried to add an interceptor. The webservice itself is working perfeclty but though my interceptor gets instantiated, it never get invoked. I only use one configuration file, cxf-servlet.xml under WEB-INF/ with the following contents: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:cxf=http://cxf.apache.org/core; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd; bean id=ServiceInterceptor name=ServiceInterceptor class=toy.ServiceInterceptor/ jaxws:endpoint id=classImpl1 implementor=toy.WebService1 address=/WebService1 / jaxws:endpoint id=classImpl2 implementor=toy.WebService2 address=/WebService2 / !-- cxf:bus cxf:inInterceptors ref bean=ServiceInterceptor/ /cxf:inInterceptors /cxf:bus-- bean id=cxf class=org.apache.cxf.bus.CXFBusImpl property name=inInterceptors list ref bean=ServiceInterceptor/ /list /property /bean /beans I already tried both, the cxf:bus element and the bean-element, nothing seems to help.. Did i miss something? Best regards T. Jungblut
Re: How to make classes created from wsdl2java implements serializable?
Hi , Add the wsdlLocation and Xpath express to provide which schema you want to customize , try the following binding file to see if it works for your wsdl: jaxws:bindings wsdlLocation=${your.wsdl} xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; jaxws:bindings node=wsdl:definitions/wsdl:types/xs:schema jaxb:globalBindings xjc:serializable uid=-6026937020915831338/ /jaxb:globalBindings /jaxws:bindings /jaxws:bindings Regards Jim daniel.mfreitas wrote: Hello. I want to use wsdl2java to generate the client stubs to be used by my client web application. I am using Spring Web Flow and it requires that objects used in the flow are Serializable. I successfully generated Serializable classes using the following bindings file and Metro JAXWS RI implementation: ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc; elementFormDefault=qualified attributeFormDefault=unqualified jaxb:extensionBindingPrefixes=xjc jaxb:version=1.0 xs:annotation xs:appinfo jaxb:globalBindings xjc:serializable uid=-6026937020915831338/ /jaxb:globalBindings /xs:appinfo /xs:annotation /xs:schema But because of some limitations of Metro RI, we want to switch to CXF. When calling wsdl2java from a maven build file and we try to supply the above binding file, cfx throws WSDLToJava Error : Unknown external binding files: This is not a FileNotFoundError. wsdl2java does find the file, but it seems it does not understand its contents. I wanted to use CXF for everything including java2wsdl and wsdl2java. We have bad experiences to set up JAXWS Metro RI and for some developers it is a pain to put it to work. So how can I make the entities stubs to implement serializable with wsdl2java?
Re: How to make classes created from wsdl2java implements serializable?
serializable element is in wrong namespace , you need to change it to jaxb:serializable uid=-6026937020915831338 /. daniel.mfreitas wrote: Well, the file that worked for me is this: ?xml version=1.0 encoding=UTF-8? jaxws:bindings wsdlLocation=mywsdl.wsdl xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc; xs:annotation xs:appinfo jaxb:globalBindings xjc:serializable uid=-6026937020915831338 / /jaxb:globalBindings /xs:appinfo /xs:annotation /jaxws:bindings Problem is the classes are still not Serializable. I think jaxws:bindings dot not recognize xs:appinfo or xjc:serializable. Ok let's forget about binding files for a moment. Let's get to the basic problem. I want the generated stubs to implement Serializable. That's all I need. How can I make this happen? James Mao wrote: You have to make sure all your xmls are well-formed, probably caused by a missing closing tag, or such You can check it with your browser James Well, the file you provided as an example throws WSDLToJava Error : The binding file: file:/jaxb-bindings.xml references a not well-formed xml document. The file that I provided as an example and that works with JAXWS RI looks quite different from the jaxws:bindings/ file I've seen around. For example the root of the document is xs:schema/. Also in the file I provided I do not have to specify my WSDL file, which makes sense for me sisnce all I want to do is that the entity stubs implement Serializable. I need them to be serializable so I can use them with other frameworks that requires it. Jim Ma-3 wrote: Hi , Add the wsdlLocation and Xpath express to provide which schema you want to customize , try the following binding file to see if it works for your wsdl: jaxws:bindings wsdlLocation=${your.wsdl} xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; jaxws:bindings node=wsdl:definitions/wsdl:types/xs:schema jaxb:globalBindings xjc:serializable uid=-6026937020915831338/ /jaxb:globalBindings /jaxws:bindings /jaxws:bindings Regards Jim daniel.mfreitas wrote: Hello. I want to use wsdl2java to generate the client stubs to be used by my client web application. I am using Spring Web Flow and it requires that objects used in the flow are Serializable. I successfully generated Serializable classes using the following bindings file and Metro JAXWS RI implementation: ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc; elementFormDefault=qualified attributeFormDefault=unqualified jaxb:extensionBindingPrefixes=xjc jaxb:version=1.0 xs:annotation xs:appinfo jaxb:globalBindings xjc:serializable uid=-6026937020915831338/ /jaxb:globalBindings /xs:appinfo /xs:annotation /xs:schema But because of some limitations of Metro RI, we want to switch to CXF. When calling wsdl2java from a maven build file and we try to supply the above binding file, cfx throws WSDLToJava Error : Unknown external binding files: This is not a FileNotFoundError. wsdl2java does find the file, but it seems it does not understand its contents. I wanted to use CXF for everything including java2wsdl and wsdl2java. We have bad experiences to set up JAXWS Metro RI and for some developers it is a pain to put it to work. So how can I make the entities stubs to implement serializable with wsdl2java?
Re: Cxf Issue
JAXB can not handle interfaces . See : http://weblogs.java.net/blog/kohsuke/archive/2006/06/jaxb_and_interf.html. Jim priya j wrote: The FrontEndService is the implementor class of IFrontEndService. The problem here is if i call my interface it fails. Hope i have explained wht my problem is Liu, Jervis wrote: -Original Message- From: priya j [mailto:[EMAIL PROTECTED] Sent: 2007年12月6日 13:15 To: cxf-user@incubator.apache.org Subject: RE: Cxf Issue Thanks for your reply, this is my implementor class: @WebService(endpointInterface = demo.webService.server.IWebService) public class WebService implements IWebService { //The service that perform the query private FrontEndService service; public String webService (String queryString) throws FrontEndServiceException { ResultData resultData=service.doSearch(queryString, SearchMode.MULTI, NameConstants.LWI_KEY); return The result +resultData; } public FrontEndService getService() { return service; } public void setService(FrontEndService service) { this.service = service; } } Here the FrontEndService is another class, if it is an interface the execution fails in client side. Can you suggest me how to proceed. [Liu, Jervis] If I understand your problem correctly, your service fails to return a valid result (does the String webService (String queryString) method throw an exception?) when FrontEndService is implemented in a certain way. Not sure what you mean by if FrontEndService is an interface. Anyway, this seems to be a problem in your application code rather than a problem in CXF. A simply way to find out is to write a standalone Java mainline to get WebService instance from spring context then invoke String webService (String queryString) from your java mainline to see how it goes. Most likely it is a problem in your application code or sth wrong with your spring configuration. Cheers, Jervis execution fails in client side. Liu, Jervis wrote: Hi can you be more specific about the problem please? Some code snippets of your service implementation and configuration that can help us to reproduce the problem or a complete test case would be helpful. Cheers, Jervis -Original Message- From: priya j [mailto:[EMAIL PROTECTED] Sent: 2007年12月6日 11:16 To: cxf-user@incubator.apache.org Subject: Cxf Issue Hi all, Im priya, i have used cxf to make my application(spring framework) a Web Service. The application works perfect when my Web Service implementing class inturn calls another class, but the issue arise when iam trying to call an interface. Can anyone help me in solving this, its very urgent. Thanks inadvance. Regards, priya -- View this message in context: http://www.nabble.com/Cxf-Issue-tf4953753.html#a14185545 Sent from the cxf-user mailing list archive at Nabble.com. IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland -- View this message in context: http://www.nabble.com/Cxf-Issue-tf4953753.html#a14186492 Sent from the cxf-user mailing list archive at Nabble.com. IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Cxf Issue
Can you change the IFrontEndService to abstract class? You also need to put the FrontEndService class in the same package as the IFrontEndService, After @XmlSeeAlso is fully supported in CXF, you can put them in different package. Jim priya j wrote: Oh k. is there any other way i can make it work. Thanks a lot for ur response Jim Ma-3 wrote: JAXB can not handle interfaces . See : http://weblogs.java.net/blog/kohsuke/archive/2006/06/jaxb_and_interf.html. Jim priya j wrote: The FrontEndService is the implementor class of IFrontEndService. The problem here is if i call my interface it fails. Hope i have explained wht my problem is Liu, Jervis wrote: -Original Message- From: priya j [mailto:[EMAIL PROTECTED] Sent: 2007年12月6日 13:15 To: cxf-user@incubator.apache.org Subject: RE: Cxf Issue Thanks for your reply, this is my implementor class: @WebService(endpointInterface = demo.webService.server.IWebService) public class WebService implements IWebService { //The service that perform the query private FrontEndService service; public String webService (String queryString) throws FrontEndServiceException { ResultData resultData=service.doSearch(queryString, SearchMode.MULTI, NameConstants.LWI_KEY); return The result +resultData; } public FrontEndService getService() { return service; } public void setService(FrontEndService service) { this.service = service; } } Here the FrontEndService is another class, if it is an interface the execution fails in client side. Can you suggest me how to proceed. [Liu, Jervis] If I understand your problem correctly, your service fails to return a valid result (does the String webService (String queryString) method throw an exception?) when FrontEndService is implemented in a certain way. Not sure what you mean by if FrontEndService is an interface. Anyway, this seems to be a problem in your application code rather than a problem in CXF. A simply way to find out is to write a standalone Java mainline to get WebService instance from spring context then invoke String webService (String queryString) from your java mainline to see how it goes. Most likely it is a problem in your application code or sth wrong with your spring configuration. Cheers, Jervis execution fails in client side. Liu, Jervis wrote: Hi can you be more specific about the problem please? Some code snippets of your service implementation and configuration that can help us to reproduce the problem or a complete test case would be helpful. Cheers, Jervis -Original Message- From: priya j [mailto:[EMAIL PROTECTED] Sent: 2007年12月6日 11:16 To: cxf-user@incubator.apache.org Subject: Cxf Issue Hi all, Im priya, i have used cxf to make my application(spring framework) a Web Service. The application works perfect when my Web Service implementing class inturn calls another class, but the issue arise when iam trying to call an interface. Can anyone help me in solving this, its very urgent. Thanks inadvance. Regards, priya -- View this message in context: http://www.nabble.com/Cxf-Issue-tf4953753.html#a14185545 Sent from the cxf-user mailing list archive at Nabble.com. IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland -- View this message in context: http://www.nabble.com/Cxf-Issue-tf4953753.html#a14186492 Sent from the cxf-user mailing list archive at Nabble.com. IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Cannot generate from wsdl with ws-*....
Hi , Move the wsp:Policy section under service and try again: service name=IdentityService port name=IdentityServiceImplPort binding=tns:IdentityServiceImplPortBinding soap:address location=http://localhost:99/saas-identity-2.0-CXF-WSDLFirst/services/IdentityService/ wsp:Policy wsu:Id=Identity_WSPortBindingPolicy wsp:ExactlyOne wsp:All wsaw:UsingAddressing / wsrm:RMAssertion wsrm:ReliableMessaging / wsrm:InactivityTimeout Milliseconds=60 / wsrm:AcknowledgementInterval Milliseconds=200 / /wsrm:RMAssertion /wsp:All /wsp:ExactlyOne /wsp:Policy /port /service Regards Jim Ma Bradford Maxwell wrote: Can't generate code from ?xml version=1.0 encoding=UTF-8? definitions xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy; xmlns:wsaw=http://www.w3.org/2006/05/addressing/wsdl; xmlns:wsrm=http://schemas.xmlsoap.org/ws/2005/02/rm/policy; xmlns:id=urn:schemas-kronos-com:identity xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=urn:services-kronos-com:identity xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:sc=http://schemas.sun.com/2006/03/wss/server; xmlns:wspp=http://java.sun.com/xml/ns/wsit/policy; targetNamespace=urn:services-kronos-com:identity name=IdentityService wsp:UsingPolicy / wsp:Policy wsu:Id=Identity_WSPortBindingPolicy wsp:ExactlyOne wsp:All wsaw:UsingAddressing / wsrm:RMAssertion wsrm:ReliableMessaging / wsrm:InactivityTimeout Milliseconds=60 / wsrm:AcknowledgementInterval Milliseconds=200 / /wsrm:RMAssertion /wsp:All /wsp:ExactlyOne /wsp:Policy types xsd:schema targetNamespace=urn:services-kronos-com:identity xsd:import namespace=urn:schemas-kronos-com:identity schemaLocation=file:/C:/temp/wsdl/identity.xsd /xsd:import xsd:element name=CreateIdentity xsd:complexType xsd:sequence xsd:element name=arg0 type=id:Identity minOccurs=0 / /xsd:sequence /xsd:complexType /xsd:element xsd:element name=CreateIdentityResponse xsd:complexType xsd:sequence xsd:element name=return type=id:Identity minOccurs=0 / /xsd:sequence /xsd:complexType /xsd:element xsd:element name=DeleteIdentity xsd:complexType xsd:sequence xsd:element name=emailAddress type=xsd:string minOccurs=0 / /xsd:sequence /xsd:complexType /xsd:element xsd:element name=DeleteIdentityResponse xsd:complexType xsd:sequence xsd:element name=return type=xsd:boolean / /xsd:sequence /xsd:complexType /xsd:element xsd:element name=GetIdentities xsd:complexType xsd:sequence / /xsd:complexType /xsd:element xsd:element name=GetIdentitiesResponse xsd:complexType
Re: Diagnosis of stupid JAXB/JAXWS errors
Hi Benson , Is this issue same as https://issues.apache.org/jira/browse/CXF-1226? Regards Jim Benson Margulies wrote: Consider the following pile of snails. Now, I realize, I don't need them in CXF, but I had coded them to test something. Except, that, I'd neglected to code the @WebResult at all, so while I had a wrapper, there was no way for the code to know the element to use for the response. It didn't work, of course. It also didn't diagnose in the log. Should this sort of thing produce some whining? @RequestWrapper(className = org.apache.cxf.javascript.fortest.BasicTypeFunctionReturnStringWrapper ) @ResponseWrapper(className = org.apache.cxf.javascript.fortest.StringWrapper) @WebResult(name = returnValue, targetNamespace = uri:org.apache.cxf.javascript.testns)
Re: Diagnosis of stupid JAXB/JAXWS errors
: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Body ns2:sayHi xmlns:ns2=http://nstest.helloworld;MyInputABC/MyInput/ns2:say Hi/soap:Body/soap:Envelope -- Nov 20, 2007 10:51:13 PM org.apache.cxf.interceptor.LoggingOutInterceptor$Loggin gCallback onClose INFO: Outbound Message: -- soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Body ns1:sayHiResponse xmlns:ns1=http://nstest.helloworld;MyResultHello ABC/My Result/ns1:sayHiResponse/soap:Body/soap:Envelope- - You can see that both MyInput and MyResult have no namespace. Benson Margulies wrote: I can't tell you until tomorrow. Comcast can't route to issues.apache.org tonight, and I just disconnected from the complex alternative path I was using just now. -Original Message- From: Jim Ma [mailto:[EMAIL PROTECTED] Sent: Sunday, November 25, 2007 9:27 PM To: cxf-user@incubator.apache.org Subject: Re: Diagnosis of stupid JAXB/JAXWS errors Hi Benson , Is this issue same as https://issues.apache.org/jira/browse/CXF-1226? Regards Jim Benson Margulies wrote: Consider the following pile of snails. Now, I realize, I don't need them in CXF, but I had coded them to test something. Except, that, I'd neglected to code the @WebResult at all, so while I had a wrapper, there was no way for the code to know the element to use for the response. It didn't work, of course. It also didn't diagnose in the log. Should this sort of thing produce some whining? @RequestWrapper(className = org.apache.cxf.javascript.fortest.BasicTypeFunctionReturnStri ngWrapper ) @ResponseWrapper(className = org.apache.cxf.javascript.fortest.StringWrapper) @WebResult(name = returnValue, targetNamespace = uri:org.apache.cxf.javascript.testns)
Re: with simple frontend configuration, for xml over http how to change name for operation
Hi , I think you can do it . Write your own ServiceConfiguration (extends org.apache.cxf.service.factory.DefaultServiceConfiguration) and override getOperationName method to change the default operation name . Then add your ServiceConfiguration to spirng configuration xml like the following : simple:server address=http://localhost:8080/simple; simple:serviceBean bean class=org.apache.cxf.service.factory.HelloServiceImpl / /simple:serviceBean simple:serviceFactory bean class=org.apache.cxf.service.factory.ReflectionServiceFactoryBean property name=serviceConfigurations list bean class=org.apache.cxf..YourServiceConfiguration / /list /property /bean /simple:serviceFactory /simple:server Regards Jim Willem Jiang wrote: Hi , If you are using simple frontend , I don't think you can rename the operation name. If you uses Jaxws frontend , I think you can define your own operation name by setting the WebMethod annotation's operationName attribute. Willem. mule1 wrote: Hello, I have exposed my service using simple frontend spring configuration for xml over http. In my service class, I have method names, which comes out as operation name in the wsdl file for xml binding. Is it possible to change this operation name either from the configuration file or some other way? Thanks.
Re: Missing input/output param namespace in SOAP
Hi , This is an issue in CXF . Can you log it into https://issues.apache.org/jira/browse/CXF with your test case ? Thanks Jim Nianhua Li wrote: Dear list, I am using the java-first approach with spring configuration on cxf 2.0.3 and tomcat 5.5. I specified namespace for all the input and output parameters via @WebParam and @WebResult annotation. But the namespace was somehow missing from the SOAP message. Let's use the java_first_spring_support sample shipped with cxf 2.0.3 as an example. If I add some ws annotations to the service interface HelloWorld.java: == @WebService(name=MyHelloWorldService, targetNamespace=http://nstest.helloworld;) @SOAPBinding( parameterStyle=SOAPBinding.ParameterStyle.WRAPPED, style=SOAPBinding.Style.DOCUMENT, use= SOAPBinding.Use.LITERAL) public interface HelloWorld { @WebMethod @WebResult(name=MyResult, targetNamespace=http://nstest.helloworld;) String sayHi(@WebParam(name=MyInput, targetNamespace=http://nstest.helloworld;) String text); } == Deploy it to tomcat, generate a cxf client from WSDL, and invoke the service. = The SOAP request: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Body ns2:sayHi xmlns:ns2=http://nstest.helloworld;MyInputABC/MyInput/ns2:say Hi/soap:Body/soap:Envelope The SOAP response: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Body ns1:sayHiResponse xmlns:ns1=http://nstest.helloworld;MyResultHello ABC/My Result/ns1:sayHiResponse/soap:Body/soap:Envelope === Notice that both input and output parameter (MyInput and MyResult) have no namesapce. How can I make the namespace available? Should I add @RequestWrapper annotation? The namespace is available in WSDL though. Here is the related part: === wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://nstest.helloworld; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=MyHelloWorldService targetNamespace=http://nstest.helloworld; wsdl:types xsd:schema xmlns=http://nstest.helloworld; xmlns:tns=http://spring.demo/; attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://nstest.helloworld; xmlns:xsd=http://www.w3.org/2001/XMLSchema; import xmlns=http://www.w3.org/2001/XMLSchema; namespace=http://spring.demo// xsd:element name=sayHi type=sayHi/ xsd:complexType name=sayHi xsd:sequence xsd:element minOccurs=0 name=MyInput type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=sayHiResponse type=sayHiResponse/ xsd:complexType name=sayHiResponse xsd:sequence xsd:element minOccurs=0 name=MyResult type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:schema /wsdl:types wsdl:message name=sayHi wsdl:part element=ns1:sayHi name=parameters /wsdl:part /wsdl:message wsdl:message name=sayHiResponse wsdl:part element=ns1:sayHiResponse name=parameters /wsdl:part /wsdl:message ... /wsdl:definitions == Could somebody help me out on this problem please? Many thanks in advance. nianhua
Re: Example java2ws maven plugin config?
Hi Callum, I just fixed an issue for this plugin and updated the CXF wiki for it . Refer to this link http://cwiki.apache.org/CXF20DOC/maven-integration-and-plugin.html for its configuration and usage . I will ask other guys to publish a snapshot for this fix. Before the new snapshot is ready, you can download the latest code in trunk and build it . Let me know if you have any problems Regards Jim Callum Haig wrote: Could someone please post an example maven pom fragment that will help me get started with the CXF java2ws maven plugin? In the absence of documentation I have tried many variations of the fragment below without success. plugin groupIdorg.apache.cxf/groupId artifactIdcxf-java2ws-plugin/artifactId version2.1-incubator-SNAPSHOT/version dependencies dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version2.1-incubator-SNAPSHOT/version /dependency /dependencies executions execution idgenerate-ws/id phaseprocess-classes/phase configuration className my.ws.target.class /className classpathElements ${project.compileClasspathElements} /classpathElements classpath ${basedir}/target/classes /classpath genServertrue/genServer genClienttrue/genClient genWrapperbeantrue/genWrapperbean genWsdltrue/genWsdl project${project}/project /configuration goals goaljava2ws/goal /goals /execution /executions /plugin Regards, Callum.
Re: Problem with JAXB
Hi , If the method returns an interface , jaxb can not handle it and throws exception . This is the reason why it can not : http://weblogs.java.net/blog/kohsuke/archive/2006/06/jaxb_and_interf.html, FYI. Cheers Jim Roberto Druetto wrote: Hi, I've a problem when I try to set up a service that return a n interface. If I make a method that returns an object of mine, I have no problem (the client get the object with no problems), instead if I make a method that returns an interface I get this exception on server-side: javax.xml.bind.JAXBException: it.ipsaweb.servermonitor.interfaces.Test Here the methods: MyObject getMyObject(); // ok, no problem MyInterface getMyInterface(); // throws that exception MyObject getMyObject(){ return new MyObject(); } MyInterface getMyInterface(){ MyInterface m = new MyObject(); return m; } what is the problem in your opinion? Thanks. Roberto
Re: wsdl2java problem
Hi , The cxf system test module also uses this plugin to generate code . It works fine . I did not see any error related to wsdl2java tool or this plugin from the maven output . Use mvn -e to see if you can get the error stack trace . Cheers Jim Ivo van Dongen wrote: Hi, We're using the cxf-codegen-plugin for maven 2.1-snapshot atm and this worked out great until yesterday when the source generation suddenly failed. The last build that succeeded was on monday and no builds were made in between. The strangest part is that I can't get it working again even when using a maven plugin version from last week (2.1-incubator-20071008.202151-8) which certainly worked then. This leads me to beleive that something has changed in one of the dependencies, but I can't figure out where. Has somebody else expirienced this problem? Going back to the 2.0.2 release seems to fix it. The relevant part of the maven output: Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Loading plugin jar:file:/home/ivo/.m2/repository/org/apache/cxf/cxf-tools-wsdlto-frontend-jaxws/2.1-incubator-SNAPSHOT/cxf-tools-wsdlto-frontend-jaxws-2.1-incubator-SNAPSHOT.jar!/META-INF/tools-plugin.xml Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Found 1 frontends in jaxws plugin. Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Loading jaxws frontend from jaxws plugin. Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Loading plugin jar:file:/home/ivo/.m2/repository/org/apache/cxf/cxf-tools-wsdlto-databinding-jaxb/2.1-incubator-SNAPSHOT/cxf-tools-wsdlto-databinding-jaxb-2.1-incubator-SNAPSHOT.jar!/META-INF/tools-plugin.xml Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Found 1 databindings in jaxb plugin. Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Loading jaxb databinding from jaxb plugin. Loading FrontEnd jaxws ... Loading DataBinding jaxb ... wsdl2java -d /local/home/ivo/workspace-fresh/tesis/target/xfire-source -verbose -all /local/home/ivo/workspace-fresh/tesis/src/main/wsdl/backstage/TesisBackstageServices.wsdl wsdl2java - Apache CXF (incubator) 2.1-incubator-SNAPSHOT Oct 19, 2007 10:48:14 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing [EMAIL PROTECTED]: display name [EMAIL PROTECTED]; startup date [Fri Oct 19 10:48:14 CEST 2007]; root of context hierarchy Oct 19, 2007 10:48:14 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] Oct 19, 2007 10:48:15 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-xml.xml] Oct 19, 2007 10:48:15 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml] Oct 19, 2007 10:48:15 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http.xml] Oct 19, 2007 10:48:15 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http-jetty.xml] Oct 19, 2007 10:48:15 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO: Bean factory for application context [EMAIL PROTECTED]: [EMAIL PROTECTED] Oct 19, 2007 10:48:15 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) Oct 19, 2007 10:48:15 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) Oct 19, 2007 10:48:15 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in [EMAIL PROTECTED]: defining beans
Re: JAXB Bindings problem in runtime
This issue is fixed in cxf 2.0.2 . You need to update cxf to 2.0.2 . Cheers Jim Bc. Jiří Mikulášek wrote: Hi, we are using cxf 2.0, we are using wsdl provided by SAP in Norway (and because we don't speak Norwegian and whole application is developed in english we have done this jaxws and jaxb binding customization). So, we are developing client side using cxf, soap binding is document/literal wrapped. We are using soapui to mock the service side (it is a tool which can import wsdl and simply mock the service). We are logging from cxf both requests and response. Jaxb binding is customized both for request and response wrapper. While generating request, everything is OK and problem is while handling response. Our client is started by this code: NoMilSapNumberLookupService service = new NoMilSapNumberLookupService(wsdlUrl, serviceName); service.getZMMMATEXISTMATNRSoapBinding().existSapNumber( ASKING_SYSTEM, sapNumber, status, nsn, description); shortened client stub: @WebServiceClient(name = ZMM_MAT_EXIST_MATNRService, targetNamespace = urn:sap-com:document:sap:soap:functions:mc-style) public class NoMilSapNumberLookupService extends Service { public NoMilSapNumberLookupService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } } see wsdl and binding customization in attachment. On Friday 19 of October 2007 09:58:20 Jim Ma wrote: Hi , Could you tell me more information about this issue ? Which version CXF did you use ? How did you start and call this service ? Cheers Jim Bc. Jiří Mikulášek wrote: Hi all, I have used wsdl2java with external binding file specified through -b. My stubs for client have been generated correctly, but I got in trouble during runtime. The point is, that have renamed response properties names. But it seems that cxf ignores jaxb annotations when handling the response wrapper. More concretly thanks to this part of external binding file: jaxws:bindings node=wsdl:definitions/wsdl:types/xsd:[EMAIL PROTECTED]'urn:sap-co m:document:sap:soap:functions:mc-style'] jaxb:bindings node=xsd:[EMAIL PROTECTED]'ZBapiMaterialExistsMatnrResponse']/xsd:complexTy pe/xsd:sequence/xsd:[EMAIL PROTECTED]'MaterialFinnes'] jaxb:property name=existMark / /jaxb:bindings /jaxws:bindings this code is generated: @XmlElement(name = MaterialFinnes, required = true) protected String existMark; public String getExistMark() { return existMark; } public void setExistMark(String value) { this.existMark = value; } but when trying to use this client against some mockservice generated from the same wsdl I got: Caused by: java.lang.NoSuchMethodException: cz.aura.isl.katalog.davky.control.sapnorway.sapnumberlookup.SapNumberLook upResponse.getMaterialFinnes() at org.apache.cxf.jaxb.WrapperHelper.getWrappedPart(WrapperHelper.java:194) at org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage (WrapperClassInInterceptor.java:136) ... 70 more
Re: JAXB Bindings problem in runtime
Hi , Could you tell me more information about this issue ? Which version CXF did you use ? How did you start and call this service ? Cheers Jim Bc. Jiří Mikulášek wrote: Hi all, I have used wsdl2java with external binding file specified through -b. My stubs for client have been generated correctly, but I got in trouble during runtime. The point is, that have renamed response properties names. But it seems that cxf ignores jaxb annotations when handling the response wrapper. More concretly thanks to this part of external binding file: jaxws:bindings node=wsdl:definitions/wsdl:types/xsd:[EMAIL PROTECTED]'urn:sap-com:document:sap:soap:functions:mc-style'] jaxb:bindings node=xsd:[EMAIL PROTECTED]'ZBapiMaterialExistsMatnrResponse']/xsd:complexType/xsd:sequence/xsd:[EMAIL PROTECTED]'MaterialFinnes'] jaxb:property name=existMark / /jaxb:bindings /jaxws:bindings this code is generated: @XmlElement(name = MaterialFinnes, required = true) protected String existMark; public String getExistMark() { return existMark; } public void setExistMark(String value) { this.existMark = value; } but when trying to use this client against some mockservice generated from the same wsdl I got: Caused by: java.lang.NoSuchMethodException: cz.aura.isl.katalog.davky.control.sapnorway.sapnumberlookup.SapNumberLookupResponse.getMaterialFinnes() at org.apache.cxf.jaxb.WrapperHelper.getWrappedPart(WrapperHelper.java:194) at org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage(WrapperClassInInterceptor.java:136) ... 70 more
Re: deploying CXF Web service in JBoss
Can you check the following files on your classpath ? META-INF/spring.handlers META-INF/spring.schemas -Jim shaminda perera wrote: Hi all, I have created a web service and followed the instructions in http://cwiki.apache.org/CXF20DOC/servlet-transport.html in order to deploy it in JBoss. I am publishing the end point using the XML. As mentioned in the instructions, i added edited the web.xml with the servelt information and created a services.xml file which specifies the web service endpoint. Now after doing all these configurations and then starting JBoss, i get the following error log in JBoss..and the Web service is not getting deployed. It looks like everything is fine, apart from reading the services.xml file. Please advise as to what i need to do done here. 18:01:50,890 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml ] 18:01:51,327 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-ext ension-soap.xml] 18:01:51,484 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/cxf/cxf-ser vlet.xml] 18:01:51,687 INFO [DefaultNamespaceHandlerResolver] Ignoring handler [ org.springframework.transaction.config.TxNamespac eHandler]: class not found 18:01:51,749 ERROR [ContextLoader] Context initialization failed java.lang.IllegalArgumentException: Cannot locate BeanDefinitionParser for element [endpoint]. at org.springframework.beans.factory.xml.NamespaceHandlerSupport.findParserForElement (NamespaceHandlerSupport.ja va:63) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseCustomElement (DefaultXmlBeanDefinit ionParser.java:415) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions (DefaultXmlBeanDefin itionParser.java:374) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions (DefaultXmlBeanDe finitionParser.java:206) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions (XmlBeanDefinitionReader .java:388) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.j ava:259) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.jav This is my services.xml file contents: 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-2.0.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/ jaxws:endpoint id=xxx implementor=com.company.WebServiceImpl address=/CompanyService/ /beans Thanks in advance for any help
Re: deploying CXF Web service in JBoss
Jim, yes I have those files in the classpath. I mean they are inside the spring-beans-2.0-m2.jar\META-INF folder. this spring jar is in the classpath. These files should be in cxf-rt-frontend-jaxws.jar. And jaxws.xsd is also packaged into this jar file. Can you confirm this jar file on your classpath ? CXF2.0.2 use spring 2.0.6 . I also suggest you update the spring version to 2.0.6. -Jim
Re: deploying CXF Web service in JBoss
11:50:42,892 INFO [STDOUT] 11:50:42,892 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyTrackSearch': Invocation o f init method failed; nested exception is java.lang.ClassCastException: It seems to me this is caused by the error configuration in your services.xml. Can you paste the related segment for the bean companyTrackSearch ? -Jim
Re: deploying CXF Web service in JBoss
It is jaxb jar issue . FYI : http://forums.java.net/jive/message.jspa?messageID=212259 . -Jim Jeff Yu wrote: Hi, The simple way to verify whether it is the JAXB jar issue, you can put the jaxb-api, jaxb-impl in the $JBoss_HOME/lib/endorsed folder, and then see if it works or not. If it is the issue, you might need to refer to the this [1] to see how to configure a scoped classloader in JBoss to resolve classloader stuff. Hope This Helps. Jeff [1] http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration shaminda perera wrote: Yes, i put the CXF libraries in the war file. and then use maven to deploy a EAR file which contains the war file. Does JBoss have a JAXB jar file? if so where can i locate it? On 10/18/07, Jeff Yu [EMAIL PROTECTED] wrote: Hi, When I see the ClassCastException, the ClassLoader issue would pop up in my mind.. ;-), I stuck with the classloader issues these days. Can you show how you deploy the cxf libraries? put the required jars in the war, and then deploy the war to JBoss with scoping classloader? I am guessing it might be conflict with the JAXB jar that JBoss had with the CXF's. Thanks Jeff shaminda perera wrote: Hi Jim, Thanks again,, updating the spring version to 2.0.6 did the trick.. now that error is not coming... however,, now i am getting the following error: 11:50:41,860 ERROR [STDERR] 18-Oct-2007 11:50:41 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServic eFromClass INFO: Creating Service { http://server.webservice.search.services.company.com}CompanySearchServicefrom class com.company.services.search.webservice.server.CompanySearchServiceImpl 11:50:42,876 INFO [STDOUT] 11:50:42,876 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework [EMAIL PROTECTED]: defining beans [cxf,org.apache.cxf.bus.spring.Jsr250BeanPostPro cessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor, org.apache.cxf.resource.ResourceManager,org.apache.cxf.bindin g.BindingFactoryManager, org.apache.cxf.transport.DestinationFactoryManager, org.apache.cxf.transport.ConduitInitiatorMana ger,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager, org.apache.cxf.workqueue.WorkQueueManager,org.apac he.cxf.buslifecycle.BusLifeCycleManager, org.apache.cxf.endpoint.ServerRegistry, org.apache.cxf.endpoint.ServerLifeCycleMa nager,org.apache.cxf.endpoint.ClientLifeCycleManager, org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf. endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager, org.apache.cxf.catalog.OASISCatalogManager,org.ap ache.cxf.binding.soap.SoapBindingFactory, org.apache.cxf.binding.soap.SoapTransportFactory, org.apache.cxf.binding.soap.cu stomEditorConfigurer, org.apache.cxf.transport.servlet.ServletTransportFactory ,ricallTrackSearch]; root of factory hierar chy 11:50:42,892 INFO [STDOUT] 11:50:42,892 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyTrackSearch': Invocation o f init method failed; nested exception is java.lang.ClassCastException: com.company.services.search.webservice.server.Mai nCompanySearchInput$JaxbAccessorF_clientID cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor Caused by: java.lang.ClassCastException: com.company.services.search.webservice.server.MainCompanySearchInput$JaxbAccessorF_clientIDc annot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate (OptimizedAccessorFactory.java:15 1) at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get( OptimizedAccessorFactory.java:143) at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize( Accessor.java:204) at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty .init(SingleElementLeafProperty.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java :513) at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create( PropertyFactory.java:88) I think this is something to do with a library/jar issue, since when i publish this same web service to Jetty HTTP server using Endpoint.publish() , it is working fine. I mean i was also able to access the WSDL using the URL. Please help. On 10/18/07, Jim Ma [EMAIL PROTECTED] wrote: Jim, yes I have those files in the classpath. I mean they are inside the spring-beans-2.0-m2
Re: deploying CXF Web service in JBoss
eFromClass INFO: Creating Service { http://server.webservice.search.services.company.com}CompanySearchServicefrom class com.company.services.search.webservice.server.CompanySearchServiceImpl 11:50:42,876 INFO [STDOUT] 11:50:42,876 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework [EMAIL PROTECTED]: defining beans [cxf,org.apache.cxf.bus.spring.Jsr250BeanPostPro cessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor, org.apache.cxf.resource.ResourceManager,org.apache.cxf.bindin g.BindingFactoryManager, org.apache.cxf.transport.DestinationFactoryManager, org.apache.cxf.transport.ConduitInitiatorMana ger,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager, org.apache.cxf.workqueue.WorkQueueManager,org.apac he.cxf.buslifecycle.BusLifeCycleManager, org.apache.cxf.endpoint.ServerRegistry, org.apache.cxf.endpoint.ServerLifeCycleMa nager,org.apache.cxf.endpoint.ClientLifeCycleManager, org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf. endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager , org.apache.cxf.catalog.OASISCatalogManager,org.ap ache.cxf.binding.soap.SoapBindingFactory, org.apache.cxf.binding.soap.SoapTransportFactory, org.apache.cxf.binding.soap.cu stomEditorConfigurer, org.apache.cxf.transport.servlet.ServletTransportFactory ,ricallTrackSearch]; root of factory hierar chy 11:50:42,892 INFO [STDOUT] 11:50:42,892 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'companyTrackSearch': Invocation o f init method failed; nested exception is java.lang.ClassCastException : com.company.services.search.webservice.server.Mai nCompanySearchInput$JaxbAccessorF_clientID cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor Caused by: java.lang.ClassCastException: com.company.services.search.webservice.server.MainCompanySearchInput$JaxbAccessorF_clientIDc annot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate (OptimizedAccessorFactory.java:15 1) at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get( OptimizedAccessorFactory.java:143) at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize( Accessor.java:204) at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty .init(SingleElementLeafProperty.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java :513) at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create ( PropertyFactory.java:88) I think this is something to do with a library/jar issue, since when i publish this same web service to Jetty HTTP server using Endpoint.publish() , it is working fine. I mean i was also able to access the WSDL using the URL. Please help. On 10/18/07, Jim Ma [EMAIL PROTECTED] wrote: Jim, yes I have those files in the classpath. I mean they are inside the spring-beans-2.0-m2.jar\META-INF folder. this spring jar is in the classpath. These files should be in cxf-rt-frontend-jaxws.jar. And jaxws.xsd is also packaged into this jar file. Can you confirm this jar file on your classpath ? CXF2.0.2 use spring 2.0.6 . I also suggest you update the spring version to 2.0.6. -Jim
Re: specifying wsdlLocation in jaxws:endpoint
Hi , Did you configure wsdlLocation as an attribute for jaxws:endpoint like the following example : jaxws:endpoint id=wsdlLocation implementor=org.apache.cxf.Greeter address=http://localhost:8080/sample; wsdlLocation=wsdl/addNumbers.wsdl/ You can also add the wsdlLocation attribute to simple:server to configure wsdl first approach. Cheers Jim mule1 wrote: Hello, I am confused a little for this - I want to do wsdl first configuration and I define my jaxws:endpoint with wsdlLocation=WEB-INF/hello.wsdl - but it just seems that the service is build from the java class and not wsdl file. e.g. If I specify a completely wrong wsdl filename in wsdlLocation, it doesn't give any error. How do I configure wsdl first from xml? Also is it possible to configure wsdl first using simple:server configuration?
Re: JAXB and namespace prefixes
It is right . package-info.class is only used to generate schema element . It will not impact on the namespace prefixes for the wsdl:definition element. -jim Benson Margulies wrote: At least with CXF, the namespace prefixes for the wsdl:definition element ignore any @XmlNs mappings on the package-info.java of the package containing the SEI. Is this right?
Re: Are namespace prefixes normative in jaxb?
It is ok to set this property to JAXB Marshaller to control the namespace prefix. Currently we use hard code to set properties for JAXB Marshaller , maybe we need more flexible way to configure JAXB Marshaller.(use spring configuration ? ) -Jim Benson Margulies wrote: I see a way to get a grip on this problem via com.sun.xml.bind.namespacePrefixMapper. Does CXF want to have a way to communicate one of these to the JAXB marshaller? -Original Message- From: Benson Margulies [mailto:[EMAIL PROTECTED] Sent: Sunday, October 14, 2007 5:07 PM To: cxf-user@incubator.apache.org Subject: Are namespace prefixes normative in jaxb? I've got the following situation. I've used annotations to control all the namespace prefixes in my service. The wsdl I can pull with ?wsdl or java2wsdl has the prefixes I expect. However, responses from my service do not use the specified prefix. Here's an example. Note the use of 'ns1', which is nowhere to be seen in my wsdl. I appreciate that from a pure XSD perspective I have no cause for complaint here, but my poor tiny-brained scripted language client would really like to avoid having a full XML parser, given that IE before version 7 was/is namespace-ignorant in the DOM. The critical question here is whether CXF has any influence over the behavior of the JAXB RI in this respect. soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body ns1:echoResponse xmlns:ns1=uri:com.basistech.ws.fortest returnEcho This/return /ns1:echoResponse /soap:Body /soap:Envelope
Re: xs:choice
You need to use the below jaxb binding file when run wsdl2java to tell jaxb you need choice content : jaxb:bindings version=2.0 schemaLocation=your.wsdl xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:xsd=http://www.w3.org/2001/XMLSchema; node=//xsd:schema jaxb:globalBindings choiceContentProperty=true/ /jaxb:bindings You will see the generated OjbectFactory.java is a different one. CXF will load these classes you generated with this binding file and run java2wsdl to generate the wsdl contains choice content. -Jim David W Sica wrote: Ok, great, thanks. Let me ask you this then...if I run wsdl2java on my wsdl that contains xs:choice, deploy this with CXF, the resulting CXF-generated wsdl (I took out the wsdlLocation annotation) does not contain xs:choice? Does this make sense? I'm also curious if/how CXF/JAXB can enforce xs:choice? David Sent from my iPhone On Oct 8, 2007, at 3:21 PM, Daniel Kulp [EMAIL PROTECTED] wrote: On Monday 08 October 2007, David W Sica wrote: Does CXF wsdl2java support xs:choice XSD attributes? If it's not supported what will happen if I try to use wsdl2java against a schema that has this attribute? Finally, is there a place/document where I can find out what attributes are supported/non-supported? When using the JAXB databinding, there is VERY VERY little that isn't supported from a schema/wsdl first point of view. JAXB was designed to map as much of schema as is possible. The place to look for more information about jaxb would be: https://jaxb.dev.java.net/ To answer your specific question: yes, xs:choice is supported. :-) Thanks!
Re: JAva First/WSDL-Contract First Pros and Cons
Hi Matt, FYI , http://static.springframework.org/spring-ws/site/reference/html/why-contract-first.html Jim mattmadhavan wrote: Hello, I am looking into various ways of developing Webservices. For green field development it seems that, Java first is the better way! Any ideas on pros and cons of Java first vs wsdl first? Any documentation and pointers will be appreciated. Also any tool to convert my Java interface/impl to clean WSDL (java2wsdl) in eclipse would be appreciated. Thanks Matt
Re: wsdl2java - soap:header handling/generation
Hi exgorth , You use the wsdl2java -exsh true to generate the parameter for soap header . Regards Jim exgorth wrote: The service i'm trying to access accepts the auth info in custom way - client must specify a soap:header with login:password pair and receive a token, that must be included as soap:header in all further requests. The problem that in generated code (wsdl2java) any info about that is not present. In XFIRE 1.2.4 the generated method was: @WebMethod(operationName = Search, action = http://tourml.ru/service/2006-03-14/Search;) @WebResult(name = TourML, targetNamespace = http://tourml.ru/products/2004-04-19;) public TourML search( @WebParam(name = request, targetNamespace = http://tourml.ru/query-request/2004-07-07;) Request request, @WebParam(name = UserSessionId, targetNamespace = http://tourml.ru/serviceSecurity/2006-03-14/;, header = true) ru.tourml.servicesecurity._2006_03_14.UserSessionId UserSessionId); but in CFX-2.0.1: @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebMethod(action = http://tourml.ru/service/2006-03-14/Search;, operationName = Search) @WebResult(targetNamespace = http://tourml.ru/service/2006-03-14;, partName = parameters, name = SearchResponse) public ru.tourml.service._2006_03_14.SearchResponse search( @WebParam(targetNamespace = http://tourml.ru/service/2006-03-14;, partName = parameters, name = Search) ru.tourml.service._2006_03_14.Search parameters); the UserSessionId is not present as argument. How can i supply the request with the required header? Why it doesn't present in generated API?
Re: wsdl2java - soap:header handling/generation
] [ERROR] BUILD ERROR [INFO] [INFO] ExitException: status 1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 minute 12 seconds [INFO] Finished at: Fri Aug 31 12:37:56 MSD 2007 [INFO] Final Memory: 11M/28M [INFO] Jim Ma-3 wrote: Hi exgorth , You use the wsdl2java -exsh true to generate the parameter for soap header . Regards Jim exgorth wrote: The service i'm trying to access accepts the auth info in custom way - client must specify a soap:header with login:password pair and receive a token, that must be included as soap:header in all further requests. The problem that in generated code (wsdl2java) any info about that is not present. In XFIRE 1.2.4 the generated method was: @WebMethod(operationName = Search, action = http://tourml.ru/service/2006-03-14/Search;) @WebResult(name = TourML, targetNamespace = http://tourml.ru/products/2004-04-19;) public TourML search( @WebParam(name = request, targetNamespace = http://tourml.ru/query-request/2004-07-07;) Request request, @WebParam(name = UserSessionId, targetNamespace = http://tourml.ru/serviceSecurity/2006-03-14/;, header = true) ru.tourml.servicesecurity._2006_03_14.UserSessionId UserSessionId); but in CFX-2.0.1: @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebMethod(action = http://tourml.ru/service/2006-03-14/Search;, operationName = Search) @WebResult(targetNamespace = http://tourml.ru/service/2006-03-14;, partName = parameters, name = SearchResponse) public ru.tourml.service._2006_03_14.SearchResponse search( @WebParam(targetNamespace = http://tourml.ru/service/2006-03-14;, partName = parameters, name = Search) ru.tourml.service._2006_03_14.Search parameters); the UserSessionId is not present as argument. How can i supply the request with the required header? Why it doesn't present in generated API?
Re: wsdl2java - soap:header handling/generation
Sorry , forget to metion , you need to add this dependency to cxf-codegen-plugin : plugin groupIdorg.apache.cxf/groupId artifactIdcxf-codegen-plugin/artifactId dependencies dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-bindings-soap/artifactId version${project.version}/version /dependency /dependencies executions execution /execution /executions /plugin Jim Ma wrote: You need to add the soap binding dependency in your pom : dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-bindings-soap/artifactId version2.0.1-incubator/version /dependency -Jim exgorth wrote: Thanx wsdl2java works fine with this flags, but i'm trying to use maven: ?xml version=1.0? project parent artifactIdbronni-ws-client/artifactId groupIdru.invito.ws.client.bronni/groupId version1.0-SNAPSHOT/version /parent modelVersion4.0.0/modelVersion groupIdru.invito.ws.client.bronni.model/groupId artifactIdbronni-model/artifactId namebronni-model/name version1.0-SNAPSHOT/version urlhttp://maven.apache.org/url dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version2.0.1-incubator/version scopecompile/scope /dependency /dependencies build plugins plugin groupIdorg.apache.cxf/groupId artifactIdcxf-codegen-plugin/artifactId version2.0.1-incubator/version executions execution idgenerate-sources/id phasegenerate-sources/phase configuration !-- sourceRoot${basedir}/target/generated/src/main/java/sourceRoot -- wsdlOptions !-- wsdlOption wsdlhttp://touralliance.bronni.ru/TourMLSearch.asmx?wsdl/wsdl /wsdlOption wsdlOption wsdlhttp://touralliance.bronni.ru/Booking.asmx?wsdl/wsdl /wsdlOption -- wsdlOption wsdlhttp://touralliance.bronni.ru/Loader.asmx?wsdl/wsdl extraargs extraarg-exsh/extraarg extraargtrue/extraarg extraarg-verbose/extraarg /extraargs /wsdlOption /wsdlOptions /configuration goals goalwsdl2java/goal /goals /execution /executions /plugin /plugins /build /project and i'm getting the following error: INFO: Loading jaxb databinding from jaxb plugin. Loading FrontEnd jaxws ... Loading DataBinding jaxb ... wsdl2java -d C:\bronni\bronni-model\target\generated\src\main\java -exsh true -verbose http://touralliance.bronni.ru/Loader.asmx?wsdl wsdl2java - 2.0.1-incubator 31.08.2007 12:37:40 org.springframework.context.support.AbstractApplicationContext refresh INFO: Refreshing [EMAIL PROTECTED]: display name [EMAIL PROTECTED]; startup date [Fri Aug 31 1 2:37:40 MSD 2007]; root of context hierarchy 31.08.2007 12:37:41 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] 31.08.2007 12:37:41 org.springframework.context.support.AbstractApplicationContext refresh INFO: Bean factory for application context [EMAIL PROTECTED]: org.springframework.beans.factory.support.DefaultListableBeanFactory@ 1de007d 31.08.2007 12:37:41 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxyin g) 31.08.2007 12:37:41 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization INFO: Bean 'cxf' is not eligible
Re: wsdl2java - soap:header handling/generation
Did you regenerate the server side code ? From the stack trace , I think the server did not use the implementor class which contains soap header parameter ? Could you check it ? -Jim exgorth wrote: One more.. I've generated stubs with: wsdl2java -d .\generated -exsh true -client http://touralliance.bronni.ru/Loader.asmx?wsdl And whee invoking generated client i'm getting: INFO: Creating Service {http://tourml.ru/service/2006-03-14}Loader from WSDL: http://touralliance.bronni.ru/Loader.asmx?wsdl Exception in thread main javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a message part matching name {http://tourml.ru/serviceSecurity/2006-03-14/}UserSessionId. Possible values are [{http://tourml.ru/service/2006-03-14}UserSessionId]. at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:243) at javax.xml.ws.Service.getPort(Service.java:94) at ru.tourml.service._2006_03_14.Loader.getLoaderSoap(Loader.java:51) at ru.invito.ws.client.bronni.App.main(App.java:49) Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a message part matching name {http://tourml.ru/serviceSecurity/2006-03-14/}UserSessionId. Possible values are [{http://tourml.ru/service/2006-03-14}UserSessionId]. at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:391) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(JaxWsServiceFactoryBean.java:358) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:173) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:319) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:182) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:211) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:262) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:143) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:89) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:81) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:336) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:241) ... 3 more Jim Ma-3 wrote: Hi exgorth , You use the wsdl2java -exsh true to generate the parameter for soap header . Regards Jim exgorth wrote: The service i'm trying to access accepts the auth info in custom way - client must specify a soap:header with login:password pair and receive a token, that must be included as soap:header in all further requests. The problem that in generated code (wsdl2java) any info about that is not present. In XFIRE 1.2.4 the generated method was: @WebMethod(operationName = Search, action = http://tourml.ru/service/2006-03-14/Search;) @WebResult(name = TourML, targetNamespace = http://tourml.ru/products/2004-04-19;) public TourML search( @WebParam(name = request, targetNamespace = http://tourml.ru/query-request/2004-07-07;) Request request, @WebParam(name = UserSessionId, targetNamespace = http://tourml.ru/serviceSecurity/2006-03-14/;, header = true) ru.tourml.servicesecurity._2006_03_14.UserSessionId UserSessionId); but in CFX-2.0.1: @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebMethod(action = http://tourml.ru/service/2006-03-14/Search;, operationName = Search) @WebResult(targetNamespace = http://tourml.ru/service/2006-03-14;, partName = parameters, name = SearchResponse) public ru.tourml.service._2006_03_14.SearchResponse search( @WebParam(targetNamespace = http://tourml.ru/service/2006-03-14;, partName = parameters, name = Search) ru.tourml.service._2006_03_14.Search parameters); the UserSessionId is not present as argument. How can i supply the request with the required header? Why it doesn't present in generated API?
Re: wsdl2java and faults
Hi Benson , This class is generated as per Jaxws spec 2.5 . I think the string message in constructor is useful if there is no message in X to tell us what the fault is or where throw this fault . The below is the sample we use the message to indicate where cause this error : throw new XFault(XFault raised by server when , X); We also can add a constructor (X x , Throwable cause) for your case . Can you log an enhancement in CXF jira? Regards Jim Benson Margulies wrote: The objects generated by wsdl2java for faults seem unnecessarily clumsy. I get a POJO + annotations that corresponds to the fault type. Call it 'X'. Then I get XFault. To construct an XFault over a Throwable, I need to provide a message --- (String message, X x, Throwable cause) Could there not be no-message constructor? All the information I want to transmit is inside the x object.
Re: Is there any way to customise schema namespaces with java2wsdl?
Great! Ade. It's artful hackery . -Jim Adrian Trenaman wrote: Hi Jim, Just to follow up on this - I had a go at providing a skeleton Java package with the package-info.java(.class) in place: CXF correctly picked up the class and placed all JAX-B related artifacts from that package into the namespace specified in package-info: --- package-info.java (in directory my/package) @javax.xml.bind.annotation.XmlSchema(namespace =http://i.wandered.lonely.as.a.cloud;); package my.package; --- So, this clever little hack works just fine. Cheers, Ade. Adrian Trenaman wrote: Hi Jim, Thanks for the idea - if only I could modify the class!! It's been made available to me only as a JAR, not in source format, so I don't have the possiblity of adding the familiar JAX-B annotations that would do this. One suggestion I've had from a colleague in Dublin is to create a skeleton directory structure that matches the package structure, and create a package-info.java file in each directory with a @javax.xml.bind.annotation.XmlSchema(namespace=...) annotation; if I compile and then put this ahead of my JAR in the classpath then java2wsdl might pick up these annotations and help out. What do you think? Pragmatic workaround or artful hackery? Cheers, Ade. Jim Ma-3 wrote: Hi Adrian, If this class can be modified , I think we can add some annotations for this method to avoid generating wrapper element and resolve clash : pacakge com.foo; public class Bar { @ResponseWrapper(targetNamespace = http://apache.org/namespace;, className = com.foo.CreateCaseResponse, localName = createCaseResponse) @RequestWrapper(targetNamespace = http://apache.org/namespace;, className = com.foo.CreateCaseRequest2, localName = createCaseRequst) public CreateCaseResponse createCase(String arg0, CreateCaseRequest arg1); } When java2wsdl can not read these annotations for this method , it will try to load the RequestWrapper class and ReponseWrapper class from package com.foo.jaxws (as per jaxws spec). If it is failed to load , it will generate wrapper elements for this method . Regards Jim Adrian Trenaman wrote: Hi Jim, Thanks for the info! The collision I'm running into is due to the Java API (based on an EJB) already providing wrappers classes for parameter lists. For example: public CreateCaseResponse createCase(String arg0, CreateCaseRequest arg1) ... as you can see, our java2wsdl will try and create a wrapper element for CreateCaseResponse (as per the JAXWS spec) which then clashes with the already existing type CreateCaseResponse. Ugly, huh?! The original CreateCaseResponse is in a different Java package from the interface, so if we could map individual packages to schema namespaces then I would be able to resolve the clash. However, as you say in your email, CXF doesn't provide support for this. Best, Ade. Jim Ma-3 wrote: Hi Adrian, What type of collision did you run into ? Is this schema element name collision? Java2wsdl uses converted packagename or annotated namepace as it's namespace , and there is no way to customize the namespace on per-package basis like wsdl2java does. Cheers -Jim Trenaman, Adrian wrote: Hi all, I'm creating some WSDL from classes in an existing Jar file; CXF's java2wsdl is putting everything into the same schema namespace which is causing collisions. Is there any way to customise the namespace on a per-package basis so that I can avoid the collisions? Thanks, Ade. Adrian Trenaman Principal Consultant, IONA Technologies. E: [EMAIL PROTECTED] P: +353-1-6372659 M: +353-86-6051026 IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Is there any way to customise schema namespaces with java2wsdl?
Hi Adrian, If this class can be modified , I think we can add some annotations for this method to avoid generating wrapper element and resolve clash : pacakge com.foo; public class Bar { @ResponseWrapper(targetNamespace = http://apache.org/namespace;, className = com.foo.CreateCaseResponse, localName = createCaseResponse) @RequestWrapper(targetNamespace = http://apache.org/namespace;, className = com.foo.CreateCaseRequest2, localName = createCaseRequst) public CreateCaseResponse createCase(String arg0, CreateCaseRequest arg1); } When java2wsdl can not read these annotations for this method , it will try to load the RequestWrapper class and ReponseWrapper class from package com.foo.jaxws (as per jaxws spec). If it is failed to load , it will generate wrapper elements for this method . Regards Jim Adrian Trenaman wrote: Hi Jim, Thanks for the info! The collision I'm running into is due to the Java API (based on an EJB) already providing wrappers classes for parameter lists. For example: public CreateCaseResponse createCase(String arg0, CreateCaseRequest arg1) ... as you can see, our java2wsdl will try and create a wrapper element for CreateCaseResponse (as per the JAXWS spec) which then clashes with the already existing type CreateCaseResponse. Ugly, huh?! The original CreateCaseResponse is in a different Java package from the interface, so if we could map individual packages to schema namespaces then I would be able to resolve the clash. However, as you say in your email, CXF doesn't provide support for this. Best, Ade. Jim Ma-3 wrote: Hi Adrian, What type of collision did you run into ? Is this schema element name collision? Java2wsdl uses converted packagename or annotated namepace as it's namespace , and there is no way to customize the namespace on per-package basis like wsdl2java does. Cheers -Jim Trenaman, Adrian wrote: Hi all, I'm creating some WSDL from classes in an existing Jar file; CXF's java2wsdl is putting everything into the same schema namespace which is causing collisions. Is there any way to customise the namespace on a per-package basis so that I can avoid the collisions? Thanks, Ade. Adrian Trenaman Principal Consultant, IONA Technologies. E: [EMAIL PROTECTED] P: +353-1-6372659 M: +353-86-6051026 IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Is there any way to customise schema namespaces with java2wsdl?
Hi Adrian, What type of collision did you run into ? Is this schema element name collision? Java2wsdl uses converted packagename or annotated namepace as it's namespace , and there is no way to customize the namespace on per-package basis like wsdl2java does. Cheers -Jim Trenaman, Adrian wrote: Hi all, I'm creating some WSDL from classes in an existing Jar file; CXF's java2wsdl is putting everything into the same schema namespace which is causing collisions. Is there any way to customise the namespace on a per-package basis so that I can avoid the collisions? Thanks, Ade. Adrian Trenaman Principal Consultant, IONA Technologies. E: [EMAIL PROTECTED] P: +353-1-6372659 M: +353-86-6051026 IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Error trying to run client against web service with Header
I verified and this issue is fixed in latest cxf kit . But I found another unsupported binding in CXF. When I run the soap client , I get the below exception : [java] Exception in thread main javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstrluctionException [java] at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:243) [java] at javax.xml.ws.Service.getPort(Service.java:94) ... [java] Caused by: org.apache.cxf.BusException: No binding factory for namespace http://schemas.xmlsoap.org/wsdl/http/ registered [java] at org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:78) [java] at org.apache.cxf.endpoint.EndpointImpl.createBinding(EndpointImpl.java:127) [java] ... 14 more I filled a jira issue for this : https://issues.apache.org/jira/browse/CXF-816. BTW , CXF implemented own http binding which can easily build restful webservice. http://cwiki.apache.org/CXF20DOC/http-binding.html ,FYI. Jim Jim Ma wrote: Hi, I think this issue is fixed by James couple days before .(http://svn.apache.org/viewvc?view=revrev=554819*)* . Did you used the lastest cxf kit ? Cheers Jim kranga wrote: Can someone please attempt to duplicate this and help me debug the root cause. The error is with the geenrated code without changes. The WSDL is readily accessible at the location (you don't have to register) and the error happens on calling the SoapPort implementation. Any help is appreciated. Thanks - Original Message - From: kranga [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Sent: Thursday, July 19, 2007 1:52 PM Subject: Error trying to run client against web service with Header I'm trying to build a webservice against the WSDL at http://www.xignite.com/xRealTime.asmx?WSDL I generated the client using wsdl2Java included the -exsh flag. However, when I run the SOAP client, I get the following exception: Note: The web service works perfectly when I access from Axis2 generated client, but I'd really like to use CXF. So please help! EXCEPTION STACK TRACE: Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a message part matching name {http://www.xignite.com/services/}Header. Possible values are [{http://www.xignite.com/services/}Time, {http://www.xignite.com/services/}Symbol, http://www.xignite.com/services/}Exchange]. at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(Jax WsServiceFactoryBean.java:393) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(Jax WsServiceFactoryBean.java:371) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation (JaxWsServiceFactoryBean.java:187) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOp erations(ReflectionServiceFactoryBean.java:303) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation s(JaxWsServiceFactoryBean.java:196) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom WSDL(ReflectionServiceFactoryBean.java:195) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic eModel(ReflectionServiceFactoryBean.java:246) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio nServiceFactoryBean.java:136) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpo intFactory.java:83) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean .java:82) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:320) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:238)
Re: Returning a java map
namespace=http://lor.rbx.com/ws/metadata; use=literal/ /wsdl:output /wsdl:operation /wsdl:binding wsdl:service name=MetadataService wsdl:port binding=ns1:MetadataServiceSoapBinding name=MetadataServiceImplPort soap:address location=http://localhost:8080/lor/services/MetadataService/ /wsdl:port /wsdl:service /wsdl:definitions And this is the error: WSDLToJava Error : Thrown by JAXB : undefined simple or complex type 'ns3:Coverage' org.apache.cxf.tools.common.ToolException: Thrown by JAXB : undefined simple or complex type 'ns3:Coverage' at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:34) at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:245) at com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:61) at com.sun.xml.xsom.impl.parser.ParserContext$2.error(ParserContext.java:188) at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:166) at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:103) at com.sun.xml.xsom.impl.parser.DelayedRef.resolve(DelayedRef.java:91) at com.sun.xml.xsom.impl.parser.DelayedRef.run(DelayedRef.java:66) at com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:126) at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:172) at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:488) at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:197) at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:123) at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate(JAXBDataBinding.java:163) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:483) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:168) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:215) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:84) at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102) at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171) Caused by: org.xml.sax.SAXParseException: undefined simple or complex type 'ns3:Coverage' at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:162) ... 15 more On Jul 19, 2007, at 8:06 PM, Jim Ma wrote: Hi , The generated wsdl seems invalid**. Can you also paste the wsdl you generated? Cheers Jim Julio Arias wrote: Hi - I have the following web method, we are using JAXB binding but the WSDL generator doesn't create a complex type for the returning(or param) map thus wsdl2java blows up with the following exception(see below). Xfire use to create a complex type in the WSDL for this. Do I need a special annotation? @WebMethod MapLong, MetadataVO getMap(MapLong, String param); - WSDLToJava Error : java.lang.NullPointerException org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:223) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:84) at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102) at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171) Caused by: java.lang.NullPointerException at org.apache.ws.commons.schema.XmlSchemaCollection.getElementByQName(XmlSchemaCollection.java:372) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildMessage(WSDLServiceBuilder.java:775) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterfaceOperation(WSDLServiceBuilder.java:578) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterface(WSDLServiceBuilder.java:561) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:251) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:154) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:143) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:142) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:215) ... 3 more Julio Arias Java Developer Roundbox Global : enterprise : technology : genius - Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica tel: 404.567.5000 ext. 2001 | cell: 11.506.849.5981 email: [EMAIL PROTECTED
Re: Error trying to run client against web service with Header
Hi, I think this issue is fixed by James couple days before .(http://svn.apache.org/viewvc?view=revrev=554819*)* . Did you used the lastest cxf kit ? Cheers Jim kranga wrote: Can someone please attempt to duplicate this and help me debug the root cause. The error is with the geenrated code without changes. The WSDL is readily accessible at the location (you don't have to register) and the error happens on calling the SoapPort implementation. Any help is appreciated. Thanks - Original Message - From: kranga [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Sent: Thursday, July 19, 2007 1:52 PM Subject: Error trying to run client against web service with Header I'm trying to build a webservice against the WSDL at http://www.xignite.com/xRealTime.asmx?WSDL I generated the client using wsdl2Java included the -exsh flag. However, when I run the SOAP client, I get the following exception: Note: The web service works perfectly when I access from Axis2 generated client, but I'd really like to use CXF. So please help! EXCEPTION STACK TRACE: Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a message part matching name {http://www.xignite.com/services/}Header. Possible values are [{http://www.xignite.com/services/}Time, {http://www.xignite.com/services/}Symbol, http://www.xignite.com/services/}Exchange]. at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(Jax WsServiceFactoryBean.java:393) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(Jax WsServiceFactoryBean.java:371) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation (JaxWsServiceFactoryBean.java:187) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOp erations(ReflectionServiceFactoryBean.java:303) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation s(JaxWsServiceFactoryBean.java:196) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom WSDL(ReflectionServiceFactoryBean.java:195) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic eModel(ReflectionServiceFactoryBean.java:246) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio nServiceFactoryBean.java:136) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpo intFactory.java:83) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean .java:82) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:320) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:238)
Re: [Fwd: CXFServlet-Config]
Hi Jan, By default CXF will use JaxWsServiceFactoryBean to construct JaxwsServerFactoryBean when it parse the jaxws:endpoint/ configuration . We do not have many tests for JaxwsServiceFactoryBean working with AegisDatabinding . I think the ReflectionServiceFactoryBean and AegisDatabinding is a good choice , I wrote the follow configuration sample for your reference : bean id=serviceClass class=org.apache.cxf.ImplClass/ bean id=aegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=serviceFactory class=org.apache.cxf.service.factory.ReflectionServiceFactoryBean property name=dataBinding ref=aegisDatabinding/ /bean bean id=serverBeanFactory class=org.apache.cxf.frontend.ServerFactoryBean init-method=create property name=address value=/aegis/ property name=bindingId value=http://schemas.xmlsoap.org/soap// property name=serviceBean ref=serviceClass/ property name=serviceFactory ref=serviceFactory/ /bean BTW, If you think it's an issue(JaxwsServiceFactoryBean working with AegisDatabinding) in CXF , please feel free to log a jira issue for it : https://issues.apache.org/jira/browse/CXF . Cheers Jim Jan Kriesten wrote: hi, I think this can inject the databinding in ServiceFactoryBean : bean id=aegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/bean id=JaxWsServiceFactoryBean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisDatabinding/ /bean jaxws:endpoint jaxws:serviceFactory ref bean=JaxWsServiceFactoryBean/ /jaxws:serviceFactory /jaxws:endpoint the service seems to be created, but my client doesn't get a response any more. the wsdl looks good afaik. i'll have to dig a bit deeper... best regards, --- jan. i don't get jaxws:endpoint working with aegis CXFServlet. if i configure it the way above, the client doesn't get any connection with the server any more. if i remove the service-factory all is well though. just that jaxb is used again and this doesn't support interfaces, which i need for the acegi authentication... this spring-bean-xml is driving me nuts. any more ideas? as cxf works fine with jaxb (i.e. default config) - it shouldn't be that hard to just change to aegis. best regards, --- jan.
Re: JaxWsServiceFactoryBean / Aegis
Hi Jan, Did you test ReflectionServiceFactoryBean with Aegis ? Is it working ? bean id=serviceFactory class=org.apache.cxf.service.factory.ReflectionServiceFactoryBean property name=dataBinding ref=aegisDatabinding/ /bean I think you can use ClientProxyFactoryBean to invoke service used AegisDatabinding : ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean(); ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean(); clientBean.setAddress(http://localhost:8088/Hello;); clientBean.setBus(CXFBusFactory.getDefaultBus()); clientBean.setTransportId(http://schemas.xmlsoap.org/wsdl/http/;); clientBean.setServiceClass(BookService.class); proxyFactory.getServiceFactory().setDataBinding(new AegisDatabinding()); BookService client = (BookService) proxyFactory.create(); client.getBook(isbn) Cheers Jim Jan Kriesten wrote: Hi Jim, did some tests again. There really seems to be an issue with JaxWsServiceFactoryBean and Aegis. Based on your suggestion, I tried the following (CXFServlet): ---8--- bean id=serviceClass class=de.footprint.www.services.auth.AcegiAuthService/ bean id=aegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=serviceFactory class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisDatabinding/ /bean bean id=serverBeanFactory class=org.apache.cxf.frontend.ServerFactoryBean init-method=create property name=address value=/AuthService/ property name=bindingId value=http://schemas.xmlsoap.org/soap// property name=serviceBean ref=serviceClass/ property name=serviceFactory ref=serviceFactory/ /bean ---8--- This did _not_ work. The services-log tells me, that the WebService-Parameters are blank (btw, only Strings are used). Commenting out the dataBinding-property in the serviceFactory-bean solves it again - all parameters are ok! My client looks like this: ---8--- Bus bus = new SpringBusFactory().createBus(); AegisDatabinding aegisBinding = new AegisDatabinding(); JaxWsProxyFactoryBean proxyBean = new JaxWsProxyFactoryBean(); proxyBean.setBus( bus ); proxyBean.getServiceFactory().setDataBinding( aegisBinding ); proxyBean.setAddress( http://wicket.silberlicht.de/service/AuthService; ); proxyBean.setServiceClass( IAuthService.class ); service = (IAuthService) proxyBean.create(); ---8--- Best regards, --- Jan.
Re: WSDL2Java generates 2 client/server files?
Yes. You can . Jim Guy Pardon wrote: No problem:-) I assume I can still use the generated files if we delete the duplicate classes? Thanks, Guy On 5-jul-07, at 04:42, Jim Ma wrote: Hi Guy, This is an issue in wsdl2java tool . I filled a jira issue for it : https://issues.apache.org/jira/browse/CXF-765. I am working on it now . Thank you for reporting this issue . Thanks Jim Guy Pardon wrote: On 4-jul-07, at 14:54, Jim Ma wrote: Hi Guy, Can you paste your wsdl ? Is there any elements in wsdl which name is CoordinatorPortTypeClient ? See below. No such element, nor in the referenced xsd files. Guy ?xml version=1.0 encoding=UTF-8? !-- This file contains the specification of the transactional messages exchanged as part of the Atomikos Transactions (TM) protocol for transactions and activities that span different web services. COPYRIGHT (C) 2001-2005, ATOMIKOS. ALL RIGHTS RESERVED. -- wsdl:definitions targetNamespace=http://www.atomikos.com/schemas/2005/10/transactions; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:ato=http://www.atomikos.com/schemas/2005/10/transactions; wsdl:types xs:schema xs:import namespace=http://www.atomikos.com/schemas/2005/10/transactions; schemaLocation=atomikos-termination.xsd / xs:import namespace=http://www.atomikos.com/schemas/2005/10/transactions; schemaLocation=atomikos-propagation.xsd / /xs:schema /wsdl:types !-- NOTES: -No Synchronization ports are here because each Atomikos component will have its own TM; only 2PC is co-ordinated via SOAP. -No registration port for Participants is provided since this is done intra-VM by SOAP request handlers. This implies that the response of a transactional request should contain the AddressType contents of the Participant to register. -- !-- Header to add to outgoing application-level messages at the sender. (Done by Atomikos SOAP handlers.) This information serves to reconstruct the transaction at the receiver side. -- wsdl:message name=PropagationHeader wsdl:part name=Propagation element=ato:Propagation/wsdl:part /wsdl:message !-- Header to add to returning application-level messages. (Done by Atomikos SOAP handlers.) This information serves to register the remote work as part of the global transaction. -- wsdl:message name=ExtentHeader wsdl:part name=Extent element=ato:Extent/wsdl:part /wsdl:message !-- Below are Atomikos-specific messages; these are exchanged out-of-band by the transaction services at sender and receiver side (during commit/rollback processing). -- wsdl:message name=PrepareRequestMessage wsdl:part name=PrepareRequestContent element=ato:Prepare/wsdl:part /wsdl:message wsdl:message name=PrepareResponseMessage wsdl:part name=PrepareResponseContent element=ato:Prepared/wsdl:part /wsdl:message wsdl:message name=CommitMessage wsdl:part name=CommitContent element=ato:Commit/wsdl:part /wsdl:message wsdl:message name=StateMessage wsdl:part name=StateContent element=ato:State/wsdl:part /wsdl:message wsdl:message name=RollbackMessage wsdl:part name=RollbackContent element=ato:Rollback/wsdl:part /wsdl:message wsdl:message name=ForgetMessage wsdl:part name=ForgetContent element=ato:Forget/wsdl:part /wsdl:message wsdl:message name=ReplayMessage wsdl:part name=ReplayContent element=ato:Replay/wsdl:part /wsdl:message wsdl:message name=ErrorMessage wsdl:part name=ErrorContent element=ato:Error/wsdl:part /wsdl:message wsdl:portType name=ParticipantPortType wsdl:operation name=prepare wsdl:input message=ato:PrepareRequestMessage/wsdl:input /wsdl:operation wsdl:operation name=commit wsdl:input message=ato:CommitMessage/wsdl:input /wsdl:operation wsdl:operation name=rollback wsdl:input message=ato:RollbackMessage/wsdl:input /wsdl:operation wsdl:operation name=forget wsdl:input message=ato:ForgetMessage/wsdl:input /wsdl:operation /wsdl:portType wsdl:portType name=CoordinatorPortType wsdl:operation name=prepared wsdl:input message=ato:PrepareResponseMessage/wsdl:input /wsdl:operation wsdl:operation name=participantStateNotification wsdl:input message=ato:StateMessage/wsdl:input /wsdl:operation
Re: Problem writing restful services with Spring
Hi , I wrote the follow configuration to deploy the sample restful_http_binding (under cxf-home/samples) in tomcat : beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; jaxws:endpoint id=customer implementor=com.acme.customer.CustomerServiceImpl address=/customer bindingUri=http://apache.org/cxf/binding/http; jaxws:serviceFactory bean id=JaxWsServiceFactoryBean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=false/ /bean /jaxws:serviceFactory /jaxws:endpoint /beans I tried this configuration and it works . I can get info from : http://localhost:8080/customer/services/customer/customers I do not know if return List cause this problem .The method I tried like this @Get @HttpResource(location = /customers) @WebResult(name = Customers) Customers getCustomers(); Hope this will help. Cheers Jim Christian Blavier wrote: It doesn't work :( My method is annotated like this (in a @WebService class) : @Get @HttpResource(location=/books) *public* List getBooks() { *return* books; } and I get a org.apache.cxf.interceptor.Fault: Invalid URL/Verb combination. Verb: GET Path: /books exception when I try http://localhost:8080/yuipoc-webapp/cxf/bookService/books and the http://localhost:8080/yuipoc-webapp/cxf/bookService?wsdl address still works. 2007/7/5, Dan Diephouse [EMAIL PROTECTED]: I *think* given your configuration, that the correct address to look at might be: http://localhost:8080/yuipoc-webapp/cxf/bookService/books http://localhost:8080/yuipoc-webapp/cxf/books The address attribute on jaxws:endpoint specifies the root location for the restful service. Then the URIs in @HttpResource are appended to it (if you're using annotations). Cheers, - Dan On 7/5/07, Christian Blavier [EMAIL PROTECTED] wrote: No idea ? Anyone ? I'm still blocked on this.. :/ 2007/7/3, Christian Blavier [EMAIL PROTECTED]: Hello, I am currently using CXF 2.0-SNAPSHOT, and I've got some trouble writing restful services with CXF. Here is my spring configuration : beans bean id=JaxWsServiceFactoryBean class= org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=false/ /bean jaxws:endpoint id=restfulServer implementor=#bookService address=/bookService bindingUri=http://apache.org/cxf/binding/http; jaxws:serviceFactory ref bean= JaxWsServiceFactoryBean/ /jaxws:serviceFactory /jaxws:endpoint / beans My bookService is a simple java service with a single getBooks() method which return a collection of Books I haven't got any error at jetty startup and I can see a wsdl at http://localhost:8080/yuipoc-webapp/cxf/bookService?wsdl but nothing at http://localhost:8080/yuipoc-webapp/cxf/books or any other rest-like address Where am I wrong ? Thanks -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
Re: [Fwd: CXFServlet-Config]
Hi Jan , I think this can inject the databinding in ServiceFactoryBean : bean id=aegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=JaxWsServiceFactoryBean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisDatabinding/ /bean jaxws:endpoint jaxws:serviceFactory ref bean=JaxWsServiceFactoryBean/ /jaxws:serviceFactory /jaxws:endpoint Cheers Jim Jan Kriesten wrote: hi dan, We do need a databinding element yet... This may work though: jaxws:endpoint property name=databinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /property /jaxws:endpoint actually, it doesn't. :-( it tells me ---8--- [20:36:53.938] org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from class path resour ce [META-INF/CXF/services.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid conten t was found starting with element 'property'. One of '{http://cxf.apache.org/jaxws:binding, http://cxf.apache.org/jaxws:executor , http://cxf.apache.org/jaxws:features, http://cxf.apache.org/jaxws:implementor, http://cxf.apache.org/jaxws:inInterceptors, http://cxf.apache.org/jaxws:inFaultInterceptors, http://cxf.apache.org/jaxws:outInterceptors, http://cxf.apache.org/jaxws:outFa ultInterceptors, http://cxf.apache.org/jaxws:properties, http://cxf.apache.org/jaxws:serviceFactory}' is expected. [20:36:53.938] Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'pr operty'. One of '{http://cxf.apache.org/jaxws:binding, http://cxf.apache.org/jaxws:executor, http://cxf.apache.org/jaxws:featu res, http://cxf.apache.org/jaxws:implementor, http://cxf.apache.org/jaxws:inInterceptors, http://cxf.apache.org/jaxws:inFaultI nterceptors, http://cxf.apache.org/jaxws:outInterceptors, http://cxf.apache.org/jaxws:outFaultInterceptors, http://cxf.apache.o rg/jaxws:properties, http://cxf.apache.org/jaxws:serviceFactory}' is expected. ---8--- i saw the jaxws:binding in there, but didn't find out, how to possibly make use of it... any more ideas, dan? best regards, --- jan.
Re: [Fwd: CXFServlet-Config]
Hi Jan , I think this is an issue or unsupported. I see there is no item for databinding in jaxws.xsd : xsd:element name=endpoint xsd:complexType xsd:complexContent xsd:extension base=beans:identifiedType xsd:sequence xsd:element name=binding type=xsd:anyType minOccurs=0/ xsd:element name=executor type=xsd:anyType minOccurs=0/ xsd:element name=features type=xsd:anyType minOccurs=0/ xsd:element name=implementor type=xsd:anyType minOccurs=0/ xsd:element name=inInterceptors type=xsd:anyType minOccurs=0/ xsd:element name=inFaultInterceptors type=xsd:anyType minOccurs=0/ xsd:element name=outInterceptors type=xsd:anyType minOccurs=0/ xsd:element name=outFaultInterceptors type=xsd:anyType minOccurs=0/ xsd:element name=properties type=beans:mapType minOccurs=0/ xsd:element name=serviceFactory type=xsd:anyType minOccurs=0/ /xsd:sequence xsd:attributeGroup ref=cxf-beans:beanAttributes/ xsd:attribute name=address type=xsd:string / xsd:attribute name=bindingUri type=xsd:string / xsd:attribute name=bus type=xsd:string / xsd:attribute name=implementor type=xsd:string/ xsd:attribute name=publish type=xsd:boolean default=true/ xsd:attribute name=endpointName type=xsd:QName / xsd:attribute name=serviceName type=xsd:QName / xsd:attribute name=wsdlLocation type=xsd:string / /xsd:extension /xsd:complexContent /xsd:complexType /xsd:element Please feel free to log a Jira issue for it . Regards Jim Jan Kriesten wrote: Hi! I still need some help on thins issue to get the CXFServlet configured using AegisDatabinding with jaxws:...-syntax. Someone there knowing the proper hints? Thanks! :-) Best regards, --- Jan. Original Message Subject: CXFServlet-Config Date: Fri, 29 Jun 2007 17:23:49 +0200 From: Jan Kriesten [EMAIL PROTECTED] Reply-To: cxf-user@incubator.apache.org To: cxf-user@incubator.apache.org Hi, I'm not really a Spring-wizard, so I'm having some trouble getting the CXFServlet configured as I wish... The following properties work to have the Service responding: ---8--- 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-2.0.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 / jaxws:endpoint id=AuthService implementor=test.AcegiAuthService address=/AuthService / /beans ---8--- Now I want to have the service use AegisDatabinding, but I don't get it working... Could someone provide me with a hint - the following approach which Willem posted (on my marshalling exception) only leads to an unresponsive service, so the above is the only working version I have right now: ---8--- bean id=AegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=JaxWsServiceFactoryBean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=false/ property name=dataBinding ref=AegisDatabinding/ /bean bean id=authServiceFactory class=org.apache.cxf.jaxws.JaxWsServerFactoryBean init-method=create property name=serviceClass value=test.AcegiAuthService / property name=serviceBean bean class=test.AcegiAuthService/ /property property name=address value=/AuthService/ property name=bus ref=cxf/ property name=serviceFactory ref=JaxWsServiceFactoryBean/ /bean ---8--- Best regards, --- Jan.
Re: WSDL2Java generates 2 client/server files?
Hi Guy, Can you paste your wsdl ? Is there any elements in wsdl which name is CoordinatorPortTypeClient ? Cheers Jim James Mao wrote: Hi Guy I'm not sure how you run the wsdl2java, but seems that you run twice. Or before you run wsdl2java, there are client and server main line classes which has the same name already existed in your generated path, wsdl2java will not overwrite the existed code. but i think we have a flag to overwrite those existed code. James Hi, After running wsdl2java I get these generated (wsdl-specific) client and server classes: CoordinatorPortTypeClient.java and also CoordinatorPortTypeClient_Client.java Same for the server: CoordinatorPortTypeServer.java and also CoordinatorPortTypeServer_Server.java The content is identical for each pair. It seems like this is generated twice. Could this be due to some double import in the WSDL or so? Thanks Guy
Re: WSDL2Java generates 2 client/server files?
Hi Guy, This is an issue in wsdl2java tool . I filled a jira issue for it : https://issues.apache.org/jira/browse/CXF-765. I am working on it now . Thank you for reporting this issue . Thanks Jim Guy Pardon wrote: On 4-jul-07, at 14:54, Jim Ma wrote: Hi Guy, Can you paste your wsdl ? Is there any elements in wsdl which name is CoordinatorPortTypeClient ? See below. No such element, nor in the referenced xsd files. Guy ?xml version=1.0 encoding=UTF-8? !-- This file contains the specification of the transactional messages exchanged as part of the Atomikos Transactions (TM) protocol for transactions and activities that span different web services. COPYRIGHT (C) 2001-2005, ATOMIKOS. ALL RIGHTS RESERVED. -- wsdl:definitions targetNamespace=http://www.atomikos.com/schemas/2005/10/transactions; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:ato=http://www.atomikos.com/schemas/2005/10/transactions; wsdl:types xs:schema xs:import namespace=http://www.atomikos.com/schemas/2005/10/transactions; schemaLocation=atomikos-termination.xsd / xs:import namespace=http://www.atomikos.com/schemas/2005/10/transactions; schemaLocation=atomikos-propagation.xsd / /xs:schema /wsdl:types !-- NOTES: -No Synchronization ports are here because each Atomikos component will have its own TM; only 2PC is co-ordinated via SOAP. -No registration port for Participants is provided since this is done intra-VM by SOAP request handlers. This implies that the response of a transactional request should contain the AddressType contents of the Participant to register. -- !-- Header to add to outgoing application-level messages at the sender. (Done by Atomikos SOAP handlers.) This information serves to reconstruct the transaction at the receiver side. -- wsdl:message name=PropagationHeader wsdl:part name=Propagation element=ato:Propagation/wsdl:part /wsdl:message !-- Header to add to returning application-level messages. (Done by Atomikos SOAP handlers.) This information serves to register the remote work as part of the global transaction. -- wsdl:message name=ExtentHeader wsdl:part name=Extent element=ato:Extent/wsdl:part /wsdl:message !-- Below are Atomikos-specific messages; these are exchanged out-of-band by the transaction services at sender and receiver side (during commit/rollback processing). -- wsdl:message name=PrepareRequestMessage wsdl:part name=PrepareRequestContent element=ato:Prepare/wsdl:part /wsdl:message wsdl:message name=PrepareResponseMessage wsdl:part name=PrepareResponseContent element=ato:Prepared/wsdl:part /wsdl:message wsdl:message name=CommitMessage wsdl:part name=CommitContent element=ato:Commit/wsdl:part /wsdl:message wsdl:message name=StateMessage wsdl:part name=StateContent element=ato:State/wsdl:part /wsdl:message wsdl:message name=RollbackMessage wsdl:part name=RollbackContent element=ato:Rollback/wsdl:part /wsdl:message wsdl:message name=ForgetMessage wsdl:part name=ForgetContent element=ato:Forget/wsdl:part /wsdl:message wsdl:message name=ReplayMessage wsdl:part name=ReplayContent element=ato:Replay/wsdl:part /wsdl:message wsdl:message name=ErrorMessage wsdl:part name=ErrorContent element=ato:Error/wsdl:part /wsdl:message wsdl:portType name=ParticipantPortType wsdl:operation name=prepare wsdl:input message=ato:PrepareRequestMessage/wsdl:input /wsdl:operation wsdl:operation name=commit wsdl:input message=ato:CommitMessage/wsdl:input /wsdl:operation wsdl:operation name=rollback wsdl:input message=ato:RollbackMessage/wsdl:input /wsdl:operation wsdl:operation name=forget wsdl:input message=ato:ForgetMessage/wsdl:input /wsdl:operation /wsdl:portType wsdl:portType name=CoordinatorPortType wsdl:operation name=prepared wsdl:input message=ato:PrepareResponseMessage/wsdl:input /wsdl:operation wsdl:operation name=participantStateNotification wsdl:input message=ato:StateMessage/wsdl:input /wsdl:operation wsdl:operation name=participantErrorNotification wsdl:input message=ato:ErrorMessage/wsdl:input /wsdl:operation wsdl:operation name=replayCompletion wsdl:input message
Re: npe problem with cxf-2.0-inbubator-RC
Hi , Is there any annotation in your impl class? Can you provide your impl class ? --Jim Erlend Hamnaberg wrote: Hello list. I have an npe problem with the binary distribution of cxf. I am stumped over why this happens. There is probably something obvious that i have forgotten, however i dont see it. my config: applicationContext-ws.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-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schema/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 / jaxws:endpoint id=evatest implementor=org.evatest.ws.impl.TIRLaunchServiceImpl address=/EvatestLaunchService / /beans I am generating from a wsdl file with the jaxws-maven-plugin v1.3. when starting the application in jetty, the following happens, full stacktrace included below. Any thoughts why this is happening? INFO: Creating Service {http://www.imsglobal.org/services/ti/wsdl/sync/TIRLaunchService_v1p0}EvatestLaunchService from class org.evatest.ws.impl.TIRLaunchServiceImpl 2007-06-16 17:45:03,777 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'evatest': Invocation of init method failed; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createBareMessage(ReflectionServiceFactoryBean.java:561) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:229) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:246) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:135) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:82) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:84) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:280) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:178) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:361) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:511) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1189) at
Re: buildServiceFromWSDL - long processing
Hi Krystian, I think CXF does not parse the same wsdl file for several times. The WSDLManager will cache the wsdl definition with same URL. (see http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java around line 82) But we do not cache the serviceInfos built by same definition. It will build the same service model for several times. It need to enhance. Thank you for reporting this. Cheers Jim. Krystian Lider wrote: Hi Willem Thank you for the replay. Please see my comments below. On 6/5/2007 8:42 AM,User Willem Jiang wrote: Hi Krystian, Is there only one wsdl that contains all the endpoints information. In that specific situation yes CXF did not cache the wsdl information for the endpoints , it will build all service model from the wsdl and then look up a right definition for the publishing endpoint each time. Don’t you think that it would be a good idea to cache the wsdl information, to avoid parsing the same file several times? So it takes 10 times time to reparse the quite complex wsdl . I think you can broke down you wsdl for each endpoint , It could be a solution but there are reasons why I don’t want to do that or you can try the build service from class you just do not specify the wsdlLocation attribute to walk around that. I tried that. When I removed wsdlLocation attribute from the configuration file, then information about localization of the wsdl files was taken from implementor class and again service was build from wsdl. After removing from annotation buildServiceFromClass was started. Unfortunately I got following exception and creating of service was failed. NFO: Could not find the configuration file cxf.xml on the classpath. 2007-06-05 10:13:17 org.apache.cxf.configuration.spring.ConfigurerImpl getBeanName INFO: Could not determine bean name for instance of class org.apache.cxf.jaxws.JaxWsServerFactoryBean. 2007-06-05 10:13:17 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service here name of the service from class here class name 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 WARNING: failed cxf javax.servlet.ServletException: Error creating bean with name 'here_bean_id': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [here name of the operation] already exists in this service at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:617) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:210) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) …… 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 SEVERE: Nested in javax.servlet.ServletException: Error creating bean with name 'here bean id': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [here nam of the opartion] already exists in this service: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'here bean id': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [here operation id] already exists in this service Caused by: java.lang.IllegalArgumentException: An operation with name [here operation id] already exists in this service at org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:346) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:338) at
RE: @BindingType(value=http://www.w3.org/2004/08/wsdl/http)
Hi Dan , The CXF http binding id is http://apache.org/cxf/binding/http; . Try this one, @BindingType(value=http://apache.org/cxf/binding/http;). Regards Jim -Original Message- From: Dan Connelly [mailto:[EMAIL PROTECTED] Sent: Monday, May 14, 2007 12:47 AM To: cxf-user@incubator.apache.org Subject: @BindingType(value=http://www.w3.org/2004/08/wsdl/http;) I am bootstrapping myself into CXF 2.0 using the Spring/HelloWorld example. The binding type appears to be soap/http (by default). Virtual wsdl has: soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http/ This works fine running the published server code on Tomcat. However, I am bit surprised that when I add this @BindingType annotation to the SEI it does not appear change anything in the virtual wsdl. What I an expecting to see is a non-soap binding such as: http:binding verb=GET / but I still see soap:binding .../ Are my expectations wrong?Do I need to provide a different value string? -- Dan
RE: wsdl2java when wsdl is on https and password protected.
How about add a method tryFromProxy() in URIResolver ? Tools or DynamicClientFactory can all get wsdl or other resource by URIResolver. Regards Jim -Original Message- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: Thursday, April 05, 2007 10:52 AM To: cxf-user@incubator.apache.org Subject: Re: wsdl2java when wsdl is on https and password protected. Where do you think the appropriate place to add this would be? Guillaume Alleon who is working on the Groovy Web Services support which use the CXF DynamicClientFactory has been bugging me about this too. He is just passing in a URL to the DCF. Is it possible to register a URLConnectionFactory that can handle proxies? Or do we need to add support for this somewhere else? Any ideas welcome :-) Thanks, - Dan On 4/4/07, James Mao [EMAIL PROTECTED] wrote: Hi, Sorry, we do not support this yet, please add this to wish list on [1] Cheers, James. [1] https://issues.apache.org/jira/browse/CXF Hi List. I'm new here and new to web services. I have created a very simple web service using Glassfish and @Webservice annotations on a stateless session bean, which I can call using CXF. I'd like to do something very similar but with the web service requiring transport security and authentication, so https and username/password. Should wsdl2java be able to support this? Do web services work this way? What I've tried so far with no success. /home/peter/downloads/java/apache-cxf/cxf-2.0-incubator-M1/bin/wsdl2java -verbose -ant -client -d clientdirInsurance/ https://user:[EMAIL PROTECTED]:8181/InsuranceBrokerBeanService /InsuranceBrokerBean?wsdl Which moans about keystore and truststores, so rather than supply a whole bunch of -Djavax.net.ssl.keyStore=blah settings I though I'll download and save the WSDL locally. (should username/password be optional arguments to wsdl2java?) [EMAIL PROTECTED]:~/work/play/Tests/cxf$ /home/peter/downloads/java/apache-cxf/cxf-2.0-incubator-M1/bin/wsdl2java -verbose -ant -client -d clientdirInsurance/ /home/peter/work/test/webservice3/WebService3Client/InsuranceBroke rBean.wsdl /home/peter/downloads/java/apache-cxf/cxf-2.0-incubator-M1/bin/wsdl2java wsdl2java -verbose -ant -client -d clientdirInsurance/ /home/peter/work/test/webservice3/WebService3Client/InsuranceBroke rBean.wsdl wsdl2java - 2.0-incubator-M1 Error : Fail to create wsdl definition file:/home/peter/work/test/webservice3/WebService3Client/Insurance BrokerBean.wsdl org.apache.cxf.tools.common.ToolException: Fail to create wsdl definition file:/home/peter/work/test/webservice3/WebService3Client/Insurance BrokerBean.wsdl at org.apache.cxf.tools.wsdl2java.processor.WSDLToProcessor.parseWSDL( WSDLToProcessor.java:165) at org.apache.cxf.tools.wsdl2java.processor.WSDLToProcessor.init( WSDLToProcessor.java:360) at org.apache.cxf.tools.wsdl2java.processor.WSDLToJavaProcessor.process( WSDLToJavaProcessor.java:54) at org.apache.cxf.tools.wsdl2java.WSDLToJava.execute(WSDLToJava.java:85) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java :69) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java :38) at org.apache.cxf.tools.wsdl2java.WSDLToJava.main(WSDLToJava.java:218) Caused by: java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:334) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at org.apache.cxf.tools.wsdl2java.processor.WSDLToProcessor.parseWSDL( WSDLToProcessor.java:157) ... 6 more Many thanks Peter Henderson. -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog