-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException creating a DataCollection #262
Comments
Update: apparently, this is triggered by a bug in suds-jurko. You may skip to the conclusion below. 😄 Analysissuds-jurkoDebugging the situation sketched above: >>> dc = client.new("dataCollection")
>>> dc.create()
Traceback (most recent call last):
...
icat.exception.ICATInternalError: INTERNAL org.icatproject.core.IcatException Looking at the SOAP message that the client sends to the server: <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://icatproject.org" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns0:create>
<sessionId>b514b463-e45b-4317-bcf7-1502d7a702dc</sessionId>
</ns0:create>
</ns1:Body>
</SOAP-ENV:Envelope> This is clearly broken. Trying a variant, it works: >>> dc = client.new("dataCollection", id=0)
>>> dc.create()
>>> dc.id
28 The SOAP message now looks like: <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://icatproject.org" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns0:create>
<sessionId>b514b463-e45b-4317-bcf7-1502d7a702dc</sessionId>
<bean xsi:type="ns0:dataCollection">
<id>0</id>
</bean>
</ns0:create>
</ns1:Body>
</SOAP-ENV:Envelope> suds-communityTrying the first version using suds-community works: >>> dc = client.new("dataCollection")
>>> dc.create()
>>> dc.id
27 The SOAP message that suds-community sends to the server looks like: <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://icatproject.org" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns0:create>
<sessionId>69a36d8a-41ec-4beb-85b2-377ed8badf96</sessionId>
<bean xsi:type="ns0:dataCollection"/>
</ns0:create>
</ns1:Body>
</SOAP-ENV:Envelope> ConclusionThe issue is triggered by a bug in suds-jurko. Both suds versions leave out unset attributes when sending the SOAP message to the server, which is correct. But suds-jurko leaves out the entire Nevertheless, I still maintain that this is also a bug in icat.server: it should reply either with a |
Creating an empty
DataCollection
having no content and no attributes set causes aNullPointerException
inicat.server
:The relevant bits of the icat.log:
The text was updated successfully, but these errors were encountered: