You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Petr V." <gr...@yahoo.com> on 2008/11/11 22:46:30 UTC

How to Enable Logging of In/Out Bound Soap Messages

So I am trying to figure it out how could I enable logging via configuration file

Right now, I have following code

String address1 = "http://localhost:9000/service1";
Service1 implementor1 = new Service1();EndpointImpl myEndpoint1 = (EndpointImpl)  Endpoint.publish(address1, implementor1);
        
myEndpoint1.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
myEndpoint1.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());

JaxWsProxyFactoryBean factory1 = new JaxWsProxyFactoryBean();
factory1.setAddress("http://localhost:9000/service1");
factory1.setServiceClass(IService1.class);        
IService1 client1 = (IService1) factory1.create();
SampleDTO data = client1.getSampleDTO();

And on my command prompt, I can see inbound and out bound sopa messages. So far so ood.

So now next step is I want to configure this logging via cxf.xml 

Now I created file src\main\resources\cxf.xml

and copied following snippet in that

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
    <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
    
    <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
        <property name="inInterceptors">
            <list>
                <ref bean="logInbound"/>
            </list>
        </property>
        <property name="outInterceptors">
            <list>
                <ref bean="logOutbound"/>
            </list>
        </property>
        <property name="outFaultInterceptors">
            <list>
                <ref bean="logOutbound"/>
            </list>
        </property>
    </bean> 
</beans>

