Re: AXIS2 - Application Service Scope Questions
Tbanks Deepal for your informative response. Now I feel confident on how to write my 'application' scoped web service (ie, taking care to be threadsafe). Deepal jayasinghe wrote: Jonathan Joseph wrote: I have a couple of questions regarding Axis2 web services configured to run with service scope set to 'Application': 1) Is the web service a singleton? yes 2) Is the web service thread-safe? yes and no I think that the answers are 1) Yes, 2) No. I couldn't find an explicit answer in the Axis2 documentation. Once you deploy a service in application scope we create only one instance of the service implementation class. And we store the instance in the ServiceContext. So each and every request coming to that service uses the same service instance. However in web service world we have to write our services in a stateless manner , meaning write the class so that we do not store any class level variable in the service impl class. Then the service invocation would become thread safe as well. Thank you! Deepal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AXIS2 - Application Service Scope Questions
I have a couple of questions regarding Axis2 web services configured to run with service scope set to 'Application': 1) Is the web service a singleton? 2) Is the web service thread-safe? I think that the answers are 1) Yes, 2) No. I couldn't find an explicit answer in the Axis2 documentation. Thanks, Jonathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AXIS2 -Ewdc option for wsdl2java using xmlbeans databinding
I downloaded the axis2 nightly build in order to try the -Ewdc wsdl2java option. When I run the wsdl2java for the StockQuotePrice quicksample and use the -Ewdc option for xmlbeans binding, I get the following errors: compile.src: [javac] Compiling 214 source files to c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build\service\build\classes [javac] c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build\service\src\samples\quickstart\service\xmlbeans\StockQuoteServiceSkeleton.java:40: cannot find symbol [javac] symbol : method getSymbol() [javac] location: interface samples.quickstart.service.xmlbeans.xsd.UpdateDocument.Update [javac] map.put(param0.getUpdate().getSymbol(), new Double(param0.getUpdate().getPrice())); [javac] ^ [javac] c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build\service\src\samples\quickstart\service\xmlbeans\StockQuoteServiceSkeleton.java:40: cannot find symbol [javac] symbol : method getPrice() [javac] location: interface samples.quickstart.service.xmlbeans.xsd.UpdateDocument.Update [javac] map.put(param0.getUpdate().getSymbol(), new Double(param0.getUpdate().getPrice())); [javac] ^ [javac] c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build\service\src\samples\quickstart\service\xmlbeans\StockQuoteServiceSkeleton.java:44: cannot find symbol [javac] symbol : method getSymbol() [javac] location: interface samples.quickstart.service.xmlbeans.xsd.GetPriceDocument.GetPrice [javac] Double price = (Double) map.get(param1.getGetPrice().getSymbol()); [javac] ^ [javac] c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build\service\src\samples\quickstart\service\xmlbeans\StockQuoteServiceSkeleton.java:54: cannot find symbol [javac] symbol : method setReturn(double) [javac] location: interface samples.quickstart.service.xmlbeans.xsd.GetPriceResponseDocument.GetPriceResponse [javac] res.setReturn(ret); [javac]^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 4 errors BUILD FAILED c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build.xml:77: The following error occurred while executing this line: c:\swdev\axis2-SNAPSHOT\samples\quickstartxmlbeans\build\service\build.xml:50: Compile failed; see the compiler error output for details. Here's the ant task for running wsdl2java: java classname=org.apache.axis2.wsdl.WSDL2Java fork=true classpathref=axis2.wl.xmlbeans.classpath arg line=-uri ${wsdl.uri}/ arg line=-s/ arg line=-ss/ arg line=-sd/ arg line=-ssi/ arg line=-ap/ arg line=-ns2p http://quickstart.samples/xsd=samples.quickstart.service.xmlbeans.xsd/ arg line=-l java/ arg line=-p samples.quickstart.service.xmlbeans/ arg line=-d xmlbeans/ arg line=-o ${build.dir}/service/ arg line=-Ewdc/ /java I don't get any errors, when I remove the -Ewdc option. Do you know what's wrong? Thanks, Jonathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AXIS2 wsdl2java limitations using jibx and xmlbeans databinding
Correction: There is no bug to report for jbix/circular imports. Jonathan Joseph wrote: Dennis, The wsdl works with ADB, with the exception of the 2 part declarations in a message declaration. I plan to enter a separte bug in JIRA for the jibx/soapheader, jibx/circular imports cases that you can look at (I'll provide the wsdl). And I plan to enter a separate JIRA bug for the xmlbeans circular imports case for the xmlbeans experts. Here are my results using ADB binding: Test Case 1: adb binding: 2 parts in a message. Results: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException: More than one part for message getPriceMessage Test Case 2: adb binding: circular imports: Results: OK - NO ERRORS Retrieving schema wsdl:imported from '../../../schema/StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/quickstartadb/resources/META-INF/'. Retrieving schema at 'StockQuoteB.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteA.xsd'. Retrieving schema at 'StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteB.xsd'. Retrieving schema wsdl:imported from '../../../schema/StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/quickstartadb/resources/META-INF/'. Retrieving schema at 'StockQuoteB.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteA.xsd'. Retrieving schema at 'StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteB.xsd'. Test Case 3: soap header declaration: Results: OK - NO ERRORS Thanks, Jonathan Dennis Sosnoski wrote: Hi Jonathan, Since you didn't provide the modified WSDL it's difficult to say what's going wrong with this. Does your WSDL work with ADB? I gather you're using a header part, which probably has not been tested thoroughly. If you want to enter a Jira on this I'll take a look at the JiBX handling. - Dennis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AXIS2 wsdl2java limitations using jibx and xmlbeans databinding
Thanks Amila for pointing out the missing 'parts' attribute in the soap:body of my wsdl:binding. 7 out of 9 of my tests are now working. Here are my results thus far using wsdl2java for ADB, JIBX, XMLBeans data bindings: ADB Binding: All my test cases are working for ADB. XMLBeans Binding: still have a problem with circular imports. -- Amila, I don't quite understand how to proceed. What is the -Ewdc option? I tried the -Ewdc wsdl2java option using the same import declaration for the xmlschema that causes circular references, and got the same error for circular imports (Duplicate global type). There were no classes, under the build/service/classes directory due to the error. I've compiled the xmlschemas via scomp, but am not sure on how to proceed. Results: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: project://local/StockQuoteA.xsd:17:5: error: sch-props-correct.2: Duplicate global type: [EMAIL PROTECTED] (Original global type found in file: null) JIBX Binding: still have problem with the 2 part message declartion (which works with ADB binding) - Test Case 1: soap header declaration, using a wsdl:part element from a wsdl:message element that contains 2 wsdl:part elements. Results: Exception in thread main org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: No mapping defined for element {http://quickstart.samples/xsd}myHeader Relevant parts of the WSDL: wsdl:definitions xmlns:axis2=http://quickstart.samples/; xmlns:soap12=http://schemas.xmlsoap.org/wsdl/soap12/; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:ns=http://quickstart.samples/xsd; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; targetNamespace=http://quickstart.samples/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://quickstart.samples/xsd; xs:element name=myHeader type=xs:string/ etc. /wsdl:types wsdl:message name=getPriceMessage wsdl:part name=myHeaderMessagePart element=ns:myHeader/ wsdl:part name=part1 element=ns:getPrice/ /wsdl:message wsdl:binding name=StockQuoteServiceSOAP11Binding type=axis2:StockQuoteServicePortType soap:binding transport=http://schemas.xmlsoap.org/soap/http; style=document/ wsdl:operation name=getPrice soap:operation soapAction=urn:getPrice style=document/ wsdl:input soap:header message=axis2:getPriceMessage part=myHeaderMessagePart use=literal/ soap:body use=literal parts=part1 namespace=http://quickstart.samples// /wsdl:input etc /wsdl:binding Amila Suriarachchi wrote: On Sat, Mar 8, 2008 at 3:39 AM, [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm trying to use wsdl2java from the Axis2 v1.3 distribution to generate soap headers, and import xml schemas via either jibx or xmlbeans databinding. I've run into some limitations using wsdl2java and wanted to confirm my findings. All my tests used the StockQuoteService wsdl provided in the quickstartjibx and quickstartxmlbeans examples. 1) Test Results for more than one part element per message element: -jibx: obtained the following error. Caused by: org.apache.axis2.AxisFault: message {http://quickstart.samples/}myHeaderMessage http://quickstart.samples/%7DmyHeaderMessage not found in the WSDL -xmlbeans: obtained the following error. Caused by: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException: More than one part for message getPriceMessage This is because of the problem I mentioned earlier. 2) Test Results for Cirular imports in a wsdl, where xml schema A imports schema B, which imports the original schema A: -jibx: didn't try. xml schema is complicated. -xmlbeans: Get 'Duplicate global element' Error. Caused by: org.apache.xmlbeans.XmlException: project://local/AlertInfrastructureTransactions.xsd:14:5: error: sch-props-correct.2: Duplicate global element: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] (Original global element found in file: null) Try this. When generating the code with wsdl2java tool use -Ewdc option. This would generate some dummy classes for Xml beans. Then generate the Xmlbeans classes with the scomp tool comes with the Xmlbeans distribution. Then replace the above dummy classes with the latter generated data bind classes. 3) Test Results for soap headers added to binding. -jibx: Get mapping error when soap:header ... is added to binding. Exception in thread
Re: AXIS2 wsdl2java limitations using jibx and xmlbeans databinding
Dennis, The wsdl works with ADB, with the exception of the 2 part declarations in a message declaration. I plan to enter a separte bug in JIRA for the jibx/soapheader, jibx/circular imports cases that you can look at (I'll provide the wsdl). And I plan to enter a separate JIRA bug for the xmlbeans circular imports case for the xmlbeans experts. Here are my results using ADB binding: Test Case 1: adb binding: 2 parts in a message. Results: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException: More than one part for message getPriceMessage Test Case 2: adb binding: circular imports: Results: OK - NO ERRORS Retrieving schema wsdl:imported from '../../../schema/StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/quickstartadb/resources/META-INF/'. Retrieving schema at 'StockQuoteB.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteA.xsd'. Retrieving schema at 'StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteB.xsd'. Retrieving schema wsdl:imported from '../../../schema/StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/quickstartadb/resources/META-INF/'. Retrieving schema at 'StockQuoteB.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteA.xsd'. Retrieving schema at 'StockQuoteA.xsd', relative to 'file:/C:/swdev/wsproto/schema/StockQuoteB.xsd'. Test Case 3: soap header declaration: Results: OK - NO ERRORS Thanks, Jonathan Dennis Sosnoski wrote: Hi Jonathan, Since you didn't provide the modified WSDL it's difficult to say what's going wrong with this. Does your WSDL work with ADB? I gather you're using a header part, which probably has not been tested thoroughly. If you want to enter a Jira on this I'll take a look at the JiBX handling. - Dennis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]