Mapping WSDL to Java
Core Service Java clients map WSDL to their APIs differently, depending on the proxy generator used. When using the built-in tools included with NetBeans, the mapping affects elements, namespaces, nullable types, collections, plain XML fragments and property values.
- Elements
- An XML element in the XML returned by the Web service is turned into an object of the class javax.xml.bind.JAXBElement<T>.
- Namespaces
-
The Java client has a number of packages that map to the WSDL namespaces:
WSDL namespace Java package http://www.sdltridion.com/ContentManager/R6 com.sdltridion.contentmanager.r6.* http://www.sdltridion.com/ContentManager/CoreService/2010 com.sdltridion.contentmanager.coreservice.* - Nullable types
-
From the Java client, you can detect whether a property has the value
nullon the server by checking the value of thenilfield of the object you retrieved. - Collections
-
The WSDL collection type
ArrayOf{T}(where{T}is the type collected) maps to a JavaArray - Plain XML
-
A plain XML fragment (typically the result of a list query) causes a custom class
{methodName}Result(where{methodName}is the name of the method you called) to be created. Call agetAnymethod on this class and cast the object returned to the classorg.w3c.dom.Elementto get the original element.For example, the following call retrieves the XML fragment returned by a call to the server-side .NET
GetListXmlmethod:myList = (org.w3c.dom.Element) myService.getListXml(myFolder.getId().getValue(), myFilter).getAny(); - Property values
-
To get the value of the property of an object, call
get{PropertyName}().getValue()on the object you retrieved, where{PropertyName}is the name of the property you want to retrieve.For example, the following call gets the value of the Boolean that indicates if a Keyword is a root Keyword or not:
isRoot = aKeyword.getIsRoot().getValue();