Now I am wondering how to load bean cxf in my code (It has to be referred some where in code, right ? And how could I direct log to some file instead of command prompt. 

And is there any good book/resource on cxf besides user guide on CXF site?

Thanks,

Petr V.







      

Re: How to Enable Logging of In/Out Bound Soap Messages

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 11 November 2008 8:39:04 pm Petr V. wrote:
> Okay I found out the reason, I was loading cxf.xml before publishing the
> service.
>
> Now the question remains that how can I redirect  the log to some log file.
> May be cxf:bus has some properties.

Currently, the message logging always goes though the java.util.logging 
Logger.  Thus, you would need to configure where the logging for the 
org.apache.cxf.interceptor.LoggingInInterceptor and 
org.apache.cxf.interceptor.LoggingOutInterceptor categories go using standard 
java.util.logging configuration mechanisms.   Alternatively, redirect CXF 
logging to use log4j and use log4j logging.  see:
http://www.techper.net/2008/01/30/configuring-cxf-logging-to-go-through-log4j/

That said, I'd definitely welcome a patch that would add some extra properties 
to the logging feature (like infile, outfile, etc...) and would configure the 
interceptors to use those.

Dan




>
> Thanks,
>
> Petr
>
> --- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
> From: Petr V. <gr...@yahoo.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: "Ostermueller, Erik" <Er...@fnis.com>, users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 6:10 AM
>
> So I loaded explicitly cxf.xml in my code and now I am getting null pointer
> exception when I am trying to publish the web service.
>
> Here is my cxf.xml
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:cxf="http://cxf.apache.org/core"
>       xsi:schemaLocation="
> http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>         </cxf:features>
>     </cxf:bus>
> </beans>
>
> ==================================================
>
> Here is my code that tries to publish the web service
>
> ClassPathXmlApplicationContext context = new
> ClassPathXmlApplicationContext(new String[] {"cxf.xml"}); // =====> Line 1
>
> String address1 = "http://localhost:9000/service1";
> Service1 implementor1 = new Service1();
> System.out.println("Starting Service 1");
>        
> EndpointImpl myEndpoint1 = (EndpointImpl)  Endpoint.publish(address1,
> implementor1);
>
> ==============================================================
>
> Here is exception
>
> Caused by: java.lang.NullPointerException
>     at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo
>(AbstractWSDLBasedEndpointFactory.java:160) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
>tractWSDLBasedEndpointFactory.java:102) at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114
>) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.j
>ava:164) at
> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:334) at
> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251) ... 27
> more
>
> ============================================================
>
> If I remove the line to load the cxf.xml then every thing goes fine .
>
> Any idea what is causing Null pointer exception.
>
> Thanks,
>
> Petr
> --- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
> From: Petr V. <gr...@yahoo.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: "Ostermueller, Erik" <Er...@fnis.com>
> Cc: users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 4:22 AM
>
> Thanks Erik but how are you integrating this with your service. Can you
> please eloborate more.
>
> I have this cxf.xml in my class path
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>         </cxf:features>
>     </cxf:bus>
>
> </beans>
>
> Where is the log going ? I am not specifying any location for log. I want
> to see the out put but simply cant figure it out how to specify the
> lcoation.
>
> I also do not know if this cxf.xml is being loaded. I just put in class
> path. I have simple test environment where I am creating and publishing
> service and then
> accessing the service via simple client. There is no web.xml etc involved
> nor any spring resources.
>
> Am I making sense ?
>
> Thanks,
>
> Petr
>
>
>
> --- On Wed, 11/12/08, Ostermueller, Erik <Er...@fnis.com>
> wrote:
> From: Ostermueller, Erik <Er...@fnis.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: users@cxf.apache.org, greatman787@yahoo.com
> Date: Wednesday, November 12, 2008, 3:44 AM
>
> This works for me:
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>         </cxf:features>
>     </cxf:bus>
>
> Taken from here: http://cwiki.apache.org/CXF20DOC/features.html
>
> --Erik
>
>
> -----Original Message-----
> From: Petr V. [mailto:greatman787@yahoo.com]
> Sent: Tuesday, November 11, 2008 4:40 PM
> To: users@cxf.apache.org
> Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
>
> Thanks Glex for the reply.
>
> Yeah I did look at that page and was able to configured logging via
> programming includes but I want to do via config files.
>
> I have included cxf-2.1.1.jar file in my class path so I do not know
> what to do when that wiki says I need to change settings in
> /etc/logging.properties file
>
> And this page shows how to configure logging in cfx.xml but apparently
> it seems incomplete to me as a novice user of cfx.xml.
>
> Any help would be much appreciated.
>
> Thanks,
>
> Petr
>
> --- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
> From: Glen Mazza <gl...@gmail.com>
> Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
> To: users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 3:25 AM
>
> http://cwiki.apache.org/CXF20DOC/debugging.html ?
>
> Petr V. wrote:
> > So I am trying to figure it out how could I enable logging via
> > configuration file
>
> --
> View this message in context:
> http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
> s-tp20449139p20449787.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
>
>
>
> _____________
>
> The information contained in this message is proprietary and/or
> confidential. If you are not the
> intended recipient, please: (i) delete the message and all copies; (ii) do
> not disclose,
> distribute or use the message in any manner; and (iii) notify the sender
> immediately. In addition,
> please be aware that any message addressed to our domain is subject to
> archiving and review by
> persons other than the intended recipient. Thank you.
> _____________



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: I see Twice In/Out Bound Soap Messages in logs ...Why ?

Posted by Daniel Kulp <dk...@apache.org>.
I assume your service is in the same process as the client?   That would 
explain it.   If you look at it:

> INFO: Outbound Message
The message going OUT of the client

> INFO: Inbound Message
The message coming into the server

> INFO: Outbound Message
The message going out of the server

> INFO: Inbound Message
The message coming in to the client

If the clients and servers were in separate processes, you would obviously 
only see the messages that pertain to that process.

Dan





