Author: sagara
Date: Wed Sep 2 15:25:04 2009
New Revision: 810561
URL: http://svn.apache.org/viewvc?rev=810561&view=rev
Log:
add some missing features.
Modified:
webservices/woden/branches/woden65/src/org/apache/woden/internal/DOMWSDLWriter.java
Modified:
webservices/woden/branches/woden65/src/org/apache/woden/internal/DOMWSDLWriter.java
URL:
http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/DOMWSDLWriter.java?rev=810561&r1=810560&r2=810561&view=diff
==============================================================================
---
webservices/woden/branches/woden65/src/org/apache/woden/internal/DOMWSDLWriter.java
(original)
+++
webservices/woden/branches/woden65/src/org/apache/woden/internal/DOMWSDLWriter.java
Wed Sep 2 15:25:04 2009
@@ -47,6 +47,7 @@
import org.apache.woden.wsdl20.xml.ImportElement;
import org.apache.woden.wsdl20.xml.IncludeElement;
import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
@@ -313,15 +314,23 @@
}
QName[] extendedInterfaces =
intrface.getExtendedInterfaceNames();
- for(int i=0;i<extendedInterfaces.length;i++){
+ String attrExtendedInterfaces="";
+ for(int i=0;i<extendedInterfaces.length;i++){
if(extendedInterfaces[i]!=null){
-
- DOMUtils.printQualifiedAttribute(
- Constants.ATTR_EXTENDS,
- extendedInterfaces[i],
- des, pw);
+ attrExtendedInterfaces=attrExtendedInterfaces +
DOMUtils.
+
getQualifiedValue(extendedInterfaces[i].getNamespaceURI(),
+
extendedInterfaces[i].getLocalPart(), des);
+ if(i!=extendedInterfaces.length-1){
+
attrExtendedInterfaces=attrExtendedInterfaces+ " ";
+
+ }
+
}
}
+ if(extendedInterfaces.length>0){
+
DOMUtils.printAttribute(Constants.ATTR_EXTENDS,attrExtendedInterfaces,pw);
+ }
+
URI[] styleDefaults = intrface.getStyleDefault();
for(int i=0;i<styleDefaults.length;i++){
@@ -336,12 +345,11 @@
pw);
}
}
-
-
printExtensibilityAttributes(intrface.getExtensionAttributes(), intrface, pw);
pw.println('>');
printDocumentation(intrface.getDocumentationElements(),
des, pw);
printOperations(intrface.getInterfaceOperationElements(),
des, pw);
+ printFaults(intrface.getInterfaceFaultElements(), des,
pw);
printExtensibilityElements(intrface.getClass(),
intrface.getExtensionElements(), des, pw);
pw.println(" </" + tagName + '>');
}
@@ -398,9 +406,6 @@
pw);
}
}
-
-
-
printExtensibilityAttributes(operation.getExtensionAttributes(), operation, pw);
pw.println('>');
printDocumentation(operation.getDocumentationElements(),
des, pw);
@@ -472,7 +477,6 @@
DOMUtils.printAttribute(Constants.ATTR_ELEMENT,
qtu.getToken(), pw);
}
}
-
printExtensibilityAttributes(msgRef.getExtensionAttributes(),
msgRef, pw);
pw.println('>');
printDocumentation(msgRef.getDocumentationElements(), des, pw);
@@ -524,9 +528,8 @@
DOMUtils.getQualifiedValue(faulRef.getNamespaceURI(attrQName.getPrefix()).toString(),
attrQName.getLocalPart(),
faulRef);
- DOMUtils.printAttribute(Constants.ATTR_ELEMENT, attrName, pw);
-
-
+ DOMUtils.printAttribute(Constants.ATTR_REF, attrName, pw);
+
printExtensibilityAttributes(faulRef.getExtensionAttributes(),
faulRef, pw);
pw.println('>');
printDocumentation(faulRef.getDocumentationElements(), des,
pw);
@@ -540,6 +543,59 @@
}
+
+
+ /**
+ * Serialize the InterfaceInterfaceFaultElement of the WSDL element
model.
+ *
+ * @param faulEles an array of InterfaceFaultElements.
+ * @param des corresponding DescriptionElement.
+ * @param pw the Writer to write the xml to.
+ */
+ protected void printFaults(InterfaceFaultElement[] faulEles,
+ DescriptionElement des,
+ PrintWriter pw)
+ throws WSDLException{
+ for(int ind=0;ind<faulEles.length;ind++){
+
+ InterfaceFaultElement faulEle=faulEles[ind];
+ if(faulEle!=null){
+
+ String tagName =null;
+
+ tagName=DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
+ Constants.ELEM_FAULT,
+ faulEle);
+
+
+
+
+ pw.print(" <" + tagName);
+
+ String attrName=faulEle.getName().getLocalPart();
+ DOMUtils.printAttribute(Constants.ATTR_NAME, attrName, pw);
+ //TODO check here - returns QNameTokenUnion but only take
QName
+ QName attrElement=faulEle.getElement().getQName();
+ String attrEle=
+
DOMUtils.getQualifiedValue(faulEle.getNamespaceURI(attrElement.getPrefix()).toString(),
+ attrElement.getLocalPart(),
+ faulEle);
+ DOMUtils.printAttribute(Constants.ATTR_ELEMENT, attrEle, pw);
+
+ printExtensibilityAttributes(faulEle.getExtensionAttributes(),
faulEle, pw);
+ pw.println('>');
+ printDocumentation(faulEle.getDocumentationElements(), des,
pw);
+ printExtensibilityElements(faulEle.getClass(),
faulEle.getExtensionElements(), des, pw);
+ pw.println(" </" + tagName + '>');
+ }
+
+
+
+ }
+
+
+ }
+
/**
* Serialize the printBindings of the WSDL element model.
@@ -581,24 +637,13 @@
des,
pw);
-
-
DOMUtils.printAttribute(Constants.ATTR_TYPE,
binding.getType().toString(),
pw);
-
-
-
-
-
+
printExtensibilityAttributes(binding.getExtensionAttributes(), binding, pw);
pw.println('>');
- printBindingOperations(
- binding.getBindingOperationElements(),des,pw);
-
}
-
-
printDocumentation(binding.getDocumentationElements(), des,
pw);
printExtensibilityElements(binding.getClass(),
binding.getExtensionElements(), des, pw);
printBindingOperations(binding.getBindingOperationElements(),
des, pw);
@@ -659,7 +704,6 @@
PrintWriter pw)
throws WSDLException
{
-
if (operations != null){
String tagName =
@@ -722,8 +766,6 @@
DOMUtils.printQualifiedAttribute(Constants.ATTR_INTERFACE,
interfaceName,des, pw);
}
-
-
printExtensibilityAttributes(service.getExtensionAttributes(),
service, pw);
pw.println('>');
printEndpoints(service.getEndpointElements(), des, pw);
@@ -774,8 +816,6 @@
address.toString(),
pw);
}
-
-
printExtensibilityAttributes(endPoint.getExtensionAttributes(), endPoint, pw);
pw.println('>');
printDocumentation(endPoint.getDocumentationElements(), des,
pw);
@@ -1009,4 +1049,4 @@
}
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]