|
Hello fellow programmers,
I would be ecstatic if anybody could give me some insight into what exactly
is going on here!
Client Code:
public class adminHandlerClient
{ static String router = "http://localhost:8081/axis/adminDirect/"; static String service = "adminDirectService.wsdl"; static String url=""http://localhost:8080/axis/services/adminHandlerServicePort">http://localhost:8080/axis/services/adminHandlerServicePort"; public static void main(String[] args) { try { ServiceFactory sf = ServiceFactory.newInstance(); URL u = new URL(router + "/" + service); QName serviceName = new QName(url,"adminHandlerService"); Service s = sf.createService(u,serviceName);
QName portName = new QName(url,"adminHandlerServicePort");
List handlerChain =
s.getHandlerRegistry().getHandlerChain(portName);
HandlerInfo hi = new HandlerInfo(LoggingHandler.class,null,null); handlerChain.add(hi);
//Checking for proper syntax of
call
if (args.length==0) { System.err.println("Incorrect usage of Client. Please use the following:"); System.err.println("adminHandlerClient" + " [Group Name]" + " [Password]" + " [Account Name]" + " [XML Path]" ); } else { System.out.println("Thank You. Processing. . .");
String groupName =
args[0];
System.out.println("Group Name Received."); . .
.
System.out.println(xmlData);
if(s == null)
System.out.println("Yikes"); //<!!---THIS LINE IS CAUSING AN
ERROR---!>
boolean success = handler.postReport(groupName,
password, accountName, xmlData);
} } catch(Exception e) { System.err.println("Error running Client:"); System.err.println(e); e.printStackTrace(); } } Command Line Stream:
- requestor request
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <postReport xmlns="http://localhost:8080/axis/services/adminHandlerServicePort"> <groupName>LibCorner</groupName> <password>monkeyboy</password> <accountName>Georgia</accountName> <xmlData><page></page></xmlData> </postReport> </soapenv:Body> </soapenv:Envelope> - requestor response - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>java.lang.NullPointerException</faultstring> <detail/> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> Error running Client: java.lang.NullPointerException AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.NullPointerException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.NullPointerException faultActor: faultNode: faultDetail: I humbly beg for your assistance,
James
|