On Tuesday 11 November 2008 9:44:25 pm Petr V. wrote:
> May be I sound stupid but I am trying to learn web services and CXF on
> hands, please bear with me :-(
>
> ========================================================
>
> I am seeing every message in/out bound twice in log, can I tweak it, it is
> pretty confusing, the only difference is b/w headers.
>
> I call one function and get one response but log shows two round trips.
>
> ========================================================
> INFO: Outbound Message
> ---------------------------
> Encoding: UTF-8
> Headers: {SOAPAction=[""], Accept=[*]}
> Messages:
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getS
>ampleDTO xmlns:ns1="http:/ /cxftest1.com.com/"
> /></soap:Body></soap:Envelope>
> --------------------------------------
> Nov 11, 2008 6:28:50 PM org.apache.cxf.interceptor.LoggingInInterceptor
> logging
>
>
> INFO: Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers: {content-type=[text/xml; charset=UTF-8], connection=[keep-alive],
> transfer-encoding=[chunked], Host=[localhost:9000] , SOAPAction=[""],
> User-Agent=[Java/1.6.0_10], Accept=[*], Pragma=[no-cache],
> Cache-Control=[no-cache]} Messages:
> Message:
>
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getS
>ampleDTO xmlns:ns1="http:/ /cxftest1.com.com/"
> /></soap:Body></soap:Envelope>
> --------------------------------------
> Nov 11, 2008 6:28:50 PM
> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>
>
> INFO: Outbound Message
> ---------------------------
> Encoding: UTF-8
> Headers: {SOAPAction=[""]}
> Messages:
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getS
>ampleDTOResponse xmlns:ns1
> ="http://cxftest1.com.com/"><return><Name>AndyNorm</Name><Age>26</Age></ret
>urn></ns1:getSampleDTOResponse></soap:Body>< /soap:Envelope>
> --------------------------------------
> Nov 11, 2008 6:28:50 PM org.apache.cxf.interceptor.LoggingInInterceptor
> logging
>
>
> INFO: Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers: {content-type=[text/xml; charset=utf-8], Content-Length=[256],
> SOAPAction=[""], Server=[Jetty(6.1.9)]} Messages:
> Message:
>
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getS
>ampleDTOResponse xmlns:ns1
> ="http://cxftest1.com.com/"><return><Name>AndyNorm</Name><Age>26</Age></ret
>urn></ns1:getSampleDTOResponse></soap:Body>< /soap:Envelope>
>
>
> =======================================================
>
> Thanks,
>
> Petr
>
> --- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
> From: Petr V. <gr...@yahoo.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: "Ostermueller, Erik" <Er...@fnis.com>, users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 6:39 AM
>
> Okay I found out the reason, I was loading cxf.xml before publishing the
> service.
>
> Now the question remains that how can I redirect  the log to some log file.
> May be cxf:bus has some properties.
>
> Thanks,
>
> Petr
>
> --- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
> From: Petr V. <gr...@yahoo.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: "Ostermueller, Erik" <Er...@fnis.com>,
> users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 6:10 AM
>
> So I loaded explicitly cxf.xml in my code and now I am getting null pointer
> exception when I am trying to publish the web service.
>
> Here is my cxf.xml
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:cxf="http://cxf.apache.org/core"
>       xsi:schemaLocation="
> http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>         </cxf:features>
>     </cxf:bus>
> </beans>
>
> ==================================================
>
> Here is my code that tries to publish the web service
>
> ClassPathXmlApplicationContext context = new
> ClassPathXmlApplicationContext(new String[] {"cxf.xml"}); // =====> Line 1
>
> String address1 = "http://localhost:9000/service1";
> Service1 implementor1 = new Service1();
> System.out.println("Starting Service 1");
>        
> EndpointImpl myEndpoint1 = (EndpointImpl)  Endpoint.publish(address1,
> implementor1);
>
> ==============================================================
>
> Here is exception
>
> Caused by: java.lang.NullPointerException
>     at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo
>(AbstractWSDLBasedEndpointFactory.java:160) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
>tractWSDLBasedEndpointFactory.java:102) at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114
>) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.j
>ava:164) at
> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:334) at
> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251) ... 27
> more
>
> ============================================================
>
> If I remove the line to load the cxf.xml then every thing goes fine .
>
> Any idea what is causing Null pointer exception.
>
> Thanks,
>
> Petr
> --- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
> From: Petr V. <gr...@yahoo.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: "Ostermueller, Erik" <Er...@fnis.com>
> Cc: users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 4:22 AM
>
> Thanks Erik but how are you integrating this with your service. Can you
> please eloborate more.
>
> I have this cxf.xml in my class path
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>         </cxf:features>
>     </cxf:bus>
>
> </beans>
>
> Where is the log going ? I am not specifying any location for log. I want
> to see the out put but simply cant figure it out how to specify the
> lcoation.
>
> I also do not know if this cxf.xml is being loaded. I just put in class
> path. I have simple test environment where I am creating and publishing
> service and then
> accessing the service via simple client. There is no web.xml etc involved
> nor any spring resources.
>
> Am I making sense ?
>
> Thanks,
>
> Petr
>
>
>
> --- On Wed, 11/12/08, Ostermueller, Erik <Er...@fnis.com>
> wrote:
> From: Ostermueller, Erik <Er...@fnis.com>
> Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
> To: users@cxf.apache.org, greatman787@yahoo.com
> Date: Wednesday, November 12, 2008, 3:44 AM
>
> This works for me:
>     <cxf:bus>
>         <cxf:features>
>             <cxf:logging/>
>         </cxf:features>
>     </cxf:bus>
>
> Taken from here: http://cwiki.apache.org/CXF20DOC/features.html
>
> --Erik
>
>
> -----Original Message-----
> From: Petr V. [mailto:greatman787@yahoo.com]
> Sent: Tuesday, November 11, 2008 4:40 PM
> To: users@cxf.apache.org
> Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
>
> Thanks Glex for the reply.
>
> Yeah I did look at that page and was able to configured logging via
> programming includes but I want to do via config files.
>
> I have included cxf-2.1.1.jar file in my class path so I do not know
> what to do when that wiki says I need to change settings in
> /etc/logging.properties file
>
> And this page shows how to configure logging in cfx.xml but apparently
> it seems incomplete to me as a novice user of cfx.xml.
>
> Any help would be much appreciated.
>
> Thanks,
>
> Petr
>
> --- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
> From: Glen Mazza <gl...@gmail.com>
> Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
> To: users@cxf.apache.org
> Date: Wednesday, November 12, 2008, 3:25 AM
>
> http://cwiki.apache.org/CXF20DOC/debugging.html ?
>
> Petr V. wrote:
> > So I am trying to figure it out how could I enable logging via
> > configuration file
>
> --
> View this message in context:
> http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
> s-tp20449139p20449787.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
>
>
>
> _____________
>
> The information contained in this message is proprietary and/or
> confidential. If you are not the
> intended recipient, please: (i) delete the message and all copies; (ii) do
> not disclose,
> distribute or use the message in any manner; and (iii) notify the sender
> immediately. In addition,
> please be aware that any message addressed to our domain is subject to
> archiving and review by
> persons other than the intended recipient. Thank you.
> _____________



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

