cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r826724 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Date Mon, 19 Oct 2009 16:58:21 GMT
Author: dkulp
Date: Mon Oct 19 16:58:20 2009
New Revision: 826724

URL: http://svn.apache.org/viewvc?rev=826724&view=rev
Log:
Update sts client to be smarter about finding the operation it needs

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=826724&r1=826723&r2=826724&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Mon Oct 19 16:58:20 2009
@@ -69,6 +69,7 @@
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 import org.apache.cxf.transport.Conduit;
@@ -295,6 +296,16 @@
                 return boi;
             }
         }
+        //operation is not correct as the Action is not set correctly.   Let's see if
+        //we can at least find it by name and then set the action and such manually later.
+        for (BindingOperationInfo boi : bi.getOperations()) {
+            if (boi.getInput().getMessageInfo().getMessageParts().size() > 0) {
+                MessagePartInfo mpi = boi.getInput().getMessageInfo().getMessagePart(0);
+                if ("RequestSecurityToken".equals(mpi.getConcreteName().getLocalPart()))
{
+                    return boi;
+                }
+            }
+        }
         return null;
     }
 
@@ -318,6 +329,9 @@
         client.getRequestContext().putAll(ctx);
         if (action != null) {
             client.getRequestContext().put(SoapBindingConstants.SOAP_ACTION, action);
+        } else {
+            client.getRequestContext().put(SoapBindingConstants.SOAP_ACTION, 
+                                           namespace + "/RST/Issue");
         }
 
         W3CDOMStreamWriter writer = new W3CDOMStreamWriter();



Mime
View raw message