axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davanum Srinivas (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Resolved: (AXIS-1769) Null Pointer when creating a SOAPEnvelope with a SOAP message containing a SOAP Fault
Date Fri, 21 Jan 2005 17:01:17 GMT
     [ http://issues.apache.org/jira/browse/AXIS-1769?page=history ]
     
Davanum Srinivas resolved AXIS-1769:
------------------------------------

    Resolution: Fixed

Fixed. Thanks.

-- dims

> Null Pointer when creating a SOAPEnvelope with a SOAP message containing a SOAP Fault
> -------------------------------------------------------------------------------------
>
>          Key: AXIS-1769
>          URL: http://issues.apache.org/jira/browse/AXIS-1769
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: Windows XP
>     Reporter: Joshua Hendrick

>
> When creating a SOAPEnvelope with a SOAP message containing a SOAP Fault a NullPointerException
is thrown.  Here is sample code to reproduce the issue:
>     public static void main(String[] args) {
>         String msg = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
>                      "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+
>                      "	<SOAP-ENV:Body>" +
>                      "		<SOAP-ENV:Fault>" +
>                      "			<faultcode>A code</faultcode>" +
>                      "			<faultstring>This is a fault.</faultstring>" +
>                      "			<faultactor>actor</faultactor>" +
>                      "		</SOAP-ENV:Fault>" +
>                      "	</SOAP-ENV:Body>" +
>                      "</SOAP-ENV:Envelope>";
>         try {
>             StringBufferInputStream in =
>                 new StringBufferInputStream(msg.toString());
>             // NPE stems from this call
>             SOAPEnvelope env = new SOAPEnvelope(in);
>             Call call = new Call("http://ws1.parasoft.com/glue/store-01");
>             call.invoke(env);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
> Here is the fix I put in to stop this from occuring in org.apache.axis.encoding.DeserializationContext
in method getTypeMapping():
>     public TypeMapping getTypeMapping()
>     {
>         if (msgContext == null || msgContext.getTypeMappingRegistry() == null) {
>             return (TypeMapping) new org.apache.axis.encoding.TypeMappingRegistryImpl().getTypeMapping(
>                     null);
>         }
>         TypeMappingRegistry tmr = msgContext.getTypeMappingRegistry();
>         return (TypeMapping) tmr.getTypeMapping(getEncodingStyle());
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message