Creating web services from xsd file containing xsd:union
Hi All, I would like to know that is there any way to create web services from xsd file having the tag 'xsd:union'. I knew from the old thread that there is a limitation of axis1 that it does not support the tag 'xsd:union, so I plan to move to Axis2, but I do not know much which binding frameworks in Axis2 supporting the 'xsd:union' tag. Can anybody shade me some light on my issue? Cheers, - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: SOAP and Axis2 book recommendation
Hi Joe, Have you read the Axis2 book written by Kent Ka Iok Tong which can be found at http://www.agileskills2.org/DWSAA. I have read his book and it is good for me to start working Axis2 with Eclipse IDE, and also the writer is pretty good and helpful. He always replies my emails when I got problems with Axis2. Cheers, Suriya Joe S <[EMAIL PROTECTED]> wrote: Hi all, I'm wondering if any one can recommend good, practical SOAP books which covers AXIS2. Thanks. Joe - Never miss a thing. Make Yahoo your homepage.
Re-format the style of double value
Hi All, I am developing the SOAP server with Java by implementing it with Axis2 engine. Now I have got a problem that when the data in double attribute is greater than 10,000,000 , the number will convert to science notation format like '2.022E9' automatically. So could any one tell me how can I get the data in the normal format like '202200'. I used ADB as data binding when creating the class from WSDL. Thank you for any help in advance. Cheers, - Looking for last minute shopping deals? Find them fast with Yahoo! Search.
How to get the properties in context.xml in the server skeleton class
Hi all, I would like to know is it possible to get the properties' values from the file 'context.xml' in \webapps\axis2\META-INF. The example of context.xml It said on Tomcat document that the value can be retrieved by calling ServletContext.getInitParameter(), but I do not know how to get this data via the Axis2 server skeleton class. Thank you for any help in advance. Cheers, Suriya - Looking for last minute shopping deals? Find them fast with Yahoo! Search.
Re: How to get the properties in context.xml in the server skeleton class
Thank Simon for your reply. I have tried it, but always got the java.lang.NullPointerException. Any suggestion? My context.xml data located in \webapps\axis2\META-INF : My SOAP server class : /** * HelloServiceSkeleton java skeleton for the axisService */ public class HelloServiceSkeleton implements HelloServiceSkeletonInterface { /** * Auto generated method signature * @param helloRequest */ public com.glovia.www.hello.HelloResponse sayHello( com.glovia.www.hello.HelloRequest helloRequest) { System.out.println("Print properties from Tomcat context.xml"); String xsltPath = ""; try { MessageContext msgC = MessageContext.getCurrentMessageContext(); System.out.println("Get MessageContext"); ServletContext context = ((HttpServlet) msgC .getProperty(HTTPConstants.MC_HTTP_SERVLET)) .getServletContext(); System.out.println("Get ServletContext"); xsltPath = context.getInitParameter("xsltPath"); System.out.println("Get xsltPath"); xsltPath = context.getInitParameter("xsltPath"); } catch (Exception e) { e.printStackTrace(); } System.out.println("XsltPath : "+xsltPath); HelloResponse resp = new HelloResponse(); resp.setHelloResponse("Hi "+ helloRequest.getHelloRequest()); return resp; } } The error message : java.lang.NullPointerException at com.glovia.service.HelloServiceSkeleton.sayHello(HelloServiceSkeleton .java:48) at com.glovia.service.HelloServiceMessageReceiverInOut.invokeBusinessLog ic(HelloServiceMessageReceiverInOut.java:48) at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBus inessLogic(AbstractInOutSyncMessageReceiver.java:42) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe ssageReceiver.java:96) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq uest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1 20) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p rocessConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo int.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol lowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:689) at java.lang.Thread.run(Thread.java:595) Simon Steinacker <[EMAIL PROTECTED]> wrote: Something like this > MessageContext msgC=MessageContext.getCurrentContext(); > ServletContext context=((HttpServlet)msgC.getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext(); should work. Generally speaking you can get a lot of properties concerning the current http and soap message by using the MessageContext.getProperty(...) method. Parameters taht can be used for this are located in org.apache.axis2.Constants or HTTPConstants or whatever. Hope that helped, best regards, Simon Suriya Simsuwat wrote: > Hi all, > > I would like to know is it possible to get the properties' values from > the file 'context.xml' in \webapps\axis2\META-INF. > > The example of context.xml > > > > > > > > It said on Tomcat document that the value can be retrieved by calling > |ServletContext.getInitParameter(), |but I do not know how to get this > data via the Axis2 server skeleton class. Thank you for any help in > advance. > > Cheers, > > Suriya > > > Looking for last minute shopping deals? Find them fast wi
Re: How to get the properties in context.xml in the server skeleton class
Thank you very very much, Simon. It works like a charm this time. ;) Simon Steinacker <[EMAIL PROTECTED]> wrote: This way it works: > MessageContext ctx = MessageContext.getCurrentMessageContext(); > ServletContext sr = (ServletContext) ctx.getProperty("transport.http.servletContext"); > System.out.println("xsltPath: " + sr.getInitParameter("xsltPath")); regards Simon Suriya Simsuwat wrote: > Thank Simon for your reply. I have tried it, but always got the > java.lang.NullPointerException. Any suggestion? > > My context.xml data located in \webapps\axis2\META-INF : > > > > > > > My SOAP server class : > > > /** > * HelloServiceSkeleton java skeleton for the axisService > */ > * * > *public* *class* HelloServiceSkeleton *implements* > HelloServiceSkeletonInterface { > /** > * Auto generated method signature > * [EMAIL PROTECTED] helloRequest > */ > *public* com.glovia.www.hello.HelloResponse sayHello( > com.glovia.www.hello.HelloRequest helloRequest) { > System./out/.println("Print properties from Tomcat context.xml"); > String xsltPath = ""; > *try* { > MessageContext msgC = MessageContext./getCurrentMessageContext/(); > System./out/.println("Get MessageContext"); > ServletContext context = ((HttpServlet) msgC > .getProperty(HTTPConstants./MC_HTTP_SERVLET/)) > .getServletContext(); > System./out/.println("Get ServletContext"); > xsltPath = context.getInitParameter("xsltPath"); > System./out/.println("Get xsltPath"); > xsltPath = context.getInitParameter("xsltPath"); > } *catch* (Exception e) { > e.printStackTrace(); > } > System./out/.println("XsltPath : "+xsltPath); > HelloResponse resp = *new* HelloResponse(); > resp.setHelloResponse("Hi "+ helloRequest.getHelloRequest()); > *return* resp; > } > } > > > > The error message : > > java.lang.NullPointerException > at > com.glovia.service.HelloServiceSkeleton.sayHello(HelloServiceSkeleton > .java:48) > at > com.glovia.service.HelloServiceMessageReceiverInOut.invokeBusinessLog > ic(HelloServiceMessageReceiverInOut.java:48) > at > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBus > inessLogic(AbstractInOutSyncMessageReceiver.java:42) > at > org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe > ssageReceiver.java:96) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145) > at > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq > uest(HTTPTransportUtils.java:275) > at > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1 > 20) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl > icationFilterChain.java:269) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF > ilterChain.java:188) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV > alve.java:213) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextV > alve.java:174) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j > ava:127) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j > ava:117) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal > ve.java:108) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav > a:174) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java > :874) > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p > rocessConnection(Http11BaseProtocol.java:665) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo > int.java:528) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol > lowerWorkerThread.java:81) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP > ool.java:689) > at java.lang.Thread.run(Thread.java:595) > > > */Simon Steinacker /* wrote: > > Something like this > > > MessageContext msgC=MessageContext.getCurrentContext(); > > ServletContext > > context=((HttpServlet)msgC.getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext(); > > should work. > Generally speaking you can
It is a bug of ADB with xsd:decimal?
Hi all, I have faced the strange problem that in my WSDL file I have xsd:simpleType for xsd:decimal element like below (full details of WSDL can be found in the attached file). After I created a skeleton class, built .aar file, and then deploy it on Tomcat. Currently I am using Axis2 version 1.3. When I used the client class to call this service by setting the value as 1.0002 to UserNum1 parameter which having xsd:decimal type defined in the WSDL, the web service server always got this value 1.000177973175191436894237995147705078125 instead of 1.0002. It is a bug with ADB when it serializes and deserializes xsd:decimal element (BigDecimal object). http://www.test.com/WOLaborTime Service" name="WOLaborTime" business_id="testTH03" create_date="2008-03-26Z" cre ate_time="03:19:48.00866Z" source_reference="G1" destination_reference="G2"> Alpha1 Alpha2 Alpha3 1.000177973175191436894237995147705078125 2 3 0002 TEST 0001 0123 8 T T T 2008-03-26Z Can anyone suggest me how to solve this issue? Best Regards, Suriya - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. WOLaborTime.wsdl Description: 245107509-WOLaborTime.wsdl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: It is a bug of ADB with xsd:decimal?
Hi all, I got the solution. If I initial the BigDecimal object with number value for UserNum1 parameter like below Number11_4 userNum1 = new Number11_4(); userNum1.setNumber11_4(new BigDecimal(1.0002)); header.setUserNum1(userNum1); Then the value will be changed to 1.000177973175191436894237995147705078125. Whereas when the value for UserNum1 parameter is declared with string, the value is correct on web service server. Number11_4 userNum1 = new Number11_4(); userNum1.setNumber11_4(new BigDecimal("1.0002")); header.setUserNum1(userNum1); So, it is BigDecimal class of Java 1.5 bug not Axis2 ADB. Best regards, Suriya Suriya Simsuwat <[EMAIL PROTECTED]> wrote: Hi all, I have faced the strange problem that in my WSDL file I have xsd:simpleType for xsd:decimal element like below (full details of WSDL can be found in the attached file). After I created a skeleton class, built .aar file, and then deploy it on Tomcat. Currently I am using Axis2 version 1.3. When I used the client class to call this service by setting the value as 1.0002 to UserNum1 parameter which having xsd:decimal type defined in the WSDL, the web service server always got this value 1.000177973175191436894237995147705078125 instead of 1.0002. It is a bug with ADB when it serializes and deserializes xsd:decimal element (BigDecimal object). http://www.test.com/WOLaborTime Service" name="WOLaborTime" business_id="testTH03" create_date="2008-03-26Z" cre ate_time="03:19:48.00866Z" source_reference="G1" destination_reference="G2"> Alpha1 Alpha2 Alpha3 1.000177973175191436894237995147705078125 2 3 0002 TEST 0001 0123 8 T T T 2008-03-26Z Can anyone suggest me how to solve this issue? Best Regards, Suriya - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Never miss a thing. Make Yahoo your homepage.