System.ArgumentNullException: Value cannot be null.

We have an application that utilizes the WCF-OracleDB adapter on a send port connecting to an Oracle database. The application sends insert statements to a stored procedure that inserts the data into one of the tables. The table has a column for City Fee Amount that allows NULL values. The schema that we populate the insert statement into contains a corresponding node called "P_CITY_FEE_AMT", that node is also set to allow null values. WE are running into an intermittent issue in which an error message is returned to BizTalk stating the value for field P_CITY_FEE_AMT cannot be NULL. We are not seeing any error messages in the Oracle database so it appears the error is being generated by the adapter. Any ideas as to why it would be generating an error like this when the schema and the target table both allow NULL values for this field?

Error Message:

A message sent to adapter "WCF-OracleDB" on send port "SendSproc" with URI "oracledb://test" is suspended. 
 Error details: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The value for field "P_CITY_FEE_AMT" is invalid. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: numStr
   at Oracle.DataAccess.Types.OracleDecimal..ctor(String numStr, String format)
   at Microsoft.Adapters.OracleCommon.OracleCommonMetadataUtils.CreateParameterValue(OracleDbType oracleType, Object xmlValue, OracleConnection dbConn, Boolean ignoreLOB, String fieldName)
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result) 
 MessageId:  {A4503B09-51A0-48B7-915C-753100D250A7}
 InstanceID: {D8DC8808-41B9-47CC-A790-ACA0963E5BFE

Insert Message:

<ns0:TSA103 xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/BIZTALK/Procedure">
	<ns0:P_CITY_FEE_AMT/>
	<ns0:P_NO_LOCATIONS_NBR>1</ns0:P_NO_LOCATIONS_NBR>
	<ns0:P_STATE_FEE_AMT>12.00</ns0:P_STATE_FEE_AMT>
	<ns0:P_DOC_LOC_NBR_REGION>1234567890</ns0:P_DOC_LOC_NBR_REGION>
	<ns0:P_DLN_OCCUR_ID_REGION>0</ns0:P_DLN_OCCUR_ID_REGION>
	<ns0:P_REGION_CD>MAR</ns0:P_REGION_CD>
	<ns0:P_UPDATE_IF_EXISTS_INDC>N</ns0:P_UPDATE_IF_EXISTS_INDC>
</ns0:TSA103>		
February 20th, 2015 9:13pm

Hi Bruce,

Have you configured SOAP Action Header property at WCF-OracleDB send port.

Refer the post-> https://social.msdn.microsoft.com/Forums/en-US/238fdee1-564e-45cc-be96-6215af682b1e/exception-on-outbound-map-with-wcforacledb-adapter-at-send-port-in-biztalk-2010?forum=biztalkr2adapters

For the alternate solution you can also refer the workaround mentioned here -> Error while inserting NULL value to Oracle database table using BizTalk

Rachit

Free Windows Admin Tool Kit Click here and download it now
February 20th, 2015 9:36pm

Yes, we have the SOAP Action Header configured correctly. This does not happen 100% of the time, but rather only about 5% to 10% of these messages error out. Had not considered the Use Ambient Transaction setting but will give that a try. We have a workaround of setting the value of the node to 0 so my main question was why this was happening in the first place. The second link you added seems to answer that question.

Thanks

Bruce

February 20th, 2015 10:34pm

There is a property in the WCF-Custom and WCF-OracleDB adapters called SkipNilNodes. When I use the NIL functoid to set a node to NULL, and the value of that property is set to TRUE the adapter generates the System.ArgumentNullException:Value cannot be null error. But when the value of the property is set to FALSE the adapter passes the NULL value through to the database. Thought this might be helpful in some cases.
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2015 11:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics