- This topic has 7 replies, 3 voices, and was last updated 17 years, 6 months ago by d_pavel.
-
AuthorPosts
-
d_pavelMember1) How can one trace the SOAP message exchange when using MyEclipse/Xfire for developing web services ?
2) Did anybody enabled SOAP tracing when deploying the web services on JBoss ?
Any suggestions are greatly appreciated.
Thanks in advance,
Dragos
tomekszMemberAnswer is here : http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-16920.html
d_pavelMemberThank you very much tomeksz.
d_pavelMemberOK it was suggested the following:
You can use TCPMON ( the one build in MyEclipse or from https://tcpmon.dev.java.net/ ).
You can also tell XFire to log all traffic to file, see http://xfire.codehaus.org/Logging1)TCPMON is great but only works for HTTP ( = Proxy that sniffs and shows HTTP messages and responses, both SOAP and plain HTTP ). If I am building a service client for a https:// endpoint I can not use TCPMON… How can one test/debug locally this kind of service (for HTTPS) ? Can we do a loop back to the same server (not to point to the target remote server for which we have to provide the hostname and port – well 443 for HTTPS) using a fictive HTTP URL ? I suppose not, correct me if I’m wrong, but you need a valid QName qualified name when constructing the endpoint for your web service.
I looked on the web for HTTPS monitors, there are a bunch of them out there can you recommend one of them ?
2)For the TCP/IP monitor inside MyEclipse I will have to change the endpoint insted of the real one (for the target server) to another endpoint where TCPMON can listen (In order to route the Web service through the monitor, the endpoint of the Web service client needs to be changed). Again useless if I build a service for HTTPS, the MyEclipse TCP/IP monitor is based probably on the same TCPMON libraries. Beside I don’t want to change the code everytime when I have to test something….
Can I build a service for a HTTP endpoint and redirect later through TCP/IP monitor to a HTTPS remote server ?
3) I think the best solution will be enabling XFire logging.
Can we have a feed back from XFire on how precisely can we do this please? I followed the steps from their website (see link above) but I was not succesful.
More precise I introduced the related handlers in the code (Tell XFire to cache a DOM document, Add a logging handler to each flow) and I put the log4j.properties file in the WEB-INF lib directory in order to be available on the classpath when deploying but it didn’t work. I am missing something here ? PLEASE help me to enable log tracing in order to debug locally because I don’t want to ask from the remote server to send me the SOAP in order to debug the related web service client…. So because MyEclipse redistributed XFire libraries, please let us know where should we place properly the properties file for log4j and how can we configure the XFire wehre to write to the log (we should be able to do that thorogh the log4j.properties). How the log4j classes should be encapsulated in the XFire webservice project ?PLEASE help me with XFire logging. This is really important.
Thanks in advance.
Riyad KallaMemberMoving to OT > Soft Dev
This is an XFire-specific question, please consider posting on the XFire forums to ensure faster turn-around time.
tomekszMemberThis is not XFire specific, but Log4j specific 🙂 You must put this properties at the root of classloader, e.g. in classes directory ( you can check XFire examples ).
d_pavelMemberOK I fixed the XFire logging, thanks. I can see all xfire invocations and stuff but no SOAP messages exchanged. So this is not solving my problem.
How can one debug the web services developed with MyEclipse(Xfire)?
In order to debug these webservices we need to trace/monitor the outgoing and incoming SOAP mesages.
I need suggestions particularly when developing endpoint services for HTTPS.
If you developed something like that please share your knowledge.
Thanks
d_pavelMemberHi All,
I was trying to use the DOMInHandler and DOMOutHandler in order to fetch the SOAP messages using XFire logging with no success. I created my own Handler etc as described on the XFire website but the console output contains only org.codehaus.xfire.handler.HandlerPipeline invocations but no SOAP messages.
FYI I was following :
http://xfire.codehaus.org/MessageContext – getting at the xml
http://xfire.codehaus.org/FAQ – add custom handler
and especial this post:
http://www.mail-archive.com/user@xfire.codehaus.org/msg02896.htmlThis is my handler:
package xyz; import org.codehaus.xfire.MessageContext; import org.codehaus.xfire.handler.AbstractHandler; import org.w3c.dom.Document; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class CustomHandler extends AbstractHandler { //enable XFire logging private Log log = LogFactory.getLog(MDMHandler.class); public void invoke(MessageContext context) { log.info("invoke in MSMHandler was called"); // get inbound and outbound messages Document inputDoc = (Document) context.getInMessage().getProperty(org.codehaus.xfire.util.dom.DOMInHandler.DOM_MESSAGE); Document outputDoc = (Document) context.getOutMessage().getProperty(org.codehaus.xfire.util.dom.DOMOutHandler.DOM_MESSAGE); System.out.println(inputDoc.toString()); System.out.println(outputDoc.getXmlVersion()); System.out.println(outputDoc.getLocalName()); System.out.println(outputDoc.toString()); log.info(inputDoc); log.info(outputDoc); // log.trace(inputDoc); // log.trace(outputDoc); } }
and at the end of the client constructor I added this:
// Tell XFire to cache a DOM document for the various in/out/fault flows service1.addInHandler(new org.codehaus.xfire.util.dom.DOMInHandler()); service1.addOutHandler(new org.codehaus.xfire.util.dom.DOMOutHandler()); service1.addFaultHandler(new org.codehaus.xfire.util.dom.DOMOutHandler()); // Add a logging handler to each flow service1.addInHandler(new org.codehaus.xfire.util.LoggingHandler()); service1.addOutHandler(new org.codehaus.xfire.util.LoggingHandler()); service1.addFaultHandler(new org.codehaus.xfire.util.LoggingHandler());
I don’t think the Handler intercepts the right MessageContext. How you get the proper context of a web service developed with XFire?
So if you been able to perform SOAP tracing / monitoring / fetching using XFire please let me know the right procedure. And last question: XFire logging will work only for HTTP (exactly like TCOMON for example) or is working as well for HTTPS endpoints ?
I still wasn’t able to fetch the SOAP content 😳 😯 🙁
Thanks in advance.
-
AuthorPosts