1 23 package com.sun.enterprise.management.j2ee; 24 25 import java.io.IOException ; 26 import java.io.Serializable ; 27 import java.util.Set ; 28 import java.util.Iterator ; 29 import java.util.Map ; 30 31 import javax.management.ObjectName ; 32 import javax.management.InstanceNotFoundException ; 33 34 import com.sun.appserv.management.base.AMX; 35 import com.sun.appserv.management.base.QueryMgr; 36 import com.sun.appserv.management.base.XTypes; 37 import com.sun.appserv.management.base.Util; 38 import com.sun.appserv.management.j2ee.WebServiceEndpoint; 39 import com.sun.appserv.management.j2ee.J2EETypes; 40 import com.sun.appserv.management.ext.wsmgmt.MessageTrace; 41 import com.sun.appserv.management.ext.wsmgmt.MessageTraceImpl; 42 43 44 import com.sun.enterprise.management.AMXTestBase; 45 import com.sun.enterprise.management.Capabilities; 46 47 48 50 public final class WSMsgTraceTest extends AMXTestBase 51 { 52 public 53 WSMsgTraceTest( ) 54 throws IOException 55 { 56 } 57 58 public void 59 testMessageTrace() 60 throws ClassNotFoundException 61 { 62 final Set <WebServiceEndpoint> s = 63 getQueryMgr().queryJ2EETypeSet(J2EETypes.WEB_SERVICE_ENDPOINT); 64 65 for( final WebServiceEndpoint wsp : s ) 66 { 67 MessageTrace[] msgs = wsp.getMessagesInHistory(); 68 if ( msgs == null) { 69 System.out.println(" No messages collected " ); 70 return; 71 } 72 System.out.println(" Collected messages " + msgs.length); 73 for ( int idx =0; idx < msgs.length; idx++) { 74 final MessageTrace msg = msgs[idx]; 75 76 System.out.println(" message id " + msg.getMessageID()); 77 System.out.println(" application id " + msg.getApplicationID()); 78 System.out.println(" endpoint name " + msg.getEndpointName()); 79 System.out.println(" response size " + msg.getResponseSize()); 80 System.out.println(" request size " + msg.getRequestSize()); 81 System.out.println(" transport type is " + 82 msg.getTransportType()); 83 System.out.println(" request headers are " + 84 msg.getHTTPRequestHeaders() ); 85 System.out.println(" response headers are " + 86 msg.getHTTPResponseHeaders() ); 87 System.out.println(" fault code is " + msg.getFaultCode()); 88 System.out.println(" fault string is " + msg.getFaultString()); 89 System.out.println(" fault actor is " + msg.getFaultActor()); 90 System.out.println(" client host is " + msg.getClientHost()); 91 System.out.println(" principal name is " + 92 msg.getPrincipalName()); 93 } 94 } 95 } 96 97 98 } 99 100 101 | Popular Tags |