I see Twice In/Out Bound Soap Messages in logs ...Why ?

Posted by "Petr V." <gr...@yahoo.com>.
May be I sound stupid but I am trying to learn web services and CXF on hands, please bear with me :-(

========================================================

I am seeing every message in/out bound twice in log, can I tweak it, it is pretty confusing, the only difference is b/w headers.

I call one function and get one response but log shows two round trips.

========================================================
INFO: Outbound Message
---------------------------
Encoding: UTF-8
Headers: {SOAPAction=[""], Accept=[*]}
Messages:
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getSampleDTO xmlns:ns1="http:/
/cxftest1.com.com/" /></soap:Body></soap:Envelope>
--------------------------------------
Nov 11, 2008 6:28:50 PM org.apache.cxf.interceptor.LoggingInInterceptor logging


INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {content-type=[text/xml; charset=UTF-8], connection=[keep-alive], transfer-encoding=[chunked], Host=[localhost:9000]
, SOAPAction=[""], User-Agent=[Java/1.6.0_10], Accept=[*], Pragma=[no-cache], Cache-Control=[no-cache]}
Messages:
Message:

Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getSampleDTO xmlns:ns1="http:/
/cxftest1.com.com/" /></soap:Body></soap:Envelope>
--------------------------------------
Nov 11, 2008 6:28:50 PM org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose


INFO: Outbound Message
---------------------------
Encoding: UTF-8
Headers: {SOAPAction=[""]}
Messages:
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getSampleDTOResponse xmlns:ns1
="http://cxftest1.com.com/"><return><Name>AndyNorm</Name><Age>26</Age></return></ns1:getSampleDTOResponse></soap:Body><
/soap:Envelope>
--------------------------------------
Nov 11, 2008 6:28:50 PM org.apache.cxf.interceptor.LoggingInInterceptor logging


INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {content-type=[text/xml; charset=utf-8], Content-Length=[256], SOAPAction=[""], Server=[Jetty(6.1.9)]}
Messages:
Message:

Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getSampleDTOResponse xmlns:ns1
="http://cxftest1.com.com/"><return><Name>AndyNorm</Name><Age>26</Age></return></ns1:getSampleDTOResponse></soap:Body><
/soap:Envelope>


=======================================================

Thanks,

Petr

--- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
From: Petr V. <gr...@yahoo.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <Er...@fnis.com>, users@cxf.apache.org
Date: Wednesday, November 12, 2008, 6:39 AM

Okay I found out the reason, I was loading cxf.xml before publishing the
service.

Now the question remains that how can I redirect  the log to some log file.
May be cxf:bus has some properties.

Thanks,

Petr

--- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
From: Petr V. <gr...@yahoo.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <Er...@fnis.com>,
users@cxf.apache.org
Date: Wednesday, November 12, 2008, 6:10 AM

So I loaded explicitly cxf.xml in my code and now I am getting null pointer
exception when I am trying to publish the web service.

Here is my cxf.xml

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:cxf="http://cxf.apache.org/core"
      xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 
</beans>

==================================================

Here is my code that tries to publish the web service

ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new
String[] {"cxf.xml"}); // =====> Line 1 

