Java Reference
In-Depth Information
</xs:complexType>
<xs:complexType name="CreateUserResponse">
<xs:sequence>
<xs:element name="userId" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
In addition to the UserDTO , the schema includes a CreateUserResponse . The re-
sponse is used to communicate the ID of the new user back to the client for subsequent web
service invocations.
Now that the schema is created, you use the JAXB generator tool provided by the JDK to
turn the schema into real Java objects:
xjc -d <base directory> /ActionBazaar-ejb/src/main/java/ -p
com.actionbazaar.ws.dto UserDTO.xsd
After the real Java objects are created, you can turn your attention to the WSDL of the
web service. The WSDL file is shown in listing 8.4 . The WSDL file should be placed
in META-INF/wsdl. Because the WSDL references the UserDTO.xsd file, UserDTO.xsd
should be placed in the same directory. The UserService.wsdl file defines one service,
createUser , which will be implemented in the code.
Search WWH ::




Custom Search