In the EM Console go to the ‘Test’ page for the service you are developing a client for and copy the WSDL url.
In JDeveloper, in your Java Project, create a new Web Service Proxy
When setting the wsdl url, change ‘wsdl’ to ‘orawsdl’
Go through the wizard accepting the defaults and setting appropriate package names for the generated classes. In the Client policy section, select ‘oracle/wss_username_token_service_policy’
When you finish this wizard the Web Service client classes will be generated. Look at the code below to see how the User Id and Password are set when calling the Web Service.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
package webserviceClientApp;</code> import javax.xml.ws.BindingProvider; import javax.xml.ws.WebServiceRef; import weblogic.wsee.jws.jaxws.owsm.SecurityPoliciesFeature; // !THE CHANGES MADE TO THIS FILE WILL BE DESTROYED IF REGENERATED! // This source file is generated by Oracle tools // Contents may be subject to change // For reporting problems, use the following // Version = Oracle WebServices (11.1.1.0.0, build 130224.1947.04102) public class UserNamePasswordStartPortClient { @WebServiceRef private static UserNamePasswordStartService userNamePasswordStartService; public static void main(String[] args) { userNamePasswordStartService = new UserNamePasswordStartService(); SecurityPoliciesFeature securityFeatures = new SecurityPoliciesFeature (new String[] { "oracle/wss_username_token_client_policy" }); UserNamePasswordStartPortType userNamePasswordStartPortType = userNamePasswordStartService.getUserNamePasswordStartPort(securityFeatures); // Add your code to call the desired methods. ((BindingProvider)userNamePasswordStartPortType). getRequestContext().put(BindingProvider.USERNAME_PROPERTY,"jaideep"); ((BindingProvider)userNamePasswordStartPortType). getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,"welcome1"); userNamePasswordStartPortType.start(); } } |
Latest posts by Jaideep (see all)
- Oracle Business Rules: Sums and Averages in Test Conditions - April 2, 2016
- Rolling Up a BPM KPI into Business Architecture Models - January 28, 2016
- The BPM 12c Process Monitor Dashboard in 5 Minutes - January 6, 2016