How can I change namespace prefix for JAX-RPC client request?

I'm creating a JAX-RPC client to invoke a RPC/encoded web service. The service was generated from a ColdFusion program and for some reason when the SOAP namespace prefix is anything but "soapenv" it returns text/html instead of text/xml. Currently the client is sending requests with the prefix "env" and I'd like to change it to "soapenv".
I created a type of javax.xml.rpc.handler.GenericHandler and attempted to do the follow:
@Override public boolean handleRequest(MessageContext p1) {
     SOAPMessage msg = ((SOAPMessageContext) p1).getMessage(); 
     try {
          SOAPPart part = msg.getSOAPPart();
          SOAPEnvelope envelope = part.getEnvelope(); 
          envelope.setPrefix("soapenv"); 
          msg.saveChanges(); 
     } catch(SOAPException ex) {
          // TODO
          return false;
     return true;
However I get the following exception:
java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [UNIMPLEMENTED ] FaultActor [null] Detail [<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.AssertionError: UNIMPLEMENTED
at weblogic.xml.domimpl.NodeImpl.setPrefix(NodeImpl.java:173)
at test.MyHandler.handleRequest(MyHandler.java:33)
at weblogic.wsee.handler.JaxrpcHandlerChain.handleRequest(JaxrpcHandlerChain.java:58)
at weblogic.wsee.ws.dispatch.server.JaxrpcChainHandler.handleRequest(JaxrpcChainHandler.java:102)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:132)
at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87)
at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:341)
at test.Approvedsuppliers_Wrap_Stub.echo(Approvedsuppliers_Wrap_Stub.java:31)
at test.Approvedsuppliers_WrapPortClient.echo(Approvedsuppliers_WrapPortClient.java:130)
at test.Approvedsuppliers_WrapPortClient.main(Approvedsuppliers_WrapPortClient.java:43)
Is there any workaround? I appreciate any feedback.
Thanks, Bill

