I've never used these particular method signatures but you will have to create an array of body elements to return. You can't use the input elements (from the request) to get hold of the response SOAP envelope. You need to create a new array of reponse elements, to return, there is no point in returning the input elements. Axis will put those elements into a SOAP message that it creates to send back to the client.
Tony
"Reuben Christie" <[EMAIL PROTECTED]> wrote on 08/12/2004 17:42:03:
> 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>
>
>
- how to add child to SOAPBodyElement Reuben Christie
- tony . q . weddle