cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Homer <ian.ho...@gmail.com>
Subject Re: WS-Security with SSL: Http error 415
Date Tue, 07 Apr 2009 10:22:19 GMT
You might be sending a SOAP 1.1 request to a SOAP 1.2 port.  I've seen  
a 415 thrown from WCF for this reason.  415 essentially means an  
unsupported media type - http://www.w3.org/2000/xp/Group/2/03/11/soap-1.2-conformance.html#http-415

Cheers,

Ian

On 7 Apr 2009, at 11:09, Rodriguez, José wrote:

> Hi,
>
> I have a cxf 2.0.10 client and I try to use a service with WS- 
> Security and SSL. The service is based on the Microsoft  
> implementation.
>
> It works just fine with soapUI but using CXF I have the following  
> exception:
>
> 7 avr. 2009 11:33:58 org.apache.cxf.phase.PhaseInterceptorChain  
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not send Message.
> 	at org.apache.cxf.interceptor.MessageSenderInterceptor 
> $ 
> MessageSenderEndingInterceptor 
> .handleMessage(MessageSenderInterceptor.java:64)
> 	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: 
> 124)
> 	at $Proxy40.test(Unknown Source)
> 	at  
> ch.generali.test.ServiceFlexiServices.woot(ServiceFlexiServices.java: 
> 10)
> 	at  
> ch.generali.test.ServiceFlexiServices.main(ServiceFlexiServices.java: 
> 26)
> Caused by: java.io.IOException: Server returned HTTP response code:  
> 415 for URL: https://xxxx/xxxxx.svc
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native  
> Method)
> 	at  
> sun 
> .reflect 
> .NativeConstructorAccessorImpl 
> .newInstance(NativeConstructorAccessorImpl.java:39)
> 	at  
> sun 
> .reflect 
> .DelegatingConstructorAccessorImpl 
> .newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> 	at sun.net.www.protocol.http.HttpURLConnection 
> $6.run(HttpURLConnection.java:1225)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at  
> sun 
> .net 
> .www 
> .protocol 
> .http.HttpURLConnection.getChainedException(HttpURLConnection.java: 
> 1219)
> 	at  
> sun 
> .net 
> .www 
> .protocol 
> .http.HttpURLConnection.getInputStream(HttpURLConnection.java:906)
> 	at  
> sun 
> .net 
> .www 
> .protocol 
> .https 
> .HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java: 
> 234)
> 	at org.apache.cxf.transport.http.HTTPConduit 
> $WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2097)
> 	at org.apache.cxf.transport.http.HTTPConduit 
> $WrappedOutputStream.handleResponse(HTTPConduit.java:1987)
> 	at org.apache.cxf.transport.http.HTTPConduit 
> $WrappedOutputStream.close(HTTPConduit.java:1912)
> 	at  
> org 
> .apache 
> .cxf 
> .io 
> .CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java: 
> 47)
> 	at  
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java: 
> 179)
> 	at  
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java: 
> 66)
> 	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java: 
> 611)
> 	at org.apache.cxf.interceptor.MessageSenderInterceptor 
> $ 
> MessageSenderEndingInterceptor 
> .handleMessage(MessageSenderInterceptor.java:62)
> 	... 9 more
>
>
>
>
> Here is my applicationContext:
>
> ...
>
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
>
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http- 
> jetty.xml" />
>
>
> 	<cxf:bus>
> 		<cxf:inInterceptors>
> 			<ref bean="logInbound" />
> 		</cxf:inInterceptors>
> 		<cxf:outInterceptors>
> 			<ref bean="logOutbound" />
> 		</cxf:outInterceptors>
> 		<cxf:inFaultInterceptors>
> 			<ref bean="logOutbound" />
> 		</cxf:inFaultInterceptors>
> 	</cxf:bus>
>
>
> 	<http:conduit name="*.http-conduit">
> 		<http:client ProxyServer="xxxxx" ProxyServerPort="xxxx" />
>
>
> 	</http:conduit>
>
> 	<bean id="logInbound"  
> class="org.apache.cxf.interceptor.LoggingInInterceptor" />
> 	<bean id="logOutbound"  
> class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
>
> 	<bean id="xxxxx" class="xxxxxxx">
>
> 		<property name="XXXX" ref="XXXX"></property>
>
> 	</bean>
>
> 	<jaxws:client id="XXXX" serviceClass="XXXX"
> 		address="https://xxxxx/xxxx.svc"
> 		wsdlLocation="classpath:META-INF/xxxxxx.wsdl" serviceName="s:xxxxxx"
> 		xmlns:s="http://xxxxxxxxx">
> 		<jaxws:outInterceptors>
> 			<!--
> 				SAAJ Interceptor needs to be explicitly declared only in CXF 2.0.x
> 			-->
> 			<bean  
> class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" />
>
> 			<bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
> 				<constructor-arg>
> 					<map>
> 						<entry key="action" value="UsernameToken" />
> 						<entry key="user" value="xxxxxxxx" />
> 						<entry key="passwordType" value="PasswordDigest" />
> 						<entry>
> 							<key>
> 								<value>passwordCallbackRef</value>
> 							</key>
> 							<ref bean="passwordCallback" />
> 						</entry>
> 					</map>
> 				</constructor-arg>
> 			</bean>
> 		</jaxws:outInterceptors>
>
> 	</jaxws:client>
>
> 	<bean id="passwordCallback" class="XXX.PasswordCallbackHandler" />
> </beans>
> ...
>
>
> I also tried :
> - CXF 2.2
> - changing the content type to "text/xml; action='http://tempuri.org/IFlexicarService/Test'

> ; charset=UTF-8"
> - <http:tlsClientParameters secureSocketProtocol="SSL"></ 
> http:tlsClientParameters>
>
>
> Any ideas?
>
> Regards
> J.
>

-- 
Ian Homer | http://blog.bemoko.com







Mime
View raw message