* @param reader - XMLStreamReader holding the <interface.wsdl/> element
* @return - the WSDLInterfaceContract
*/
public WSDLInterfaceContract read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
// Read an <interface.wsdl>
WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
Monitor monitor = context.getMonitor();
// Read wsdlLocation
String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
wsdlInterfaceContract.setLocation(location);
String uri = getURIString(reader, INTERFACE);
if (uri != null) {
WSDLInterface wsdlInterface = createWSDLInterface(uri, monitor);
if (wsdlInterface != null)
wsdlInterfaceContract.setInterface(wsdlInterface);
}
uri = getURIString(reader, CALLBACK_INTERFACE);
if (uri != null) {
WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri, monitor);
if (wsdlCallbackInterface != null)
wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
}
String remotable = reader.getAttributeValue(null, REMOTABLE);
if (remotable != null &&
!remotable.equals("true")){
Monitor.error(monitor,
this,
"interface-wsdlxml-validation-messages",
"InvalidRemotableValue",
((WSDLInterface)wsdlInterfaceContract.getInterface()).getName().toString(),
remotable);
}
// Read intents and policy sets
policyProcessor.readPolicies(wsdlInterfaceContract.getInterface(), reader);
// Skip to end element
while (reader.hasNext()) {
if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
break;