You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2016/05/26 08:56:25 UTC

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Hi

Quick question, can a JAX-WS server return 406 ? is it a CXF JAX-WS 
server ?

Cheers, Sergey
On 25/05/16 15:44, nicolasduminil wrote:
> Greetings,
>
> I have a JAX-WS web service deployed on an app server and I try to call it
> via a JAX-WS client generated by the maven cxf-codegen-plugin. But it
> doesn't work as the server returns HTTP 406 : Not Acceptable. I cannot
> figure out what happens as it works with SoapUI.
>
> The only think I could think at is that the service requires user/password
> authentication. This is set in SoapUI via "User" and "Password" properties
> in the request properties. I'm doing the equivalent in the code like this:
>
>
> bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
> "foo");
>
> bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
> "bar");
>
> This is supposed to work correctly. Anyway, if the authentication was the
> problem, I would have HTTP 401 insted of HTTP 406. This is what I get when
> I'm altering the password in SoapUI.
>
> I tried to trace the SOAP trafic on the client side, as I don't have access
> to the server. But unsuccessfully. Could anyone advise please ?
>
> Many thanks in advance,
>
> Nicolas
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
"However, you came to the CXF list and we certainly do not support the JAX-WS
impl in the JDK.   From our perspective, we just need to make sure it works
OK with CXF and if not, fix any CXF bug that might be exposed.  If you want
it working with the JDK JAX-WS, you would need to go to the jax-ws community
at Oracle and report it there."

Yes Dan, I kinow. In a way, it's like going to Renault to ask for advise for
Peugeot cars :-).

But many thanks again for your help without which I woudn't have made it. 

Kind regards,

Nicolas DUMINIL

P.S. I tried to close the ticket or put it in a status solved, but I didn't
find how. I juste leave it as it is.



--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5769048.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by Daniel Kulp <dk...@apache.org>.
> On May 27, 2016, at 9:02 AM, nicolasduminil <ni...@simplex-software.fr> wrote:
> 
> Okay, problem was solved by removing another dependency to 2.7.8 that was
> forgotten. Now everything works properly.
> 
> But just for my understanding: why did I have to use CXF libraries and I
> couldn't simply use JAX-WS comming with Java 7/8 ?

In theory, it should work with the JAX-WS in the JDK.    Since it doesn’t, you may have hit a bug or something there.   No idea.

However, you came to the CXF list and we certainly do not support the JAX-WS impl in the JDK.   From our perspective, we just need to make sure it works OK with CXF and if not, fix any CXF bug that might be exposed.  If you want it working with the JDK JAX-WS, you would need to go to the jax-ws community at Oracle and report it there.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
Okay, problem was solved by removing another dependency to 2.7.8 that was
forgotten. Now everything works properly.

But just for my understanding: why did I have to use CXF libraries and I
couldn't simply use JAX-WS comming with Java 7/8 ?

Kind regards,

Nicolas DUMINIL



--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5769043.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
Hi Dan,

Many thanks for your suggestion. My dependencies now are as follows:

    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxws</artifactId>
      <version>3.1.6</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http</artifactId>
      <version>3.1.6</version>
    </dependency>

and the new stack trace is as follows:

java.lang.NoSuchMethodError:
org.apache.cxf.common.util.ReflectionUtil.getDeclaredConstructors(Ljava/lang/Class;)[Ljava/lang/reflect/Constructor;
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:325)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:236)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:226)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:406)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:370)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:236)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:226)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:406)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:370)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:236)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:226)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:406)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:370)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:236)
	at
org.apache.cxf.jaxb.JAXBContextInitializer.begin(JAXBContextInitializer.java:143)
	at
org.apache.cxf.service.ServiceModelVisitor.visitOperation(ServiceModelVisitor.java:109)
	at
org.apache.cxf.service.ServiceModelVisitor.walk(ServiceModelVisitor.java:74)
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:315)
	at
org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
	at
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:423)
	at
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:525)
	at
org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261)
	at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
	at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
	at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
	at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
	at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
	at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:493)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:359)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:350)
	at javax.xml.ws.Service.getPort(Service.java:119)
	at
com.lnf.ts_archivage.ArchivageService.getArchivageSoap12(ArchivageService.java:78)
	at com.lnf.ts.workflow.TestArchiver.setUpBeforeClass(TestArchiver.java:25)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

It looks like a version missmatch but between what and what 'cause I only
have two CXF dependencies, both on the same version. I have googled around
and found lots of guys reporting the issue but not any pertinent solution.

Could you please shed some light again ?

Many thanks in advance,