String address1 = "http://localhost:9000/service1";
Service1 implementor1 = new Service1();
System.out.println("Starting Service 1");
        
EndpointImpl myEndpoint1 = (EndpointImpl)  Endpoint.publish(address1,
implementor1);

==============================================================

Here is exception 

Caused by: java.lang.NullPointerException
    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:160)
    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
    at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)
    at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:164)
    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:334)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
    ... 27 more

============================================================

If I remove the line to load the cxf.xml then every thing goes fine . 

Any idea what is causing Null pointer exception.

Thanks,

Petr
--- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
From: Petr V. <gr...@yahoo.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <Er...@fnis.com>
Cc: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 4:22 AM

Thanks Erik but how are you integrating this with your service. Can you please
eloborate more.

I have this cxf.xml in my class path

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

</beans>

Where is the log going ? I am not specifying any location for log. I want to
see the out put but simply cant figure it out how to specify the lcoation.

I also do not know if this cxf.xml is being loaded. I just put in class path. I
have simple test environment where I am creating and publishing service and
then
accessing the service via simple client. There is no web.xml etc involved nor
any spring resources. 

Am I making sense ?

Thanks,

Petr



--- On Wed, 11/12/08, Ostermueller, Erik <Er...@fnis.com>
wrote:
From: Ostermueller, Erik <Er...@fnis.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org, greatman787@yahoo.com
Date: Wednesday, November 12, 2008, 3:44 AM

This works for me:
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

Taken from here: http://cwiki.apache.org/CXF20DOC/features.html

--Erik
 

-----Original Message-----
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 11, 2008 4:40 PM
To: users@cxf.apache.org
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages

Thanks Glex for the reply.

Yeah I did look at that page and was able to configured logging via
programming includes but I want to do via config files.

