Well after a few days struggling with this I'm back to trying to capture
the request object via the interceptor.  I've managed to add the
interceptor to my code base and print the output stream.  I'm not
knowledgeable with either Steams or Interceptors and would like to get a
few questions answered to hopefully get this data logged to the DB.

So first a little more background into what I'm trying to do: I don't want
to log the request to the console or file or use log4j or Java's logger.
 I'd like and object available to the web service client that can be logged
to the a database in a larger transaction that will also include the
response object.

How do I gracefully expose a method or object to my main web service client
that can use the data in the interceptor?

And I believe I want to morph the OutputStream into a printable object?
 Basically what is the best object to save to the Database and how do you
get there from handleMessage in the interceptor?

Thanks for the insights


On Tue, Jan 14, 2014 at 1:17 PM, Jeffrey Born <[email protected]> wrote:

> Ah, I missed that I should be adding the Client object via the
> getClient(port) method.
>
> Thanks much for nudging me in the correct direction.
>
>
> On Tue, Jan 14, 2014 at 12:35 PM, José Manuel Prieto <
> [email protected]> wrote:
>
>>
>> http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-LoggingMessages
>>
>> Client client = ClientProxy.getClient(port);
>> client.getInInterceptors().add(new LoggingInInterceptor());
>> client.getOutInterceptors().add(new LoggingOutInterceptor())
>>
>> In spring application context:
>>     <cxf:bus>
>>         <cxf:outInterceptors>
>>             <ref bean="logOutbound"/>
>>         </cxf:outInterceptors>
>>     </cxf:bus>
>>
>> or:
>>     <cxf:bus>
>>        <cxf:features>
>>           <cxf:logging />
>>        </cxf:features>
>>     </cxf:bus>
>> http://cxf.apache.org/docs/bus-configuration.html
>> http://cxf.apache.org/docs/configuration-of-the-bus.html
>>
>> http://www.ibm.com/developerworks/webservices/library/ws-apache-cxf-logging/index.html?ca=
>>
>> To create a custom log interceptor:
>> http://cxf.apache.org/docs/interceptors.html
>>
>> ;)
>> JMPrieto
>>
>>
>>
>> 2014/1/14 Jeffrey Born <[email protected]>
>>
>> > Hi all,
>> >
>> > I am having problems figuring out how to log the Request and Response
>> > objects after successfully calling a .NET Web Service.  I created the
>> > client using Eclipse Kepler that generated all the skeleton code for me.
>> >  I'm using the 2.7.8 version of CXF and Java jdk1.7.0_45.
>> >
>> > I've read a lot about interceptors and believe that is the way to go,
>> > however I can't figure out how to add an interceptor to what is
>> generated.
>> >  Everything object generated in the client does not allow an
>> interceptor to
>> > be added.  It's like everything got generated at too high of a level
>> for me
>> > to add interceptors.
>> >
>> > Not sure if this section of code will be useful to illustrate what I'm
>> > seeing, but including in hopes that it is:
>> >
>> > PhoneBookManagement ss = new PhoneBookManagement(wsdlURL, SERVICE_NAME);
>> > PhoneBookManagementSoap port = ss.getPhoneBookManagementSoap();
>> >
>> > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationByPhoneNumberRequest
>> > _phoneBookVerificationByPhoneNumber_payload = new
>> >
>> com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationByPhoneNumberRequest();
>> >
>> > I'd like to log the _phoneBookVerificationByPhoneNumber_payload SOAP
>> > request to the DB at this point, and all I see are my getters and
>> setters
>> >
>> > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationResponse
>> > _phoneBookVerificationByPhoneNumber__return =
>> >
>> >
>> port.phoneBookVerificationByPhoneNumber(_phoneBookVerificationByPhoneNumber_payload);
>> >
>> > After the call to the service I'd now like to log the
>> > _phoneBookVerificationByPhoneNumber__return SOAP response object to the
>> DB.
>> >
>> > Thanks for any help with this!
>> >
>>
>
>

Reply via email to