Results 1 to 7 of 7
  1. #1
    mydesktop is offline Member
    Join Date
    Nov 2010
    Posts
    2
    Rep Power
    0

    Default Urgent-how to get xml message before sending in webservice

    I have a wsdl, so I use this wsdl file to generate both Client and server (using axis 2). Both server and client are web application. Then I can send a SOAP request from client to server. SOAP request will be in xml format, right? Now, I'd like to catch this SOAP message before it will be sent to Server so that I can log this SOAP message (in xml) to file. Anybody please help me to solve this problem? I'm writing in java, using eclipse. It's urgent, deadline is comming. I have to solve this in this week....

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    I can't remember which is which, but axis has something like interceptors that let you intercept the message before it's sent (and also the response when it's received), which allows you to do additional processing directly onto the message if need be.

    Ah, they're called Handlers.

    In fact I seem to remember there being one for loggin, but I can't guarantee that.

  3. #3
    mydesktop is offline Member
    Join Date
    Nov 2010
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    I can't remember which is which, but axis has something like interceptors that let you intercept the message before it's sent (and also the response when it's received), which allows you to do additional processing directly onto the message if need be.

    Ah, they're called Handlers.

    In fact I seem to remember there being one for loggin, but I can't guarantee that.


    Thank Tolls ! You're right. I found the solution for server side. We will use Handler. And base on technology to generate web service's stuff (my server using axis, but my client using jaxWS), we have different ways to implement and deploy Handler. My purpose is only write input/output xml message to log, so with my server, I only adjust server-config.wsdd as bellow:
    <deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

    <handler name="log" type="java: org.apache.axis.handlers.LogHandler"/>

    <globalConfiguration>
    <requestFlow>
    <handler type="log"/>
    </requestFlow>
    <responseFlow>
    <handler type="log"/>
    </responseFlow>
    </globalConfiguration>

    <transport
    name="http" pivot="java: org.apache.axis.transport.http.HTTPSender"/>

    </deployment>

    But now I still can not control directory and log file name yet (now it's axis.log by default).
    Last edited by mydesktop; 11-16-2010 at 02:25 AM.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    Log files and their location are the bane of my life.
    For some reason I've never managed to figure them out...
    :)

  5. #5
    darkangle is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default

    hi mydesktop,
    I have this problem too.do you solve this problem. can you help me...

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default

    Um.
    The solution is up there?

  7. #7
    darkangle is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default

    hi,

    I'll use this method but I can't have (MessageContext context).I'll take saop xml message and use this message.


    public boolean handleRequest(MessageContext context) {

    SOAPMessageContext messageContext = (SOAPMessageContext) context;
    System.out.println("** Request: "+messageContext.getMessage().toString());
    return true;

    }

Similar Threads

  1. Sending a message to a flash chat
    By Jman85 in forum New To Java
    Replies: 3
    Last Post: 11-08-2010, 06:07 PM
  2. sending a simple email message via SMTP
    By chahhchahh in forum Networking
    Replies: 5
    Last Post: 03-08-2009, 06:58 PM
  3. Sending [CDATA] element with SOAP message
    By suchismitasuchi in forum Advanced Java
    Replies: 0
    Last Post: 01-19-2009, 10:59 AM
  4. [SOLVED] Sending a message to clients using RMI
    By ChrisMayhew in forum New To Java
    Replies: 11
    Last Post: 01-12-2009, 07:29 PM
  5. sending the message from trigger to mailid
    By geeta_ravikanti in forum JDBC
    Replies: 0
    Last Post: 04-04-2008, 11:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •