java - Spring MVC - "IllegalArgumentException: Object reference not set to an instance of an object" when get SOAP response -
i'm beginner in spring mvc. want response soap web service. error message.
here source code.
private static final string get_document_soap_action = "apvx:bus:reportgenerator:{1d81bedf-3894-45b2-99c9-95e50b1b9494}/document_get"; @autowired protected pathcentralwstemplatefactory webservicetemplatefactory; public documentgetresponse documentget(documentget request) { try { return (documentgetresponse) webservicetemplatefactory.getclient().marshalsendandreceive(request, getcallback(get_document_soap_action)); } catch (exception e) { throw new illegalargumentexception(e); } }
pathcentralwstemplatefactoryimpl
public pathcentralwstemplatefactoryimpl() throws soapexception { marshaller = new jaxb2marshaller(); messagefactory = new saajsoapmessagefactory(); messagefactory obj = messagefactory.newinstance(soapconstants.soap_1_1_protocol); if(obj != null){ ((saajsoapmessagefactory) messagefactory).setmessagefactory(obj); } ((saajsoapmessagefactory) messagefactory).setsoapversion(org.springframework.ws.soap.soapversion.soap_11); url = "https://www.mypathcentral.net/..."; } @override public webservicetemplate getclient() { webservicetemplate webservicetemplate = new webservicetemplate(messagefactory); webservicetemplate.setmarshaller(marshaller); webservicetemplate.setunmarshaller((unmarshaller) marshaller); webservicetemplate.setdefaulturi(url); webservicetemplate.setmessagesender(getmessagesender()); return webservicetemplate; }
i'm not familiar framework have going on here have idea what's wrong code. getting message says no object reference. believe because declaring get_document_soap_action static final. static keyword causes system allocate static memory outside of heap separate object. think if declare string standard object might clear issue i'm not sure if cause problems rest of code.