Author: thomas.diesler(a)jboss.com
Date: 2006-10-27 13:09:42 -0400 (Fri, 27 Oct 2006)
New Revision: 1327
Modified:
trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java
trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java
Log:
Warn on xmlType == null
Prevent NPE when xmlType == null
Modified: trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-10-27 16:07:39
UTC (rev 1326)
+++ trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-10-27 17:09:42
UTC (rev 1327)
@@ -34,7 +34,6 @@
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.holders.Holder;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.SOAPException;
@@ -189,7 +188,11 @@
QName xmlName = paramMetaData.getXmlName();
QName xmlType = paramMetaData.getXmlType();
Class javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+ if (xmlType == null)
+ throw new IllegalStateException("Cannot obtain xml type for:
[xmlName=" + xmlName + ",javaName=" + javaName + "]");
+
Object retValue = paramValue;
// Handle attachment part
Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-10-27
16:07:39 UTC (rev 1326)
+++ trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-10-27
17:09:42 UTC (rev 1327)
@@ -297,20 +297,23 @@
TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
JAXBRIContext jaxbCtx = getJAXBContext(epMetaData);
- try
+ QName xmlName = paramMetaData.getXmlName();
+ QName xmlType = paramMetaData.getXmlType();
+ Class javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+
+ if (xmlType == null)
{
- QName xmlName = paramMetaData.getXmlName();
- QName xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName,
paramMetaData.getJavaType()));
+ xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
+ if (xmlType == null)
+ log.warn("Cannot obtain xml type for: [xmlName=" + xmlName +
",javaName=" + javaName + "]");
+
if (xmlType != null)
{
paramMetaData.setXmlType(xmlType);
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType,
paramMetaData.getJavaTypeName()));
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
}
}
- catch (Exception ex)
- {
- log.warn("Cannot obtain xmlType for: " + paramMetaData.getXmlName());
- }
}
protected void processSOAPBinding(EndpointMetaData epMetaData, Class wsClass)
Show replies by date