java - Print Axis2 Request Response XML -
i want print raw request response xml console. have created stubs using wsdl2java axis2.
wsdl2java has created 2 java files, 1 stub , 1 callbackhandler.
i trying below method getting null value
operationcontext.getmessagecontext("out"); / operationcontext.getmessagecontext("in");.
code
public void soaploghandler(stub stub){ servicecontext serviceconxt = stub._getserviceclient().getservicecontext(); //**** enable cache hold last operation operationcontext operationcontext = new operationcontext(); boolean cachelastoperationcontext = true; operationcontext.setcomplete(true); // enable cache value serviceconxt.setcachingoperationcontext(cachelastoperationcontext); serviceconxt.setlastoperationcontext(operationcontext); operationcontext operationcontext = serviceconxt.getlastoperationcontext(); if (operationcontext != null) { messagecontext outmessagecontext = operationcontext.getmessagecontext("out"); operationcontext.getmessagecontexts(); if (outmessagecontext != null) { system.out.println("out soap: "+outmessagecontext.getenvelope().tostring()); } messagecontext inmessagecontext = operationcontext.getmessagecontext("in"); if (inmessagecontext != null) { system.out.println("in soap: "+ inmessagecontext.getenvelope().tostring()); } }
can please let me know there other way raw xml
unfortunately unless intercept message via tcp monitor, have tough time getting raw message.
Comments
Post a Comment