Nicolas DUMINIL



--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5769026.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by Daniel Kulp <dk...@apache.org>.
> On May 26, 2016, at 12:07 PM, nicolasduminil <ni...@simplex-software.fr> wrote:
> 
> Apache CXF 2.4.5


I would start with upgrading to Apache CXF 3.1.6.   That version is ANCIENT and certainly not supported anymore.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
Okay, adding cxf-rt-transports-http as a dependency solves the previous
exception. Now I'm sure I'm using CXF instead of the default JAX-WS comming
with Java 8. And the result has changed: I'm receiving:

org.apache.cxf.transport.http.HTTPException: HTTP response '401:
Unauthorized' when communicating with http://...

Here is the service response in TCP/IP Monitor (by the way the trick with
-Dhttp.ProxyHost ... worked):

HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
WWW-Authenticate: Basic realm="Spring"
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 26 May 2016 16:00:41 GMT

a5
{"timestamp":1464278441332,"status":401,"error":"Unauthorized","message":"Full
authentication is required to access this
resource","path":"/api/ts/archivage/1.1/ws"}
0

And here is the request:

POST http://test.... HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8
Accept: */*
User-Agent: Apache CXF 2.4.5
Cache-Control: no-cache
Pragma: no-cache
Host: test.intrasie.lexisnexis.fr
Proxy-Connection: keep-alive
Content-Length: 259

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
    ...
  </soap:Body>
</soap:Envelope>

The SoapUI request is as follows:

POST /ws HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8
Content-Length: 679
Host: localhost:9000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
mlns:ts="http://ts_archivage.lnf.com/">
   <soap:Header/>
   <soap:Body>
     ...
   </soap:Body>
</soap:Envelope>

POST /ws HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8
Content-Length: 679
Host: localhost:9000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Authorization: Basic c2VjdXJlZDpmb28=

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:ts="http://ts_archivage.lnf.com/">
   <soap:Header/>
   <soap:Body>
     ...
   </soap:Body>
</soap:Envelope>

and the SoapUI response:

HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
WWW-Authenticate: Basic realm="Spring"
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 26 May 2016 15:49:52 GMT

90
{"timestamp":1464277792181,"status":401,"error":"Unauthorized","message":"Full
authentication is required to access this resource","path":"/ws"}
0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Application-Context: application:9001
Accept: application/soap+xml, text/html, image/gif, image/jpeg, *; q=.2,
*/*; q=.2
SOAPAction: ""
Content-Type: Multipart/Related;
boundary="----=_Part_4_135559848.1464277792196"; type="application/xop+xml";
start-info="application/soap+xml";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 26 May 2016 15:49:52 GMT

1ff
------=_Part_4_135559848.1464277792196
Content-Type: application/xop+xml; charset=utf-8;
type="application/soap+xml"

<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header/><env:Body>...</env:Body></env:Envelope>
------=_Part_4_135559848.1464277792196--
0

What seems to happen is that the authentication doesn't work in my unit test
calling the JAX-WS proxy. However, the following is setting the credentials:

   
bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"bar");
   
bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"foo");

What I'm doing wrong here ?

Many thanks in advance,

Nicolas




--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5768967.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
Hello,

Many thanks again for this precious information. I added the mentioned
dependency (cxf-rt-frontend-jaxws) to my pom and here is the new
stack-trace:

