cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Weaver <myordinat...@gmail.com>
Subject Chunked encoding from Microsoft client causes exception on WS request.
Date Wed, 27 Jul 2016 04:59:30 GMT
I've been using CXF successfully for several items in a trial basis--
however I am having an issue with a Microsoft client causing an exception
on the server that I'm banging my head against. I was hoping someone knew
of a resolution.

I think this is related to chunked encoding processing as all the requests
without
Transfer-Encoding: chunked
set in the header work just fine.. but any request from this client with
that header set gives the exception.

Any ideas?

Exception is as follows:

java.lang.RuntimeException: Couldn't parse stream.
at
org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1706)
at
org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:123)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:234)
at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1129)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1065)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxIOException: Unexpected first character
(char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM
marker. Make sure that the Reader uses correct encoding or pass an
InputStream instead
at
com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:174)
at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:545)
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:605)
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:628)
at
com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331)
at
org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1704)
... 18 more

I created a trial server to demonstrate:

import org.apache.cxf.annotations.DataBinding;
import org.apache.cxf.jaxws.EndpointImpl;


import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.transform.Source;
import javax.xml.ws.Service;
import javax.xml.ws.ServiceMode;
import java.io.IOException;

/**
 * Created by jweaver on 7/26/2016.
 */
@WebService(targetNamespace = "urn:schemas-microsoft-com:xml-analysis")
@ServiceMode(Service.Mode.PAYLOAD)
@DataBinding(org.apache.cxf.databinding.source.SourceDataBinding.class)
public class CXFTester {
  @WebMethod(operationName = "Discover", action =
"urn:schemas-microsoft-com:xml-analysis:Discover")
  @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  public Source discover(Source input) {
    return input;
  }

  public static void main(String[] args) throws IOException {
    String address = "http://0.0.0.0:9000/";
    CXFTester test = new CXFTester();

    EndpointImpl jaxwsEndpoint = new EndpointImpl(test);
    jaxwsEndpoint.setAddress(address);
    jaxwsEndpoint.publish();

  }

}

My POM is only the CXF imports.

<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-frontend-jaxws</artifactId>
    <version>3.1.6</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-transports-http
-->
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>3.1.6</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-transports-http-jetty
-->
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http-jetty</artifactId>
    <version>3.1.6</version>

</dependency>

Message sent from client:
POST http://nwtlt03276:9000/ HTTP/1.1
User-Agent: ADOMD.NET
Content-Type: text/xml
SOAPAction: "urn:schemas-microsoft-com:xml-analysis:Discover"
X-Transport-Caps-Negotiation-Flags: 0,0,0,0,0
SspropInitAppName: Microsoft SQL Server Management Studio
Host: nwtlt03276:9000
Transfer-Encoding: chunked
Expect: 100-continue
Connection: Keep-Alive

341
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
  <Header>
    <Version Sequence="410" xmlns="
http://schemas.microsoft.com/analysisservices/2003/engine/2" />
  </Header>
  <Body>
    <Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
      <RequestType>DISCOVER_PROPERTIES</RequestType>
      <Restrictions>
        <RestrictionList>
          <PropertyName>DbpropMsmdActivityID</PropertyName>
        </RestrictionList>
      </Restrictions>
      <Properties>
        <PropertyList>
          <Timeout>0</Timeout>
          <SspropInitAppName>Microsoft SQL Server Management
Studio</SspropInitAppName>
          <LocaleIdentifier>1033</LocaleIdentifier>
          <ClientProcessID>12528</ClientProcessID>
        </PropertyList>
      </Properties>
    </Discover>
  </Body>
</Envelope>
0

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message