Calling a Radio service using JAX RPC and Axis
import javax.xml.rpc.Call; import javax.xml.rpc.ParameterMode; import javax.xml.rpc.namespace.QName; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; import org.apache.axis.transport.http.HTTPConstants;</xmp><xmp>public class HelloDave { public static void main(String args[]) throws Exception { Call call = (new Service()).createCall(); call.setTargetEndpointAddress(new java.net.URL(("http://127.0.0.1:5335/"))); call.setOperationName(new QName("", "helloWorld") ); call.addParameter("Name", XMLType.XSD_STRING, ParameterMode.PARAM_MODE_IN); call.setProperty(HTTPConstants.MC_HTTP_SOAPACTION, "/radio"); System.out.println(call.invoke(new Object[] {"Dave from Axis"})); } }</xmp>
Calling a Axis service using soap.rpc.client
on getQuote (name) {</xmp><xmp> local (quote, params={"symbol": name});</xmp><xmp> quote = soap.rpc.client ( actionURI: "/axis/servlet/AxisServlet", methodName: "getQuote", adrParams: @params, rpcServer: "nagoya.apache.org", rpcPort: 5049, username: "user1", password: "pass1", methodNamespace: "xdq", methodNamespaceURI: "urn:xmltoday-delayed-quotes" );</xmp><xmp> return ("Stock quote for " + name + " is " + quote)</xmp><xmp>}</xmp>
[Macro error: Poorly formed XML text, string constant is improperly formatted. (At character #421.)]