Author: thomas.diesler(a)jboss.com
Date: 2006-11-21 14:32:58 -0500 (Tue, 21 Nov 2006)
New Revision: 1491
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java
Log:
Prevent NPE on on fault with no xmlType
[JBWS-1303] Unmarshall issue with xsi:type specified bean property
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java 2006-11-21
19:27:40 UTC (rev 1490)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java 2006-11-21
19:32:58 UTC (rev 1491)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.ws.jaxrpc.jbws1303;
-// $Id$
+// $Id:JBWS1303TestCase.java 1490 2006-11-21 19:27:40Z thomas.diesler(a)jboss.com $
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
@@ -61,11 +61,6 @@
public void testEndpoint() throws Exception
{
- if (true)
- {
- System.out.println("FIXME: JBWS-1303");
- return;
- }
Lastmod lastmod = new Lastmod("yesterday");
LastmodResponse lastmodRes = port.lastmod(lastmod);
assertEquals("yesterday", lastmodRes.getTimeChanged());
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java 2006-11-21
19:27:40 UTC (rev 1490)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java 2006-11-21
19:32:58 UTC (rev 1491)
@@ -27,8 +27,11 @@
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
+import org.jboss.ws.Constants;
+
public class ServerHandler extends GenericHandler
{
public QName[] getHeaders()
@@ -37,11 +40,11 @@
}
/**
- * <env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ * <env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
* <env:Header/>
* <env:Body>
* <lastmodResponse xmlns='http://netid.msu.edu:8080/lastmod.pl'>
- * <TimeChanged
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:type='string'>yesterday</TimeChanged>
+ * <TimeChanged
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:type='xsd:string'>yesterday</TimeChanged>
* </lastmodResponse>
* </env:Body>
* </env:Envelope>
@@ -51,11 +54,13 @@
try
{
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+ soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_XSD,
Constants.NS_SCHEMA_XSD);
SOAPElement bodyElement =
soapMessage.getSOAPBody().addChildElement("lastmodResponse");
bodyElement.setAttribute("xmlns",
"http://netid.msu.edu:8080/lastmod.pl");
SOAPElement soapElement = bodyElement.addChildElement("TimeChanged");
- soapElement.addNamespaceDeclaration("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
- soapElement.setAttribute("xsi:type", "string");
+ soapElement.addNamespaceDeclaration(Constants.PREFIX_XSI,
Constants.NS_SCHEMA_XSI);
+ soapElement.setAttribute("xsi:type", "xsd:string");
soapElement.setValue("yesterday");
((SOAPMessageContext)msgContext).setMessage(soapMessage);
}