You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by NY...@aol.com on 2004/07/01 23:39:47 UTC
Frustration! Unpredictable Axis Output?
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/_
(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/_ (http://schemas.xmlsoap.org/soap/envelope/) " xmlns:xsd="_http://www_
(http://www)
w3.org/2001/XMLSchema"
xmlns:xsi="_http://www.w3.org/2001/XMLSchema-instance_ (http://www.w3.org/2001/XMLSchema-instance) ">
<soapenv:Body>
<postReport
xmlns="_http://localhost:8080/axis/services/adminHandlerServicePort_ (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/_ (http://schemas.xmlsoap.org/soap/envelope/) " xmlns:xsd="_http://www_
(http://www)
w3.org/2001/XMLSchema"
xmlns:xsi="_http://www.w3.org/2001/XMLSchema-instance_ (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