What I ended up doing is converting the SOAP message to a string, replacing the namespace prefix and converting it back to a SOAP message.
@Override
   public boolean handleRequest(MessageContext messageContext) {
      SOAPMessageContext soapMessageContext = (SOAPMessageContext) messageContext;
      SOAPMessage soapMessage = soapMessageContext.getMessage();
      String soapString = convertSOAPToString(soapMessage);
      soapString = soapString.replaceAll("env:", "soapenv:");
      soapString = soapString.replaceAll("xmlns:env", "xmlns:soapenv");
      SOAPMessage newSoapMessage = convertStringToSOAP(soapString);
      MimeHeaders mimeHeader = newSoapMessage.getMimeHeaders();
      mimeHeader.setHeader("SOAPAction", "");
      soapMessageContext.setMessage(newSoapMessage);
      return true;
   private String convertSOAPToString(SOAPMessage soapMessage) {
      StringWriter stringWriter = null;
      try {
         stringWriter = new StringWriter();
         StreamResult streamResult = new StreamResult(stringWriter);
         TransformerFactory transformFactory = TransformerFactory.newInstance();
         Transformer transformer = transformFactory.newTransformer();
         transformer.transform(new DOMSource(soapMessage.getSOAPPart()), streamResult);
      } catch (TransformerException e) {
         throw new RuntimeException(e);
      } finally {
         close(stringWriter);
      return stringWriter.toString();   
   private SOAPMessage convertStringToSOAP(String soapString) {
      SOAPMessage soapMessage = null;
      ByteArrayInputStream byteInputStream = null;
      try {
         MessageFactory msgFactory = MessageFactory.newInstance();
         soapMessage = msgFactory.createMessage();
         SOAPPart soapPart = soapMessage.getSOAPPart();
         // Load the SOAP text into a stream source
         byte[] buffer = soapString.getBytes();
         byteInputStream = new ByteArrayInputStream(buffer);
         StreamSource source = new StreamSource(byteInputStream);
         // Set contents of message
         soapPart.setContent(source);       
      } catch (SOAPException e) {
         throw new RuntimeException(e);
      } finally {
         close(byteInputStream);
      return soapMessage;
   private void close(Closeable closeable) {
      if(closeable != null) {
         try {
            closeable.close();
         } catch (IOException e) {
            // TODO

Similar Messages

  • HT1349 how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    how can I change an email for authorization, the email address we used years back, is no longer a valid email address

    SfromW wrote: ... how can I change an email for authorization, the email address we used years back, is no longer a valid email address
    How to change account here: http://support.apple.com/kb/PH1641
    If you need more help, start here: http://www.apple.com/support/itunes/
    SfromW wrote: ... we can't remember the password from the old email address (for authorization)...
    Help Retrieving and changing passwords here: http://support.apple.com/kb/HT1911
    If you need more help, from iTunes for Windows, click  iTunes > iTunes Store > Support
    SfromW wrote: ... apple should make it easier to transfer authorization authority....I would think anyways.
    You might want to rethink your thoughts about making transferring authority easier.  Making it too easy would certainly degrade your account's security.  If you still believe it should be easier, you can send feedback directly to Apple via http://www.apple.com/feedback/itunesapp.html
    You will not get a response, but you can be certain that the responsible Apple people will see your input for consideration in FaceTime product development.
    As a new user, please understand that you are NOT directly addressing Apple here.  For more info about Apple discussions, start here: http://discussions.apple.com/static/apple/tutorial/etiquette.html 
    Message was edited by: EZ Jim
    Mac OSX 10.7.4

  • I no longer want to merge my work laptop with my icloud account on other devices.  How can I change the setting for the laptop?

    I accidentally agreed to set up my work laptop icloud account to merge with my other devices and want to keep the work information separate.  How can I change the setting for the PC at work?

    Sign out of iCloud.

  • How can I change the password for the USER in SAP.

    How can I change the password for the USER in SAP?
    also I want to change the Language and  date Format b/c it's displaying in German language..

    Hi,
    Assuming that User has already his/her user-id and password, and now he/ she wants to change it.
    select the client and provide Log-in credentials. Now, instead of 'ENTER' there is one Tab: 'New Password' (up, left hand). Click it.
    Now, system will ask for new password to change.
    If you are asking from Basis point of view, then T.code: SU01 - User Maintenance.
    Enter User's id and Click Change icon.
    It will lead to Page: Maintain User.
    Here, Select tab: Logon Data
    There is a Sub-Tab: Password.
    Here, key-in change password and SAVE.
    For Language and Date format, contact your Basis-Personnel.
    Best regards,
    Amit

  • I have installed Itunes on my laptop. However, the apple store opens in German language. I need it in English. How can i change the language for istore through the itunes?

    I have installed Itunes on my laptop. However, the apple store opens in German language. I need it in English. How can i change the language for istore through the itunes?

    Go to the bottom of the page, click the flag, then select your country.

  • How can i change the font for a theme in iDVD.

    how can i change the font for a theme in iDVD. For example; the text of the rotation theme in the background of the movie. i want to change the font of the rotating text there. How do i do this?

    Have a look at this: http://hints.macworld.com/article.php?story=20080130180258257

  • How can I change view options for ALL playlists?

    How can I change view options for ALL playlists? With one single click or trick?
    I have a lot playlists and don't want to change every single one of them separatly.
    Thanks for your help. (I use Windows 7)

    There's no FAST way I know of, which is what I think you mean.
    Only the painful SLOW way of one-by-one.
    You could make a new playlist from the main library after you've set the columns up as you like.
    Go to an existing playlist that doesn't have the columns you want, and select all.
    RIght-click > Add to Playlist and send them to the new playlist.
    That's still one-by-one and only works with static playlists, not smart ones.

  • How can I change the settings for being timed out (I don't want to be timed out ever)

    How can I change the settings for being timed out (I don't want to be timed out ever)?

    I am sorry but this isn't something that you can set. The system has timeouts built into the code.
    Andrew

  • How can I change the email for the Apple ID

    How can I change my email for my Apple ID

    Hello there, Lelizabeth2014.
    The following Knowledge Base article goes over the steps for doing just that:
    Apple ID: Changing your Apple ID
    http://support.apple.com/kb/ht5621
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How Can I change the Authentication for this Dynpage

    Hello ,
    I have created a rss feed in special Dnypage.   When I try to connect with rss reader  to dynpage it occurs an error 500.  The problem is that no logon screen appears and the portal would start the Dynpage with the User Guest.
    How Can I change the Authentication for this Dynpage ? I need a LogonScreen
    RSS URL:
    /irj/servlet/prt/portal/prtmode/rss/prtroot/com.geberit.ep.uwlquick.uwlquickstarter?mode=rss

    Hi ,
    sry the entry in xml does not help. No Logon Prompt
    <?xml version="1.0" encoding="UTF-8"?>
    <application>
      <application-config>
        <property name="SecurityArea" value="NetWeaver.Portal"/>
        <property name="Vendor" value="xx.com"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb,com.sap.portal.pcd.glservice,com.sap.portal.ivs.iviewservice,usermanagement,,com.sap.netweaver.bc.uwl"/>
      </application-config>
      <components>
        <component name="uwlquickstarter">
          <component-config>
              <property name="SafetyLevel" value="no_safety"/>
            <property name="ClassName" value="com.xx.portal.uwl.uwlquickstarter"/>   
          </component-config>
              <component-profile>
                   <property name="AuthScheme" value="default"/>
              </component-profile>
        </component>
      </components>
      <services/>
    </application>

  • How can I change the language for the Quiz Results page?

    How can I change the language for the Quiz Results (labels on buttons and text labels)? Is this possible only manually each time, or are general settings possible?

    For Quiz Slides you've already added to your project file you will need to change the labels manually.  If you change your Quiz Settings and Master Slides that control the defaults and then add new Quiz Slides, THEN those slides will carry your new settings.

  • How can i change the ringtone for different contacts.  "edit contacts" won't let me`??

    how can i change the ringtones for different contacts on the razor.  "edit contacts" wont allow me to

    Here is the Instructions your Looking For:  Down towards the Bottom of the Instructions shows how to set Ringtones for each Contact.
    How do I download and use ringtones on my DROID  Razr & RAZR MAXX?
    Quick links
    Set any of your songs on your SDcard as a phone ringtone
    Choose Phone ringtones through settings menu
    Customize the text message ringtone
    Assign a ringtone to a specific contact
    Download ringtones from Play Store      
    1. Set any of your songs on your SDcard as a phone ringtone:
    Touch Apps > My music
    While the music is playing, touch the phone Menu Key > More > Use as ringtone 
    The ringtone is set as your default incoming call ringtone and copied to your Phone ringtone list.       
    Note: The above instructions are for the My music player and not for other players such as Play music.      2. Choose Phone ringtones through settings menu:
    Press the Menu key
    Touch Settings
    Touch Sound
    Touch Phone ringtone  (If option is greyed out, make sure handset volume is not set to Silent Mode)
    Select a Phone ringtone from the list. Press OK to set. (Music files you have set as Incoming Call ringtone from your SDcard will be included in this list along with downloaded and preloaded ringtones.
    3. Customize the text message ringtone
    From the homescreen or from within the applications tray, touch Text messaging
    Press the Menu key (On the left with 4 squares)
    Touch Messaging Settings
    Touch Select ringtones (if option is greyed out, make sure Notifications is turned on / actived)
    Touch on any Notification ringtone to select and hear a sample.
    Press OK to set as notification ringtone
    CLICK HERE for instructions on creating your own custom ringtone for Text Messages
    4. Assign a ringtone to a specific contact:
    Press Contacts icon on homescreen or tap on Contacts application from the Applications Tray
    Touch and select the specific contact
    Press the menu key
    Touch Options
    Touch V (down)  icon next to Ringtone
    Choose a Phone ringtone from the list and tap OK to set.
    Note: To assign a music/song from your memory card as a ringtone, first follow step1 above and follow step 4 again. 5. Download ringtones from the Play Store
    From the applications menu, touch Play Store
    Touch search  to search for ringtones.
    Answers others found helpful
    How do I setup and use Bluetooth on my DROID RAZR MAXX?
    How do I transfer files to/from my DROID RAZR MAXX?
    How do I set up and use the Smart Actions application using the DROID RAZR MAXX?
    How do I use the DROID RAZR MAXX for video chat?
    How do I force my DROID RAZR MAXX to reboot or restart?

  • How can I change the duration for all clips in iMovie 10.2

    How can I change the duration for all clips in iMovie 10.2?  I'm used to working in the older version of iMovie where all I had to do was click on the gear on the clip and change the duration. ALso could use the tool bar to set the duration for all clips. Can't figure out how to do that in this new version. Any suggestions would be appreciated.

    In the timeline select the clip whose duration you want to change. Click the adjust button at the top of the viewer and then click the i button and you can set the duration. For multiple clips select them all and in the i button type in the duration you want and it will be applied to all the selected clips. You can also change the duration of a clip in the timeline by putting the cursor over the beginning or end of a clip and dragging. A popup will show the new duration.

  • How can i change the phonenumber for my security code in keychain on ios 7.03

    how can i change the phonenumber for my security code in keychain on ios 7.03?

    i have changed the phonenumber under icloud preferences keychain. after the update on ios 7.03 there is no sms arriving for the security code because there is a double international code in the telephone number like +49 +49. How can i fix this?

  • How can i change the paasword for my backup?

    how can i change the password for my backup?

    Actually what I'm looking for to backup my data but unfrotunetely I can't because always asked me for the correct pasword to allowed to restore my data. thx Libby 101a

Maybe you are looking for

  • I forgot my  passcode for my iphone 4

    i forgot my passcode for my passcode for my iphone 4 how do i reactivate it

  • Wrong data when consuming web service via ABAP

    Dear all, we tried to consume a web service via ABAP and used one of the various existing how-to papers from the internet in order to develop everything. The development was not that difficult, but when we now execute our ABAP, we noticed that - the

  • Movieclip - Button - Location on stage

    Fellow Gurus! I am using Flash 8. I rendered some boxes on the stage. One is for a menu and another is for graphics. The idea is to have a picture pop-up in the graphic box whenever one passes a mouse over a button in the menu (which is in the menu b

  • IPhoto 6.0.6 slide timer error after Quicktime export

    After a slideshow has been exported to Quicktime, the adjustment arrows for "Play this slide for x seconds" in the "Adjust This Slide" window are gone, and individual slide timing can no longer be adjusted for the slideshow. Anybody know how to fix t

  • Replacing files (changing file path) and keeping playcounts

    Hello! First of all, sorry if this a little bit confusing, english is not my first language. I'm thinking about moving my library and music files to an external HD, but I also would like to organize my music folders differently from the way iTunes do