org.apache.woden.tool.converter. I instantly new what was its purpose :)Today's post is a short post about converting WSDL 1.1 to WSDL 2.0 using Woden's
Convert class.Know how blog: Java EE, Web Services, WSIT, WS-BPEL, SOA, Spring, Maven2, best practices and testing
org.apache.woden.tool.converter. I instantly new what was its purpose :)Convert class.HelloWorldWSDL2 class and copy and paste:public class HelloWorldWSDL2 {
public String sayHello(String name) {
return "Hi " + name + "! How are you?";
}
}Next in META-INF directory create Axis2 services.xml descriptor, copy and paste:<service name="HelloWorldWSDL2" targetNamespace="http://wsdl2.ws.studies.xh.org">Then, still inside
<!-- this is the key property -->
<parameter name="useOriginalwsdl">true</parameter>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</messageReceivers>
<parameter name="ServiceClass" locked="xsd:false">
org.xh.studies.ws.wsdl2.HelloWorldWSDL2</parameter>
</service>
META-INF directory, create HelloWorldWSDL2.wsdl file and copy and paste:<description xmlns="http://www.w3.org/ns/wsdl"Deploying on Apache Axis2
targetNamespace="http://wsdl2.ws.studies.xh.org" xmlns:tns="http://wsdl2.ws.studies.xh.org"
xmlns:wsoap="http://www.w3.org/ns/wsdl/soap" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/ns/wsdl http://www.w3.org/2007/06/wsdl/wsdl20.xsd
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
<types>
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://wsdl2.ws.studies.xh.org"
xmlns:ns="http://wsdl2.ws.studies.xh.org">
<xs:element name="sayHello">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sayHelloResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<interface name="HelloWorldWSDL2Interface">
<operation name="sayHello" pattern="http://www.w3.org/ns/wsdl/in-out">
<input messageLabel="In" element="tns:sayHello" wsaw:Action="urn:sayHello" />
<output messageLabel="Out" element="tns:sayHelloResponse"
wsaw:Action="urn:sayHelloResponse" />
</operation>
</interface>
<binding name="HelloWorldWSDL2SOAPBinding" interface="tns:HelloWorldWSDL2Interface"
type="http://www.w3.org/ns/wsdl/soap" wsoap:version="1.2"
wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
<operation ref="tns:sayHello" wsoap:action="urn:sayHello" />
</binding>
<service name="HelloWorldWSDL2" interface="tns:HelloWorldWSDL2Interface">
<endpoint name="HelloWorldWSDL2SOAPBindingEndpoint" binding="tns:HelloWorldWSDL2SOAPBinding"
address="http://localhost:8181/ode/processes/HelloWorldWSDL2">
</endpoint>
</service>
</description>
$CATALINA_HOME/webapps/axis2/WEB-INF/services. There was an error:14:44:34,033 INFO [ServiceDeployer] The wsdl2-0.0.1-SNAPSHOT.aar service, which is not valid, caused java.lang.NoClassDefFoundError: org/apache/wodenUsing M2Eclipse's code completion I added the following Maven dependency to my
/wsdl20/xml/DocumentableElement
at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:322)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:64)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:137)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:571)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:141)
pom.xml file:<dependency>I rebuilt the aar package and tried to deploy it once again.
<groupId>org.apache.woden</groupId>
<artifactId>woden-impl-dom</artifactId>
<version>1.0M8</version>
</dependency>
woden-impl-dom-1.0M8.jar and woden-api-1.0M8.jar to Axis' WEB-INF/lib and restarted Axis2 application.Woden[Warning],0:0,Description-1001,The targetNamespace 'http://wsdl2.ws.studies.xh.org' is not dereferencable.By looking at the stack trace I instantly spotted Woden's version mismatch. I went to Woden's home page and it turned out that 1.0M8 was the latest version.
14:54:50,625 INFO [ServiceDeployer] The wsdl2-0.0.1-SNAPSHOT.aar service, which is not valid, caused java.lang.NoSuchMethodError: org.apache.woden.ws
dl20.xml.DescriptionElement.getNamespaces()Ljava/util/Map;
at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.setup(WSDL20ToAxisServiceBuilder.java:392)
at org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.populateAllServices(WSDL20ToAllAxisServicesBuilder.java:71)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLFile(ArchiveReader.java:232)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:332)
woden-1.0-incubating-M7b (I downloaded it manually, it hadn't been added to Maven2 repository).woden-1.0-incubating-M7b.jar to Axis' WEB-INF/lib directory, removed both 1.0M8 jars, and again restarted Axis2.http://localhost:8181/axis2/services/listServices and saw my Web Service. I could also invoke it directly from my:http://localhost:8181/ode/processes/HelloWorldWSDL2?name=LukaszResulted in:
<ns:sayHelloResponse xmlns:ns="http://wsdl2.ws.studies.xh.org">Now you know how to create WSDL 2.0 Web Services and how to deploy them on Apache Axis2.
<ns:return>Hi Lukasz! How are you?</ns:return>
</ns:sayHelloResponse>
http://schemas.xmlsoap.org/wsdl/ and WSDL 2.0 http://www.w3.org/ns/wsdl.db2 => connect to lukasz1I kept getting this errors:
SQL1084C - Shared Memory Segments cannot be allocated. SQLSTATE=57019I did some googling but couldn't find the answer... after a longer while I finally found the solution.
WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.Today I will write a little bit about WSDL 1.1 and will show you how to manually prepare a WSDL file and use it in JAX-WS.
The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint.
Related concrete endpoints are combined into abstract endpoints (services).
WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate.
jetty-maven-plugin :)Integration testing is the activity of software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before system testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing.Today I will show you how to test Web Services using Maven2,
failsafe-maven-plugin and maven-jetty-plugin.
All examples that I have ever used in any post in my blog can be found here:
http://www.mediafire.com/jbs-blog-examples
enjoy!
If you need more examples do not hesitate to contact me or add a comment to post to which you would like me to add an example.