Contradictory soap handler guidelines

why does bea say this: "...Message handlers should <b>not</b> be used to implement security or encryption..." (Specifying SOAP Handlers for a Web Service).
but then turns around and contradicts the above with this:
"...A simple example of using handlers is to encrypt and decrypt secure data in the body of a SOAP message..." (Using SOAP Message Handlers to Intercept the SOAP Message).
and this: "...you might design an Encryption handler whose handleRequest() method decrypts secure data in the SOAP request and handleResponse() method encrypts the SOAP response..." (Designing the SOAP Message Handlers and Handler Chains).
does anybody know what BEA's position is on this issue?
many thanks.

If i understand your requirement correctly then you can do following to register SOAP handlers
QName portName = new QName( "http://tutorial/sample4/",
"ServicePort");
HandlerRegistry registry = service.getHandlerRegistry();
List handlerList = new ArrayList();
handlerList.add( new HandlerInfo( ClientHandler.class, null, null ) );
registry.setHandlerChain( portName, handlerList )
http://e-docs.bea.com/wls/docs81/webserv/interceptors.html

Similar Messages

  • Soap handler configuration weblogic v9.2

    All the doc. on soap handlers for weblogic version 9x i could find describes using annotations. This works fine when you have the source but not in the case where i only have a "black box" web service in a WAR file.
    I want to configure a soap handler in xml config. files but i can only find this kind of configuration doc. for version 8.x. Can anyone point me to doc on how th do this in version 9.x?
    Ideally i think it should be possible to configure a handler in webservices.xml. Soap handlers should be configurable for any deployed web service i think? I also tried to use the admin. console but as far as i can see this only gives administration control over already configured handlers - not the functionality to add handlers.
    Regards,
    Ole Bech Mogensen, 7N

    Manish,
    Thanks for the reply. Yes I did. I keep getting the following error:
    XML Parsing Error: no element found
    Location: http://192.168.198.129:7001/Sample_App/Sample_Config.xml
    Line Number 1, Column 1:
    I even copied one of the actual WebLogic OOTB (out of the box) config files (i.e. WebLogic Platform9.2.3.0_chmods.xml) and I still get the same error from WebLogic when directly trying to invoke the Sample_Config.xml file. The actual contents of the Sample_Config.xml are as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <Boot_test>
    <URLContextPath>Sample_App</URLContextPath>
    <ConfigFilePath>C:\Temp\Another_Config_File.xml</ConfigFilePath>
    <ConfigPassword>admin</ConfigPassword>
    </Boot_test>
    So, I am still unresolved in getting the three(3) parms loaded via a config file in BEA WebLogic v9.2. Any other suggestions/thoughts on getting this loaded via a config file?
    Thanks.
    /workingtohard

  • Soap handler to process header before policy authentication

    I have a web service secured with WSSE Security. One of the web service client is using a custom security header instead of the standard WSSE Security header, so my web service fails authenticating the request. Can I write a soap handler to intercept the header before policy authentication, and modify the header to add the WSSE Security header so it can be authenticated?

    Hi Mike,
    Thank you for your response. Yes, I was trying to cast the elements returned from
    examineHeaderElements to SOAPHeaderElement. This was throwing a ClassCastException.
    Now, I am using
    soapHeader.getChildElements(nodeName)
    This seems to work fine. Where I created the nodeName through SOAPEnvelope's createNode()
    method. Don't know what the original problem was. But, now I avoided using that
    API. Will let you know if I get any more information.
    Regards,
    Adam
    "Michael Wooten" <[email protected]> wrote:
    >
    Hi Adam,
    The java.util.Iterator returned from the examineHeaderElements() method,
    should
    contain javax.xml.soap.SOAPHeaderElement objects. Is that what you are
    trying
    to cast to?
    Regards,
    Mike Wooten
    "Adam Athimuthu" <[email protected]> wrote:
    Hello,
    I am getting a ClassCastException when trying to process the SOAPHeader
    in a SOAP
    handler. I tried the following...inside the handleRequest(MessageContext
    context)
    method:
    SOAPPart soapPart=null;
    SOAPEnvelope soapEnvelope=null;
    SOAPHeader soapHeader=null;
    SOAPMessageContext soapContext=(SOAPMessageContext) context;
    System.out.println("handleRequest");
    SOAPMessage soapMessage=soapContext.getMessage();
    System.out.println("SOAPMessage: "+soapMessage.toString());
    try
    soapPart=soapMessage.getSOAPPart();
    soapEnvelope=soapPart.getEnvelope();
    soapHeader=soapEnvelope.getHeader();
    System.out.println("SOAPHeader: "+soapHeader.toString());
    soapHeader.addTextNode("CustomNode");
    Iterator allHeaders=soapHeader.examineHeaderElements("http://someuri.com");
    The examineHeaderElements throws a ClassCastException, no matter what
    method gets
    invoked on the soapHeader object. I tried casting this to the weblogic.webservice.core....
    implemented objects. The result is the same.
    I appreciate any help.
    Thanks,
    Adam
    Athi D. Athimuthu

  • SOAP Handler and ClassCastException during Header Processing

    Hello,
    I am getting a ClassCastException when trying to process the SOAPHeader in a SOAP
    handler. I tried the following...inside the handleRequest(MessageContext context)
    method:
    SOAPPart soapPart=null;
    SOAPEnvelope soapEnvelope=null;
    SOAPHeader soapHeader=null;
    SOAPMessageContext soapContext=(SOAPMessageContext) context;
    System.out.println("handleRequest");
    SOAPMessage soapMessage=soapContext.getMessage();
    System.out.println("SOAPMessage: "+soapMessage.toString());
    try
    soapPart=soapMessage.getSOAPPart();
    soapEnvelope=soapPart.getEnvelope();
    soapHeader=soapEnvelope.getHeader();
    System.out.println("SOAPHeader: "+soapHeader.toString());
    soapHeader.addTextNode("CustomNode");
    Iterator allHeaders=soapHeader.examineHeaderElements("http://someuri.com");
    The examineHeaderElements throws a ClassCastException, no matter what method gets
    invoked on the soapHeader object. I tried casting this to the weblogic.webservice.core....
    implemented objects. The result is the same.
    I appreciate any help.
    Thanks,
    Adam
    Athi D. Athimuthu
    [WLSSOAPHeaderIssue.txt]

    Hi Mike,
    Thank you for your response. Yes, I was trying to cast the elements returned from
    examineHeaderElements to SOAPHeaderElement. This was throwing a ClassCastException.
    Now, I am using
    soapHeader.getChildElements(nodeName)
    This seems to work fine. Where I created the nodeName through SOAPEnvelope's createNode()
    method. Don't know what the original problem was. But, now I avoided using that
    API. Will let you know if I get any more information.
    Regards,
    Adam
    "Michael Wooten" <[email protected]> wrote:
    >
    Hi Adam,
    The java.util.Iterator returned from the examineHeaderElements() method,
    should
    contain javax.xml.soap.SOAPHeaderElement objects. Is that what you are
    trying
    to cast to?
    Regards,
    Mike Wooten
    "Adam Athimuthu" <[email protected]> wrote:
    Hello,
    I am getting a ClassCastException when trying to process the SOAPHeader
    in a SOAP
    handler. I tried the following...inside the handleRequest(MessageContext
    context)
    method:
    SOAPPart soapPart=null;
    SOAPEnvelope soapEnvelope=null;
    SOAPHeader soapHeader=null;
    SOAPMessageContext soapContext=(SOAPMessageContext) context;
    System.out.println("handleRequest");
    SOAPMessage soapMessage=soapContext.getMessage();
    System.out.println("SOAPMessage: "+soapMessage.toString());
    try
    soapPart=soapMessage.getSOAPPart();
    soapEnvelope=soapPart.getEnvelope();
    soapHeader=soapEnvelope.getHeader();
    System.out.println("SOAPHeader: "+soapHeader.toString());
    soapHeader.addTextNode("CustomNode");
    Iterator allHeaders=soapHeader.examineHeaderElements("http://someuri.com");
    The examineHeaderElements throws a ClassCastException, no matter what
    method gets
    invoked on the soapHeader object. I tried casting this to the weblogic.webservice.core....
    implemented objects. The result is the same.
    I appreciate any help.
    Thanks,
    Adam
    Athi D. Athimuthu

  • SOAP handler for outgoing message

    Hello,
    I am implementing a order related webservice running under WebLogic 8.1. It sometime needs to send SOAP request to other external (outside my org) webservices. Is there a way to add a handler to intercept all outgoing SOAP message from my order webservice?
    Thanks,
    PC

    > I also want to use a module for the message received from the adapter. Do I have to call the module after the
    > sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
    > entry?
    yes.

  • Handling SOAP faults

    hello,
    I created a java control which calls an external webservice. How do you handle
    SOAP fault messages coming back from the webservice?
    Weblogic just throws an java.lang.reflect.UndeclaredThrowableException since it
    cannot parse the expected XML message.
    For example, when I call Logon() via the java control. The WebService should
    reply with a LogonResult object(in xml format). However, if there's an error,
    the WebService returns a SOAP Fault message. Since this fault message is not
    in the format of the expected LogonResult xml schema, weblogic throws an error
    (since it cannot create the LogonResult object) and the caller just receives the
    UndeclaredThrowableException without knowing any of the contents within the SOAP
    Fault.
    I'd like to be able to send back the SOAP fault content back to the calling function.
    I've tried throwing an exception from the java control handler, but it gets swallowed
    up by the SOAP Handler so I still get an exception with no content.
    any info is appreciated.
    thanks,
    Tom

    Hi,
    Do you get answer for that?
    I had similar problem and solved this in this way:
    In this java.lang.reflect.UndeclaredThrowableException handler is possible to get also SoapFault back:
    catch (java.lang.reflect.UndeclaredThrowableException e){
    RemoteException re = (RemoteException).getUndeclaredThrowable();
    ServiceControlException sfe = (ServiceControlException)re.getCause();
    SoapFault fault = sfe.getSoapFault();
    XmlObject[] objs = fault.getDetailContents();
    // more procssing here to get Soap detailed error
    Maybe this helps.
    rgrds,
    H

  • SOAP Message Handler

    I have a stand-alone java client which invokes a WSE enabled .NET web service. A custom policy file (no encryption or certificate. Just username token) is associated with the java client. I also include a SOAP handler to display the SOAP request. When I ran the client,
    the display of the SOAP request message was quite different between the console and the .NET server trace file. The statement "messageContext.getMessage().toString());" just display "weblogic.xml.saaj.SOAPMessageImpl@502e15"
    Could some one please tell me why the SOAP handler did not display the rest of the SOAP message like the .NET server trace file (shown below)?
    Here is a snippet of my SOAP Handler handleRequest implementation:
    public boolean handleRequest(MessageContext context) {
    System.out.println("handle request...");
    SOAPMessageContext messageContext = (SOAPMessageContext) context;
    System.out.println("** Request: " + messageContext.getMessage().toString());
    SOAPHeader sh = null;
    try {
    sh = messageContext.getMessage().getSOAPHeader();
    } catch (SOAPException se) {
    Iterator it = sh.examineAllHeaderElements();
    while (it.hasNext()) {
    System.out.println("*** There are SOAP Headers.....");
    SOAPHeaderElement elem = (SOAPHeaderElement)it.next();
    System.out.println("header ==> " + elem.getElementName().getQualifiedName());
    return true;
    Here is the display on the console:
    run:
    [java] in class digimarc.foto.webservice.clientstub.ClientHandler init()
    [java] in class digimarc.foto.webservice.clientstub.ClientHandler init()
    [java] in class digimarc.foto.webservice.clientstub.ClientHandler init()
    [java] handle request...
    [java] ** Request: weblogic.xml.saaj.SOAPMessageImpl@502e15
    [java] *** There are SOAP Headers.....
    [java] header ==> wsse:Security
    [java] <11-Apr-2008 2:14:04 o'clock PM ADT> <Info> <WebService-LogHandler> <BEA-000000> <weblogic.xml.saaj.SOAPMessageImpl@502e15>
    [java] ** Fault: weblogic.xml.saaj.SOAPMessageImpl@57b10b
    [java] <11-Apr-2008 2:14:06 o'clock PM ADT> <Info> <WebService-LogHandler> <BEA-000000> <weblogic.xml.saaj.SOAPMessageImpl@57b10b>
    [java] fetchMostRecent() Failed...
    .NET web server trace:
    <inputMessage utc="3/28/2008 3:05:43 PM" messageId="urn:uuid:23052686-df58-4144-9ec9-52617e5b5cd6">
    <processingStep description="Unprocessed message">
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" env:mustUnderstand="1">
    <wsse:UsernameToken wsu:Id="unt_R4qflJg2MR0no0AY" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>nbddls\john</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">G0ggin!</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </env:Header>
    <env:Body>
    <m:ImagingFolioFetchMostRecent xmlns:m="urn:digimarc.com:ImageServer:WebServices">
    <m:personID>1001917</m:personID>
    </m:ImagingFolioFetchMostRecent>
    </env:Body>
    </env:Envelope>
    </processingStep>
    </inputMessage>

    But when i am calling the sevrice the client side
    handler is not creating the soap envlope it is
    showing it as null.
    Follwing are the errors on Sun ONE console.The stack trace appears to be coming from the server side, not the client side. Then you get another error on the client side when the first error comes back. Without the line numbers in the file, I can't be positive, but it looks like the NPE is coming from the it.next() call below in your server handler:
    Iterator it=header.getChildElements(name);
    SOAPHeaderElement she= (SOAPHeaderElement)it.next();
    It would be good to see the message on the wire to be sure, but this prolly means you have no header elements. Maybe the setMessage call on the client side handler isn't working -- are you sure that the client handler is being invoked? I don't see the "***Client***" message anywhere in the output.
    If so, you could always try getting the existing soap message from the context and add headers to instead of creating a new message. The new message won't have the contents that you want to send to the service, so it looks like the call would fail even if the handler finishes correctly.
    Cheers,
    Bobby

  • How Can I call a UCM service from SOAP request

    Hi,
    I have created one custom service and I would like to call that service from 3rd Party system via SOAP call. The 3rd Party system does not have the capability to call through RIDC.
    Now I have exposed my service and tried to call but authentication exception was coming status code 401.
    So I created one sample ADF application and tried to call the DocInfo service for testing (I thought let's try DocInfo then I will check my custom service). I downloaded the DocInfo service from UCM and  uploaded the WSDL into the project and got the client DocInfoSoapClient.java file.
    public class DocInfoSoapClient
      @WebServiceRef
      private static DocInfo docInfo;
      public static void main(String [] args)
        docInfo = new DocInfo();
        DocInfoSoap docInfoSoap = docInfo.getDocInfoSoap();
        DocInfoByNameResult res = docInfoSoap.docInfoByName("TEST_001603", null);
        System.out.println(res.getContentInfo());
        // Add your code to call the desired methods.
    The error is coming like:
    Exception in thread "main" com.sun.xml.ws.client.ClientTransportAccessException: The server sent HTTP status code 401: Unauthorized: http://xxxxxxxx:16200/_dav/cs/idcplg
      at com.sun.xml.ws.transport.http.client.HttpTransportPipe.getClientTransportException(HttpTransportPipe.java:340)
    I tried a lot but same error. There should be some process by which I can send the userid and password but failed. Even I tried to send the properties as key value pair in IdcPropertyList but I know that is wrong.
    I checked the Issue: https://community.oracle.com/thread/2424460
    But there was no answer.
    Can anyone help on it?
    Regards,
    Santanu

    Hi Santanu,
    You need to write SoapHandler in order to pass username and pwd. You will need 2 classes namely HeaderHandlerResolver & SoapHandler. This is how i do in in my JAX-WS clients. I generate stubs and then attach handler to webserviceinterface
    PFA HeaderHandlerResolver.java and SoapHandler.java you would attach soap handler something like this in your code i have never done this via ADF so not sure.
    HeaderHandlerResolver soapHandlerResolver = new HeaderHandlerResolver();
    docInfo.setHandlerResolver(soapHandlerResolver);
    In SoapHandler class you will mention username and pwd like this
    soapMessageContext.put(BindingProvider.USERNAME_PROPERTY,"username");
    soapMessageContext.put(BindingProvider.PASSWORD_PROPERTY,"pwd");
    Regards,
    Amol Gavali

  • How to get SOAP Message while Request in WebService.. ?

    i am working on Web Logic WebService. I have created Web service and deployed into server.
    But now is there any ways to get the SOAP Message while request because i want to add some headers to the my SOAP Message before it sent to the backend.
    SOAPMessageContext smc=null;
    SOAPMessage soapMsg = smc.getMessage();
    System.out.println("SOAP MESSAGE :"+soapMsg);
    But I am getting NullPointerException.
    any Help ??...
    ThankQ.
    Ajay

    Hi
    In your code the NullPointerException is expected as the message context is null and not initialized before you call getMessage method on it.
    You can use soap handlers (client/server side handlers) to add the headers to the message before it is sent to the server.
    Soap handler has methods like below in which you can add the headers.
    * Handles incoming web service requests and outgoing callback requests
    public boolean handleRequest(MessageContext mc)
    System.out.println("Soap message is: \n " +
    ((SOAPMessageContext)mc).getMessage() + "\n");
    return true;
    More docs at http://e-docs.bea.com/wls/docs100/webserv_adv/handlers.html
    Vimala-

  • Intercepting SOAP Requests at HTTP Level

    We have a WLS Web Service in which we want to compress the body of the HTTP
    message containing the SOAP request (envelope). The compression will be done
    using gzip and including a standard
    Content-Encoding: gzip
    HTTP request header.
    This makes it necessary to intercept the HTTP/SOAP request on the server
    side to decompress the body of the HTTP message before WLS SOAP processing
    begins.
    Doing this in the SOAP Handler Chain is too late; by this time, WLS will
    have already attempted to parse the HTTP message and create (bind) the
    appropriate Java SOAP object structure (SOAPMessage, SOAPPart, etc.).
    Question: Is there a way to intercept the HTTP POST request containing the
    SOAP message early enough (e.g., as it comes off the wire) so that the body
    of the HTTP message can be decompressed before WLS parses it and creates
    the SOAP objects to pass to the Handler Chain?
    Thanks for any help and insight you can provide.
    John

    I've been dealing with a similar problem and it actually doesn't appear that WLS has bound everything by the SOAP Handler level. I have been working on inserting encryption into the WLS's SOAP handlers. I was getting nasty error messages when I was trying to encrypt the contents of the message body. At first I thought this was due to WLS trying to bind passed variables. This was mostly because of the invalid schema representation of a variable type x combined with a java.lang.NumberFormatException. However, if I encrypt 1 level lower i.e. the contents of the operations WLS becomes happy so I don't know what to think anymore. If you have any insites into why it would give me the error message it is giving me I would like to know. I hope my post has furthered the understanding of your problem in some way.
    more information on what I did is below:
    complete client request
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    </env:Header>
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:getBalance xmlns:m="http://example.com" Id="encryptMyContents">
    <intVal xsi:type="xsd:int">1</intVal>
    <string xsi:type="xsd:string">blah blah blah</string>
    </m:getBalance>
    </env:Body>
    </env:Envelope>
    general form of encrypted client request
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:getBalance xmlns:m="http://example.com" Id="encryptMyContents">
    <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#"
    Id="encryptedDataID"
    Type="http://www.w3.org/2001/04/xmlenc#Content">
    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <CipherData>
    <CipherValue>long encrypted stuff</CipherValue>
    </CipherData>
    </EncryptedData>
    </m:getBalance>
    </env:Body>
    The above encrypting the contents of the operation
    works with WLS
    The below encrypting the contents of the body
    does NOT work with WLS
    The target of the encrytion is moved
    <env:Body Id="encryptMyContents" ...
    general form of encrypted server response (I suppose I should have copied server response above but you can get the picture without it)
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:getBalance xmlns:m="http://example.com" Id="encryptMyContents">
    <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#"
    Id="encryptedDataID"
    Type="http://www.w3.org/2001/04/xmlenc#Content">
    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <CipherData>
    <CipherValue>long encrypted stuff</CipherValue>
    </CipherData>
    </EncryptedData>
    </m:getBalance>
    </env:Body>
    I get my nasty error message...
    Note this error message is if I simply use the invoke button that weblogic creates for me
    In this case the what happens is
    - the request handler recieves an unencrypted client request does nothing to the request
    - the web service generates its response
    - the response handler encrypts body contents of the response
    - the handler finishes
    - WLS throws the exception below
    NOTE: after this point there is nothing but the error message.
    Failed to invoke service:
    weblogic.xml.schema.types.IllegalLexicalValueException: "9HhL2AdpL5d4B2KOWrTCtJ2Q6Ybu+6..." is not a valid lexical representation of {http://www.w3.org/2001/XMLSchema}double - java.lang.NumberFormatException: For input string: "9HhL2AdpL5d4B2KOWrTCtJ2Q6Ybu+6/AftWxi/Kv752g4P9r30FhOXGgrCimrkd6 v09FsLsPdQagJQiETnMSVwVw1Kfw34fITv/S36Et+4SQ1t5+TpZwypuVz8bkyBFy KdSzrAD9ONxYERR1y6fy3m1XPZD5IUECmAKI/QaymtZjAyzQkA3U33sB+V3n5ZqS QcYcCj/9JwheIlBPkKL/JIPn6yqg6VBMp15a8CHYY5W/+aRpSMaDeDFkXOgBIelX wQumJ47tKXbHrhHio+MmeoMrlf0A1oU71j8ZPOBkvvfg3ty56OV9HBULOr+FtpnP dIlgJA3CxyX6L3W6ElP82biZwJumqL6ABDKNvyTJn8kfCkYUPjIynv8iiOHPUPEE ssHqVy+PI1tqoXHL6llVcb2a9gL4WNPXEC8EQnIlOay1t+nVrCRAG8PbzqIFApzd" at weblogic.xml.schema.types.XSDDouble.naiveConvertXml(XSDDouble.java:182) at weblogic.xml.schema.types.XSDDouble.convertXml(XSDDouble.java:153) at weblogic.xml.schema.binding.internal.builtin.XSDDoubleDeserializer.getObjectFromContent(XSDDoubleDeserializer.java:15) at weblogic.xml.schema.binding.internal.builtin.XSDSimpleTypeDeserializer.processContent(XSDSimpleTypeDeserializer.java:173) at weblogic.xml.schema.binding.internal.builtin.XSDSimpleTypeDeserializer.processContent(XSDSimpleTypeDeserializer.java:161) at weblogic.xml.schema.binding.internal.builtin.XSDSimpleTypeDeserializer.deserialize(XSDSimpleTypeDeserializer.java:101) at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428) at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328) at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:387) at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:487) at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:329) at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:147) at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:473) at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:439) at weblogic.webservice.server.servlet.ServletBase.invokeMultiOutput(ServletBase.java:359) at weblogic.webservice.server.servlet.ServletBase.invokeOperation(ServletBase.java:314) at weblogic.webservice.server.servlet.WebServiceServlet.invokeOperation(WebServiceServlet.java:361) at weblogic.webservice.server.servlet.ServletBase.handleGet(ServletBase.java:280) at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:157) at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:280) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288) Caused by: java.lang.NumberFormatException: For input string: "9HhL2AdpL5d4B2KOWrTCtJ2Q6Ybu+6/AftWxi/Kv752g4P9r30FhOXGgrCimrkd6 v09FsLsPdQagJQiETnMSVwVw1Kfw34fITv/S36Et+4SQ1t5+TpZwypuVz8bkyBFy KdSzrAD9ONxYERR1y6fy3m1XPZD5IUECmAKI/QaymtZjAyzQkA3U33sB+V3n5ZqS QcYcCj/9JwheIlBPkKL/JIPn6yqg6VBMp15a8CHYY5W/+aRpSMaDeDFkXOgBIelX wQumJ47tKXbHrhHio+MmeoMrlf0A1oU71j8ZPOBkvvfg3ty56OV9HBULOr+FtpnP dIlgJA3CxyX6L3W6ElP82biZwJumqL6ABDKNvyTJn8kfCkYUPjIynv8iiOHPUPEE ssHqVy+PI1tqoXHL6llVcb2a9gL4WNPXEC8EQnIlOay1t+nVrCRAG8PbzqIFApzd" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224) at java.lang.Double.parseDouble(Double.java:482) at weblogic.xml.schema.types.XSDDouble.naiveConvertXml(XSDDouble.java:173) at weblogic.xml.schema.types.XSDDouble.convertXml(XSDDouble.java:153) at weblogic.xml.schema.binding.internal.builtin.XSDDoubleDeserializer.getObjectFromContent(XSDDoubleDeserializer.java:15) at weblogic.xml.schema.binding.internal.builtin.XSDSimpleTypeDeserializer.processContent(XSDSimpleTypeDeserializer.java:173) at weblogic.xml.schema.binding.internal.builtin.XSDSimpleTypeDeserializer.processContent(XSDSimpleTypeDeserializer.java:161) at weblogic.xml.schema.binding.internal.builtin.XSDSimpleTypeDeserializer.deserialize(XSDSimpleTypeDeserializer.java:101) at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428) at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328) at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:387) at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:487) at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:329) at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:147) at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:473) at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:439) at weblogic.webservice.server.servlet.ServletBase.invokeMultiOutput(ServletBase.java:359) at weblogic.webservice.server.servlet.ServletBase.invokeOperation(ServletBase.java:314) at weblogic.webservice.server.servlet.WebServiceServlet.invokeOperation(WebServiceServlet.java:361) at weblogic.webservice.server.servlet.ServletBase.handleGet(ServletBase.java:280) at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:157) at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:280) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:214) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:120) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925)

  • Handler chain file - validation files

    Hi Everyone,
    I have webservice where I would like to log all SOAP messages. Back in the WebLogic 8.1 days the developer merely specified an annotation to a soap handler like this:
    * @editor-info:link autogen-style="java" autogen="false"
    * @jws:handler operation="foo.utils.soaphandlers.BARHandler"
    During the WebLogic 10.3 upgrade/import process this annotation disappeared. I am thus trying to restore this link to BARHandler. So... following this documentation:
    http://download.oracle.com/docs/cd/E15523_01/web.1111/e13734/handlers.htm#i261458
    I add an annotation:
    @HandlerChain(file="bar_handler.xml")
    and created XML...
    <?xml version="1.0" encoding="UTF-8"?>
    <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
    <handler-chain>
    <handler>
    <handler-class>foo.utils.soaphandlers.BARHandler</handler-class>
    </handler>
    </handler-chain>
    </handler-chains>
    BARHandler is a modern SOAP handler I know works in another context...
    package foo.utils.soaphandlers;
    ...snip...
    public class BARHandler implements SOAPHandler<SOAPMessageContext>
    ...snip...
    Everything seems to go fairly well, until my <jwsc> task in build.xml blows up with this error (re-spaced for reading):
    build.xml:123: weblogic.wsee.tools.WsBuildException: JWS Validation failed:
    [Handler chain file validation error for file:
    file:/path/src/foo/webservice/bar_handler.xml.
    Element handler-chains@http://java.sun.com/xml/ns/javaee is not a valid
       handler-config@http://www.bea.com/xml/ns/jws document or
         a valid substitution.,
    Handler chain file validation error for file:
    file:/path/src/foo/webservice/bar_handler.xml.
    Element handler-chains@http://java.sun.com/xml/ns/javaee is not a valid
       handler-config@http://www.bea.com/xml/ns/jws document or
         a valid substitution.]
    I worked all day searching for an answer, but no luck so far. I also feel like the gremlins are mocking me! Not only does the validation error repeat twice but the first sentence of JSR 181 specification says all of this is "a simplified programming model". Alas, for me, it hasn't be so "simple" :(
    Thanks a bunch for reading and if you reply I will be very grateful!
    Cheers,
    -Randy

    Hello Randy -
    Please check the following thread.
    Validation Error in the JWS
    Regards,
    Justin.

  • SOAP HandlerChain class not invoked

    I've seen lots of posts about getting a HandlerChain class invoked, but I can't seem to find the magic cure.
    I have an EJB web service with the HandlerChain annotation and a SOAP handler and a handler-chain.xml file. But the handler does not get invoked.  I was wondering if anyone HAS been able to get one to work using the HanderChain annotation for a weblogic deployment within an EJB annotated as a web service.
    EJB code:
    package foo.bar;
    import ...
    @WebService(portName = "RunWebServiceSOAP", serviceName = "RunWebService", targetNamespace = "http://foo.bar/RunWebService/", wsdlLocation = "RunWebService.wsdl", endpointInterface = "foo.bar.RunWebService")
    @SchemaValidation
    @BindingType(SOAPBinding.SOAP12HTTP_BINDING)
    @Stateless
    @Local(RunWebService.class)
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    @HandlerChain(file="handler-chain.xml") <<<--------------------HANDLER CHAIN ANNOTATION
    //@HandlerChain(file="../..handler-chain.xml") <<<-- ALTERNATE ATTEMPT
    public class RunWebServiceImpl implements RunWebService {
    Handler code:
    package boo.flork;
    public  class LowLevelSoapMsgPrinterHandler implements SOAPHandler<SOAPMessageContext> {
      @Override
      public boolean handleMessage(SOAPMessageContext smc) {
    Handler.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
      <handler-chain>
        <handler>
          <handler-class>boo.flork.LowLevelSoapMsgPrinterHandler</handler-class>
        </handler>
      </handler-chain>
    </handler-chains>
    Deployment locations of the handler xml file:
    1) my_app.ear/my_ejb.ejb/handler-chain.xml
    2) my_app.ear/my_ejb.ejb/handler-chain.xml
    3) my_app.ear/my_ejb.ejb/foo/bar/handler-chain.xml
    Kind of stumped here, anyone have any success with weblogic and a HandlerChain?

    Hello Chintan,
    I can't find any way to prevent the JSR168/286 portlet container from handling the exceptions during render. There is an option (specified in WEB-INF/weblogic-portlet.xml) which allows you to specify a particular JSP that gets called when an exception is caught during render, but any exceptions thrown by the JSP will also be handled and converted into "normal markup" rather than a WSRP SOAP fault. This would mean any JAX RPC handler (or consumer-side interceptor) wouldn't see an explicit fault message.
    So the answer to both questions 1 and 3 is that because the container is sending the error message embedded in markup, rather than a fault message, there is no way for the RPC handler or the interceptor to capture the exception as a fault. If you want, you can contact Oracle support and refer to issue 9645339. As a workaround, you could make the RPC / interceptor look at the markup for an embedded error message or special tag, rather than a fault message. If you took advantage of the error-handling JSP configurable in weblogic-portlet.xml you could even have the JSP include specific markers that the RPC handler / interceptor can look for. To configure the error JSP in the weblogic-portlet.xml file, you will need to add a section for each portlet along the lines of this:
    <portlet>
       <portlet-name>nameFromPortlet.xml</portlet-name>
       <supports>
            <mime-type>text/html</mime-type>
            <error-uri>path/to/error.jsp</error-uri>
       </supports>
    </portlet>If you have any questions about this suggestion, let me know!
    For question #2, I honestly don't know the best way to get the HttpServletRequest from there.
    Kevin

  • Soap and deserialize objects

    Hello,
    problem:
    I'am trying to get a connection between a java soap client and a perl soap server. There's no problem with that for "simple data types" (like String) for return values but i need to get an object back from the server ... so theres no deserializer found for that object.
    question:
    it is possible to deserialize an object from a perl soap server in a java client ?
    how can i do it ?
    thanks and greets
    guen

    HI Liessur
                I am Ravindra, i started iphone development few months back then presently working from wsdl url and soap .
    plz help how to connect NSURLConnection/NSURLRequest and SOAP handling finaly HTTPRequest.
    plz forward sample code.
    Thanks
    Ravindra

  • Howto proces SOAP Header with security info

    My incoming Soap messages contain security info in the soapenv:Header part.
    However, I only need the contents of the Body element.
    If I do NOT handle the Soap Message, then an Exception is thrown: something like: 'Do not know how to handle MustUnderstand'.
    So something must be done with the Security info in the header, but I do not know how. Do I have to remove the header completely in the Soap handler, after checking the singning? If somebody can point me to some examples of Soap header processing for this case it would be helpful.
    kind regs.
    Harry

    Hi Harry
    The header in Soap Messages is optional. Is is used to carry security information, that is security on the level of the Soap message. So when the header of an incoming Soap message is 'handled', the header is of no use any longer and can (must) be discarded. Indeed discarded, because the rest of the handlers don't expect a header in the Soap message. They extract the 'contents' from the body of the Soap message, and deliver that to you backend system.
    I will describe the header handling in the webservice: to get access to the Soap message in your code, you have to write a 'handler' Class. This Class should implement the Handler Interface or extend the abstract GenericHandler Class. To handle only the incoming Soap messages, the 'Requests', the method 'handleRequest' should be implemented. This handleRequest method has 1 parameter (mc) with type MessageContext. This parameter contains the original Soap message in Object format. You can access the original header information via:
    SOAPMessageContext smc = (SOAPMessageContext)mc;
    SOAPMessage message = smc.getMessage();
    SOAPPart part = message.getSOAPPart();
    SOAPEnvelope envelope = part.getEnvelope();
    SOAPHeader header = envelope.getHeader();
    With: Iterator iterator = header.getChildElements();
    you can navigate through the header elements and do whatever you like. If you decide that security info in this header does not match the contents of the body for instance, you can issue an Exception and log it.
    After processing the header you have to discard it with:
    header.detachNode(); and let your handleRequest method return 'true'.
    The rest of the webservice processing takes the contents from the body element, and delivers that to your application.
    To let you webservice make use of your Handler, you have to name it in the web-services.xml as follows:
    <webservices>
    <handler-chains>
    <handler-chain name="myChain">
    <handler class-name="a.b.c.MyHandler" />
    </handler-chain>
    </handler-chains>
    <web-service name="MyService">
    <operations>
    <operation ... handler-chain="myChain" .... />
    </operations>
    When the webservice 'MyService' gets a request, the handler 'MyHandler' is automatically invoked. you can have more handlers in a chain. Also you can declare more chains in your <webservices> section and refer to them from the <operation> elements.
    Items of interest:
    javax.xml.rpc.handler.soap.*
    javax.xml.rpc.handler.*
    javax.xml.namespace.*
    javax.xml.soap.*
    May be this of use for you :).

  • Flex&SAP Exceptions handling.

    Hello
    We have deployed a Web Service application in our WAS 7.10 SP6.
    Our application is a standard java 5 app with annotations (ejbs exposed as web services).
    When a web service call operation returns a java exception (any kind of exception), WAS returns http 500 to the client.
    http 500 cannot be interpreted by a flex client (2.0, 3.0 no matter which version) because of an interaction between browser and flex runtime issue. Flex code can only obtain an i/o error when http 500 is returned by the server.
    The usual way to solve this problem is to create a filter that transforms http 500 to http 200, but we don't know how to implement a filter for web services http responses in WAS 7.1 or 7.0
    Other solutions involve using Adobe proxy, but in our case we can't use it.
    Is there any other solution to this matter?

    If you don't mind coding the SOAP handling yourself you can use the [as3httpclientlib project|http://github.com/gabriel/as3httpclient/tree/master] which is a nearly fully implemented httpclient that uses sockets to work. 
    The socket config can sometimes be a bit tricky to get setup but if you control the servers in question it's possible.  This isn't a perfect solution but in this case Adobe is a bit behind what the browser do ( which is not pass 500s to plugins ) so they are a bit stuck in what they can provide to the player then on to the framework.
    -d

Maybe you are looking for