-
Type:
Regression Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: Master
-
Fix Version/s: 7.0.0 DXP FP89, 7.0.10.13 DXP SP13, 7.0.X, 7.1.10 DXP FP17, 7.1.10.4 SP4, 7.1.X, 7.2.10 DXP FP4, 7.2.X, 7.3.0 CE GA1, 7.3.10 DXP GA1, Master
-
Component/s: Web Services > SOAP
-
Branch Version/s:7.2.x, 7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Last Working Version:
-
Git Pull Request:
Description
A NullPointerException is thrown when a SOAP Service call is made to the addUser operation with fewer arguments.
Context
The addUser operation has overloaded methods, where one method has fewer arguments than the other method.
- Method with fewer arguments: UserServiceSoap.java#L211-L221
- Method with more arguments: UserServiceSoap.java#L294-L310
The bug is reproduced when making a service call to the method with fewer arguments.
Issue
When making a SOAP Service call with the addUser operation to the method with fewer arguments, the call actually ends up at the method with more arguments.
As a result, a NullPointerException is encountered, due to the unexpected additional arguments that are now being provided as nulls.
Steps to Reproduce
- Startup Liferay with 7.2 DXP with Fix Pack 3
- Setup Postman (or any other tool that can send SOAP requests)
- Create Request in Postman
- Option 1: Import the attached script into Postman (see section below - Additional Resource: Postman Script)
- Option 2: Prepare a POST request to: http://localhost:8080/api/axis/Portal_UserService?wsdl
- Navigate to 'Authorization' tab
- Input the test Liferay user's credentials (e.g. test@liferay.com//test)
- Navigate to 'Headers' tab
- Add the following Header:
- Key: SOAPAction
- Value:
- Add the following Header:
- Navigate to the 'Body' tab
- Input the following SOAP body:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:http.service.portal.liferay.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <soapenv:Header/> <soapenv:Body> <urn:addUser soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <companyId xsi:type="xsd:long">20101</companyId> <autoPassword xsi:type="xsd:boolean">false</autoPassword> <password1 xsi:type="xsd:string">test</password1> <password2 xsi:type="xsd:string">test</password2> <autoScreenName xsi:type="xsd:boolean">false</autoScreenName> <screenName xsi:type="xsd:string">testSoapUser</screenName> <emailAddress xsi:type="xsd:string">testSoapUser@liferay.com</emailAddress> <facebookId xsi:type="xsd:long">0</facebookId> <openId xsi:type="xsd:string"></openId> <locale xsi:type="xsd:string"></locale> <firstName xsi:type="xsd:string">TestSoapUser</firstName> <middleName xsi:type="xsd:string"></middleName> <lastName xsi:type="xsd:string">Test</lastName> <prefixId xsi:type="xsd:long">0</prefixId> <suffixId xsi:type="xsd:long">0</suffixId> <male xsi:type="xsd:boolean">true</male> <birthdayMonth xsi:type="xsd:int">1</birthdayMonth> <birthdayDay xsi:type="xsd:int">1</birthdayDay> <birthdayYear xsi:type="xsd:int">2019</birthdayYear> <jobTitle xsi:type="xsd:string">User</jobTitle> <groupIds xsi:type="urn:ArrayOf_xsd_long" soapenc:arrayType="xsd:long[]"/> <organizationIds xsi:type="urn:ArrayOf_xsd_long" soapenc:arrayType="xsd:long[]"/> <roleIds xsi:type="urn:ArrayOf_xsd_long" soapenc:arrayType="xsd:long[]"/> <userGroupIds xsi:type="urn:ArrayOf_xsd_long" soapenc:arrayType="xsd:long[]"/> <sendEmail xsi:type="xsd:boolean">false</sendEmail> <serviceContext xsi:type="ser:ServiceContext" xmlns:ser="http://service.kernel.portal.liferay.com"/> </urn:addUser> </soapenv:Body> </soapenv:Envelope>
- Note: Modify the companyId to your Liferay Instance's companyId, if needed
- Input the following SOAP body:
- Navigate to 'Authorization' tab
- Click Send
Expected Results:
No errors are encountered and the user: TestSoapUser is successfully created
Actual Results:
NullPointerException is encountered
Additional Resource: Postman Script
Here is also a copy of the Postman script that's based on the steps above: SOAP - NPE - POC.postman_collection.json
This can be imported within Postman: https://learning.getpostman.com/docs/postman/collections/data-formats/#importing-postman-data
Additional Test Results - Works with 7.2 DXP SP1 (Fix Pack 2)
- Startup Liferay with 7.2 DXP SP1
- Follow steps 2-4
Result:
No errors are encountered and the user: TestSoapUser is successfully created
- is caused by
-
LPS-104001 Patch axis to prevent random overload methods wsdd generation failures
- Closed