There are plenty of post in the archives regarding the TCPMon which none I could find my answer that I was looking for. Here is my situation.
I have an axis client written in java. I have attached this client to this email for your viewing. I did not use java2WSDL ant task to create this client. I start the TCPMon in window 2000 with the listen port=1234, target host= 127.0.0.1 and the target port to 8080. When I run my client I don't see anything in the TCPMon applet under "port 1234" tab. How do I make my java axis client to listen on port 1234?
Thanks a lot,
Tony.
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
package apacheaxis; import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.utils.Options;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import java.util.*;
public class Client
{
public static void main(String [] args) throws Exception
{
Options options = new Options(args);
Request req = new Request(); //here is the complex object
Param busLocId = new Param(); //here is the 1st bean
busLocId.setName("BUSINESS_LOCATION_ID");
busLocId.setValue("100889567");
ArrayList inparams = new ArrayList(3); //here is the array list
inparams.add(busLocId);
req.setParams(inparams); //stuff the array list inside of a Complex object
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:PublicService4", "Request" );
call.registerTypeMapping(Request.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory(Request.class, qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(Request.class, qn));
QName qn1 = new QName( "urn:PublicService4", "Response" );
call.registerTypeMapping(Response.class, qn1,
new org.apache.axis.encoding.ser.BeanSerializerFactory(Response.class, qn1),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(Response.class, qn1));
QName qn2= new QName( "urn:PublicService4", "Param" );
call.registerTypeMapping(Param.class, qn2,
new org.apache.axis.encoding.ser.BeanSerializerFactory(Param.class, qn2),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(Param.class, qn2));
Response resp=null;
try {
String url = options.getURL();
System.out.println("URL:"+ url);
call.setTargetEndpointAddress( new java.net.URL(url) );
call.setOperationName( new QName("PublicService4", "getSeveralBusinessLocation") );
call.addParameter( "arg1", qn, ParameterMode.IN );
call.setReturnClass(Response.class);
resp = (Response) call.invoke( new Object[] { req } );
} catch (AxisFault fault) {
String error = "Error : " + fault.toString();
System.out.println(error);
}
System.out.println("Name Value");
System.out.println("------------------------");
Collection result = resp.getParams();
Iterator itr = result.iterator();
while(itr.hasNext()){
Param p = (Param)itr.next();
String name = p.getName();
String value = (String)p.getValue();
System.out.println(name+" "+value);
}
}
}
