[JBossWS-CXF] - Connecting to a WCF front end
by bryan.kearney
I am trying to connect a WCF front end to a backend WS exposed via jbossws-cxf. I have planned to test in the following he following steps:
1) "Bare" Web Service
2) WSRM+Addressing ontop of (1)
3) Security on top of (2)
1) worked with basicHttpBinding
I am failing on (2) using both a custom binding as well as wsHttpBinding. Both give me the following exception:
|
| C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1
| \bin\Debug>ConsoleApplication1.exe
|
| Unhandled Exception: System.ServiceModel.ProtocolException: The remote endpoint responded to the CreateSequence request
| with a response with action . The response must be a CreateSequenceResponse with action http://schemas.xmlsoap.org/ws/20
| 05/02/rm/CreateSequenceResponse. The channel could not be opened.
|
| Server stack trace:
| at System.ServiceModel.Channels.ClientReliableSession.ProcessCreateSequenceResponse(Message response, DateTime start)
|
| at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)
| at System.ServiceModel.Channels.ReliableRequestSessionChannel.OnOpen(TimeSpan timeout)
| at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
| at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
| at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
| at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Cal
| l(ServiceChannel channel, TimeSpan timeout)
| at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
| at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
| at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, O
| bject[] ins, Object[] outs, TimeSpan timeout)
| at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, O
| bject[] ins, Object[] outs)
| at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntim
| e operation)
| at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
|
| Exception rethrown at [0]:
| at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
| at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
| at ConsoleApplication1.ServiceReferenceWCF.WCFBackendBean.runAction(runActionRequest request)
| at ConsoleApplication1.ServiceReferenceWCF.WCFBackendBeanClient.ConsoleApplication1.ServiceReferenceWCF.WCFBackendBea
| n.runAction(runActionRequest request) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Project
| s\ConsoleApplication1\ConsoleApplication1\Service References\ServiceReferenceWCF\Reference.cs:line 1132
| at ConsoleApplication1.ServiceReferenceWCF.WCFBackendBeanClient.runAction(vdcActionType actionType, vdcActionParamete
| rs parameters) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\ConsoleApplication1\C
| onsoleApplication1\Service References\ServiceReferenceWCF\Reference.cs:line 1139
| at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and Settings\Administrator\My Documents\Visual Stu
| dio 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 13
|
| C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1
| \bin\Debug>ConsoleApplication1.exe
|
|
Has anyone gotten this to work that can post the configurations on the server and client side?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217141#4217141
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217141
15 years, 2 months
[JBossWS-CXF] - Reliable message erroring on extra sends
by bryan.kearney
I have a working RM client and server (Thanks!) using signed certificates. It appears that after the request is done, the server is resending a response again and failing becuase it can not. I am seeing the following stack trace:
| 10:40:39,507 INFO [RetransmissionQueueImpl] WS-RM retransmission of message 1.
| 10:40:39,507 INFO [ContextUtils] retrieving MAPs from context property javax.xml.ws.addressing.context.outbound
| 10:40:39,507 INFO [ContextUtils] current MAPs [MessageId: urn:uuid:9ed5dbdb-0d44-4a34-a577-5be371be9388, Action: http://backend.vdc.redhat.com/WCFBackendBean/runActionResponse, To: http://www.w3.org/2005/08/addressing/anonymous, RelatesTo: urn:uuid:36fb469f-67bc-4ea7-ba50-3b095abd31a5]
| 10:40:39,507 WARN [DeferredConduitSelector] MessageObserver not found
| 10:40:40,516 ERROR [RetransmissionQueueImpl] WS-RM retransmission failed.
| java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
| at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1111)
| at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
| at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2001)
| at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1980)
| at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1905)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.resend(RetransmissionQueueImpl.java:350)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.serverResend(RetransmissionQueueImpl.java:303)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.access$500(RetransmissionQueueImpl.java:71)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$3.resend(RetransmissionQueueImpl.java:546)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$ResendCandidate.run(RetransmissionQueueImpl.java:417)
| at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$ResendCandidate.initiate(RetransmissionQueueImpl.java:406)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$ResendCandidate$1ResendTask.run(RetransmissionQueueImpl.java:500)
| at java.util.TimerThread.mainLoop(Timer.java:512)
| at java.util.TimerThread.run(Timer.java:462)
| 10:53:27,506 INFO [RetransmissionQueueImpl] WS-RM retransmission of message 1.
| 10:53:27,507 INFO [ContextUtils] retrieving MAPs from context property javax.xml.ws.addressing.context.outbound
| 10:53:27,507 INFO [ContextUtils] current MAPs [MessageId: urn:uuid:9ed5dbdb-0d44-4a34-a577-5be371be9388, Action: http://backend.vdc.redhat.com/WCFBackendBean/runActionResponse, To: http://www.w3.org/2005/08/addressing/anonymous, RelatesTo: urn:uuid:36fb469f-67bc-4ea7-ba50-3b095abd31a5]
| 10:53:27,507 WARN [DeferredConduitSelector] MessageObserver not found
| 10:53:28,113 ERROR [RetransmissionQueueImpl] WS-RM retransmission failed.
| java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
| at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1111)
| at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
| at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2001)
| at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1980)
| at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1905)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.resend(RetransmissionQueueImpl.java:350)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.serverResend(RetransmissionQueueImpl.java:303)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl.access$500(RetransmissionQueueImpl.java:71)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$3.resend(RetransmissionQueueImpl.java:546)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$ResendCandidate.run(RetransmissionQueueImpl.java:417)
| at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$ResendCandidate.initiate(RetransmissionQueueImpl.java:406)
| at org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl$ResendCandidate$1ResendTask.run(RetransmissionQueueImpl.java:500)
| at java.util.TimerThread.mainLoop(Timer.java:512)
| at java.util.TimerThread.run(Timer.java:462)
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215385#4215385
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215385
15 years, 2 months
[JBossWS-CXF] - Re: WSSecurityEngine: No crypto property file supplied for d
by bryan.kearney
Lets try server first. My CXF endpoint is in a single ejb jar within the ear. The jar file looks like:
| 0 Wed Mar 04 14:45:44 GMT-05:00 2009 META-INF/
| 127 Wed Mar 04 14:45:42 GMT-05:00 2009 META-INF/MANIFEST.MF
| 0 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/wsdl/
| 0 Wed Mar 04 12:51:58 GMT-05:00 2009 com/
| 0 Wed Mar 04 12:51:58 GMT-05:00 2009 com/redhat/
| 0 Wed Mar 04 12:51:58 GMT-05:00 2009 com/redhat/vdc/
| 0 Wed Mar 04 12:51:58 GMT-05:00 2009 com/redhat/vdc/backend/
| 2523 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/wsdl/com.redhat.vdc.backend.WCFBackendBean.wsdl
| 10140 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/wsdl/WCFBackendBean_schema1.xsd
| 634 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/solidiceserver.cer
| 1675 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/solidiceserver.jks
| 334 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/cxf.properties
| 634 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/solidiceclient.cer
| 3490 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/jbossws-cxf.xml
| 357 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/README
| 1673 Wed Mar 04 12:51:52 GMT-05:00 2009 META-INF/solidiceclient.jks
| 2362 Wed Mar 04 12:51:58 GMT-05:00 2009 com/redhat/vdc/backend/PasswordCallbackHandler.class
| 1879 Wed Mar 04 12:51:58 GMT-05:00 2009 com/redhat/vdc/backend/WCFBackendBean.class
| 0 Wed Mar 04 14:45:44 GMT-05:00 2009 META-INF/maven/
| 0 Wed Mar 04 14:45:44 GMT-05:00 2009 META-INF/maven/com.redhat.vdc/
| 0 Wed Mar 04 14:45:44 GMT-05:00 2009 META-INF/maven/com.redhat.vdc/wcf-cxf/
| 3036 Wed Feb 25 16:20:00 GMT-05:00 2009 META-INF/maven/com.redhat.vdc/wcf-cxf/pom.xml
| 121 Wed Mar 04 14:45:42 GMT-05:00 2009 META-INF/maven/com.redhat.vdc/wcf-cxf/pom.properties
|
The code for the bean itself is this:
| package com.redhat.vdc.backend;
|
| import javax.ejb.EJB;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.wsf.spi.annotation.WebContext;
|
| import com.redhat.vdc.action.VdcActionParameters;
| import com.redhat.vdc.action.VdcActionType;
| import com.redhat.vdc.action.VdcReturnValue;
| import com.redhat.vdc.common.utils.VdcException;
|
| @WebService(serviceName = "WCFBackendBean", wsdlLocation = "META-INF/wsdl/com.redhat.vdc.backend.WCFBackendBean.wsdl")
| @WebContext(contextRoot = "/backend", urlPattern = "/*")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
| @Stateless(name = "WCFBackend")
| public class WCFBackendBean {
|
| @EJB(beanName = "Backend")
| Backend backend;
|
| static {
| //com.sun.xml.ws.transport.http.HttpAdapter.dump=true ;
| }
|
| @WebMethod
| @WebResult(name = "vdcReturnValue")
| public VdcReturnValue runAction(
| @WebParam(name = "actionType") VdcActionType type,
| @WebParam(name = "parameters") VdcActionParameters params) {
|
| try {
| return backend.runAction(type, params);
| } catch (VdcException e) {
| throw e;
| } catch (Exception e) {
| throw new VdcException(e);
| }
| }
| }
|
cxf.properties:
| org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
| org.apache.ws.security.crypto.merlin.keystore.type=jks
| org.apache.ws.security.crypto.merlin.keystore.password=password
| org.apache.ws.security.crypto.merlin.keystore.alias=solidiceserver
| org.apache.ws.security.crypto.merlin.file=solidiceserver.jks
|
And jbossws-cxf.xml
| <beans xmlns='http://www.springframework.org/schema/beans'
| xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:beans='http://www.springframework.org/schema/beans'
| xmlns:jaxws='http://cxf.apache.org/jaxws' xmlns:wsp='http://www.w3.org/2006/07/ws-policy'
| xmlns:p='http://cxf.apache.org/policy'
| xsi:schemaLocation='http://www.springframework.org/schema/beans
| http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
| http://cxf.apache.org/policy
| http://cxf.apache.org/schemas/policy.xsd
| http://www.w3.org/2006/07/ws-policy
| http://www.w3.org/2006/11/ws-policy.xsd
| http://cxf.apache.org/jaxws
| http://cxf.apache.org/schemas/jaxws.xsd'>
|
| <bean id="Sign_Request" class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
| <constructor-arg>
| <map>
| <entry key="action" value="Timestamp Signature Encrypt" />
| <entry key="signaturePropFile" value="cxf.properties" />
| <entry key="decryptionPropFile" value="cxf.properties" />
| <entry key="passwordCallbackClass"
| value="com.redhat.vdc.backend.PasswordCallbackHandler" />
| </map>
| </constructor-arg>
| </bean>
|
| <bean id="Sign_Response" class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
| <constructor-arg>
| <map>
| <entry key="action" value="Timestamp Signature Encrypt" />
| <entry key="user" value="solidice" />
| <entry key="signaturePropFile" value="cxf.properties" />
| <entry key="encryptionPropFile" value="cxf.properties" />
| <entry key="encryptionUser" value="solidiceserver" />
| <entry key="signatureKeyIdentifier" value="DirectReference" />
| <entry key="passwordCallbackClass"
| value="com.redhat.vdc.backend.PasswordCallbackHandler" />
| <entry key="signatureParts"
| value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
| <entry key="encryptionParts"
| value="{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
| <!-- <entry key="encryptionKeyTransportAlgorithm" value="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /> -->
| <entry key="encryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
| </map>
| </constructor-arg>
| </bean>
|
|
| <wsp:Policy wsu:Id="wsrm10policy"
| xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...">
| <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2006/05/addressing/wsdl" />
| <wsrmp:RMAssertion xmlns:wsrmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" />
| </wsp:Policy>
|
| <!-- address='http://@jboss.bind.address@:8080/backend' -->
| <jaxws:endpoint id='WCFBackend'
| implementor='com.redhat.vdc.backend.WCFBackendBean'>
| <jaxws:invoker>
| <bean class='org.jboss.wsf.stack.cxf.InvokerJSE' />
| </jaxws:invoker>
| <jaxws:features>
| <p:policies namespace="http://www.w3.org/2006/07/ws-policy">
| <wsp:PolicyReference URI="#wsrm10policy"
| xmlns:wsp="http://www.w3.org/2006/07/ws-policy" />
| </p:policies>
| </jaxws:features>
| <jaxws:outInterceptors>
| <!-- <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/> -->
| <ref bean="Sign_Response"/>
| </jaxws:outInterceptors>
| <jaxws:inInterceptors>
| <ref bean="Sign_Request"/>
| <!-- <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/> -->
| </jaxws:inInterceptors>
| </jaxws:endpoint>
|
| </beans>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215016#4215016
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215016
15 years, 2 months