Support Forum [ All Topics | New Topic ]

Thread: Login giving Null Pointer Exception in Java

hi. I  login to Rapnet and do further operation on rapnet (like import rap price, upload Diamond, delete Diamond). Every thing was working perfectly before. but eventually Login request throwing Null Pointer Exceptions.. below is my cdde for Login..


private static final String TECHNET_NAMESPACE_PREFIX = "technet";
private static final String WEBSERVICE_SECURE_URL
= "https://technet.rapaport.com/webservices/prices/rapaportprices.asmx";
private static final String WEBSERVICE_INSECURE_URL
= "http://technet.rapaport.com/webservices/prices/rapaportprices.asmx";




private String login(String username, String password) throws SOAPException {
final SOAPMessage soapMessage = getSoapMessage();
final SOAPBody soapBody = soapMessage.getSOAPBody();
final SOAPElement loginElement = soapBody.addChildElement("Login", TECHNET_NAMESPACE_PREFIX);
loginElement.addChildElement("Username", TECHNET_NAMESPACE_PREFIX).addTextNode(username);
loginElement.addChildElement("Password", TECHNET_NAMESPACE_PREFIX).addTextNode(password);
soapMessage.saveChanges();
final SOAPConnection soapConnection = getSoapConnection();
final SOAPMessage soapMessageReply = soapConnection.call(soapMessage, WEBSERVICE_SECURE_URL);
final String textContent = soapMessageReply.getSOAPHeader().getFirstChild().getTextContent();
soapConnection.close();
return textContent;
}


red color line throwing exception....

i don't understand what happened. because it was working perfectly till now. 

Thanks and Regards

Digesh Patel (Ph. : 9909531610)


>> add a comment
Digesh Patel
01/08/2019 03:52


1 Replies:

Digesh Patel,
Thank you for contacting the TechNet Support Forum. 
I did test the Soap Login API using your username/password that I have on file and this works fine.

Does the login API not work at all now?
Also, could the account password have been changed?  Please let me know at tech@diamonds.net.

Sometimes the account password is changed and it now differs from the password used by TechNet  API.  We can fix that - please let me know and your customer service rep.

>> add a comment
Tech customer support - Zalman
1/8/2019 5:32:00 AM