Unable to invoke a secured web service

Hi all
I have been trying to call a secured web service which enforces wss11_saml_token_with_message_protection_client_policy policy. To create a web proxy in JDev, I am using the following wiki - http://aseng-wiki.us.oracle.com/asengwiki/display/ASDevOWSM/How+can+I+create+a+JSE+client+to+invoke+ADF+BC+Web+Service+with+OWSM+wss11_saml_token_with_message_protection_service_policy (scroll down to find "Creating JSE client for above Web service")
I have got the default-keystore.jks, cwallet.sso and jps-config.xml from the webservice env. I am getting this error now -
SEVERE: WSM-00055 The keystore located at xyzabc\default-keystore.jks cannot be loaded due to java.io.IOException: Keystore was tampered with, or password was incorrect. Ensure that valid keystore type and password are configured.
Any pointers would be appreciated.
Thanks,
Pushkal

One more update i tried printing l_http_response.status_code and got 302.
Thanks,
PKV

Similar Messages

  • Unable to invoke a protected web service from PL/Sql

    Hi All
    I am trying to invoke a protected web service from Plsql. But getting the below error.
    error message is ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "html" is not declared in the DTD
    Error at line 2
    If i try to invoke the service after disabling the protection then i am able to call it and getting response. Pls let me know how to deal with this authentication issue.
    Below is the invoking code i am using.
    BEGIN
    generate_envelope(p_request, l_envelope);
    show_envelope(l_envelope);
    l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.0');
    UTL_HTTP.set_header(l_http_request, 'Authorization', 'Basic Y29tcGxpYW5jZS5nZW46Y29tcGxpYW5jZQ11');
    UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
    UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
    UTL_HTTP.write_text(l_http_request, l_envelope);
    l_http_response := UTL_HTTP.get_response(l_http_request);
    UTL_HTTP.read_text(l_http_response, l_envelope);
    UTL_HTTP.end_response(l_http_response);
    l_response.doc := XMLTYPE.createxml(l_envelope); -- Error Line
    l_response.envelope_tag := p_request.envelope_tag;
    l_response.doc := l_response.doc.extract('/'||l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/child::node()',
    'xmlns:'||l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"');
    show_envelope(l_response.doc.getstringval());
    check_fault(l_response);
    RETURN l_response;
    END;
    I tried invoking the service by passing username and password in LDE tool and captured the Request SOAP Message. I saw username/password encrypted to "Y29tcGxpYW5jZS5nZW46Y29tcGxpYW5jZQ11". Hence tried with that.
    I have also tried the below line for authentication but it is not working.
    utl_http.set_authentication(l_http_request, 'myusername', 'mypassword','Basic',false);
    Pls assist me in resolving this.
    Thanks,
    PKV

    One more update i tried printing l_http_response.status_code and got 302.
    Thanks,
    PKV

  • Problems to invoke a secure Web service from Oracle BPM Studio 10.3

    Hi all
    I'm trying to consume a web service through HTTPS protoloco Oracle BPM Studio v10.3, but I get the following error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
    Some help!!
    Thanks

    Without going into any technical discussion about the code, my first question is what JDK version was used to create this which was imported into the form? Understand that Forms 10 runs on JDK 1.4.2, so if you used any newer JDK version, likely there will be problems.

  • Invoking a secure web service from a standalone java client

    I am using stand alone java client to invoke a web service. This web service in turn invokes a jcs which is protected ( role based access ).
    I am using a proxy at the client side for web service invocation
    FileSubmission_Impl filesubmission_impl = new FileSubmission_Impl();
    FileSubmissionSoap filesubmissionsoap = filesubmission_impl.getFileSubmissionSoap();
    filesubmissionsoap.processFiles(...)
    This works if there are no security constraints on any of the resources (@common:security).
    I need to pass the username and password from the java client that will be authenticated and allowed to access the protected resources.
    Please let me know as to how this can be achieved ( passing username and password from client )

    Paula,
    I suppose you're using CFINVOKE (http://www.activsoftware.com/code_samples/code.cfm/CodeID/44/ColdFusion/Invoking_SOAP_Web_Services_with_ColdFusion_MX_CFINVOKE_Tag) or are you using a third party tool like CFX_SOAP (http://www.activsoftware.com/products/productdetail.cfm/id/1015)?
    Are you working with WebAS 6.4 or 6.2?
    It works with web services created with WebAS 6.4, but you should generate proxy classes. Check Thomas' weblog (second part of it)->https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1012. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    The WSDL generated by this method is more standard than the one generated when you just Remote enable an FM and look at the webservice browser.
    Th core of CF MX is Java and that engine is rather strict in standards.
    Eddy

  • Invoking a secured web service

    Hello,
    I'm using a clustered osb with a loadbalancer, i have two nodes osb1 and osb2.
    i'm trying to test a secured business service which points to a web service deployed on another server.
    i installed its certificate in both nodes.
    if i stop osb1, the test is always successful.
    if i stop osb2, the test always fails.
    if they are both running, the test fails sometimes and succeeds sometimes.
    the log in osb1 contains the following errors :
    java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.a(DashoA13*..)
    at javax.crypto.Cipher.init(DashoA13*..)
    at javax.crypto.Cipher.init(DashoA13*..)
    <Error> <WliSbTransports> <BEA-381304> <Exception in HttpTransportServlet.service: java.net.SocketException: Broken pipe
    java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at weblogic.utils.io.ChunkedOutputStream.writeTo(ChunkedOutputStream.java:193)
    at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:434)
    Truncated. see log file for complete stacktrace
    <Error> <Socket> <soaapp1> <osbms1> <ExecuteThread: '4' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <> <1263614497772> <BEA-000403> <IOException occurred on socket: Socket[addr=/10.100.10.112,port=59913,localport=7001]
    java.net.SocketException: Connection refused.
    java.net.SocketException: Connection refused
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:887)
    at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:859)
    at weblogic.socket.DevPollSocketMuxer.processSockets(DevPollSocketMuxer.java:120)
    at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    the log in osb2 contains the following error :
    <Error> <WliSbTransports> <BEA-381304> <Exception in HttpTransportServlet.service: java.net.SocketException: Broken pipe
    java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at weblogic.utils.io.ChunkedOutputStream.writeTo(ChunkedOutputStream.java:193)
    at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:434)
    Truncated. see log file for complete stacktrace
    <Error> <Socket> <soaapp2> <osbms2> <ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <> <1261190759758> <BEA-000403> <IOException occurred on socket: Socket[addr=/10.100.10.112,port=41815,localport=7001]
    java.net.SocketException: Connection refused.
    java.net.SocketException: Connection refused
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:887)
    at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:859)
    at weblogic.socket.DevPollSocketMuxer.processSockets(DevPollSocketMuxer.java:120)
    at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    >
    could someone help?

    Hi - I know it has been a long time since you posted into this forum. I am seeing a similar error though I have "Hostname verification" set to none. Can you please tell me if your problem has been fixed and if so, how? Thanks

  • Handshaking problem while invoking a secured web service

    Hi,
    I have developed a web service. I made my WLS 7.0 secured, using SSL. Also
    I made the
    my web service accessible only by https protocol. Also I configured the WLS SSL
    to have one
    way SSL. The problem is I am not able to access this web service using a swing
    client, It throws
    an exception saying some Handshaking exception. This problem occured only when
    I made
    the web service secured (https).
    Has anybody faced this problem ever?.
    For one way SSL do I need to supply any certificate file or PEM file from the
    client to the
    server?.
    Thanks,
    Anish

    Hi Anish,
    No, in this case the client is checking the cert provided by the
    server. Have you tried the flag
    -Dweblogic.webservice.client.ssl.strictcertchecking=false on the client
    side?
    Also take a look at the entry by Michael Jouravlev, on SSL "how to"
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.webservices&item=1910&utag=
    Have you gone through the simpleSSL example:
    http://webservice.bea.com/simpleSSL.zip
    HTHs,
    Bruce
    Anish wrote:
    >
    Hi,
    I have developed a web service. I made my WLS 7.0 secured, using SSL. Also
    I made the
    my web service accessible only by https protocol. Also I configured the WLS SSL
    to have one
    way SSL. The problem is I am not able to access this web service using a swing
    client, It throws
    an exception saying some Handshaking exception. This problem occured only when
    I made
    the web service secured (https).
    Has anybody faced this problem ever?.
    For one way SSL do I need to supply any certificate file or PEM file from the
    client to the
    server?.
    Thanks,
    Anish

  • Problem in updating a java client to invoke data-secured web service

    hello
    i'm following the document 'programming weblogic web services' to use ws-security
    functionality to encrypt & digitally sign SOAP Request & Response
    and I first made a client that calls a secure weblogic web service.
    ( using a keystore having RSA key pair. )
    the code is like below -----------------------------------------------------------------
    final KeyStore keystore = loadKeystore(CLIENT_KEYSTORE, KEYSTORE_PASS);
    TestEJB_Impl service = new TestEJB_Impl("file:///C:/bea/user_projects/domains/FirstDomain/working/TestEJB_with_Security_surpport.wsdl");
    WebServiceContext context = service.context();
    System.out.println("passing context info to the client");
    X509Certificate clientcert;
    clientcert = getCertificate(CLIENT_KEYNAME, keystore);
    PrivateKey clientprivate;
    clientprivate = getPrivateKey(CLIENT_KEYNAME, CLIENT_KEYPASS, keystore);
    WebServiceSession session = context.getSession();
    session.setAttribute(WSSEClientHandler.CERT_ATTRIBUTE, clientcert);
    session.setAttribute(WSSEClientHandler.KEY_ATTRIBUTE, clientprivate);
    UserInfo ui = new UserInfo(AUTHENTICATION_USER, AUTHENTICATION_USER_PASS);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    TestEJBPort port = service.getTestEJBPort();
    String result = null;
    result = port.firstMethodTest("A123");
    System.out.println(result);
    and there comes error stacktrace like below ------------------------------
    <Info> <WebService> <BEA-220024> <Handler
    weblogic.webservice.core.handler.WSSEClientHandler threw an exception from its
    h
    andleRequest method. The exception was:
    weblogic.xml.security.SecurityConfigurationException: Failed adding encryption
    t
    o request - with nested exception:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys].>
    Exception in thread "main" java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.so
    ap.SOAPFaultException: Exception during processing: weblogic.xml.security.Securi
    tyConfigurationException: Failed adding encryption to request - with nested exce
    ption:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys] (see Fault Detail for stacktrace)
    Detail:
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webse
    rvice/fault/1.0.0">
    </bea_fault:stacktrace>weblogic.xml.security.SecurityProcessingException: No
    ke
    ywrapping algorithm available for DSA keys
    at weblogic.xml.security.wsse.v200207.SecurityImpl.getWrappingAlgorithm(
    SecurityImpl.java:200)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:175)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:153)
    i am using RSA key pair but, when i use DSA key pair , the error message is same
    as above.
    what is problem? and what am i missing?

    Hello,
    The current implementation only supports RSA key types as legal
    wrapping. It is on the TODO list to expand this to other algorithms.
    Regards,
    Bruce
    dolso wrote:
    >
    hello
    i'm following the document 'programming weblogic web services' to use ws-security
    functionality to encrypt & digitally sign SOAP Request & Response
    and I first made a client that calls a secure weblogic web service.
    ( using a keystore having RSA key pair. )
    the code is like below -----------------------------------------------------------------
    final KeyStore keystore = loadKeystore(CLIENT_KEYSTORE, KEYSTORE_PASS);
    TestEJB_Impl service = new TestEJB_Impl("file:///C:/bea/user_projects/domains/FirstDomain/working/TestEJB_with_Security_surpport.wsdl");
    WebServiceContext context = service.context();
    System.out.println("passing context info to the client");
    X509Certificate clientcert;
    clientcert = getCertificate(CLIENT_KEYNAME, keystore);
    PrivateKey clientprivate;
    clientprivate = getPrivateKey(CLIENT_KEYNAME, CLIENT_KEYPASS, keystore);
    WebServiceSession session = context.getSession();
    session.setAttribute(WSSEClientHandler.CERT_ATTRIBUTE, clientcert);
    session.setAttribute(WSSEClientHandler.KEY_ATTRIBUTE, clientprivate);
    UserInfo ui = new UserInfo(AUTHENTICATION_USER, AUTHENTICATION_USER_PASS);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    TestEJBPort port = service.getTestEJBPort();
    String result = null;
    result = port.firstMethodTest("A123");
    System.out.println(result);
    and there comes error stacktrace like below ------------------------------
    <Info> <WebService> <BEA-220024> <Handler
    weblogic.webservice.core.handler.WSSEClientHandler threw an exception from its
    h
    andleRequest method. The exception was:
    weblogic.xml.security.SecurityConfigurationException: Failed adding encryption
    t
    o request - with nested exception:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys].>
    Exception in thread "main" java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.so
    ap.SOAPFaultException: Exception during processing: weblogic.xml.security.Securi
    tyConfigurationException: Failed adding encryption to request - with nested exce
    ption:
    [weblogic.xml.security.SecurityProcessingException: No keywrapping algorithm ava
    ilable for DSA keys] (see Fault Detail for stacktrace)
    Detail:
    <detail>
    <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webse
    rvice/fault/1.0.0">
    </bea_fault:stacktrace>weblogic.xml.security.SecurityProcessingException: No
    ke
    ywrapping algorithm available for DSA keys
    at weblogic.xml.security.wsse.v200207.SecurityImpl.getWrappingAlgorithm(
    SecurityImpl.java:200)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:175)
    at weblogic.xml.security.wsse.v200207.SecurityImpl.addEncryption(Securit
    yImpl.java:153)
    i am using RSA key pair but, when i use DSA key pair , the error message is same
    as above.
    what is problem? and what am i missing?

  • OWSM 11g: Invoking a secured web service through a java proxy service

    Hi All,
    I am trying to call a secured bpel service which is expecting a username token password. I have created a java proxy service for the same. I now need to add the username token to the same. Can anyone please guide me in this regard.
    Thanks in advance.

    Just to add some pointers,
    I added the following code to the proxy still the soap headers is not getting propagated.
    OrderBookingAndShipment orderBookingAndShipment = orderbookingandshipment_client_ep.getOrderBookingAndShipment_pt();
    String username = "OWSM_11g";
    String password = "password";
    List credProviders = new ArrayList();
    //client side UsernameToken credential provider
    CredentialProvider cp = new ClientUNTCredentialProvider(username.getBytes(),password.getBytes());
    credProviders.add(cp);
    Map<String,Object> context = ((BindingProvider) orderBookingAndShipment).getRequestContext();
    context.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST,credProviders);

  • Can config wallet on cloud DB for security web service invoke ?

    Currently, I can invoke the security web service by APEX at my local DB env.
    based the apex_web_service API
    http://docs.oracle.com/cd/E37546_01/doc/doc.41/e28475/apex_web_service.htm#AEAPI537
    we need wallet to store the cert files.
    want to confirm that
    --> Can we config wallet to import cert files on cloud DB?
    Thanks
    Edited by: 985754 on Feb 6, 2013 2:17 AM

    Hello 985754,
    Unfortunately, you cannot import your own certificates into the wallet used by Application Express in the Database Cloud Service. However, this wallet already contains many common CA certificates. Unless the web service you are consuming uses a self-signed certificate, chances are you will be able to use this functionality in the Cloud.
    -- Vlad

  • Security procesing failed(actions mismatch) while invkng secure web-service

    Hi,
    This mail is to seek help from our Java community in a issue that we are currently facing with web service we have written in the application
    that I am currently working on. An early response in this is highly appreciated.
    I have implemented Java client to invoke the secure web-service(Signing and Encryption of SOAP Request). I am using the classes WSSecEncrypt & WSSecSignature for signing and encrypt the request.
    I did the signing and encryption for the SOAP request, invoked the Web-service. The server side received the request and sent the encrypted response. But I am getting an error in the client side while receiving the encrypted response.
    Client side :
    1) sign the SOAP reuqest with client private key
    2) Encrypt the request with server side public key
    3) invoke the web-service ( request sent to server and server sent the response) but getting error while reading the encrypted the response.
    Server side :
    1) receive the request
    2) decrypt the request, process the request
    3) encrypth the response and send to client
    I am getting the below exception exactly at below line (while getting encrypted response) and I have pasted the java client code below
    SOAPEnvelope resEnvelope = call.invoke(msg);
    Exception message :
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
    faultSubcode:
    faultString: security processing failed (actions mismatch)
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}hostname:apsp9097
    security processing failed (actions mismatch)
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:727)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:1870)
    at CallSecWS.main(CallSecWS.java:118)
    Java Code :
    Properties clinetProps = new Properties();               
              MessageContext msgContext = null;          
              System.setProperty("javax.xml.soap.MessageFactory", "org.apache.axis.soap.MessageFactoryImpl");          
              FileInputStream fis = new FileInputStream("C:\\crypto.properties");          
              clinetProps.load(fis);
              Crypto ClientCrypto = CryptoFactory.getInstance(clinetProps);
              //Creating Messaging Object
              InputStream inStream = new ByteArrayInputStream(soapMsg.getBytes());
              Message axisMsg = new Message(inStream);
              axisMsg.setMessageContext(msgContext);
    //creating envelople based on Message
              SOAPEnvelope envelope = axisMsg.getSOAPEnvelope();
    // Encrypting an signing the SOAP request
              WSSecEncrypt encrypt = new WSSecEncrypt();
              WSSecSignature sign = new WSSecSignature();
    // Set the encryption and signging details
              encrypt.setUserInfo("serverpublickey");     
              String strProvateKey = clinetProps.getProperty("org.apache.ws.security.crypto.merlin.keystore.alias");
              String password = clinetProps.getProperty("org.apache.ws.security.crypto.merlin.keystore.password");
              sign.setUserInfo(strProvateKey,password);     
    // Creating the header
              Document doc = envelope.getAsDocument();     
              WSSecHeader secHeader = new WSSecHeader();
              secHeader.insertSecurityHeader(doc);
         // Dcoument ment signed and encrypted
              Document encryptedDoc = encrypt.build(doc, ClientCrypto, secHeader);
              System.out.println("After Encryption....");
              Document encryptedSignedDoc = sign.build(encryptedDoc, ClientCrypto, secHeader);
         Message msg = (Message) toSOAPMessage(encryptedSignedDoc);
         System.out.println(msg.getSOAPPartAsString() );
    // Encryption and signing done and invoking the secure web-service
              String endpoint = "http://sys.ws.com/services/SecureService";
              Service service = new Service();
              Call call = (Call) service.createCall();
              call.setTargetEndpointAddress( new java.net.URL(endpoint) );
              call.setOperationStyle(org.apache.axis.constants.Style.MESSAGE);
    // Sender handler
              WSDoAllSender send = new WSDoAllSender();     
              send.setOption( WSHandlerConstants.SIG_PROP_FILE , "crypto.properties" );
              send.setOption( WSHandlerConstants.SIG_KEY_ID, "DirectReference" );
              send.setOption( WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT +" " + WSHandlerConstants.SIGNATURE );
              send.setOption( WSHandlerConstants.USER, "PrivateKey" );     
              send.setOption( WSHandlerConstants.ENCRYPTION_USER, "serverpublickey");     
              send.setOption( WSHandlerConstants.PW_CALLBACK_CLASS,com.client.B2BCallBack.class.getName() );     
    // Receiver handler
              WSDoAllReceiver recv = new WSDoAllReceiver();
              recv.setOption( WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE+ " " + WSHandlerConstants.ENCRYPT );
              recv.setOption( WSHandlerConstants.SIG_PROP_FILE, "crypto.properties" );
              recv.setOption( WSHandlerConstants.SIG_KEY_ID, "DirectReference" );
              recv.setOption( WSHandlerConstants.PW_CALLBACK_CLASS,com.client.B2BCallBack.class.getName() );          
              recv.setOption( WSHandlerConstants.ENCRYPTION_USER ,"serverpublickey");
              // Setting the handlers          
    call.setClientHandlers(send, recv);
              System.out.println("Set the all parameters");
    // Invoking the web-service.
              SOAPEnvelope resEnvelope = call.invoke(msg);
    public static SOAPMessage toSOAPMessage(Document doc) throws Exception
         Canonicalizer c14n = Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
         byte[] canonicalMessage = c14n.canonicalizeSubtree(doc);
         ByteArrayInputStream in = new ByteArrayInputStream(canonicalMessage);
         MessageFactory factory = MessageFactory.newInstance();
         return factory.createMessage(null, in);
    Thanks
    J Ashok
    Edited by: 846090 on Mar 21, 2011 11:34 AM

    Hi,
    This mail is to seek help from our Java community in a issue that we are currently facing with web service we have written in the application
    that I am currently working on. An early response in this is highly appreciated.
    I have implemented Java client to invoke the secure web-service(Signing and Encryption of SOAP Request). I am using the classes WSSecEncrypt & WSSecSignature for signing and encrypt the request.
    I did the signing and encryption for the SOAP request, invoked the Web-service. The server side received the request and sent the encrypted response. But I am getting an error in the client side while receiving the encrypted response.
    Client side :
    1) sign the SOAP reuqest with client private key
    2) Encrypt the request with server side public key
    3) invoke the web-service ( request sent to server and server sent the response) but getting error while reading the encrypted the response.
    Server side :
    1) receive the request
    2) decrypt the request, process the request
    3) encrypth the response and send to client
    I am getting the below exception exactly at below line (while getting encrypted response) and I have pasted the java client code below
    SOAPEnvelope resEnvelope = call.invoke(msg);
    Exception message :
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
    faultSubcode:
    faultString: security processing failed (actions mismatch)
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}hostname:apsp9097
    security processing failed (actions mismatch)
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:727)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:1870)
    at CallSecWS.main(CallSecWS.java:118)
    Java Code :
    Properties clinetProps = new Properties();               
              MessageContext msgContext = null;          
              System.setProperty("javax.xml.soap.MessageFactory", "org.apache.axis.soap.MessageFactoryImpl");          
              FileInputStream fis = new FileInputStream("C:\\crypto.properties");          
              clinetProps.load(fis);
              Crypto ClientCrypto = CryptoFactory.getInstance(clinetProps);
              //Creating Messaging Object
              InputStream inStream = new ByteArrayInputStream(soapMsg.getBytes());
              Message axisMsg = new Message(inStream);
              axisMsg.setMessageContext(msgContext);
    //creating envelople based on Message
              SOAPEnvelope envelope = axisMsg.getSOAPEnvelope();
    // Encrypting an signing the SOAP request
              WSSecEncrypt encrypt = new WSSecEncrypt();
              WSSecSignature sign = new WSSecSignature();
    // Set the encryption and signging details
              encrypt.setUserInfo("serverpublickey");     
              String strProvateKey = clinetProps.getProperty("org.apache.ws.security.crypto.merlin.keystore.alias");
              String password = clinetProps.getProperty("org.apache.ws.security.crypto.merlin.keystore.password");
              sign.setUserInfo(strProvateKey,password);     
    // Creating the header
              Document doc = envelope.getAsDocument();     
              WSSecHeader secHeader = new WSSecHeader();
              secHeader.insertSecurityHeader(doc);
         // Dcoument ment signed and encrypted
              Document encryptedDoc = encrypt.build(doc, ClientCrypto, secHeader);
              System.out.println("After Encryption....");
              Document encryptedSignedDoc = sign.build(encryptedDoc, ClientCrypto, secHeader);
         Message msg = (Message) toSOAPMessage(encryptedSignedDoc);
         System.out.println(msg.getSOAPPartAsString() );
    // Encryption and signing done and invoking the secure web-service
              String endpoint = "http://sys.ws.com/services/SecureService";
              Service service = new Service();
              Call call = (Call) service.createCall();
              call.setTargetEndpointAddress( new java.net.URL(endpoint) );
              call.setOperationStyle(org.apache.axis.constants.Style.MESSAGE);
    // Sender handler
              WSDoAllSender send = new WSDoAllSender();     
              send.setOption( WSHandlerConstants.SIG_PROP_FILE , "crypto.properties" );
              send.setOption( WSHandlerConstants.SIG_KEY_ID, "DirectReference" );
              send.setOption( WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT +" " + WSHandlerConstants.SIGNATURE );
              send.setOption( WSHandlerConstants.USER, "PrivateKey" );     
              send.setOption( WSHandlerConstants.ENCRYPTION_USER, "serverpublickey");     
              send.setOption( WSHandlerConstants.PW_CALLBACK_CLASS,com.client.B2BCallBack.class.getName() );     
    // Receiver handler
              WSDoAllReceiver recv = new WSDoAllReceiver();
              recv.setOption( WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE+ " " + WSHandlerConstants.ENCRYPT );
              recv.setOption( WSHandlerConstants.SIG_PROP_FILE, "crypto.properties" );
              recv.setOption( WSHandlerConstants.SIG_KEY_ID, "DirectReference" );
              recv.setOption( WSHandlerConstants.PW_CALLBACK_CLASS,com.client.B2BCallBack.class.getName() );          
              recv.setOption( WSHandlerConstants.ENCRYPTION_USER ,"serverpublickey");
              // Setting the handlers          
    call.setClientHandlers(send, recv);
              System.out.println("Set the all parameters");
    // Invoking the web-service.
              SOAPEnvelope resEnvelope = call.invoke(msg);
    public static SOAPMessage toSOAPMessage(Document doc) throws Exception
         Canonicalizer c14n = Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
         byte[] canonicalMessage = c14n.canonicalizeSubtree(doc);
         ByteArrayInputStream in = new ByteArrayInputStream(canonicalMessage);
         MessageFactory factory = MessageFactory.newInstance();
         return factory.createMessage(null, in);
    Thanks
    J Ashok
    Edited by: 846090 on Mar 21, 2011 11:34 AM

  • Error while invoking a WS-Security secured web service from Oracle BPEL..

    Hi ,
    We are facing some error while invoking a WS-Security secured web service from our BPEL Process on the windows platform(SOA 10.1.3.3.0).
    For the BPEL process we are following the same steps as given in an AMIS blog : - [http://technology.amis.nl/blog/1607/how-to-call-a-ws-security-secured-web-service-from-oracle-bpel]
    but sttill,after deploying it and passing values in it,we are getting the following error on the console :-
    &ldquo;Header [http://schemas.xmlsoap.org/ws/2004/08/addressing:Action] for ultimate recipient is required but not present in the message&rdquo;
    Any pointers in this regard will be highly appreciated.
    Thanks,
    Saurabh

    Hi James,
    Thanks for the quick reply.
    We've tried to call that web service from an HTML designed in Visual Studios with the same username and password and its working fine.
    But on the BPEL console, we are getting the error as mentioned.
    Also if you can tell me how to set the user name and password in the header of the parter link.I could not find how to do it.
    Thanks,
    Saurabh

  • Error while invoking secure web service.

    Hi,
    I am trying to access a secure web service through a simple BPEL process in SOA Suite 11g. When I test it through enterprise manager I am getting the following error. Since it's a secured websecure i set the WS policy(oracle/wss_username_token_client_policy) in the external reference and also provided the credentials. If anyone has come across similar error or know the solution please let me know. Also I am not sure if its related to security or is it with the way I am trying to call the service.
    Error Message:
    Fault ID     reference:80014
    Fault Time     May 22, 2011 12:54:45 PM
    Non Recoverable System Fault :
    javax.xml.ws.soap.SOAPFaultException: 99999: Unknown Service
    Error Message: {http://schemas.oracle.com/bpel/extension}remoteFault
    Fault ID     default/Mocking!1.0*soa_be35cb3e-5f05-49df-a696-a653d5703681/BPELProcess1/30017-BpInv0-BpSeq0.3-3
    Fault Time     May 22, 2011 12:54:46 PM
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>99999: Unknown Service</summary></part><part name="detail"><detail>&lt;con:fault xmlns:con="http://www.bea.com/wli/sb/context"> &lt;con:errorCode>99999&lt;/con:errorCode> &lt;con:reason>Unknown Service&lt;/con:reason> &lt;con:location> &lt;con:node>PipelinePairNode1&lt;/con:node> &lt;con:pipeline>PipelinePairNode1_request&lt;/con:pipeline> &lt;con:stage>stage1&lt;/con:stage> &lt;/con:location> &lt;/con:fault> </detail></part><part name="code"><code>soap:Server</code></part></remoteFault></bpelFault>

    Thanks very much for your suggestion. I will take a look into the wsdl again and see if something is wrong in that.
    I have a peculiar problem with the wsdl. When I created the partner link using the remote wsdl it would throw a compilation error. But when I took a local copy of the remote wsdl and seperated all the schema's from the wsdl and imported them inside wsdl it gets compiled. But I am not sure if this is a appropriate thing to do and if that is creating this problem. Any thoughts on this would be really helpful.

  • Unable to consume secured Web service from a Dynpro application

    Hello,
    I have followed <a href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/bac36a469e4c75aba646077e71516d/frameset.htm">this tutorial</a>
    in order to protect and consume a secured Web service from a Dynpro application using SAP logon ticket.
    The problem is that after implementing everything needed I  receive 401 Unauthorized when I am trying to consume it from the web dynpro side.
    If I manually transfer the request the credentials, before the execute i.e:
    modObj._setUser
    modObj._setPassword
    modObj.execute();
    I am able to call it, meaning the dynpro application doesn't transfer these credentials to the Webservice even though it's authentication property is set to true.
    Any idea how to solve it?
    Roy
    Message was edited by:
            Roy Cohen

    Try below steps
    • Add jars
    o security.class
    o tc/sec/destinations/interface
    • Setting WebDynpro project property
    o Project>Properties>Web Dynpro References-->Interface references
    &#61607; Name=tcsecdestinations~interface
    o Project>Properties>Web Dynpro References-->Service reference
    &#61607; Name=webservices
    &#61607; Name=tcsecdestinations~service
    • Dynamically Set httpdestination and Call web service
    final InitialContext ctx = new InitialContext();
    final DestinationService dstService = (DestinationService)ctx.lookup(DestinationService.JNDI_KEY);
    if (dstService== null)
    throw new NamingException ("Destination service not available");
    final Destination destination = dstService.getDestination("HTTP"," DestinationName");
    // getting user name
    Properties destprop = destination.getDestinationProperties();
    String username = destprop.getProperty("USERNAME");
    String password = destprop.getProperty("PASSWORD");
    final HTTPDestination httpDestination = (HTTPDestination) destination;
    HttpURLConnection httpConnection = httpDestination.getURLConnection();
    String httpURL = String.valueOf(httpConnection.getURL());
    Request_AdvLocationVer1ViDocument_getLocation obj=wdContext.currentRequest_AdvLocationVer1ViDocument_getLocationElement().modelObject();
    obj._setUser( user );
    obj._setPassword(pass);
    obj._setEndPoint(httpURL);
    obj.execute();
    Rahul

  • Invoke Siebel OnDemand Web Service via BPEL

    Hi,
    We are trying to invoke Siebel OnDemand Web Service via BPEL.
    We have followed the steps as mentioned in
    http://www.oracle.com/technetwork/topics/ofm-siebel-blog-postings-092216.html
    But still we are unable to get the Session Id.
    Do we need to opne any port to resolve this issue or do we have any other way to get the session ID.
    Please let me know if there is any solution to this...
    Thanks

    Thanks for the update..
    We are trying to invoke the CRM On Demand session ID using the BPEL. It seems the we are having some problem with the URL
    https://secure-ausomxapa.crmondemand.com/Services/Integration?command=login
    => `Integration?command=login
    we are trying to access the URL from our SOA server using wget and we are getting following result.
    [XXXXXXXXXXXXXXX ~]$ wget https://secure-ausomxapa.crmondemand.com/Services/Integration?command=login
    --07:32:19-- https://secure-ausomxapa.crmondemand.com/Services/Integration?command=login
    => `Integration?command=login'
    Resolving secure-ausomxapa.crmondemand.com... 141.146.149.68
    Connecting to secure-ausomxapa.crmondemand.com|141.146.149.68|:443...
    We are expecting that we are unable to access the URL using 443 port.

  • Calling secured web service from Pl SQL

    Hi
    I am trying to call a secured web service from pl/sql using utl_http.
    Is there a sample pl/sql program that i can refer to call a secured web service.
    sample soap header that am trying to acheive.
    <soap:Header>
    <wsa:Action>http://myactaction</wsa:Action>
    <wsa:MessageID>uuid:asdfadrewrwqr</wsa:MessageID>
    <wsa:ReplyTo>
    <wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsa:To>http://myact</wsa:To>
    <wsse:Security soap:mustUnderstand="1">
    <wsse:UsernameToken wsu:Id="SecurityToken-321321">
    <wsse:Username>mordfsafsdae</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">werwqrewrwe</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    Thanks a ton in advance

    Hi,
    On way we can call a web service is to pass the Web Service URL to UTL_HTTP package:
    Sample Web Service URL
    ===================
    lv_url :=
    'http://67.97.189.151:8888/plsqlsample/dbfunc?invoke=placeOrder'
    || '&'
    || 'param0=1'
    || '&'
    || 'param1=1'
    || '&'
    || 'param2=1';
    Sample Call using UTL_HTTP
    =====================
    SELECT UTL_HTTP.request (lv_url)
    INTO lv_result
    FROM DUAL;
    Thank you.
    Regards,
    Balu

Maybe you are looking for

  • IMac 24" freezes on boot about 50% of the time

    My iMac freezes on bootup about 50% of the time. The freeze occurs prior to getting to the login password screen (the screen is blue when the Mac freezes). Holding down the power button to hard-shutdown the Mac works, and then typically on the next b

  • Using Wildcards in Prompts

    Post Author: LeedsLass CA Forum: Desktop Intelligence Reporting I've built two prompts in a report which use the Pattern Match option. However in order to fetch all results you have to leave a '%' in the prompt field which generates the sql  LIKE '%'

  • Is Oracle XML DB a native xml database?

    Hi! XML DB provides native data type XMLTYPE, and it can provide traditional storage for xml. So is it a enabled xml database or a native one?? Cheers

  • Plugged i phone 4s into different computer now all photos gone!

    I have tried to find the answer to this in another thread but no luck. I have an i phone 4s, I recently plugged the phone into the family computer (not my itunes on this comp) to print off a photo. However once I had finished I realised all of the ph

  • Oracle XE switching between instances

    Hi, I've installed oracle XE and created second database. Currently, I have two databases, can switch between them and have 8GB of user data available, even in separate DBs. I wonder, if this is license agreement complient. Only one instance is runni