I have included cxf-2.1.1.jar file in my class path so I do not know
what to do when that wiki says I need to change settings in
/etc/logging.properties file

And this page shows how to configure logging in cfx.xml but apparently
it seems incomplete to me as a novice user of cfx.xml.

Any help would be much appreciated.

Thanks,

Petr

--- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
From: Glen Mazza <gl...@gmail.com>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 3:25 AM

http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via 
> configuration file
> 

--
View this message in context:
http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
s-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.




      

_____________

The information contained in this message is proprietary and/or confidential.
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not
disclose, 
distribute or use the message in any manner; and (iii) notify the sender
immediately. In addition, 
please be aware that any message addressed to our domain is subject to
archiving and review by 
persons other than the intended recipient. Thank you.
_____________



      


      


      


      

RE: How to Enable Logging of In/Out Bound Soap Messages

Posted by "Petr V." <gr...@yahoo.com>.
Okay I found out the reason, I was loading cxf.xml before publishing the service.

Now the question remains that how can I redirect  the log to some log file. May be cxf:bus has some properties.

Thanks,

Petr

--- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
From: Petr V. <gr...@yahoo.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <Er...@fnis.com>, users@cxf.apache.org
Date: Wednesday, November 12, 2008, 6:10 AM

So I loaded explicitly cxf.xml in my code and now I am getting null pointer
exception when I am trying to publish the web service.

Here is my cxf.xml

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:cxf="http://cxf.apache.org/core"
      xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 
</beans>

==================================================

Here is my code that tries to publish the web service

ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new
String[] {"cxf.xml"}); // =====> Line 1 

String address1 = "http://localhost:9000/service1";
Service1 implementor1 = new Service1();
System.out.println("Starting Service 1");
        
EndpointImpl myEndpoint1 = (EndpointImpl)  Endpoint.publish(address1,
implementor1);

==============================================================

Here is exception 

Caused by: java.lang.NullPointerException
    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:160)
    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
    at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)
    at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:164)
    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:334)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
    ... 27 more

============================================================

If I remove the line to load the cxf.xml then every thing goes fine . 

Any idea what is causing Null pointer exception.

Thanks,

Petr
--- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
From: Petr V. <gr...@yahoo.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <Er...@fnis.com>
Cc: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 4:22 AM

Thanks Erik but how are you integrating this with your service. Can you please
eloborate more.

I have this cxf.xml in my class path

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

</beans>

Where is the log going ? I am not specifying any location for log. I want to
see the out put but simply cant figure it out how to specify the lcoation.

I also do not know if this cxf.xml is being loaded. I just put in class path. I
have simple test environment where I am creating and publishing service and
then
accessing the service via simple client. There is no web.xml etc involved nor
any spring resources. 

Am I making sense ?

Thanks,

Petr



--- On Wed, 11/12/08, Ostermueller, Erik <Er...@fnis.com>
wrote:
From: Ostermueller, Erik <Er...@fnis.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org, greatman787@yahoo.com
Date: Wednesday, November 12, 2008, 3:44 AM

This works for me:
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

Taken from here: http://cwiki.apache.org/CXF20DOC/features.html

--Erik
 

-----Original Message-----
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 11, 2008 4:40 PM
To: users@cxf.apache.org
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages

Thanks Glex for the reply.

Yeah I did look at that page and was able to configured logging via
programming includes but I want to do via config files.

I have included cxf-2.1.1.jar file in my class path so I do not know
what to do when that wiki says I need to change settings in
/etc/logging.properties file

And this page shows how to configure logging in cfx.xml but apparently
it seems incomplete to me as a novice user of cfx.xml.

Any help would be much appreciated.

Thanks,

Petr

--- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
From: Glen Mazza <gl...@gmail.com>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 3:25 AM

http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via 
> configuration file
> 

--
View this message in context:
http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
s-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.




      

_____________