javax.xml.ws.soap.SOAPFaultException: Could not find conduit initiator for
transport http://schemas.xmlsoap.org/soap/http
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
	at com.sun.proxy.$Proxy31.getBundle(Unknown Source)
	at com.lnf.ts.workflow.TestArchiver.test(TestArchiver.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

I googled but I found many confusing things suggesting to add another
half-dozen of dependencies on Jetty stuff etc. Shouldn't
cxf-rt-frontend-jaxws pull everything it needs ?

Many thanks in advance,

Nicolas



--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5768965.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by Daniel Kulp <dk...@apache.org>.
> On May 26, 2016, at 10:26 AM, nicolasduminil <ni...@simplex-software.fr> wrote:
> 
> Hello,
> 
> I confirm the exception is raised by
> com.sun.xml.internal.ws.client.ClientTransportException. When you're saying
> that I'm not using CXF, do you mean on the client side or the service is not
> CXF ?

The client side.   The “com.sun.xml.internal.ws.client” package is the JAX-WS implementation built into the JDK/JRE.


> For the service, as I said, it was developed using Spring WS. As per
> the client, it is a JAX-WS proxy generated by the maven plugin for CXF, like
> this:
> ………….
> 
> There is no any CXF jar.

CXF generates (by default) clients that are completely compatible with the JAX-WS standard and thus work with the implementation in the JDK (like you are using) or our own implementation.   To use CXF, you would need to add the cxf-rt-frontend-jaxws and it’s dependencies onto the classpath.


> As per turning on the logging on the service, how should I dod it in an
> embedded Tomcat running in Spring Boot ? I tried to use TCP/IP Monitor. I'm
> getting the traffiv when using the SoapUI proxy but when I use the one
> generated by wsdl2java nothing appears in the TCP/IP Monotor console and the
> HTTP 401 is returned.
> 
> Could you please help further ?

Since you are not using CXF at runtime, I’m not sure what to suggest.   You should be able to get the client to use the TCP proxy via the normal system properties.  Example:

-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8080

or similar so that the data would go through the tcp monitor.   


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
Hello,

I confirm the exception is raised by
com.sun.xml.internal.ws.client.ClientTransportException. When you're saying
that I'm not using CXF, do you mean on the client side or the service is not
CXF ? For the service, as I said, it was developed using Spring WS. As per
the client, it is a JAX-WS proxy generated by the maven plugin for CXF, like
this:

      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <version>2.7.8</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <sourceRoot>src/main/java/</sourceRoot>
              <wsdlOptions>
                <wsdlOption>
                  <wsdl>http://localhost:9001/ws/archiver?WSDL</wsdl>
                  <extraargs>
                    <extraarg>-client</extraarg>
                    <extraarg>-validate</extraarg>
                  </extraargs>
                </wsdlOption>
              </wsdlOptions>
            </configuration>
            <goals>
              <goal>wsdl2java</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Then, the unit test does the following:

  private static ArchiverService archiverService;
  private static BindingProvider bindingProvider;

  @BeforeClass
  public static void setUpBeforeClass() throws Exception
  {
    Authenticator.setDefault(new ClientAuthenticator());
    archiverService = new ArchivageService();
    bindingProvider = (BindingProvider) archiverService.getArchiverSoap12();
   
bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"secured");
   
bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"foo");
  }

There is no any CXF jar.

As per turning on the logging on the service, how should I dod it in an
embedded Tomcat running in Spring Boot ? I tried to use TCP/IP Monitor. I'm
getting the traffiv when using the SoapUI proxy but when I use the one
generated by wsdl2java nothing appears in the TCP/IP Monotor console and the
HTTP 401 is returned.

Could you please help further ?

Many thanks in advance.

Nicolas




--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5768963.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by Daniel Kulp <dk...@apache.org>.
For one, if the error is coming from com.sun.xml.internal.ws.client, you aren’t using CXF.   You are using the jaxws impl built into the JDK.  I’d start off by making sure the appropriate CXF jars are found and being picked up. 

Next would be to turn on logging and check the soap message being sent to see if it more or less matches what soap-ui is sending.

Dan



> On May 26, 2016, at 9:38 AM, nicolasduminil <ni...@simplex-software.fr> wrote:
> 
> Hi,
> 
> What do you mean ? Of course it can since it does. And by "a JAX-WS server"
> you mean "a JAX-WS service" right ? 
> 
> But I probably need to provide more details concerning the web service's
> technology. AFAIK, it was developed with Spring-WS and runs in a Tomcat
> server, embedded in Spring Boot.
> 
> Anyway, the client generated with SoapUI works and I expect the same from a
> client generated with CXF wsdl2java. What does SoapUI do more that any
> standard JAX-WS proxy ?
> 
> Makes sense ?
> 
> Kind regards,
> 
> Nicolas
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5768959.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: com.sun.xml.internal.ws.client.ClientTransportException: The server sent the status code HTTP 406 : Not Acceptable

Posted by nicolasduminil <ni...@simplex-software.fr>.
Hi,

What do you mean ? Of course it can since it does. And by "a JAX-WS server"
you mean "a JAX-WS service" right ? 

But I probably need to provide more details concerning the web service's
technology. AFAIK, it was developed with Spring-WS and runs in a Tomcat
server, embedded in Spring Boot.

Anyway, the client generated with SoapUI works and I expect the same from a
client generated with CXF wsdl2java. What does SoapUI do more that any
standard JAX-WS proxy ?

Makes sense ?

Kind regards,

Nicolas



--
View this message in context: http://cxf.547215.n5.nabble.com/com-sun-xml-internal-ws-client-ClientTransportException-The-server-sent-the-status-code-HTTP-406-Note-tp5768944p5768959.html
Sent from the cxf-user mailing list archive at Nabble.com.