You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by du...@apache.org on 2001/11/13 19:28:35 UTC
cvs commit: xml-soap/java/src/org/apache/soap/server DeploymentDescriptor.java TypeMappingSerializer.java
duftler 01/11/13 10:28:35
Modified: java/src/org/apache/soap/server DeploymentDescriptor.java
TypeMappingSerializer.java
Log:
Will now allow a TypeMapping to be specified without the elementType; made
the DeploymentDescriptor and TypeMappings serializing/deserializing logic
more tolerant of null values. Also fixed the
DeploymentDescriptor.toString() method to correctly display the
TypeMappings.
Revision Changes Path
1.32 +38 -13 xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java
Index: DeploymentDescriptor.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- DeploymentDescriptor.java 2001/08/10 16:39:39 1.31
+++ DeploymentDescriptor.java 2001/11/13 18:28:35 1.32
@@ -72,6 +72,7 @@
* This class represents the deployment information about a SOAP service.
*
* @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
*/
public class DeploymentDescriptor implements Serializable {
// types of services
@@ -399,21 +400,33 @@
for (int i = 0; i < mappings.length; i++) {
TypeMapping tm = mappings[i];
- pw.print (" <isd:map encodingStyle=\"" + tm.encodingStyle +
- "\" xmlns:x=\"" + tm.elementType.getNamespaceURI () +
- "\" qname=\"x:" + tm.elementType.getLocalPart () + "\"");
- if (tm.javaType != null) {
+ pw.print (" <isd:map");
+
+ if (tm.encodingStyle != null) {
+ pw.print (" encodingStyle=\"" + tm.encodingStyle +"\"");
+ }
+
+ if (tm.elementType != null) {
+ pw.print (" xmlns:x=\"" + tm.elementType.getNamespaceURI () +
+ "\" qname=\"x:" + tm.elementType.getLocalPart () + "\"");
+ }
+
+ if (tm.javaType != null) {
pw.print (" javaType=\"" + tm.javaType + "\"");
}
+
if (tm.xml2JavaClassName != null) {
pw.print (" xml2JavaClassName=\"" + tm.xml2JavaClassName + "\"");
}
+
if (tm.java2XMLClassName != null) {
pw.print (" java2XMLClassName=\"" + tm.java2XMLClassName + "\"");
}
+
pw.println ("/>");
}
+
pw.println (" </isd:mappings>");
}
@@ -669,9 +682,10 @@
}
if (nl.getLength () == 1) {
e = (Element) nl.item (0);
+
+ String className = DOMUtils.getAttribute(e, "defaultRegistryClass");
- String className = e.getAttribute("defaultRegistryClass");
- if (className != "") {
+ if (className != null) {
dd.setDefaultSMRClass(className);
}
@@ -683,14 +697,10 @@
dd.setMappings (tms);
for (int i = 0; i < nmaps; i++) {
e = (Element) nl.item (i);
- String qnameQname = DOMUtils.getAttribute (e, "qname");
- int pos = qnameQname.indexOf (':');
- String prefix = qnameQname.substring (0, pos);
- String localPart = qnameQname.substring (pos+1);
- String nsURI = DOMUtils.getNamespaceURIFromPrefix (e, prefix);
+ QName qname = DOMUtils.getQualifiedAttributeValue(e, "qname");
tms[i] =
new TypeMapping (DOMUtils.getAttribute (e, "encodingStyle"),
- new QName (nsURI, localPart),
+ qname,
DOMUtils.getAttribute (e, "javaType"),
DOMUtils.getAttribute (e, "java2XMLClassName"),
DOMUtils.getAttribute (e, "xml2JavaClassName"));
@@ -738,8 +748,23 @@
opts.append( props.toString() );
return header + body + "methods='" + methodsStrbuf + "', " +
- "faultListener='" + lis + "', " + "mappings='" + mappings + "'], " +
+ "faultListener='" + lis + "', " + "mappings='" +
+ mappingsToString(mappings) + "'], " +
"opts='" + opts ;
+ }
+
+ private static String mappingsToString(TypeMapping[] mappings) {
+ if (mappings != null) {
+ StringBuffer strBuf = new StringBuffer();
+
+ for (int i = 0; i < mappings.length; i++) {
+ strBuf.append((i > 0 ? " " : "") + mappings[i]);
+ }
+
+ return strBuf.toString();
+ } else {
+ return null;
+ }
}
/**
1.10 +1 -0 xml-soap/java/src/org/apache/soap/server/TypeMappingSerializer.java
Index: TypeMappingSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/TypeMappingSerializer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TypeMappingSerializer.java 2001/11/13 18:26:23 1.9
+++ TypeMappingSerializer.java 2001/11/13 18:28:35 1.10
@@ -72,6 +72,7 @@
* Serialize and deserialize type mappings according to SOAP-Enc.
*
* @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
*/
public class TypeMappingSerializer implements Serializer, Deserializer {
/**