The information contained in this message is proprietary and/or confidential.
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not
disclose, 
distribute or use the message in any manner; and (iii) notify the sender
immediately. In addition, 
please be aware that any message addressed to our domain is subject to
archiving and review by 
persons other than the intended recipient. Thank you.
_____________



      


      


      

RE: How to Enable Logging of In/Out Bound Soap Messages

Posted by "Petr V." <gr...@yahoo.com>.
So I loaded explicitly cxf.xml in my code and now I am getting null pointer exception when I am trying to publish the web service.

Here is my cxf.xml

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:cxf="http://cxf.apache.org/core"
      xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 
</beans>

==================================================

Here is my code that tries to publish the web service

ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"cxf.xml"}); // =====> Line 1 

String address1 = "http://localhost:9000/service1";
Service1 implementor1 = new Service1();
System.out.println("Starting Service 1");
        
EndpointImpl myEndpoint1 = (EndpointImpl)  Endpoint.publish(address1, implementor1);

==============================================================

Here is exception 

Caused by: java.lang.NullPointerException
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:160)
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)
    at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:164)
    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:334)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
    ... 27 more

============================================================

If I remove the line to load the cxf.xml then every thing goes fine . 

Any idea what is causing Null pointer exception.

Thanks,

Petr
--- On Wed, 11/12/08, Petr V. <gr...@yahoo.com> wrote:
From: Petr V. <gr...@yahoo.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <Er...@fnis.com>
Cc: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 4:22 AM

Thanks Erik but how are you integrating this with your service. Can you please
eloborate more.

I have this cxf.xml in my class path

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

</beans>

Where is the log going ? I am not specifying any location for log. I want to
see the out put but simply cant figure it out how to specify the lcoation.

I also do not know if this cxf.xml is being loaded. I just put in class path. I
have simple test environment where I am creating and publishing service and then
accessing the service via simple client. There is no web.xml etc involved nor
any spring resources. 

Am I making sense ?

Thanks,

Petr



--- On Wed, 11/12/08, Ostermueller, Erik <Er...@fnis.com>
wrote:
From: Ostermueller, Erik <Er...@fnis.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org, greatman787@yahoo.com
Date: Wednesday, November 12, 2008, 3:44 AM

This works for me:
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

Taken from here: http://cwiki.apache.org/CXF20DOC/features.html

--Erik
 

-----Original Message-----
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 11, 2008 4:40 PM
To: users@cxf.apache.org
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages

Thanks Glex for the reply.

Yeah I did look at that page and was able to configured logging via
programming includes but I want to do via config files.

I have included cxf-2.1.1.jar file in my class path so I do not know
what to do when that wiki says I need to change settings in
/etc/logging.properties file

And this page shows how to configure logging in cfx.xml but apparently
it seems incomplete to me as a novice user of cfx.xml.

Any help would be much appreciated.

Thanks,

Petr

--- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
From: Glen Mazza <gl...@gmail.com>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 3:25 AM

http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via 
> configuration file
> 

--
View this message in context:
http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
s-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.




      

_____________

The information contained in this message is proprietary and/or confidential.
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not
disclose, 
distribute or use the message in any manner; and (iii) notify the sender
immediately. In addition, 
please be aware that any message addressed to our domain is subject to
archiving and review by 
persons other than the intended recipient. Thank you.
_____________



      


      

RE: How to Enable Logging of In/Out Bound Soap Messages

Posted by "Petr V." <gr...@yahoo.com>.
Thanks Erik but how are you integrating this with your service. Can you please eloborate more.

I have this cxf.xml in my class path

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

</beans>

Where is the log going ? I am not specifying any location for log. I want to see the out put but simply cant figure it out how to specify the lcoation.

I also do not know if this cxf.xml is being loaded. I just put in class path. I have simple test environment where I am creating and publishing service and then accessing the service via simple client. There is no web.xml etc involved nor any spring resources. 

Am I making sense ?

Thanks,

Petr



