Error org.apache.axis2.AxisFault: 
<ErrorCode>3000</ErrorCode><ErrorDescription>Undefined Error</ErrorDescription>
-----------------------------------------------------------------------------------------------------------------

                 Key: RAMPART-318
                 URL: https://issues.apache.org/jira/browse/RAMPART-318
             Project: Rampart
          Issue Type: Question
    Affects Versions: 1.5.1
         Environment: Windows 7 Enterprise Edition, Eclipse Helios, 
Axis2-1.5.4, Java 6, EJB3.

            Reporter: Edder Peña
            Priority: Critical


Hello everybody.

I'm trying to connect to a web service that uses usernametoken authentication 
and I'm implementing the security through a policy.xml, but when I set the 
username and the password through options.setUsername(getUSername) and the 
password in the same way I'm getting the following error:

org.apache.axis2.AxisFault: 
<ErrorCode>3000</ErrorCode><ErrorDescription>Undefined Error</ErrorDescription>
        at 
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:435)
        at 
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
        at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
        at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
        at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
        at 
com.comverse_in.prepaid.ccws.ServiceStub.changeCallingCircle(ServiceStub.java:23974)
        at 
sv.com.millicom.callingcircles.negocio.ejb.CallingCirclesEJB.crearCallingCircle(CallingCirclesEJB.java:420)
        at test.TestService.main(TestService.java:25)

I'm invoking the service just like this:

public boolean crearCallingCircle(String nombreCallingCircle)
                        throws RemoteException, FileNotFoundException, 
XMLStreamException {
                
                ConfigurationContext ctx = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem("axis-repo",
 null);//getAxisConf());
                
                stub = new ServiceStub(ctx, getTargetEndpoint());
                
                ServiceClient client = stub._getServiceClient();
                client.engageModule("rampart");
                
                ClassLoader loader = CallingCirclesEJB.class.getClassLoader();
                InputStream resource = loader.getResourceAsStream("policy.xml");
                StAXOMBuilder builder = new StAXOMBuilder(resource);

                Policy policy = 
PolicyEngine.getPolicy(builder.getDocumentElement());
                
                Options options = client.getOptions();
                options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
policy);
                options.setUserName(getUsuario());
                options.setPassword(getPassword());
                client.setOptions(options);
                .
                .
                .
                ChangeCallingCircleResponseDocument respuesta = 
stub.changeCallingCircle(change, header);
                ChangeCallingCircleResponse response = 
respuesta.getChangeCallingCircleResponse();
                com.comverse_in.prepaid.ccws.ChangeCallingCircleResponse result 
= response.getChangeCallingCircleResult();
                // Retorna true si se creó el CallingCircle
                return result.getSuccess();
        }

And the policy.xml file is like the next:

<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy wsu:Id="UTOverTransport"
        
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
        xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";>
        <wsp:ExactlyOne>
                <wsp:All>
                        <sp:SignedSupportingTokens
                                
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                <wsp:Policy>
                                        <sp:UsernameToken
                                                
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"/>
                                </wsp:Policy>
                        </sp:SignedSupportingTokens>
                </wsp:All>
        </wsp:ExactlyOne>
</wsp:Policy>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to