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: > 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/";> > > node="wsdl:definitions/wsdl:types/xs:[EMAIL > PROTECTED]'http://quoting.it.sybase.com' > ]"> > http://java.sun.com/xml/ns/jaxb"; > xmlns:xs="http://www.w3.org/2001/XMLSchema";> > parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime" > printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/> > > > > > > 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 > List addresses = new ArrayList(); > on my server side implementation, using the tool of WSDL2Java generates > the > getter method: > public List getAddresses() { > if (addresses == null) { > addresses = new ArrayList(); > } > return this.addresses; > } > > but it does not generate the setter method: > public void setAddresses(List 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 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 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: > > > 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/";> > > > > namespace="http://www.test.com/test"/> > > > > ... > > 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.(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 ? > > > > > > >targetNamespace="http://www.t
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 binding customization
ut via the log, since it is not > >> in the same format used by the other log messages (is this observation > >> correct?). Anyway, here's the full output when I try to generate the > >> client (running via Ant): > >> > >> [java] Mar 4, 2008 2:28:06 PM > >> org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin > >> [java] INFO: Loading plugin jar:file:[...path-to-project > >> ommitted...]/lib/cxf-2.0.4-incubator.jar!/META-INF/tools-plugin.xml > >> [java] Mar 4, 2008 2:28:06 PM > >> org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin > >> [java] INFO: Found 1 frontends in plugin. > >> [java] Mar 4, 2008 2:28:06 PM > >> org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin > >> [java] INFO: Loading frontend from plugin. > >> [java] Mar 4, 2008 2:28:06 PM > >> org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin > >> [java] INFO: Found 1 databindings in plugin. > >> [java] Mar 4, 2008 2:28:06 PM > >> org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin > >> [java] INFO: Loading databinding from 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: > >> >> > >> >> >> >> xmlns:jxb="http://java.sun.com/xml/ns/jaxb"; > >> >> xmlns:xs="http://www.w3.org/2001/XMLSchema";> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> 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: > >> >> > > >> >> > > >> >> > >> >> > xmlns:jxb="http://java.sun.com/xml/ns/jaxb"; > >> >> > xmlns:xs="http://www.w3.org/2001/XMLSchema";> > >> >> > >> >> > node="/xs:schema"> > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > 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: > >> >> >> > >> >> >> > >> >> >> >> >> >> targetNamespace="http://www.test.com/TestService/"; > >> >> >> xmlns:tns="http://www.test.com/TestService/"; > >> &g
Re: WSDL2Java error when using 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: > > xmlns:jxb="http://java.sun.com/xml/ns/jaxb"; > xmlns:xs="http://www.w3.org/2001/XMLSchema";> > > > > > > > > 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: > > > > > > > xmlns:jxb="http://java.sun.com/xml/ns/jaxb"; > > xmlns:xs="http://www.w3.org/2001/XMLSchema";> > > > > > > > > > > > > > > > > > > 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: > >> > >> > >> >> 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/";> > >> > >> 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 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: > >> >> > >> >> > >> >> >> >> 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";> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> 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 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: > > > 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";> > > > > > > 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] 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] [exec] com.aaa.bbb.myservice [exec] bindingsPD.xjb [exec] MyService.wsdl [exec] [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.setUnders
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)
Re: Generated code returns java.lang.Object instead of void
Change the operation to one-way MEP,, you can get the void return : 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 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 List items; > > public List getItems() { > if (items == null) { > items = new ArrayList(); > } > return items; > } > > public void setItems(List 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 List orderedAttributeRef; > > public List getOrderedAttributeRef() { > if (orderedAttributeRef == null) { > orderedAttributeRef = new > ArrayList(); > } >
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 List items; public List getItems() { if (items == null) { items = new ArrayList(); } return items; } public void setItems(List 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 List orderedAttributeRef; public List getOrderedAttributeRef() { if (orderedAttributeRef == null) { orderedAttributeRef = new ArrayList(); } return this.orderedAttributeRef; } } } The wsdl generated by cxf: 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/";> http://www.w3.org/2001/XMLSchema"; xmlns:tns="http://www.aaa.com/AaaOtherService"; attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.aaa.com/AaaOtherService";> [...] [...] http://www.w3.org/2001/XMLSchema"; xmlns="http://myservice.bbb.aaa.com/"; xmlns:ns1="http://www.aaa.com/AaaOtherService"; attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://myservice.bbb.aaa.com/";> http://www.aaa.com/AaaOtherService"/>
Re: Multiple services in same Spring config
There is a dataBinding configuration in jaxws.xsd which used to parse the 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 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 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 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: 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: 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 ); } bin>java2wsdl 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: JAX-WS handler attachment options within Apache CXF
I also think we need to provide spring configuration for attaching handler chain through spring configuration . I'd like to see there is api in JaxWsProxyFactoryBean, EndpointImpl and JaxwsServerFactoryBean that we can configure the Handler with spring configuration, eg : implementor="org.apache.cxf.jaxws.service.Hello" address="http://localhost:8080/test";> Regards Jim Willem Jiang wrote: For the server side, you may set the HandlerChain after the endpoint.publish is called. Willem. James Mao wrote: Probably this way is safer getBinding().getHandlerChain().add(YourHandler) James Glen, The answer is YES, you can do it programmatically Service side API Endpoint.getBinding().setHandlerChain(List) Client side API BindingProvider.getBinding().setHandlerChain(List) Besides, the Service API Service.setHandlerResolver() Hope it helps, James Hello, The JAX-WS specification--as well as our jax-ws handler sample[1]--specify/show two ways to attach a JAX-WS handler to a CXF client or service: 1.) For the service, configuration via annotations and an XML file (e.g., under /commons in [1]). 2.) For the client, programmatically within the Java class making the web service call. Question: Does anyone know of additional ways one can attach a JAX-WS handler to the web service or client? For example, can I programmatically attach handlers to the web service implementation, or do XML configuration of handler chains on the *client* side? Thanks, Glen [1] http://tinyurl.com/2ps3y2
Re: Adding ServiceConfigurations / ServiceFactories
Hi Micheal, You also need to instantiate a ServerFactoryBean (or your own server factory that extends ServerFactoryBean) and start it: ServerFactoryBean svrFactory = new ServerFactoryBean(); svrFactory.setBus(bus); // set cxf default bus svrFactory.setServiceFactory(YourServiceFactoryBean); svrFactory.setAddress(address); svrFactory.setStart(true); svrFactory.create(); Before start the server , replace the DestinationFactory and create ServletController like the CXFServlet does. Regards Jim Michael Kleinhenz wrote: Hi Jim, mmh, I don't get it, sorry. I create a new ServiceFactoryBean, do the configuration, but what to do then? I suppose I have to inject the new ServiceFactoryBean somehow into cxf. subclassing AbstractServiceFactoryBean. Then use your own ServiceFactoryBean to create your Servlet : How do I do that? Sorry if this is a dull question, but I don't see how the ServiceFactoryBean is used after creation: public class MyCustomServlet extends CXFServlet { @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); Bus bus = getBus(); BusFactory.setDefaultBus(bus); YourServiceFactoryBean serviceFactory = new YourServiceFactoryBean (); serviceFactory.getServiceConfigurations() .add(0, new AbstractServiceConfiguration() ... I think there is something missing here ... // standard JAX-WS service creation Endpoint.publish("/OtherService", new OtherServiceImpl()); } } Thanks, Michael
Re: extending databinding
Hi, hello Jervis, i'm try to use cxf with a developed framework. This are 3 kind of problem that i have: 1). when a web service return an application object, the generated wsdl return more fields than the necessary to transfer. how can i configure cxf to define the fields to transfer? I do not understand what you mean . Do you want to JAXB marshal part of the fileds? You can do it by annotating @XmlTransient to the filed you do not want to expose : public class USAAddress { @XmlTransient public String name; public String time; } 2). when a web service return a List (or a class that extends an implementation of List) the generated wsdl not recognize a sequence of elements. Can i change this? Can you give us a wsdl or soap message segment ? I do not get what you exactly mean . 3). I have a hierarchy of object that extend from a base class. I want to define a web service with a parameter whose type is the base class. Can I do this? (the generated wsdl only define the base class and don't their subclasses). Another problem is that I can only create instances of these objects using a builder. You can do it. If you hava CXF source code , you can refer to type_substitution system test. Cheers Jim
Re: Jetty + spring, I am missing a point
Davide Gesino wrote: I have always been using CXF deployed on tomcat. Switching to Jetty embedded I have some problems trying to understand some things. When I first publish and Endpoint CXF such as: Endpoint.publish(address, implementor); CXF loads the cxf.xml file and the Bus and everything else are instantiated, the jetty server is started and the endpoints get published. I would like to create everything in a Spring fashion without using (eventually) the Endpoint.publish, with Spring creating and publishign magically the endpoints 4 me. Creating an ApplicationContext explicitly in my code I see almost everthing to be correctly instantiated, but the Jetty server seems not to be up and running. Should I have to start it explicitly? In this case what should be the proper endpoint address in the cxf file?? 4 example assuming: Object implementor = new GreeterImpl(); String address = "http://localhost:8080/SoapContext/SoapPort";; Endpoint.create(Greeter.class); what should I have to write in my cxf.xml, something like; http://localhost:9000/SoapContext/SoapPort"; implementor="org.apache.hello_world_soap_http.GreeterImpl" > ?? Where is my fault? Did you use this spring configuration to create the ApplicationContext ? If yes , then you do not need to start the sever explicitly . Cxf use the spring bean definition parser to create the Endpoint and publish it automatically. The address is also correct in your spring configuration . I do not see any error . I tired the following junit test code it works. @Test public void testEndpoints() throws Exception { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/systest/spring/tmp.xml"}); Thread.sleep(300*1000); } Regards Jim
Re: Adding ServiceConfigurations / ServiceFactories
Hi Micheal , I suppose you actually mean create your own ServiceFactoryBean that extends AbstractServiceFactoryBean. AbstractServiceFactory is only used for code generation . You can create new ServiceFactoryBean by extending ReflectionServiceFactoryBean , JaxwsServiceFactoryBean or subclassing AbstractServiceFactoryBean. Then use your own ServiceFactoryBean to create your Servlet : public class MyCustomServlet extends CXFServlet { @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); Bus bus = getBus(); BusFactory.setDefaultBus(bus); YourServiceFactoryBean serviceFactory = new YourServiceFactoryBean (); serviceFactory.getServiceConfigurations() .add(0, new AbstractServiceConfiguration() // standard JAX-WS service creation Endpoint.publish("/OtherService", new OtherServiceImpl()); } } Regards Jim Michael Kleinhenz wrote: Hi, I try to get used to the inner workings of cxf. I suppose it is possible to add new ServiceFactories to cxf, but how would this be done? If I create a new ServiceFactory by subclassing AbstractServiceFactory, how do I add it to cxf? Another thing: the documentation talks about customizing the behaviour of ReflectionServiceFactoryBean by adding ServiceConfigurations. How do I add these ServiceConfigurations to cxf in a servlet environment. The example creates the server from scratch, but I understand that in a servlet context, the Server instance is started (I think) from CXFServlet..? I try to do this: public class MyCustomServlet extends CXFServlet { @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); Bus bus = getBus(); BusFactory.setDefaultBus(bus); ReflectionServiceFactoryBean serviceFactory = new ReflectionServiceFactoryBean(); serviceFactory.getServiceConfigurations() .add(0, new AbstractServiceConfiguration() { .. my programmatically created service setup .. }); ... now, how to set my custom ServiceFactory to be used? ... // standard JAX-WS service creation Endpoint.publish("/OtherService", new OtherServiceImpl()); } } Thanks, -- Michael
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.Holder 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) Holder c); } 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: 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: 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: 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";> class="toy.ServiceInterceptor"/> 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?
element is in wrong namespace , you need to change it to . daniel.mfreitas wrote: Well, the file that worked for me is this: 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";> Problem is the classes are still not Serializable. I think dot not recognize or . 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 file I've seen around. For example the root of the document is . 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: http://java.sun.com/xml/ns/jaxws"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";> uid="-6026937020915831338"/> 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: 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"> 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?
daniel.mfreitas wrote: 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. You need to make it well formed. Use CXF WSDLValidtor , WTP or other xml vlidator to validate your wsdl and binding file . The file that I provided as an example and that works with JAXWS RI looks quite different from the file I've seen around. For example the root of the document is . 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. Which cxf version did you use ? The binding file without schemaLocaiton or wsdlLocation is supported in CXF2.0.3 , see https://issues.apache.org/jira/browse/CXF-1094.
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: http://java.sun.com/xml/ns/jaxws"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";> uid="-6026937020915831338"/> 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: 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"> 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
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: 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: Cannot generate from wsdl with ws-*....
Hi , Move the section under and try again: http://localhost:99/saas-identity-2.0-CXF-WSDLFirst/services/IdentityService"/> Regards Jim Ma Bradford Maxwell wrote: Can't generate code from 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.c
Re: Specifying a JAXB search path
Hi , CXF only adds the classes that is needed to JaxbContext by reflecting and analyzing method paramter types. It can not use a search path to discover and load these classes . If you want to load extra class into JaxbContext , you can write a jaxb.index file to specify them. For example, if com.foo.bar.A.class is the method parameter type, create a file named jaxb.index and place under the same package. Write the extra class name to this file as the following : --jaxb.index- B C Cxf will read this file and add com.foo.bar.A and com.foo.bar.C into JaxbContext. Does it help? Cheers Jim Ma yesitspeter wrote: My team has had difficulty with CXF being able to discover the entire set of classes needed for serialization/deserialization using JAXB. We specify this rather easily with XFire and have great success with that solution. We wish to migrate to CXF however we see no clearly documented method of adding the context. I was hoping one of you could point us in the right direction. I apologize in advance if this question has already been asked.
Re: Diagnosis of stupid JAXB/JAXWS errors
http://www.w3.org/2001/XMLSchema"; namespace="http://spring.demo/"; /> - - - - - - - - --- Create client from WSDL by using wsdl2java. The namespaces of input/output parameters have already been missing from the generated service interface: MyHelloWorldService.java (generated by wsdl2java)== package helloworld.nstest; import javax.jws.WebParam.Mode; import javax.jws.WebParam; import javax.jws.WebService; import javax.jws.soap.SOAPBinding.Style; import javax.jws.soap.SOAPBinding; import javax.jws.WebMethod; import javax.jws.WebResult; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; /** * This class was generated by Apache CXF (incubator) 2.0.3-incubator * Tue Nov 20 22:45:47 EST 2007 * Generated source version: 2.0.3-incubator * */ @WebService(targetNamespace = "http://nstest.helloworld";, name = "MyHelloWorldService") public interface MyHelloWorldService { @ResponseWrapper(targetNamespace = "http://nstest.helloworld";, className = "helloworld.nstest.SayHiResponse", localName = "sayHiResponse") @RequestWrapper(targetNamespace = "http://nstest.helloworld";, className = "helloworld.nstest.SayHi", localName = "sayHi") @WebResult(targetNamespace = "", name = "MyResult") @WebMethod public java.lang.String sayHi( @WebParam(targetNamespace = "", name = "MyInput") java.lang.String myInput ); } === Modify the generated client: MyHelloWorldService_HelloWorldImplPort_Client.java (generated by wsdl2java)== package helloworld.nstest; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import javax.xml.namespace.QName; import demo.spring.HelloWorldImplService; import javax.jws.WebMethod; import javax.jws.WebResult; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; public final class MyHelloWorldService_HelloWorldImplPort_Client { private static final QName SERVICE_NAME = new QName("http://spring.demo/";, "HelloWorldImplService"); private MyHelloWorldService_HelloWorldImplPort_Client() { } public static void main(String args[]) throws Exception { HelloWorldImplService ss = new HelloWorldImplService(); MyHelloWorldService port = ss.getHelloWorldImplPort(); { System.out.println("Invoking sayHi..."); java.lang.String _sayHi_myInput = "ABC"; java.lang.String _sayHi__return = port.sayHi(_sayHi_myInput); System.out.println("sayHi.result=" + _sayHi__return); } System.exit(0); } } SOAP message captured on server-side: -- Encoding: UTF-8 Headers: {connection=[keep-alive], cache-control=[no-cache], host=[localhost:808 0], user-agent=[Java/1.5.0_12], transfer-encoding=[chunked], pragma=[no-cache], content-type=[text/xml; charset=UTF-8], accept=[*], soapaction=[""]} Message: xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>>xmlns:ns2="http://nstest.helloworld";>ABC Hi> -- Nov 20, 2007 10:51:13 PM org.apache.cxf.interceptor.LoggingOutInterceptor$Loggin gCallback onClose INFO: Outbound Message: -- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>>xmlns:ns1="http://nstest.helloworld";>Hello ABCResult>- - 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: 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: 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: http://schemas.xmlsoap.org/soap/envelope/";> xmlns:ns2="http://nstest.helloworld";>ABC The SOAP response: http://schemas.xmlsoap.org/soap/envelope/";> http://nstest.helloworld";>Hello ABC === 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: === http://schemas.xmlsoap.org/wsdl/"; xmlns:ns1="http://nstest.helloworld"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="MyHelloWorldService" targetNamespace="http://nstest.helloworld";> http://nstest.helloworld"; xmlns:tns="http://spring.demo/"; attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://nstest.helloworld"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://www.w3.org/2001/XMLSchema"; namespace="http://spring.demo/"/> ... == Could somebody help me out on this problem please? Many thanks in advance. nianhua
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 : http://localhost:8080/simple";> class="org.apache.cxf.service.factory.ReflectionServiceFactoryBean"> class="org.apache.cxf..YourServiceConfiguration" /> 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: cxf-codegen-plugin 2.0.3: AbstractMethodError Exception
Can you check if there is xercersimp.jar in your classpath ? Did you set the JAXP factory name? Jim Michael Matczynski wrote: Hello! After upgrading from 2.0.2 to 2.0.3, I'm now getting AbstractMethodError exceptions in cxf-codegen-plugin. I read the post by James Mao on Oct 19 about using the new 1.3.2 version of XmlSchema, but explicitly setting this dependency in the pom doesn't appear to change anything. Any other suggestions on what else I might try? My POM config and stack trace are below. Thanks! Mike <<>> org.apache.cxf cxf-codegen-plugin 2.0.3-incubator org.apache.cxf cxf-rt-frontend-jaxws 2.0.3-incubator generate-wsdl-sources generate-sources ${project.build.directory }/generated/src/main/java ${wsdlLocation} -p com.somewhere.cxf -validate wsdl2java <<>> [INFO] [cxf-codegen:wsdl2java {execution: generate-wsdl-sources}] [INFO] [ERROR] BUILD ERROR [INFO] [INFO] org.apache.xerces.dom.ElementNSImpl.setUserData (Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object; [INFO] [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: org.apache.xerces.dom.ElementNSImpl.setUserData (Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object; at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( DefaultLifecycleExecutor.java:564) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle (DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal( DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) 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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: org.apache.xerces.dom.ElementNSImpl.setUserData (Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object; at org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl( WSDL2JavaMojo.java:233) at org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java :129) at org.apache.maven.plugin.DefaultPluginManager.executeMojo( DefaultPluginManager.java:443) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( DefaultLifecycleExecutor.java:539) ... 16 more Caused by: java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData (Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object; at org.apache.cxf.tools.validator.internal.Stax2DOM.startElement( Stax2DOM.java:170) at org.apache.cxf.tools.validator.internal.Stax2DOM.getDocument( Stax2DOM.java:134) at org.apache.cxf.tools.validator.internal.Stax2DOM.ge
Re: xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified"
Hi , You can annotate the package-info.java with " XmlNsForm.QUALIFIED" like this : @javax.xml.bind.annotation.XmlSchema(namespace = "http://example.org";, attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED, elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.example; Regards Jim Monica Ferrero wrote: Hi! The wsdl generated from cxf has in the schema definition: attributeFormDefault="unqualified" elementFormDefault="unqualified" I need these to be generated as "qualified". What do I need to do for these to be generated as qualified? Is there any annotation for this? Or any specific way of defining the service? Bellow the wsdl:types from wsdl exposed at http://localhost:8080/lmqs/ws/ListService?wsdl and my ws interface. Thanks for your help, Monica http://schemas.xmlsoap.org/wsdl/"; xmlns:soap ="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:tns="http://ls.lmqs.acc.com/ " xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="LM" targetNamespace=" http://ls.lmqs.acc.com/";> http://www.w3.org/2001/XMLSchema"; attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://ls.lmqs.acc.com/"; xmlns:tns=" http://ls.lmqs.acc.com/";> [] package com.acc.lmqs.ls; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; @WebService(targetNamespace="http://ls.lmqs.acc.com/";, name = "LM") @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public interface LM { @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebMethod @WebResult(targetNamespace = "http://ls.lmqs.acc.com/";, partName= "newId", name="newId") public int newL( @WebParam(targetNamespace = "http://ls.lmqs.acc.com/";, partName= "dsId", name="dsId") int ds, @WebParam(targetNamespace = "http://ls.lmqs.acc.com/";, partName= "name", name="name") String name, @WebParam(targetNamespace = "http://ls.lmqs.acc.com/";, partName= "query", name="query") String query ); @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebResult(targetNamespace = "http://ls.lmqs.acc.com/";, partName="info" , name="info" ) @WebMethod public Info getInfo( @WebParam(targetNamespace = "http://ls.lmqs.acc.com/";, partName= "id", name="id") int id ); @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebResult(targetNamespace = "http://ls.lmqs.acc.com/",partName="data";, name="data") @WebMethod public Data getData( @WebParam(targetNamespace = "http://ls.lmqs.acc.com/";, partName="id", name="id") int id ); @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebResult(targetNamespace = "http://ls.lmqs.acc.com/";, partName= "infos", name="infos") @WebMethod public InfoArray getLists(); @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebResult(targetNamespace = "http://ls.lmqs.acc.com/";, partName = "dss", name = "dss") @WebMethod public StringArray getDsNames(); }Accelrys Limited (http://www.accelrys.com) Registered office: 334 Cambridge Science Park, Cambridge, CB4 0WN, UK Registered in England: 2326316
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. org.apache.cxf cxf-java2ws-plugin 2.1-incubator-SNAPSHOT org.apache.cxf cxf-rt-frontend-jaxws 2.1-incubator-SNAPSHOT generate-ws process-classes my.ws.target.class ${project.compileClasspathElements} ${basedir}/target/classes true true true true ${project} java2ws 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 plugin. Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Loading frontend from 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 plugin. Oct 19, 2007 10:48:13 AM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin INFO: Loading databinding from 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 [cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager
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: 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: node="wsdl:definitions/wsdl:types/xsd:[EMAIL PROTECTED]'urn:sap-com:document:sap:soap:functions:mc-style']"> node="xsd:[EMAIL PROTECTED]'ZBapiMaterialExistsMatnrResponse']/xsd:complexType/xsd:sequence/xsd:[EMAIL PROTECTED]'MaterialFinnes']"> 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
0 ERROR [STDERR] 18-Oct-2007 11:50:41 org.apache.cxf.service.factory.ReflectionServiceFactoryBeanbuildServic 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 .(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: 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 .(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
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
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
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: 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";> Thanks in advance for any help
Re: specifying wsdlLocation in jaxws:endpoint
Hi , Did you configure wsdlLocation as an attribute for jaxws:endpoint like the following example : 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: MTOM and @XmlMimeType("application/octet-stream") annotation.
This is not supported in CXF . This thread FYI: http://www.nabble.com/MTOM-sample-generated-WSDL-with-DataHandler-on-server-t4210895.html imorales wrote: Hi all. I´m trying to implemente a web service that uses MTOM Attachments. The way I´m doing is "Annotation if JAXB bean". The problem is that the wsdl that I generate with ant task "java2wsdl" doesn´t add the annotation @XmlMimeType("application/octet-stream") in the . My bean is: @XmlType public class FicheroXML { private String title; @XmlMimeType("application/octet-stream") private DataHandler xmlData; public String getTitle() {return title; } public void setTitle(String title) {this.title = title; } @XmlTransient public DataHandler getXmlData() { return xmlData;} public void setXmlData(DataHandler xmlData) {this.xmlData = xmlData;} } My service is: @WebService public interface ServicioFormularios { @WebResult(name="uuid") String guardaFormulario(@WebParam(name="xml")FicheroXML xml); } My cxf configuration is: 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";> id="servicioFormulario" implementor="com.servicios.ServicioFormulariosImpl" address="/servicioFormulario"> The wsdl generated whit java2wsdl: . .. ... ... .. . ... .. . Why the attribute (xmime:expectedContentTypes="application/octet-stream") isn´t in the "xmlData" element of "FicheroXML" ? Any ideas ... it seam like the annotation @XmlMimeType it´s not running. Thanks in advance.
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. http://schemas.xmlsoap.org/soap/envelope/";> Echo This
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: xs:choice
You need to use the below jaxb binding file when run wsdl2java to tell jaxb you need choice content : http://java.sun.com/xml/ns/jaxb"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; node="//xsd:schema"> 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
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 - soap:header handling/generation
Sorry , forget to metion , you need to add this dependency to cxf-codegen-plugin : org.apache.cxf cxf-codegen-plugin org.apache.cxf cxf-rt-bindings-soap ${project.version} Jim Ma wrote: You need to add the soap binding dependency in your pom : org.apache.cxf cxf-rt-bindings-soap 2.0.1-incubator -Jim exgorth wrote: Thanx wsdl2java works fine with this flags, but i'm trying to use maven: bronni-ws-client ru.invito.ws.client.bronni 1.0-SNAPSHOT 4.0.0 ru.invito.ws.client.bronni.model bronni-model bronni-model 1.0-SNAPSHOT http://maven.apache.org junit junit org.apache.cxf cxf-rt-frontend-jaxws 2.0.1-incubator compile org.apache.cxf cxf-codegen-plugin 2.0.1-incubator generate-sources generate-sources http://touralliance.bronni.ru/Loader.asmx?wsdl -exsh true -verbose wsdl2java and i'm getting the following error: INFO: Loading databinding from 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 for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 31.08.2007 12:37:41 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-proxy ing) 31.08.2007 12:37:41 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in [EMAIL PROTECTED]: defining beans [cxf,org.apache.cxf.bus.spring.Jsr250Be anPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.tr ansport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqu eue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,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]; root
Re: wsdl2java - soap:header handling/generation
cessInput WARNING: Can not find the soap binding in your classpath Will not generate the extra parameter. 31.08.2007 12:37:56 org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor processInput WARNING: Can not find the soap binding in your classpath Will not generate the extra parameter. WSDLToJava Error : java.lang.NullPointerException org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:242) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102) at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171) at org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:186) at org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:102) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.NullPointerException at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processParameter(ServiceProcessor.java:448) at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processOperation(ServiceProcessor.java:386) at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processPort(ServiceProcessor.java:266) at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processService(ServiceProcessor.java:192) at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.process(ServiceProcessor.java:98) at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:90) at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:59) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:198) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:234) ... 23 more [INFO] [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", targetNamesp
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 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: Returning a java map
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 Map getMap(Map 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] | www.rbxglobal.com - 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] | www.rbxglobal.com -
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=rev&rev=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: 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: 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=rev&rev=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: 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
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 Map getMap(Map 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] | www.rbxglobal.com -
Re: Global invoker
I think you have to configure your own invoker for each service you want to track . If there are many services you need to configure , I think you can modify the JaxWsServerFactoryBean to use your own invoker . By default , JaxwsServerFactoryBean will create JAXWSMethodInvoker and set it for Service , you can replace it with your own invoker . Then each service will use your invoker to track the request. Cheers Jim Lukas Zapletal wrote: Hello, I need to create a service that will accept all incoming requests and relay them to other web service. It seems Invoker can help me over here. Is it possible to register some global invoker or do I have to create endpoint+invoker for each service I want to track? Thanks for help
Re: How to set up an invoker?
Hi, You can use the below configuration to inject an invoker for the server: 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"; So you do not need to create your own servlet since it can do it by configuration . Cheers Jim Lukas Zapletal wrote: Hello, I need to set up invoker for my service but I cant find the proper XML tags for the configuration in the documentation: http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html How to do this? And if I like to do this from the code where should I put it? I mean when CXF run as Servlet I have no clue where to put this code: Endpoint e = Endpoint.publish(...); e.setInvoker(new MyInvoker()); My first idea were to create my very own servlet that will override CXFServlet.init method (and nothing else). Is this a standard way? Thank you
Re: Exposing methods
Yes . It's the normal behavior. The runtime will reflect every method in impl class and expose it unless the method is annotated with exclude WebMethod . CXF also can support publishing a service with a pojo class without implementing any interface : @WebService public class UserWebServiceImpl { private UserManager userManager; @WebMethod (exclude=true) public void setUserManager(UserManager userManager) { this.userManager = userManager; } @WebMethod public User getUserById(Long id) { return userManager.getUser(id); } } Cheers Jim Julio Arias wrote: Hi Jim, Thanks I found that property for the @WebMethod annotation too and it works fine. But is this a normal behavior to expose everything in the implementor, I thought it would only expose the methods on my interface. On Jul 12, 2007, at 9:05 PM, Jim Ma wrote: Hi Julio, I think you can add @WebMethod(exclude=true) for the setter method. @WebMethod (exclude=true) setUserManager(UserManager userManager) Cheers Jim Julio Arias wrote: The dependencies setters from my service impl are getting expose in the WSDL even though I'm specifying the endpoint interface in the implementor. How can I hide this methods? I have the following code and config: + UserWebService.java @WebService(name = "UserService") public interface UserWebService { @WebMethod User getUserById(@WebParam(name = "id") Long id); } + UserWebServiceImpl.java @WebService(endpointInterface = "com.rbx.test.webservices.UserWebService", name = "UserService") public class UserWebServiceImpl implements UserWebService { private UserManager userManager; public void setUserManager(UserManager userManager) { this.userManager = userManager; } public User getUserById(Long id) { return userManager.getUser(id); } } + Endpoint config: 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] | www.rbxglobal.com - 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] | www.rbxglobal.com -
Re: Exposing methods
Hi Julio, I think you can add @WebMethod(exclude=true) for the setter method. @WebMethod (exclude=true) setUserManager(UserManager userManager) Cheers Jim Julio Arias wrote: The dependencies setters from my service impl are getting expose in the WSDL even though I'm specifying the endpoint interface in the implementor. How can I hide this methods? I have the following code and config: + UserWebService.java @WebService(name = "UserService") public interface UserWebService { @WebMethod User getUserById(@WebParam(name = "id") Long id); } + UserWebServiceImpl.java @WebService(endpointInterface = "com.rbx.test.webservices.UserWebService", name = "UserService") public class UserWebServiceImpl implements UserWebService { private UserManager userManager; public void setUserManager(UserManager userManager) { this.userManager = userManager; } public User getUserById(Long id) { return userManager.getUser(id); } } + Endpoint config: 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] | www.rbxglobal.com -
Re: JaxWsServiceFactoryBean / Aegis
Hi Jan, Did you test ReflectionServiceFactoryBean with Aegis ? Is it working ? 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<--- http://schemas.xmlsoap.org/soap/"/> ---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: [Fwd: CXFServlet-Config]
Hi Jan, By default CXF will use JaxWsServiceFactoryBean to construct JaxwsServerFactoryBean when it parse the 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 : class="org.apache.cxf.aegis.databinding.AegisDatabinding"/> class="org.apache.cxf.service.factory.ReflectionServiceFactoryBean"> class="org.apache.cxf.frontend.ServerFactoryBean" init-method="create"> value="http://schemas.xmlsoap.org/soap/"/> 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 : 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: [Fwd: CXFServlet-Config]
Hi Jan , I think this can inject the databinding in ServiceFactoryBean : class="org.apache.cxf.aegis.databinding.AegisDatabinding"/> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> ref="aegisDatabinding"/> Cheers Jim Jan Kriesten wrote: hi dan, We do need a element yet... This may work though: 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: Problem writing restful services with Spring
Hi , I wrote the follow configuration to deploy the sample restful_http_binding (under /samples) in tomcat : 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";> id="customer" implementor="com.acme.customer.CustomerServiceImpl" address="/customer" bindingUri="http://apache.org/cxf/binding/http";> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> 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 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 : > > > > > > > > > > > > > > > > > > > > > > > implementor="#bookService" > > > > address="/bookService" > > > > bindingUri="http://apache.org/cxf/binding/http"; > > > > > > > > > > > > > > > > > > > > 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: 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 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";> namespace="http://www.atomikos.com/schemas/2005/10/transactions"; schemaLocation="atomikos-termination.xsd" /> namespace="http://www.atomikos.com/schemas/2005/10/transactions"; schemaLocation="atomikos-propagation.xsd" /> element="ato:Propagation"> element="ato:Prepare"> element="ato:Prepared"> element="ato:Commit"> element="ato:Rollback"> element="ato:Forget"> element="ato:Replay"> message="ato:PrepareRequestMessage"> message="ato:PrepareResponseMessage"> type="ato:ParticipantPortType"> transport="http://schemas.xmlsoap.org/soap/http"/> type="ato:CoordinatorPortType"> transport="http://schemas.xmlsoap.org/soap/http"/> binding="ato:ParticipantBinding"> location="http://www.atomikos.com/participant"/> binding="ato:CoordinatorBinding"> location="http://www.atomikos.com/coordinator"/> 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 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";> namespace="http://www.atomikos.com/schemas/2005/10/transactions"; schemaLocation="atomikos-termination.xsd" /> namespace="http://www.atomikos.com/schemas/2005/10/transactions"; schemaLocation="atomikos-propagation.xsd" /> element="ato:Propagation"> element="ato:Prepare"> element="ato:Prepared"> element="ato:Rollback"> message="ato:PrepareResponseMessage"> type="ato:ParticipantPortType"> transport="http://schemas.xmlsoap.org/soap/http"/> type="ato:CoordinatorPortType"> transport="http://schemas.xmlsoap.org/soap/http"/> binding="ato:ParticipantBinding"> location="http://www.atomikos.com/participant"/> binding="ato:CoordinatorBinding"> location="http://www.atomikos.com/coordinator"/> 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, 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: [Fwd: CXFServlet-Config]
Hi Jan , I think this is an issue or unsupported. I see there is no item for databinding in jaxws.xsd : minOccurs="0"/> minOccurs="0"/> minOccurs="0"/> minOccurs="0"/> minOccurs="0"/> minOccurs="0"/> minOccurs="0"/> 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 -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<--- 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";> ---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<--- ---8<--- Best regards, --- Jan.
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 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";> 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 org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:481) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(Hand
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 from class 2007-06-05 10:13:18 sun.reflect.NativeMethodAccessorImpl invoke0 WARNING: failed cxf javax.servlet.ServletException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [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 '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: An operation with name [] already exists in this service Caused by: java.lang.IllegalArgumentException: An operation with name [] 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 org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:217) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:246)
Re: XmlSchemaComplexType exception
Hi Tog, Restful_http_bindings sample use JaxwsServiceFactoryBean to create service info by reflecting the classes. JaxwsServiceFactoryBean generate the schema information with default JaxbDataBinding . The classes you modified is used to generate schema by JaxbDataBinding . When @XmlRootElement is removed from the GetBook class , JaxbDataBinding will only generate the schema type for this class. See [1] and [2] A XmlSchemaComplexType will be bound to the message part instead of a XmlSchemaElement , so it will cause the cast exception . I do not think this is an issue or unsupported. Jaxb need this annotation to generate the appropriate schema. [1] JAXB spec 8.7.2 [2] http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html Cheers Jim Freeman Fang wrote: Hi Tog, Class defined as method input para need @XmlRootElement now. Besides the GetBook.java, I also remove @XmlRootElement from Book.java, which is input para for addBook method, I also get the same exception, would you please verify it? The reason is in CXF URIParameterInInterceptor.java, we check input paras (MessagePartInfo of cxf service model), we do type cast here, so if class has no @XmlRootElement, part.getXmlSchema() in following code will return XmlSchemaComplexType, but not XmlSchemaElement, which cause type cast exception as you see. if ("POST".equals(method) || "PUT".equals(method)) { doc = IriDecoderHelper.interopolateParams(doc, (XmlSchemaElement)part.getXmlSchema(), schemas, params); } else { doc = IriDecoderHelper.buildDocument((XmlSchemaElement)part.getXmlSchema(), schemas, params); } Cheers Freeman tog wrote: Hi Freeman, Here is my GetBook class. So I changed the @XmlRootElement by @XmlElement. Actually I did it for the classes and only this one is causing problem. Can you explain what is the problem in that case ? Cheers Tog package com.acme.book //import javax.xml.bind.annotation.XmlAttribute import javax.xml.bind.annotation.XmlElement import javax.xml.bind.annotation.XmlAccessorType import javax.xml.bind.annotation.XmlAccessType //@XmlRootElement(name = "Book", namespace="http://book.acme.com/";) @XmlAccessorType(XmlAccessType.NONE) //@XmlRootElement(name = "GetBook") public class GetBook { @XmlElement long id } On 5/24/07, Freeman Fang <[EMAIL PROTECTED]> wrote: Hi Tog, I believe you remove @XmlRootElement(name = "GetBook") from you GetBook.java, right? I can reproduce your problem by means of removing @XmlRootElement(name = "GetBook") I think we should support your scenario. Other guys, any thought? I fill a jira to track it https://issues.apache.org/jira/browse/CXF-680 Thanks very much Freeman tog wrote: > Dan > > I moved to trunk and get the same exception :-) > Does the stack trace help ? > > Cheers > Guillaume > > INFO: Interceptor has thrown exception, unwinding now > java.lang.ClassCastException: > org.apache.ws.commons.schema.XmlSchemaComplexType >at > org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mergeParams > > (URIParameterInInterceptor.java:129) >at > org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handleMessage > > (URIParameterInInterceptor.java:105) >at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept( > PhaseInterceptorChain.java:147) >at org.apache.cxf.transport.ChainInitiationObserver.onMessage( > ChainInitiationObserver.java:63) >at > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest( > JettyHTTPDestination.java:220) >at > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService( > JettyHTTPDestination.java:180) >at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle( > JettyHTTPHandler.java:54) >at org.mortbay.jetty.handler.ContextHandler.handle( > ContextHandler.java:690) >at org.mortbay.jetty.handler.ContextHandlerCollection.handle( > ContextHandlerCollection.java:191) >at org.mortbay.jetty.handler.HandlerWrapper.handle( > HandlerWrapper.java:139) >at org.mortbay.jetty.Server.handle(Server.java:285) >at org.mortbay.jetty.HttpConnection.handleRequest( > HttpConnection.java:457) >at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete ( > HttpConnection.java:751) >at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500) >at > org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) >at > org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) >at org.mortbay.io.nio.SelectChannelEndPoint.run( > SelectChannelEndPoint.java:329) >at org.mortbay.thread.BoundedThreadPool$PoolThrea
RE: @BindingType(value="http://www.w3.org/2004/08/wsdl/http")
Hi Dan , This is another issue .Could you fill a jira issue for this with your test case ? Thanks Jim > -Original Message- > From: Dan Connelly [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 15, 2007 5:46 PM > To: cxf-user@incubator.apache.org > Subject: Re: @BindingType(value="http://www.w3.org/2004/08/wsdl/http";) > > > Thanks Jim: > > However, this did not work. Spring HelloWorld still fails > ignores/fails for the http binding type. > > a) When I put this > @BindingType(value=http://apache.org/cxf/binding/http) in the HelloWorld > SEI, it is ignored. The binding type remains at the default: soap, > doclit. > b) When I put it, instead, in the implementation code, then I get a > listener startup error (severe) from Tomcat.This is the same problem > I reported on another thread ("Please demo Spring-ified > restful_dispatch"). > > BTW, the standard javax.xml.ws.soap.SOAPBinding values all work fine for > @BindingType values in demo.spring.HelloWorldImpl.java on Tomcat. > But using javax.xml.ws.http.HTTPBinding.HTTP_BINDING in this code fails. > >-- Dan > > > Jim Ma wrote: > > >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: > >> >>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: > >> > >>but I still see > >> > >> > >>Are my expectations wrong?Do I need to provide a different > >>value string? > >> > >> -- Dan > >> > >> > >> > >> > >> > > > > > > > >
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: > 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: > > but I still see > > > 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 >
RE: wsdl2java and holders
Hi Matthew, This is another issue or unsupported in cxf tools . Can you fill a jira issue for this ? Thanks Jim > -Original Message- > From: Matthew Good [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 01, 2007 2:32 AM > To: cxf-user@incubator.apache.org > Subject: Re: wsdl2java and holders > > > Thanks for pointing me to that specification! Unfortunately I am > not able to change that portion of the wsdl. So I attempted to > use an external binding file instead. No luck. > > > xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"; >xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > false > > > > > > - Original Message > From: Jim Ma <[EMAIL PROTECTED]> > To: cxf-user@incubator.apache.org > Sent: Tuesday, February 27, 2007 10:44:14 PM > Subject: RE: wsdl2java and holders > > Hi Matthew, > > The operation StartApplicationSessionin in this wsdl will be mapped to > wrapper style and > the output will be mapped to holder class(see jaxws spec section > 2.3.1.2 for > details). > > If you want to get an operation which just returns a single > object , you can > modify this wsdl like this : > > > > > > >message="tns:startApplicationSessionNegResponse" /> > > >type="tns:ApplicationSessionServices"> > transport="http://schemas.xmlsoap.org/soap/http"/> > > > > > > > > > > > > > > > Regards > > Jim > > > > -Original Message- > > From: Matthew Good [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, February 28, 2007 9:39 AM > > To: cxf-user@incubator.apache.org > > Subject: Re: wsdl2java and holders > > > > > > Here's the wsdl. I ran "wsdl2java.bat -client server-appl.wsdl" > > on windows. Thanks! > > > > > > > xmlns="http://schemas.xmlsoap.org/wsdl/";; > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";; > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";; > > > > xmlns:aps="http://www.ecma-international.org/standards/ecma-354/ap > pl_session" > > xmlns:tns="http://xml.me.com/ws/pr";; > > targetNamespace="http://xml.me.com/ws/pr";; > > > > > > > > > > > http://www.ecma-international.org/standards/ecma-354/appl_session/ > start-application-session.xsd"/> > > > > > > > > > > > > > > > element="aps:StartApplicationSessionPosResponse" /> > > > > > > > element="aps:StartApplicationSessionNegResponse" /> > > > > > > > > > > > >> message="tns:startApplicationSessionNegResponse" /> > > > > > >> type="tns:ApplicationSessionServices"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > binding="tns:ApplicationSessionBinding"> > > > > > > > > > > > > > > > > > > - Original Message > > From: Dan Diephouse <[EMAIL PROTECTED]> > > To: cxf-user@incubator.apache.org > > Sent: Friday, February 23, 2007 2:41:43 PM > > Subject: Re: wsdl2java and holders > > > > Hi Matthew, > > > > CXF should only generate Holders if you have multiple outputs or the > > input/output message contain the same message part. An example > > of the later > > would be something like this: > > > > > > > > > > > > > > > > > > > > I believe if you change the part names it won't treat it as an "IN/OUT" > > parameters. > > > > If you provide a WSDL sample I can probably help more. Cheers, > > > > - Dan > > > > On 2/23/07, Matthew Good <[EMAIL PROTECTED]> wrote: > > > > > > When I use wsdl2java to generate client source, I get all these > > holders in > > > the operation calls. These are for return values. This is > > really a pain to > > > create these. How can I get it to generate code that just > > returns a single > > > object? > > > > > > > > > > > > > > > > > > > > > > > > -- > > Dan Diephouse > > Envoi Solutions > > http://envoisolutions.com | http://netzooid.com/blog > > > > > > > > > >
RE: wsdl2java and holders
Hi Matthew, The operation StartApplicationSessionin in this wsdl will be mapped to wrapper style and the output will be mapped to holder class(see jaxws spec section 2.3.1.2 for details). If you want to get an operation which just returns a single object , you can modify this wsdl like this : http://schemas.xmlsoap.org/soap/http"/> Regards Jim > -Original Message- > From: Matthew Good [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 28, 2007 9:39 AM > To: cxf-user@incubator.apache.org > Subject: Re: wsdl2java and holders > > > Here's the wsdl. I ran "wsdl2java.bat -client server-appl.wsdl" > on windows. Thanks! > > >xmlns="http://schemas.xmlsoap.org/wsdl/"; > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; > xmlns:xsd="http://www.w3.org/2001/XMLSchema"; > > xmlns:aps="http://www.ecma-international.org/standards/ecma-354/ap pl_session" > xmlns:tns="http://xml.me.com/ws/pr"; > targetNamespace="http://xml.me.com/ws/pr"; > > > > > > http://www.ecma-international.org/standards/ecma-354/appl_session/ start-application-session.xsd"/> > > > > > > > element="aps:StartApplicationSessionPosResponse" /> > > > element="aps:StartApplicationSessionNegResponse" /> > > > > > >message="tns:startApplicationSessionNegResponse" /> > > >type="tns:ApplicationSessionServices"> > > > > > > > > > > > > > > > > binding="tns:ApplicationSessionBinding"> > > > > > > > > > - Original Message > From: Dan Diephouse <[EMAIL PROTECTED]> > To: cxf-user@incubator.apache.org > Sent: Friday, February 23, 2007 2:41:43 PM > Subject: Re: wsdl2java and holders > > Hi Matthew, > > CXF should only generate Holders if you have multiple outputs or the > input/output message contain the same message part. An example > of the later > would be something like this: > > > > > > > > > > I believe if you change the part names it won't treat it as an "IN/OUT" > parameters. > > If you provide a WSDL sample I can probably help more. Cheers, > > - Dan > > On 2/23/07, Matthew Good <[EMAIL PROTECTED]> wrote: > > > > When I use wsdl2java to generate client source, I get all these > holders in > > the operation calls. These are for return values. This is > really a pain to > > create these. How can I get it to generate code that just > returns a single > > object? > > > > > > > > > > > > > > > -- > Dan Diephouse > Envoi Solutions > http://envoisolutions.com | http://netzooid.com/blog > > >
RE: Importing schemas from jars
Hi Robin , I tried http.xsd using the "-catalog" option . It works fine. XJC seems do not invoke catalog resolver if the schemaLoacation defined with relative path like " /schemas/wsdl/wsdl.xsd", so I need to change the schemaLocation as following : http://schemas.xmlsoap.org/wsdl/"; schemaLocation="http://schemas/wsdl/a.xsd"/> And this is my catalog file : http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd";> http://schemas/wsdl/a.xsd"; rewritePrefix="jar:file:/mavenrepo/org/apache/cxf/cxf-common-schemas /2.0-incubator-M1-SNAPSHOT/cxf-common-schemas-2.0-incubator-M1-SNAPSHOT.jar! /schemas/wsdl/wsdl.xsd" /> Regards Jim > -Original Message- > From: James Mao [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 16, 2006 7:09 PM > To: cxf-user@incubator.apache.org; cxf-dev@incubator.apache.org > Subject: Re: Importing schemas from jars > > > Resend this email, sorry if you received twice. > > Hi Robin, > > We only fixed this in the wsdl2java tools, I don't know how the jaxb xjc > resolve the resources, i have to ask a question in the jaxb mail list. > > The xjc catalog works only in jaxb example which use the the xjc ant > task, i tried to use in maven2 xjc plugin, seems not work properly , i > have to ask this also in jaxb mail list. > > The work-around solution i have is to create another maven plugin, the > plugin will read the xsd and turns out the dumy wsdl file which only > contain the schema, and then use the wsdl2java to generate the xsd java > types artifacts. > > I mean if it's urgent for you, i can do this for a tempo solution. > > BTW, the catalog is also a work-around solution for you, right? you are > not going to use catalog in the real system, right? > > Cheers, > James. > > > Hello, > > > > I would like to use the xsdtojava maven plugin to generate code for a > > schema that references a schema in the cxf-common-schemas jar. > > > > I tried adding a dependency to cxf-common-schemas and using the > > following import: > > > > http://schemas.xmlsoap.org/wsdl/"; > >schemaLocation="/schemas/wsdl/wsdl.xsd"/> > > > > However, xjc is unable to resolve "/schemas/wsdl/wsdl.xsd". I also > > tried using the "-catalog" option without any luck (it doesn't seem to > > search the classpath for resources either). > > > > Any suggestions? > > > > > > Thanks, > > Robin > > > > >