--- On Wed, 11/12/08, Ostermueller, Erik <Er...@fnis.com> wrote:
From: Ostermueller, Erik <Er...@fnis.com>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org, greatman787@yahoo.com
Date: Wednesday, November 12, 2008, 3:44 AM

This works for me:
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

Taken from here: http://cwiki.apache.org/CXF20DOC/features.html

--Erik
 

-----Original Message-----
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 11, 2008 4:40 PM
To: users@cxf.apache.org
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages

Thanks Glex for the reply.

Yeah I did look at that page and was able to configured logging via
programming includes but I want to do via config files.

I have included cxf-2.1.1.jar file in my class path so I do not know
what to do when that wiki says I need to change settings in
/etc/logging.properties file

And this page shows how to configure logging in cfx.xml but apparently
it seems incomplete to me as a novice user of cfx.xml.

Any help would be much appreciated.

Thanks,

Petr

--- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
From: Glen Mazza <gl...@gmail.com>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 3:25 AM

http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via 
> configuration file
> 

--
View this message in context:
http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
s-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.




      

_____________

The information contained in this message is proprietary and/or confidential.
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not
disclose, 
distribute or use the message in any manner; and (iii) notify the sender
immediately. In addition, 
please be aware that any message addressed to our domain is subject to
archiving and review by 
persons other than the intended recipient. Thank you.
_____________



      

RE: How to Enable Logging of In/Out Bound Soap Messages

Posted by "Ostermueller, Erik" <Er...@fnis.com>.
This works for me:
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

Taken from here: http://cwiki.apache.org/CXF20DOC/features.html

--Erik
 

-----Original Message-----
From: Petr V. [mailto:greatman787@yahoo.com] 
Sent: Tuesday, November 11, 2008 4:40 PM
To: users@cxf.apache.org
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages

Thanks Glex for the reply.

Yeah I did look at that page and was able to configured logging via
programming includes but I want to do via config files.

I have included cxf-2.1.1.jar file in my class path so I do not know
what to do when that wiki says I need to change settings in
/etc/logging.properties file

And this page shows how to configure logging in cfx.xml but apparently
it seems incomplete to me as a novice user of cfx.xml.

Any help would be much appreciated.

Thanks,

Petr

--- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
From: Glen Mazza <gl...@gmail.com>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 3:25 AM

http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via 
> configuration file
> 

--
View this message in context:
http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Message
s-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.




      

_____________

The information contained in this message is proprietary and/or confidential. If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, 
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, 
please be aware that any message addressed to our domain is subject to archiving and review by 
persons other than the intended recipient. Thank you.
_____________

Re: How to Enable Logging of In/Out Bound Soap Messages

Posted by "Petr V." <gr...@yahoo.com>.
Thanks Glex for the reply.

Yeah I did look at that page and was able to configured logging via programming includes but I want to do via config files.

I have included cxf-2.1.1.jar file in my class path so I do not know what to do when that wiki says I need to change settings in /etc/logging.properties file

And this page shows how to configure logging in cfx.xml but apparently it seems incomplete to me as a novice user of cfx.xml.

Any help would be much appreciated.

Thanks,

Petr

--- On Wed, 11/12/08, Glen Mazza <gl...@gmail.com> wrote:
From: Glen Mazza <gl...@gmail.com>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: users@cxf.apache.org
Date: Wednesday, November 12, 2008, 3:25 AM

http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via
> configuration file
> 

-- 
View this message in context:
http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Messages-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.




      

Re: How to Enable Logging of In/Out Bound Soap Messages

Posted by Glen Mazza <gl...@gmail.com>.
http://cwiki.apache.org/CXF20DOC/debugging.html ?


Petr V. wrote:
> 
> So I am trying to figure it out how could I enable logging via
> configuration file
> 

-- 
View this message in context: http://www.nabble.com/How-to-Enable-Logging-of-In-Out-Bound-Soap-Messages-tp20449139p20449787.html
Sent from the cxf-user mailing list archive at Nabble.com.