Hi,

I've got a SOAP operation that takes a long time to complete (in fact, I expect it to timeout, but I need that controlled by my code server side so it's not relevant to this). When I call the operation it blocks, as expected, but then after ~200s I see the operation called again. It isn't called by my code, so I think it's happening within CXF somewhere, but I can't work out where.

My web service client is set up like this:
        proxyFactory = new JaxWsProxyFactoryBean();
        proxyFactory.setServiceClass(IGenericConversion.class);
        proxyFactory.setAddress( url );

        client = (IGenericConversion)proxyFactory.create();
        BindingProvider binder = ( BindingProvider ) client;

        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
        httpClientPolicy.setConnectionTimeout( 10000 );
        httpClientPolicy.setAllowChunking( false );
        httpClientPolicy.setReceiveTimeout( 600 * 1000 );
        httpClientPolicy.setMaxRetransmits( 0 );
// httpClientPolicy.setProxyServer( "localhost" ); // Fiddler, sometimes
        // httpClientPolicy.setProxyServerPort( 8888 );

HTTPConduit http = ( HTTPConduit ) org.apache.cxf.frontend.ClientProxy.getClient( client ).getConduit();
        http.setClient( httpClientPolicy );
And called like this:
log.debug( "{}: Requesting conversion of {} to {}", new Object[]{ request.getCorrelationId(), request.getFileName(), request.getDestinationFormat() } );
        ConversionResult result = client.convert( request );

The server is set up like this:
        url = "http://localhost:"; + findFreePort() + "/pdf";
        log.debug( "Conversion web service URL: {}", url );

        if( server == null ) {
            conversionService = new ConversionWebService();
            serverFactory = new JaxWsServerFactoryBean();
            serverFactory.setServiceClass(ConversionWebService.class);
            serverFactory.setAddress( url );
            serverFactory.setServiceBean( conversionService );
            server = serverFactory.create();
        }
        server.start();
        log.debug( "server is {}", server );

        servletContext = new MockServletContext();
servletContext.addInitParameter( "office.port", Integer.toString( findFreePort() ) );
        servletContext.addInitParameter( "office.instances", "1" );
        WebappContext.init(servletContext);
conversionService.setWebappContext( WebappContext.get( servletContext ) );
And the operation implementation contains this:
    public ConversionResult convert( ConversionRequest parameters ) {

        try {
            ... // Parameter checking, no loops, honestly
log.debug( "{}: Converting file \"{}\" to {} ({} bytes)", new Object[]{
                    parameters.getCorrelationId(),
                    parameters.getFileName(),
                    destinationFormat,
                    parameters.getContent().length
                } );

And when I run it I'm getting:
Line 704: 15:33:00.977 [main] DEBUG c.g.j.s.BaseWebServiceTest - [BaseWebServiceTest.java(224) BaseWebServiceTest::convertFileToResult] 841627bf-5d24-4d51-aef2-a12693e7850f: Requesting conversion of Tardis.docx to PDF Line 844: 15:33:01.157 [qtp1672848394-16 - /pdf] DEBUG c.g.j.s.ConversionWebService - [ConversionWebService.java(84) ConversionWebService::convert] 841627bf-5d24-4d51-aef2-a12693e7850f: Converting file "Tardis.docx" to PDF (32620 bytes) Line 886: 15:36:21.498 [qtp1672848394-18 - /pdf] DEBUG c.g.j.s.ConversionWebService - [ConversionWebService.java(84) ConversionWebService::convert] 841627bf-5d24-4d51-aef2-a12693e7850f: Converting file "Tardis.docx" to PDF (32620 bytes) Line 925: 15:36:51.504 [qtp1672848394-18 - /pdf] DEBUG c.g.j.s.ConversionWebService - [ConversionWebService.java(214) ConversionWebService::convert] 841627bf-5d24-4d51-aef2-a12693e7850f: Conversion complete, file "Tardis.docx" to "null" (0 bytes) took 30.005s: null Line 1094: 15:36:51.539 [qtp1672848394-16 - /pdf] DEBUG c.g.j.s.ConversionWebService - [ConversionWebService.java(214) ConversionWebService::convert] 841627bf-5d24-4d51-aef2-a12693e7850f: Conversion complete, file "Tardis.docx" to "null" (0 bytes) took 230.377s: null Two calls to the implementation, 200s apart, but only one call from the client.

I hope this is blindingly obvious to someone in the know 'cos it's driving me insane now.
Thanks.

Jim

Reply via email to