I use a java method getTestDate () in bpel mapping for optional element "docDate" type Date.
<copy>
<from>ns0:getTestDate($ArrestIn.arrestRequest/tns:MessageData/tns:AppData/tns:person/tns:docDate)</from>
<to>$ArrestOut.arrestResponse/tns:MessageData/tns:AppData/tns:person/tns:docDate</to>
</copy>
If this element contains in the request , then everything is ok.
Why if this element doesn`t contain in the request, then throws NullPointerException?
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring><![CDATA[BPCOR-6135: A fault was not handled in the process scope; Fault Name is {http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling}java.lang.NullPointerException; Fault Data is <?xml version="1.0" encoding="UTF-8"?><jbi:message xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper" xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" type="sxeh:faultMessage" version="1.0"><jbi:part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" xsi:type="sxeh:ErrorInfoType"><pojoException xmlns="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling"><class>myutils.MyUtils</class><operation/><exception>java.lang.NullPointerException</exception><activity>Assign1</activity><activityLineNumber>28</activityLineNumber><message/><cause/><stackTrace>java.lang.NullPointerException&#13;
at com.sun.jbi.engine.bpel.core.bpel.xpath.functions.POJOFunction.getType(POJOFunction.java:141)&#13
Java metod
public static String getTestDate(String date){
return "2001-01-01";
}