Hi i m newbie. and trying to learn SOAP. I wrote sample messege style
service.it gets deployed well but when i try to add a new SOAPBodyElement
inside the webservice method the following fault code is return back to
client. anybody can please help me learning this part.
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<detail>
<ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">ws20</ns1:hostname>
</detail>
</soapenv:Fault>
Here is my code for webservice method
public SOAPBodyElement[] listAssets(SOAPBodyElement[] bodies) throws
SOAPException {
for (int i = 0; i < bodies.length; i++) {
SOAPBodyElement element = bodies[i];
SOAPEnvelope
envlp=element.getEnvelope();
SOAPBody body=(SOAPBody)
envlp.getBody();
body.addBodyElement(envlp.createName("childAsset"));
}
return bodies;
}
I have tried other methods also using the signature
public Element[] listAssets(Element[] bodies) but that also doesnt work.
here is my wsdd file
<service name="assetservice" provider="java:MSG" style="message">
<parameter name="className"
value="com.decisiontech.framework.demo.ListAssetService" />
<parameter name="allowedMethods" value="listAssets" />
</service>