My client's SOAP message doesn't seem to be making the trip to the web
service when deployed on Tomcat 5.5 (I'm using CXF 2.2-SNAPSHOT).  I've made
a JUnit4 test which uses the CXF Jetty transport, and the SOAP
request/response works when executed within Eclipse or via mvn test.  Here
are the messages from the unit test:

Mar 7, 2009 8:31:45 PM
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
Address: http://localhost:8081/myProject/issueService
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Accept=[*/*]}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><ns2:issueCreate
xmlns:ns2="http://model.company.com/";><issue><votes>0</votes></issue></ns2:issueCreate></soap:Body></soap:Envelope>
--------------------------------------
Mar 7, 2009 8:31:45 PM org.apache.cxf.interceptor.LoggingInInterceptor
logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {content-type=[text/xml; charset=UTF-8], connection=[keep-alive],
Host=[localhost:8081], Content-Length=[240], SOAPAction=[""],
User-Agent=[Apache CXF 2.2-SNAPSHOT], Accept=[*/*], Pragma=[no-cache],
Cache-Control=[no-cache]}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><ns2:issueCreate
xmlns:ns2="http://model.company.com/";><issue><votes>0</votes></issue></ns2:issueCreate></soap:Body></soap:Envelope>
--------------------------------------
Mar 7, 2009 8:31:46 PM
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><ns2:issueCreateResponse
xmlns:ns2="http://model.company.com/";><return>1.0</return></ns2:issueCreateResponse></soap:Body></soap:Envelope>
--------------------------------------
Mar 7, 2009 8:31:46 PM org.apache.cxf.interceptor.LoggingInInterceptor
logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {content-type=[text/xml; charset=utf-8], Content-Length=[229],
Server=[Jetty(6.1.11)]}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><ns2:issueCreateResponse
xmlns:ns2="http://model.company.com/";><return>1.0</return></ns2:issueCreateResponse></soap:Body></soap:Envelope>
--------------------------------------

And here are the client's outbound/inbound messages when the service is
deployed within Tomcat:


Mar 7, 2009 8:24:38 PM
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
Address: http://localhost:8081/myProject/issueService
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Accept=[*/*]}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><ns2:issueCreate
xmlns:ns2="http://model.company.com/";><issue><assigneeId>admin</assigneeId><description>afsfdsa</description><issueTypeId>1</issueTypeId><key>TEST-94</key><priorityId>3</priorityId><projectId>10040</projectId><reporterId>admin</reporterId><statusId>10008</statusId><summary>test</summary><votes>0</votes><workflowId>10580</workflowId></issue></ns2:issueCreate></soap:Body></soap:Envelope>
--------------------------------------
Mar 7, 2009 8:24:38 PM org.apache.cxf.interceptor.LoggingInInterceptor
logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Content-Type: 
Headers: {connection=[close], Date=[Sun, 08 Mar 2009 02:24:38 GMT],
transfer-encoding=[chunked], Server=[Apache-Coyote/1.1]}
Payload: 
--------------------------------------

The payload is completely empty on the inbound message.  It appears to me
that this request is never even hitting the service (I'm seeing nothing
about this request in my service's log), and that the SOAP message is
discarded on the client side.  Is this likely to be correct?

Here is the error stacktrace:

Mar 7, 2009 8:24:39 PM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
        at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:184)
        at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:1)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:641)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2113)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1992)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1917)
        at
org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
        at 
org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:601)
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:469)
        ...     
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
        at 
com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
        at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
        at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:86)
        ... 93 more
[20:24:39.753-http-8081-Processor24][IssueEventDispatcher][ERROR] -
Exception thrown from listener [com.company.IssueCreator] : Error reading
XMLStreamReader.
javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:144)
        at $Proxy71.issueCreate(Unknown Source)
        ...
Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading
XMLStreamReader.
        at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:184)
        at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:1)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:641)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2113)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1992)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1917)
        at
org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
        at 
org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170)
        at 
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:601)
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:469)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
        ... 76 more
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
        at 
com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
        at 
com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
        at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
        at 
com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
        at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:86)
        ... 93 more
        
I was initially deploying to Tomcat via Eclipse's server tools, but later
tried dropping the packaged WAR into the Tomcat webapps directory, but
received the same result.

Here is my unit test:

public class IssueServiceTest extends AbstractWsServiceTest {

    private final String uri =
"http://localhost:8081/myProject/issueService";;

    @Test
    public void issueCreateTest() {

        deployWsService( IssueService.class, IssueServiceBean.class, uri );
        IssueService client = getWsServiceClient( IssueService.class, uri );
        Double responseNum = client.issueCreate( new Issue( issue ) );
        log.info( "responseNum: " + responseNum );  // this returns an
appropriate response.
    }
    
    protected <T> void deployWsService( Class<? extends T>
serviceInterfaceClass, Class<? extends T> serviceBeanClass, String uri ) {
    
            JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    
            factory.setServiceClass( serviceInterfaceClass );
            factory.setAddress( uri );
            factory.setServiceBean( Reflection.newInstance( serviceBeanClass
) );
            factory.create();
    }
    
    protected <T> T getWsServiceClient( Class<? extends T>
serviceInterfaceClass, String uri ) {
    
            JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    
            factory.setServiceClass( serviceInterfaceClass );
            factory.setAddress( uri );
    
            T client = (T) factory.create();
            return client;
    }
}

Here is the method which fails when trying to use the Tomcat-deployed
service:

public class IssueCreator {

        public void createIssue( Issue issue ){

                JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
                factory.setServiceClass( DevTrackSyncService.class );
                factory.setAddress( 
"http://localhost:8081/myProject/issueService"; );
                DevTrackSyncService client = (DevTrackSyncService) 
factory.create();
        }
}

Does anyone have any suggestions for how I should proceed?  I've been
stepping through the CXF code (PhaseInterceptorChain, HolderOutInterceptor,
etc.) and don't see the problem...

Could it be something with project dependencies or some setting I should
change in my application context?  My firewall is off, and everything is
happening on my local machine (both client and service).

Thank you,
 - Dave
-- 
View this message in context: 
http://www.nabble.com/Empty-SOAP-Inbound-Message-when-service-is-deployed-on-Tomcat-tp22394848p22394848.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to