Welcome to your online Twist community.
Take a look around; if you need help getting started with Twist, are looking for tips using Twist in new and interesting ways or want to share cool Twist uses with other users your at the right place.
To participate in this community you should take advantage of the following activities: Join the Discussion by Posting a Topic, or view the Twist Instructional Videos.
Resources for logging defects, suggesting features, troubleshooting, installation and having general discussion about the product are all available.
We'd love to hear your Twist stories and Feedback,
| name | posts | comments | activity |
|---|---|---|---|
| General Discussion | 80 | 125 | February 2, 2012 |
| Feature Requests | 8 | 21 | January 10, 2012 |
| Troubleshooting | 12 | 20 | January 10, 2012 |
| Twist Instructional Videos | 9 | 11 | January 10, 2012 |
| Bug Reports | 11 | 20 | January 10, 2012 |
I have a case where in the Login class I want to know which type of browser I am using. What is the mobile server address. What is the version of browser and other settings defined in twist.Properties
I am using the default system web browser instantiated by the twist. Twist version is 2.4.0.12621
Please let me know how to implement this or procedure for the same.
Thanks,
Sarita.

The idea of this post is to demonstrate WebServices testing from Twist. While some of our customers have already been using Twist for services testing, this post will hopefully show you easy enough steps to test your WebServices while still leveraging the authoring, maintenance aspects of Twist. In this example, we will test a simple temperature converter service exposed at http://www.w3schools.com/webservices/tempconvert.asmx, which provides simple celsius to fahrenheit degrees conversion.
Pre-requisite:
1. Creating the project
2. Generating the building stubs, skeletons, and data types from WSDL.
What we want is a simple and usable enough java interface for accessing the remote WebService. something like:
converterService.celsiusToFahrenheit("32")
A fair amount of boilerplate code must be written to access the Service. Thankfully, we can automate all that code generation. We will generate the bindings necessary for client side testing of the service using wsdl2java utility shipped with CXF. To do this:
If you look within the package contents classes, you will find an interface annotated with @WebService (org.tempuri.TempConvertSoap). This interface has 2 basic methods that represent the operations supported by the WebService. This is the remote interface we are going to use in our Test fixtures.
Another class (org.tempuri.TempConvert) will be generated annotated with @WebServiceClient. This is the class that will return the remote interface. Methods annotated with @WebEndpoint will return you a remote interface. (in this case, we have used TempConvert.getTempConvertSoap() method)
NOTE: If you would want to customize the JAX-WS implementations created by wsdl2java, it can be done by using a customization binding file. Please refer here for more information.
3. Adding CXF Library references to your project
4. Creating the remote interface instance
<bean id="tempConvertorFactory" class="org.example.ConverterServiceFactory"
init-method="start" destroy-method="stop" lazy-init="true">
<property name="wsdlLocation" value="classpath:tempconvert.asmx.wsdl"/>
</bean>
<bean id="converterService" factory-bean="tempConvertorFactory" factory-method="getConverterServicePort"
lazy-init="true" scope="singleton">
</bean>
5. Creating a scenario and generating test fixture
Temperature Converter:
- verify that "100" degrees in centigrade is same as "212" degrees fahrenheit
6. Injecting the service interface to the fixture
public class TemperatureConverter {
@Autowired
private TempConvertSoap converterService;
....
}
7. Calling a remote service operation.
public void verifyThatDegreesInCentigradeIsSameAsDegreesFahrenheit(Double celsius, Double fahrenheit) throws Exception {
assertEquals(fahrenheit, Double.valueOf(converterService.celsiusToFahrenheit(celsius.toString())));
}
8. Execute the scenario
Additional support from Eclipse WTP
