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

Similar Messages

  • NamingException and ClassCastException during jndi lookup

    Hi,
    I am trying to access the SAP database(MaxDb)using JNDI lookup in WebDynpro simple java project.
    But, during lookup I am getting the following error
    com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name : jdbc/VSLOOKUP , can not resolve object reference [Root exception is java.lang.ClassCastException]
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:469)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:558)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.vitalspring.healthbenefits.dbaccess.DBAccessHelper.main(DBAccessHelper.java:51)
    Caused by: java.lang.ClassCastException
         at com.sap.engine.services.connector.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:149)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:466)
         ... 3 more
    Can anybody throw some light on it?
    Because, it's urgent for my project.
    I would appreciate any kind of help in this regard.
    Thanks & Regards,
    Rambabu Kancharla

    Hello Anilkumar,
    Sorry for delay in reply as I was on out of work and didn't get chance to check the SDN forums.
    I was able to do it in latest version sneak preview 11.
    I think the problem with the version.
    Thanks,
    Rambabu

  • SOAP adapter and BizTalk specific header entries

    We are trying to implement a B2B scenario using XI 2.0 and the SOAP adapter (J2SE). The customer is using BizTalk. My question is if it is it possible in the SOAP adapter to include BizTalk-specific

    Hi Stefan,
    I have a scenario in which I want to call an External WebService from SAP XI 3,sp10. An SAP RFC Is the SENDER.
    After doing the config I see 2 failed messages in MONI everytime. I do not see the soap header in the message. The error is -->failed to reach the end point.
    I want to see if I am passing the Header correctly.A
    Also most important I need to have a Authentication tag in my header tag which seems to be specific to 3rd party system hosting the webservice.
    I want my SOAP Header to have :
              <s:AuthenticationInfo>
                    <s:userName>webuser</s:userName>
                    <s:password>XXXXX</s:password>
               </s:AuthenticationInfo>
    When using the SOAP Receiver channel I expect XI to put this but does not look like its doing the job. Anyways the s: tags above are custom tags with custom namespace. How do I add in the SOAP Header ?
    Thanks
    Ashish

  • 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 to proxy scenarion  error An error occurred during the processing of proxy E 00 001 The message can not be processed in plugin mode HTTP

    Hi all
    My scenario is soap to proxy scenario .while testing using soap to proxy i am getting " An error occurred during the processing of proxy E 00 001 The message can not be processed in plugin mode HTTP:  in sxmb_moni sap pi .
    Some times this interface is failing and some time its successfully processing.
    While testing with successful xml data also i am getting the same error in sxmb_moni.
    I modified the proxy inbound code where passing error message  and still i am getting the same message.
    Please suggestion the same  for error solving.
    Regards
    Ravi.

    Hi,
    I'm facing the same problem.
    I wrote an very easy report. It works as intended, but when i set fillable='X' i get the error FPRUNX 001.
    FP_GET_LAST_ADS_TRACE return following:
    Begin operation:
    Render, elapsed time = 16 ms.
    #   End operation: Render, elapsed time = 89 ms.
    #   Begin operation: UsageRights, elapsed time = 89 ms.
    #   End operation: UsageRights, elapsed time = 97 ms.#
    ...and the error string of FP_GET_LAST_ADS_ERRSTR is:
    ADS: Request start time: Wed Jul 01 14:44:26 CEST 2009(200.101).
    Any idea what the problem might be?

  • Is it possible to turn off the fluid grid function in dreamweaver during the process of building your site by mistake? It was working fine and simply stopped and I don't see how to correct what is wrong.

    Is it possible to turn off the fluid grid function in dreamweaver during the process of building your site by mistake? It was working fine and simply stopped and I don't see how to correct what is wrong.

    There is no specific function that turns FGL on or off.
    When you say that it has stopped, do you mean that the handles no longer show?
    If that is the case, then I think you may have modified the CSS to such an extent that Dreamweaver no longer recognises it as belonging to FGL.
    There are a couple of avenues for you
    Redo the site and make sure not to touch the FGL CSS
    paste the code here so that we can see what has gone wrong.

  • PLEASE HELP ! While updating My Xperia Z1 , my pc hanged during the process and .

    While updating My Xperia Z1 , my pc hanged during the process ( so , installation of update was interrupted , guess it's same as getting your USB connection disconnected )and now the phone won't turn on .
    Its shows the Sony Xperia logo , then shows a black lit screen , and that's it , nothing else happens . I can only turn it off by pressing and holding the power+up volume button , but it turns on automatically if plugged in for charging or in PC only till it gets that black screen .
    I tried to flash it with a flashtool (Emma) , but it says phone locked , but since it can't even be turned on , i can't unlock it .
    It's a store bought phone and is not of any contracts with any mobile service provider or anything like that ....
    Funny you know ... my PC had to crash at the moment i was updating it .... my luck ....
    Anyways , now please can anyone tell me what i can do ? I'm sure there is a way i can fix it using my pc and other downloadable software , so please can some one help me how i can fix this problem ? I don't care if i lose all the data on it , i just want my phone back ....
    Solved!
    Go to Solution.

    Problem Solved ,Thank you  very much !! 
    For those who might face the problem and stumble upon this thread after googling  
    Read above mentioned comments 
    Now here's what I did :
    Turned the phone off by power+volume key method , then plugged it in to the pc via USB and opened sony pc companion , entered Support zone , then entered the Update device option , then I Unplugged my device , only after doing this a window pops up with  Repair my phone/tablet in blue text , then i clicked on that and followed the simple instructions ..
    It's basically what Thommo said , only i was so freaked out at that time that i failed to follow his instructions to the letter  
    So now my phone is back to normal , and , it got the latest lolipop update !
    Problem solved i guess  but Thommo , i need to disturb you again with  just one more  question ,  since at the very beginning , the update process was interrupted , and now i got lolipop after  the repair ,without needing to update again ,  so has the lollipop been installed properly on my phone or do i need to use any other flashtool to re-install lollipop ? 
    again , Thank you ... 

  • After forgetting the password for my iPhone, I am trying to restore it through iTunes, however, during the process, the phone keeps turning on and asking for the password, thus canceling the process. Any advice?

    After forgetting the password for my iPhone, I am trying to restore it through iTunes, however, during the process, the phone keeps turning on and asking for the password, thus canceling the process. Any advice?

    Yes, you will still get the prompt.
    I meant reset then try the recovery mode restore again.
    You can also try DFU Mode.
    DFU (Device Firmware Update) Mode is different than Recovery Mode.
    DFU Mode is a special mode where the device can still interface with iTunes, yet it does not load the iBoot bootloader.
    DFU Mode:
    Plug your device into your computer.
    Turn off the device.
    Hold the Power button for 3 seconds
    Hold the Home button without releasing the Power button for 10 seconds
    Release the Power Button but keep holding the Home button
    Keep holding the Home button until you are alerted by iTunes saying that it has detected a device in Recovery Mode
          NOTE: Make sure the device screen is blank and no logos are present. Be patient, it make take several trys.

  • HT201413 i tryed to restore my phone but it turns of during the process and an error happens so what should i do

    i tryed to restore my phone but it turn off during the process and an error happens so should i do ?

    Hello there, VladlsSwag.
    The following Knowledge Base article provides some steps for troubleshooting your issue:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Particularly:
    Will not turn on, will not turn on unless connected to power, or unexpected power off
    Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
    Check if a Liquid Contact Indicator (LCI) is activated or there are signs of corrosion. Learn about LCIsand corrosion.
    Connect the iPhone to the iPhone's USB power adapter and let it charge for at least ten minutes.
    After at least 30 minutes, if:
    The home screen appears: The iPhone should be working. Update to the latest version of iOS if necessary. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen . Then unplug the phone from power. If it immediately turns off, seek service.
    The low-battery image appears, even after the phone has charged for at least 20 minutes: See "iPhone displays the low-battery image and is unresponsive" symptom in this article.
    Something other than the Home screen or Low Battery image appears, continue with this article for further troubleshooting steps.
    If the iPhone did not turn on, reset it while connected to the iPhone USB power adapter.
    If the display turns on, go to step 4.
    If the display remains black, go to next step.
    Connect the iPhone to a computer and open iTunes. If iTunes recognizes the iPhone and indicates that it is in recovery mode, attempt to restore the iPhone. If the iPhone doesn't appear in iTunes or if you have difficulties in restoring the iPhone, see this article for further assistance.
    If restoring the iPhone resolved the issue, go to step 4. If restoring the iPhone did not solve the issue, seek service.
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Intercepting SOAP XML message in JAX-RPC Handler and calling a diff method

    Is it possible to intercept the SOAP XML message in the JAX-RPC handler and avoid the serialization and deserialization (OR avoid XML data binding)
    Here is a more detail question
    My web service has two methods
    1. One Method which accepts Java Object (this object is mapped with a Schema
    Complex Type Element in my WSDL file)
    2. Second method which accept simple String type.
    I want my web service client to send java object (using the first method), so that the Input gets validate in the WSDL itself (before it hits the actual web service) but once the request gets validated i want to pass that converted SOAP XML String (on the Server side using JAX-RPC handler) to the Second method.

    The answer to this is that the WSDL had
    elementFormDefault="qualified"
    in the schema.
    Changing to unqualified resulted in the desired output.
    Note: The service was changed to handle both cases.

  • [svn] 3347: -remove the javascript directory since it is getting cleaned and recreated during the build process .

    Revision: 3347
    Author: [email protected]
    Date: 2008-09-25 06:27:28 -0700 (Thu, 25 Sep 2008)
    Log Message:
    -remove the javascript directory since it is getting cleaned and recreated during the build process.
    -this should make SVN happy and get the builds working again
    Removed Paths:
    flex/sdk/trunk/frameworks/javascript/FABridge/samples/srcview/source/fabridge/javascript/

    - Where? That depends upon what you what. But, going by the letter of what you asked, you shouldn't deploy any applications or packages if you want them on your newly images systems, you should make them a part of the TS using Install Software and Install
    Application tasks.
    - How many times? You should only need one although depending upon what you are deploying and if you are using offline updates, some folks add more. I typically use two one right after the Setup Windows and ConfigMgr task (just like the task sequence wizard
    builds for you) to update the OS and "things" in the image and one at the end to catch additional updates for apps and components added during the TS. Note that you also have to initiate an update scan cycle for additional install update tasks to work. Do
    this by adding a run-command line task before the second Install Updates task with the proper WMIC incantation.
    - Offline Updates only injects CBS updates into the image which are typically just core OS updates. You should also update your image though to include non-CBS updates. Using a build and catpure task sequence makes this easy.
    Jason | http://blog.configmgrftw.com

  • Co products and by products during production process

    hi,
    I have a production scenario where in both co products as well
    by products exists during production process.
    We can maintain co products by choosing the indicator in material master and in BOM but how should i maintain the by products?
    And also, co products and by products produced will undergo further production process with different operations, in this scenario how I can include these operations and products in my production planning? and how the costs are calculated?
    Can any one please help in this regard.
    Thanks and Regards,
    Pavan

    Hi
    For Co-product just by choosing the indicator in material master and in BOM.
    So when ever u confirm the production order co- product GR done automatically through 101 movement type.
    For By-product
    1) u have to enter the byproduct code in the BOM with -ve sign if ur by-product is fixed qty.
    2) If ur by-product is varying qty then u have to post the by product qty through MIGO 531 movement type against the production order.

  • [svn:fx-trunk] 5473: Fix for bug around handling of constraints during and after effects were run , both for old and new effects.

    Revision: 5473
    Author: [email protected]
    Date: 2009-03-20 16:02:58 -0700 (Fri, 20 Mar 2009)
    Log Message:
    Fix for bug around handling of constraints during and after effects were run, both for old and new effects. Fix was to correctly record and handle styles that were set or not set in either state and to temporarily set width/height values for the duration of an effect if we disabled the relevant styles that affect width/height.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17809
    Reviewer: Jason
    Testing: checkintests, Mustella Effects, ListDataEffects
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17809
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.a s
    flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as

    Revision: 5473
    Author: [email protected]
    Date: 2009-03-20 16:02:58 -0700 (Fri, 20 Mar 2009)
    Log Message:
    Fix for bug around handling of constraints during and after effects were run, both for old and new effects. Fix was to correctly record and handle styles that were set or not set in either state and to temporarily set width/height values for the duration of an effect if we disabled the relevant styles that affect width/height.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17809
    Reviewer: Jason
    Testing: checkintests, Mustella Effects, ListDataEffects
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17809
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.a s
    flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as

  • I upgraded to iOS 5 and lost ALL of my apps even though during the process they were backed up to my Itunes. Can I get them back?

    I upgraded to iOS 5 and lost ALL of my apps even though they were backed up to Itunes during the process.  Whenever I plug my ipad into my computer the apps that appear in Itunes are from my ipod touch.  How can I get my apps back without purchasing them again?

    On your iPad and iPod touch tap Settings > Store
    Make sure Music is switched On under Automatic Downloads.
    Now restart your iPad and your iPod touch.
    Hold the On/Off Sleep/Wake button down until the red slider appears. Slide your finger across the slider to turn off iPhone. To turn iPhone back on, press and hold the On/Off Sleep/Wake button until the Apple logo appears.
    You can re download iTunes purchases for free if necessary >  Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I forgot my passcode, so I was unable to access my phone. I then tried to restore it, but it has frozen during the process. It won't connect to my mac again and I can't stop the process because my lock button is broken. What do I do?

    I forgot my passcode, so I was unable to access my phone. I then tried to restore it, but it has frozen during the process. It won't connect to my mac again and I can't stop the process because my lock button is broken. What do I do?

    My first advice is "Back up the device, then have it replaced."  Second item of advice, "Don't forget your passcode."
    One of the purposes of the lock button is to recover from certain software failures.  Without the lock button, such a recovery is nearly impossible.  My advice would have served you best when the malfuction first developed, not after you forgot your passcode.

Maybe you are looking for