Documentation Center

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 namespaceJava package
http://www.sdltridion.com/ContentManager/R6com.sdltridion.contentmanager.r6.*
http://www.sdltridion.com/ContentManager/CoreService/2010com.sdltridion.contentmanager.coreservice.*
Nullable types
From the Java client, you can detect whether a property has the value null on the server by checking the value of the nil field of the object you retrieved.
Collections

The WSDL collection type ArrayOf{T} (where {T} is the type collected) maps to a Java Array

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 a getAny method on this class and cast the object returned to the class org.w3c.dom.Element to get the original element.

For example, the following call retrieves the XML fragment returned by a call to the server-side .NET GetListXml method:

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();