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. <[EMAIL PROTECTED]> wrote:
From: Petr V. <[EMAIL PROTECTED]>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <[EMAIL PROTECTED]>, [email protected]
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. <[EMAIL PROTECTED]> wrote:
From: Petr V. <[EMAIL PROTECTED]>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <[EMAIL PROTECTED]>,
[email protected]
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. <[EMAIL PROTECTED]> wrote:
From: Petr V. <[EMAIL PROTECTED]>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: "Ostermueller, Erik" <[EMAIL PROTECTED]>
Cc: [email protected]
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 <[EMAIL PROTECTED]>
wrote:
From: Ostermueller, Erik <[EMAIL PROTECTED]>
Subject: RE: How to Enable Logging of In/Out Bound Soap Messages
To: [email protected], [EMAIL PROTECTED]
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:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2008 4:40 PM
To: [email protected]
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 <[EMAIL PROTECTED]> wrote:
From: Glen Mazza <[EMAIL PROTECTED]>
Subject: Re: How to Enable Logging of In/Out Bound Soap Messages
To: [email protected]
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.
_____________