Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by ChamikaraJayalath: http://wiki.apache.org/ws/FrontPage/ws-sandesha/sandesha1/faq ------------------------------------------------------------------------------ == Development Questions == - Q7. How do I install Sandesha ? - Q8. How do I deploy my web services with reliability ? + '''Q7. How do I install Sandesha ?''' - Q9. How do I access a reliable web service ? + * Get Apache Axis 1.x (http://ws.apache.org/axis). + * Install apache axis webapp in your application server. + * Download Apache Sandesha 1.0 (http://ws.apache.org/sandesha). + * Download Apache Addressing (http://ws.apache.org/addressing) + * Put Sandesha jar to <WEBAPP_DIR>/WEB-INF/lib directory. + * Put Addressing jar to <WEBAPP_DIR>/WEB-INF/lib directory. - Q10. How can I call a reliable web service synchronously ? + '''Q8. How do I deploy my web services with reliability ?''' - Q11. How can I call a reliable web service asynchronously ? + * Install Sandesha (see Q7) + * Add your web service classes to <WEB_APP>/WEB-INF/classes directory. + * Create a deploy.wsdd file similar to the following example. + {{{ + <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> + <service name="RMSampleService" provider="Handler"> + <requestFlow> + <handler type="java:org.apache.sandesha.ws.rm.handlers.RMServerRequestHandler"></handler> + <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"></handler> + </requestFlow> - Q12. Where can I find some examples for Sandesha ? + <parameter name="handlerClass" value="org.apache.sandesha.ws.rm.providers.RMProvider"/> + <parameter name="className" value="org.apache.sandesha.samples.RMSampleService"/> + <parameter name="allowedMethods" value="*"/> + <parameter name="scope" value="request"/> + </service> + </deployment> + }}} - Q13. What delivery assurance can I get from Sandesha ? + * Deploy your web service (see axis 1.x user guide for more details on deploying web services). + + '''Q9. What configurations do I have to perform before using Sandesha client ?''' + + * Add Sandesha jar file and Apache Addressing jar file to your classpath. + * Add the client-config.wsdd file given below, to your classpath. + {{{ + <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> + <globalConfiguration> + <parameter name="adminPassword" value="admin"/> + <parameter name="enableNamespacePrefixOptimization" value="true"/> + <parameter name="disablePrettyXML" value="true"/> + <parameter name="sendMultiRefs" value="true"/> + <parameter name="sendXsiTypes" value="true"/> + <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/> + <parameter name="sendXMLDeclaration" value="true"/> + </globalConfiguration> + <handler name="RMSender" type="java:org.apache.sandesha.client.RMSender"/> + <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/> + <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/> + <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/> + <transport name="RMTransport" pivot="RMSender"/> + </deployment> + }}} + + '''Q10. How can I call a reliable web service synchronously ?''' + + + * Do the configurations described in Q9. + * Write your client code and run (an example is given below) + {{{ + Service service = new Service(); + Call call = (Call) service.createCall(); + SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS); + ctx.initCall(call, targetURL, "urn:wsrm:Ping",Constants.ClientProperties.IN_ONLY); + call.setOperationName(new QName("http://tempuri.org/", "Ping")); + call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN); + call.invoke(new Object[]{"Ping Message Number One"}); + call.invoke(new Object[]{"Ping Message Number Two"}); + ctx.setLastMessage(call); + call.invoke(new Object[]{"Ping Message Number Three"}); + RMReport report = ctx.endSequence(); + }}} + + '''Q11. How can I call a reliable web service asynchronously ?''' + + * Do the configurations described in Q9. + * Write your client code and run (an example is given below) + {{{ + Service service = new Service(); + Call call = (Call) service.createCall(); + SandeshaContext ctx = new SandeshaContext(); + ctx.setAcksToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService"); + ctx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService"); + ctx.initCall(call, targetURL, "urn:wsrm:ping", Constants.ClientProperties.IN_ONLY); + call.setOperationName(new QName("http://tempuri.org", "Ping")); + call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN); + call.invoke(new Object[]{"Ping Message Number One"}); + call.invoke(new Object[]{"Ping Message Number Two"}); + ctx.setLastMessage(call); + call.invoke(new Object[]{"Ping Message Number Three"}); + RMReport report = ctx.endSequence(); + }}} + + '''Q12. Where can I find some examples for Sandesha ?''' + + Sandesha distributions come with several examples. You can find examples for synchronous + and asynchronous client calls in the 'samples' directory. Also you can find examples for + interacting with other web service frameworks in the 'interop' directory (this comes only + in the source distribution). + + '''Q13. What delivery assurance can I get from Sandesha ?''' + + Sandesha support in-order exactly once delivery assurance. Because of this you can gaurantee + that the server will invoke web service messages in the same order you add them in the client. + Also the server will invoke them exactly once (No more. No less.) + + ---- == Troubleshooting == === Server side === + + + === Client side === + '''Q15. I get the exception " No client transport named 'RMTransport' found!" ?''' + + When running Sandesha client you should have the client-config.wsdd supplied with the + Sandesha distribution (see Q9 ) in your classpath. Please add this. + + '''Q16. I get the exception "To perform the operation, ReplyTo address must be specified." ?''' + + According to the way you have written your client code you must specify a ReplyTo address. + Please add this to your client code. An example is given below. + {{{ + ctx.setReplyToURL("http://127.0.0.1:9090/axis/services/RMService"); + }}} +
