function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
k209310k209310 

Axis Fault: Non nillable element type is null

Hi there

I have just downloaded a new Partner WSDL (The first one for a while) and am having problems with the build. When I build the WSDL (using wsdl4java) and try to run a simple unit test that creates a new Account object I am presented with the following exception.

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
 faultActor:
 faultNode:
 faultDetail:
    {http://xml.apache.org/axis/}stackTrace:java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
    at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:732)
    at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:414)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:799)
    at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
    at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
    at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.client.Call.invoke(Call.java:2757)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.enterprise.SoapBindingStub.create(SoapBindingStub.java:1633)
    at com.pctfiler.salesforce.SalesForceQuery.create(SalesForceQuery.java:165)
    at com.pctfiler.salesforce.test.AbstractSalesForceTestCase.createAccount(AbstractSalesForceTestCase.java:88)
    at com.pctfiler.salesforce.TestAbstractSalesForceTestCase.testSimple(TestAbstractSalesForceTestCase.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

    {http://xml.apache.org/axis/}hostname:CHRIS

java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.client.Call.invoke(Call.java:2760)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.enterprise.SoapBindingStub.create(SoapBindingStub.java:1633)
    at com.pctfiler.salesforce.SalesForceQuery.create(SalesForceQuery.java:165)
    at com.pctfiler.salesforce.test.AbstractSalesForceTestCase.createAccount(AbstractSalesForceTestCase.java:88)
    at com.pctfiler.salesforce.TestAbstractSalesForceTestCase.testSimple(TestAbstractSalesForceTestCase.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
    at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:732)
    at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:414)
    at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1502)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:978)
    at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:799)
    at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
    at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
    at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
    at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
    at org.apache.axis.client.Call.invoke(Call.java:2757)
    ... 23 more

I am not doing anything differently here as I have in previous new builds. I have noticed tho that the endpoint URL is now

https://www.salesforce.com/services/Soap/u/9.0

The last time I ran a WSDL update this was

https://www.salesforce.com/services/Soap/u/8.0

Does anyone have any ideas as to what is going on here?

Thanks

Chris


SuperfellSuperfell
Axis has noticed that there's an element that declared in the WSDL as not supporting a NULL value, but the object you passed it to be serialized has null for this property, and as it know's that won't be accepted, it throws an exception telling you this. It would appear that you forgot to set the type property on the SObject.
k209310k209310
Why then all of a sudden is Axis returning me this error? In previous builds I have been returned an exception from salesforce detailing any problem fields within the SObject that I was trying to write.
MilanMilan
All yopu have to do is verify which element is it complaininmg about. Is it null in your request ? If yes, you need to understand that it cannot be null.
 
Once you find that element you can see if there was a difference in its definition in the 2 version , if at all that exercise if of any meaning.
 
Cheers,
Milan
 
 
Santosh ChakrapaniSantosh Chakrapani

SObject has a type attribute. If you are using Partner WSDL, then in order to successfully insert/update records in Salesforce, you need to set

the setType('Account')