Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP logging axis2

Using axis1 it is possible to log incoming/outgoing soap messages by adding logging on HTTPSender in log4j.properties. After migrating to axis2 (version 1.4.1) I have a hard time figuring out how to accomplish the same kind of logging. I have tried to add logging on the axis2 package and org.apache.commons.httpclient but no logging is provided.

Any ideas?

TIA

like image 814
Niclas Åstrand Avatar asked Mar 19 '10 12:03

Niclas Åstrand


1 Answers

Try logging these two packages with DEBUG level:

  • httpclient.wire
  • org.apache.commons.httpclient

You should see the following output like for any request you make:

>> "SOAPAction: urn:GeteBayOfficialTime[\r][\n]"
>> "User-Agent: Axis2[\r][\n]"
>> "Host: api.sandbox.ebay.com[\r][\n]"
>> "Content-Length: 1546[\r][\n]"
>> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
>> "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><ns1:RequesterCredentials xmlns:ns1="urn:ebay:apis:eBLBaseComponents"><ns1:eBayAuthToken>XYZ_ABCD</ns1:eBayAuthToken></ns1:RequesterCredentials></soapenv:Header><soapenv:Body><ns1:GeteBayOfficialTimeRequest xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:GeteBayOfficialTimeRequestType"><ns1:DetailLevelCodeType>ReturnAll</ns1:DetailLevelCodeType><ns1:ErrorLanguage>en_US</ns1:ErrorLanguage><ns1:Version>427</ns1:Version></ns1:GeteBayOfficialTimeRequest></soapenv:Body></soapenv:Envelope>

And for incoming responses:

<< "HTTP/1.1 200 OK[\r][\n]"
<< "Date: Wed, 23 Aug 2006 02:17:33 GMT[\r][\n]"
<< "Server: Microsoft-IIS/5.0[\r][\n]"
<< "X-EBAY-API-SERVER-NAME: ZXCVBA[\r][\n]"
<< "Content-Type: text/xml;charset=utf-8[\r][\n]"
<< "X-Cache: MISS from thrasher.sjc.ebay.com[\r][\n]"
<< "Connection: close[\r][\n]"
<< "<?xml version="1.0" encoding="UTF-8"?>[\n]"
<< "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">[\n]"
<< " <soapenv:Body>[\n]"
<< " <GeteBayOfficialTimeResponse xmlns="urn:ebay:apis:eBLBaseComponents">[\n]"
<< " <Timestamp>2006-08-23T02:17:33.544Z</Timestamp>[\n]"
<< " <Ack>Success</Ack>[\n]"
<< " <Version>475</Version>[\n]"
<< " <Build>e475_core_Bundled_3434772_R1</Build>[\n]"
<< " </GeteBayOfficialTimeResponse>[\n]"
<< " </soapenv:Body>[\n]"
<< "</soapenv:Envelope>"
like image 58
joragupra Avatar answered Sep 21 '22 06:09

joragupra