Re: Elements and parts seem to default to return - which upsets WSDL2X as return is generally a reserved word
Hi Jervis/James, You hit the nail on the head with the Spec section. I still wish they didn't choose a reserved word when they wrote the spec... As you say Jervice, the name shouldn't be relevant, but unfortunately using return means that anyone writing a WSDL2X will need to take more care. The situation I have is that I have a number of local web services (created using CXF + annotated POJO) that I'm feeding to Salesforce.com. Salesforce.com can consume arbitrary SOAP services - it takes the WSDL and creates local Apex objects which then do all the dirty work. The problem is that is nobody has control over that process (it's hosted). I have to currently edit the WSDL before this happens, otherwise the Apex objects are invalid. (or use @WebResult) I'll be reporting this to them though, and pointing out the spec - hopefully they can change their mapper to take more care in assigning names :-) Thanks for the resolution. I'm having great fun with CXF - it's remarkably easy to get a SOAP service up and running now. Regards, Jon On 11 Sep 2007, at 04:51, Liu, Jervis wrote: One thing to add. If your WSDL is doc-lit wrapped (this type of WSDL is generated by java2wsdl by default unless your java class has annotations to customize this), a Response Bean is required to be generated by WSDL2JAVA tool. In this case, the WSDL2JAVA tool is also required to resolve any name collisions in response bean. In CXF, when JAXB is the databinding used by WSDL2JAVA, the name mapping is handled by JAXB, detailed can be found in JAXB 2.0 spec Appendix D BINDING XML NAMES TO JAVA IDENTIFIERS. Cheers, Jervis -Original Message- From: Liu, Jervis [mailto:[EMAIL PROTECTED] Sent: 2007?9?11? 10:47 To: cxf-user@incubator.apache.org Subject: RE: Elements and parts seem to default to return - which upsets WSDL2X as return is generally a reserved word Jon, the mapping name of return is per JAX-WS 2.0 spec. Section 3.6.1: Conformance (Result naming): The javax.jws.WebResult annotation (see 7.10.4) MAY be used to specify the name of the wsdl:part or XML Schema element declaration corresponding to the Java method return type. If both the name and partName elements are used in the javax.jws.WebResult annota- tions then the partName MUST be used for the wsdl:part name attribute and the name elment from the annotation will be ignored. In the absence of customizations, the default name is return. As far as the WSDL2JAVA tool is concerned, the return name is not significant as it is not needed by the language, only the return type is significant. Or you have specific WSDL2Language in your mind? Cheers, Jervis -Original Message- From: Jon Mountjoy [mailto:[EMAIL PROTECTED] Sent: 2007?9?11? 4:46 To: cxf-user@incubator.apache.org Subject: Elements and parts seem to default to return - which upsets WSDL2X as return is generally a reserved word Hi, I'm new to CXF, so forgive this newb question. For almost all simple web services that I create using Java, such as those described here: http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html I get parts or elements automatically named return in the resulting auto-generated WSDL (see example below). As you'll see below, the argument is given a nice name like arg0, but the return is called return. Unfortunately, return is a reserved keyword in many languages, so this forces many WSDL2LanguageX converters to rename. Can you change the default return name for elements/parts to something like return0 ? Right now, I can't use CXF web services from salesforce.com without hacking all my WSDL files (or, when I have access to source, adding an annotation). LMK if I've got this wrong! Thanks! Jon xsd:complexType name=getInfo xsd:sequence xsd:element minOccurs=0 name=arg0 type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=getInfoResponse type=getInfoResponse/ xsd:complexType name=getInfoResponse xsd:sequence xsd:element minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: NameSpaceHandling error
WebLogic Server has an interesting prefer-web-inf-classes setting that you can define which changes its default class loader behaviour - see http://e-docs.bea.com/wls/docs91/programming/classloading.html#1073478 Perhaps that will help. BTW - you should describe what commons logging problem you actually get to help people here try and help you. Regards, Jon On 11 Sep 2007, at 21:46, Sureka, Sushil wrote: The issue is that since I placed the cxf incubator jar file in the system classpath, org/apache/cxf/binding/soap/spring/NamespaceHandler class is loaded by the system classpath. Since this class has a dependency to spring bean classes, the loading fails. If I placed all the spring jar files, it does go past the problem I reported earlier but it fails while looking for commons logging. So obviously putting all the classes in the bootloader classpath would work but that is defintely not what I am looking for. Any suggestions on what can be done here? Sushil -Original Message- From: Sureka, Sushil [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 11:46 AM To: cxf-user@incubator.apache.org; [EMAIL PROTECTED] Subject: RE: NameSpaceHandling error I definitely have all the classes in the classpath. I can see all the handler classes in the jar files. It may have something to do with classloader issue. Due to weblogic issues, I placed the C:\Apps\apache-cxf-2.0.1-incubator\lib\cxf-2.0.1-incubator.ja r this path in front of my classpath. Rest all the jars from CXF library distribution has been copied over to WEB-INF/lib. I did follow the tutorial and that's how I have configured my project. Sushil -Original Message- From: Dale Peakall [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 10:24 AM To: cxf-user@incubator.apache.org Subject: Re: NameSpaceHandling error From the Java documentation for NoClassDefFoundException: The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. Looks like you're missing a Jar file. Please make sure you're including all the Jars referenced here: http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html Sureka, Sushil wrote: I am afraid we will have to abandon our effort to get CXF in our project if we can not go past this issue. If any one has any suggestion, please advise Thanks -Original Message- From: Sureka, Sushil [mailto:[EMAIL PROTECTED] Sent: Monday, September 10, 2007 4:57 PM To: cxf-user@incubator.apache.org Subject: NameSpaceHandling error I am just trying to do a very simple web service using Spring but have run into an issue. I get the following excpetion when weblogic is starting up SEVERE: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsin gException : Config uration problem: Unable to locate NamespaceHandler for namespace [http://cxf.apa che.org/jaxws] Offending resource: ServletContext resource [/WEB-INF/beans.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.err or(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC ontext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC ontext.java:80) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.er ror(BeanDefinitionParserDelegate.java:261) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa rseCustomElement(BeanDefinitionParserDelegate.java:) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa rseCustomElement(BeanDefinitionParserDelegate.java:1104) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe .. There are number of warnings on these lines before the actual error occurs WARNING: Ignoring namespace handler [org.apache.cxf.binding.soap.spring.Namespac eHandler]: problem with handler class file or dependent class java.lang.NoClassDefFoundError: org/apache/cxf/binding/soap/spring/NamespaceHand ler : org/springframework/beans/factory/xml/NamespaceHandlerSupport at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.securit y.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 Here is the simple bean.xml file beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import
Default WSDL generated from annotated class has elementFormDefault=unqualified
Hi, The default WSDL generated from my annotated classes seems to have elementFormDefault=unqualified While the result is perfectly valid, the service I'm integrating with dies when it gets unqualified element content. Is there a way to configure the server to generate qualified elements by default instead? Thanks Jon
Elements and parts seem to default to return - which upsets WSDL2X as return is generally a reserved word
Hi, I'm new to CXF, so forgive this newb question. For almost all simple web services that I create using Java, such as those described here: http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html I get parts or elements automatically named return in the resulting auto-generated WSDL (see example below). As you'll see below, the argument is given a nice name like arg0, but the return is called return. Unfortunately, return is a reserved keyword in many languages, so this forces many WSDL2LanguageX converters to rename. Can you change the default return name for elements/parts to something like return0 ? Right now, I can't use CXF web services from salesforce.com without hacking all my WSDL files (or, when I have access to source, adding an annotation). LMK if I've got this wrong! Thanks! Jon xsd:complexType name=getInfo xsd:sequence xsd:element minOccurs=0 name=arg0 type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=getInfoResponse type=getInfoResponse/ xsd:complexType name=getInfoResponse xsd:sequence xsd:element minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType