wood burning stoves 2.0*
The moose likes Web Services and the fly likes Secure Web Service Client  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Secure Web Service Client  " Watch "Secure Web Service Client  " New topic
Author

Secure Web Service Client

Oha Moha
Greenhorn

Joined: Aug 09, 2010
Posts: 2
Hello.
I try to create a Web Service Proxy(client) using JDeveloper. The goal is to connect to a secured external web service.
The WSDL provided by the web service doesn't contain any information about the security policy.
I decided to give it a try, so from the "Client Policy Configuration" page from "Proxy Editor" window I choose "oracle/wss_username_token_client_policy".
The problem is that I didn't find a way to set the username and the password. So I receive a error like that:

SEVERE: WSM-00078 The configuration of the credentials in the policy is incorrect.
SEVERE: WSM-00016 The username/password credentials or certificates null are missing.
SEVERE: WSM-00005 Error in sending the request.
SEVERE: WSM-07607 Failure in execution of assertion {http://schemas.oracle.com/ws/2006/01/securitypolicy}wss-username-token executor class oracle.wsm.security.policy.scenario.executor.WssUsernameTokenScenarioExecutor.
SEVERE: WSM-07602 Failure in WS-Policy Execution due to exception.
SEVERE: WSM-07501 Failure in Oracle WSM Agent processRequest, category=security, function=agent.function.client, application=null, composite=null, modelObj=EVPQuery, policy=oracle/wss_username_token_client_policy, policyVersion=null, assertionName={http://schemas.oracle.com/ws/2006/01/securitypolicy}wss-username-token.
oracle.wsm.common.sdk.WSMException: WSM-00015 : The user name is missing.
at oracle.wsm.security.policy.scenario.executor.WssUsernameTokenScenarioExecutor.sendRequest(WssUsernameTokenScenarioExecutor.java:219)
at oracle.wsm.security.policy.scenario.executor.SecurityScenarioExecutor.execute(SecurityScenarioExecutor.java:545)
at oracle.wsm.policyengine.impl.runtime.AssertionExecutor.execute(AssertionExecutor.java:41)
at oracle.wsm.policyengine.impl.runtime.WSPolicyRuntimeExecutor.executeSimpleAssertion(WSPolicyRuntimeExecutor.java:608)
at oracle.wsm.policyengine.impl.runtime.WSPolicyRuntimeExecutor.executeAndAssertion(WSPolicyRuntime
...


The code is something like this:

private static EVPQuery_Service eVPQuery_Service;

public static void main(String [] args)
{
eVPQuery_Service = new EVPQuery_Service();
SecurityPolicyFeature[] securityFeatures =
new SecurityPolicyFeature[] { new SecurityPolicyFeature("oracle/wss_username_token_client_policy") };
EVPQuery eVPQuery = eVPQuery_Service.getEVPQuery(securityFeatures);
EVPPersonQueryCriteria crit=new EVPPersonQueryCriteria();
crit.setCnpNumber("something");
crit.setCountyCD("something");
EVPPersonQueryResult res;
// Add your code to call the desired methods.
try {
res = eVPQuery.queryPerson(crit);
} catch (SableEVPQueryException e) {
System.out.println(e.getMessage());
}
}


I am looking for a solution to pass the username and the password to the web service.
I am here after six hours of searching, so if my question is stupid, please forgive me.

Thank you
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Rather than trying to guess what security policy is used by the service, I suggest asking the developers of the web service.
This will save you a lot of time and effort, as well as make any questions regarding this issue much easier to answer.

By the way, this posting looks somewhat familiar:
http://forums.oracle.com/forums/thread.jspa?threadID=1111929&tstart=15
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Secure Web Service Client
 
Similar Threads
SOAP Header missing using (Hash values do not match ) Rampart/Axis2
CXF, WSDL, and SecurityPolicy problems with "None of the policy alternatives can be satisfied."
Axis2/Rampart fails auth from WCF client, never calls password callback handler
AXIS 2 - org.apache.axis2.AxisFault: Server was unable to process request
Security Policy in Weblogic 9.2 for Web Services