Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis client with documents  RSS feed

Avin Nar
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok here is what I need to do:

I need to write an Axis client for ""

I want to do the dynamic invocation and not create stubs out of the wsdl.
I have no clue of how to go about doing this. Can anyone help me out ?

The WSDL for the file is given in the above URL.

Can someone modify the sample code I have below to accomodate this ?


import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.enum.Style;
import org.apache.axis.enum.Use;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.message.SOAPEnvelope;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.apache.axis.utils.XMLUtils;
import java.util.Vector;

public class DocClient

public static void main(String[] args)
* NOTE: The web service uses document style
* eg:
*<service name="MyDocSample" provider="java:RPC" style="document" use="literal">
String url = "http://localhost:8080/ws/services/MyDocSample";
Service service = new Service();
Call call = (Call) service.createCall();
String param= "hello";

*construct the XML document
SOAPBodyElement[] input = new SOAPBodyElement[1];

input[0] = new SOAPBodyElement(XMLUtils.StringToElement("",
"echo", param));
Vector elems = (Vector) call.invoke( input );

SOAPBodyElement elem = (SOAPBodyElement) elems.get(0);
Element e = elem.getAsDOM();
System.out.println("returned value: " + XMLUtils.ElementToString(e)); }
catch (Throwable t)
William Barnes
Ranch Hand
Posts: 1046
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an article which talks about this.
Let us know what you learn.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!