How to create a new namespace in SOAP envelope?

I'm trying to create SOAP envelope like the following: 
  <my:Envelope xmlns:my="http://my.com/">
    <my:Header/>
    <my:Body/>
  </my:Envelope>and the following are the codes:  SOAPFactory soapFactory = SOAPFactory.newInstance();
  MessageFactory factory = MessageFactory.newInstance();
  SOAPMessage msg = factory.createMessage();
  SOAPPart part = msg.getSOAPPart();
  SOAPEnvelope env = part.getEnvelope();
  SOAPElement name = env.addNamespaceDeclaration("my", "http://my.com/");
  msg.writeTo(System.out);However, the code generates the following results:  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:my="http://my.com/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body/>
  </SOAP-ENV:Envelope>What should I do to remove the SOAP-ENV namespace? What is the clean way to create a new SOAP envelope?
Appreciate your advice, thank you!

OK, I found a way to do it:  SOAPFactory soapFactory = SOAPFactory.newInstance();
  MessageFactory factory = MessageFactory.newInstance();
  SOAPMessage msg = factory.createMessage();
  SOAPPart part = msg.getSOAPPart();
  SOAPEnvelope env = part.getEnvelope();
  // 1) must add the new namespace before deleting the default namespace
  SOAPElement name = env.addNamespaceDeclaration("my", "http://my.com/");
  // 2) now only we can delete the default namespace
  env.removeNamespaceDeclaration("SOAP-ENV");
  // 3) then change the prefix of other parts one by one...
  env.setPrefix("my");
  msg.getSOAPHeader().setPrefix("my");
  msg.getSOAPBody().setPrefix("my");Does anyone has a better way (cleaner) to do it?

Similar Messages

  • How To Create The New VO in Standered Page?

    Hi Gurus,
    Pl z help me how to create the new Custom VO in slandered page,and how to attach that VO in custom RN in all are slandered page only.
    Regards,
    Srini

    Hi Sara,
    <i>1. Could you please tell me how to create the new webservice in XI?</i>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f3ee9d7-0901-0010-1096-f5b548ac1555
    <i>2. What tools we have to use to create it.?</i>
    /people/community.user/blog/2006/09/19/xi-webservice-studio--a-plain-jane-soap-tool
    http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=65a1d4ea-0f7a-41bd-8494-e916ebc4159c
    Altova is also a good option
    <i>3. How to send the SOAP request to XI?</i>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    SAP Note 856597
    An Add-on
    /people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
    Regards,
    Prateek

  • How to create the new webservice in XI?

    Hi All,
    1. Could you please tell me how to create the new webservice in XI?
    2. What tools we have to use to create it.?
    3. How to send the SOAP request to XI?
    Regards
    Sara

    Hi Sara,
    <i>1. Could you please tell me how to create the new webservice in XI?</i>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f3ee9d7-0901-0010-1096-f5b548ac1555
    <i>2. What tools we have to use to create it.?</i>
    /people/community.user/blog/2006/09/19/xi-webservice-studio--a-plain-jane-soap-tool
    http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=65a1d4ea-0f7a-41bd-8494-e916ebc4159c
    Altova is also a good option
    <i>3. How to send the SOAP request to XI?</i>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    SAP Note 856597
    An Add-on
    /people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
    Regards,
    Prateek

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

  • How to create a new connection from SAPGUI to Test drive?

    Hi,
    I have installed Sap Netweaver Test drive on a linux virtual machine (windows host). The installation was successful and I was able to start the instance (application server and the database), yet I don't know how to create a new connection from my SAPGUI client (7.20) to this server. The static IP address of the server is 192.168.1.160.
    I entered the following values for my new connection entry
    Description: SAP Netweaver
    Application server: 192.168.1.160
    Instance number: 01
    System ID: DB2
    SAProuter: /H/192.168.1.160/S/3201/H/
    But it does not work. Any idea about the values needed  for creating a new entry?
    Thanks in advance,
    Dariyoosh

    >
    Dibya R Das wrote:
    > Why are you entering a router string? Can't you reach a box directly from your machine?
    >
    > Doesn't a ping to that host & a "telnet <host/ip address> 3201" work from your machine to the SAP System.
    >
    > Remove the router string you wont need if the above works.
    >
    > - Regards, Dibya
    Hello there,
    Thank you very much for your answer which solved my problem. In fact there was no need of providing router string.
    Kind Regards,
    Dariyoosh

  • How to create a new facebook account in iphoto?

    How to create a new facebook account in iphoto?

    Instructions can be found by selecting iPhoto Help from the Help menu within iPhoto.

  • How to create a new field for Q3 - QM notification in Header and item level

    Dear All,
    l
               Sub: How to create a new field for Q3 - QM notification in Header and item level
    Ref. the link --> Quality Notification
    We want to create a new field in header level and item level.
    As per the thread the solution is given below.
    In the IMG Config: Quality Management -> Quality Notification -> Notification Types -> Define screen areas for notification types Then Choose 'Define screen areas' Then Click on 'New entries' button Now, select the relevant Notification Type and click in 'Enter'. Select the 'Iten Cases' register and remember to setup the Tabstrip Header, Icon, etc. Set the 'Tabstrip active' flag. Then Save.
    Quality Notification -> Notification Types -> Define screen areas for notification types
    WE ARE UNABLE TO FIND IN CUSTOMIZATION PATH --> DEFINE SCREEN AREAS FOR NOTIFICATION TYPES.
    Please help.
    Question No. 2 :
    THE REQUIREMENT IS GIVEN BELOW.
    We want to hide the field in Q3 - QM Notification
    In header --> Reference tab --> Item (sub heading) --> "DEFECT LOCATION" FIELD TO BE ELIMINATED (HIDE)
    Ref the link --> Quality notification
    The solutiion is given below.
    Hi Sami,
    We can hide the collumns using the Transaction OQM1 and Program Name SAPLIQS0.
    Lets say Defect location need to be hidden, the field TXTCDOT need to have the radio button HIDE.
    Hope this will suffice your requirement.
    Kindly ask me if you need any other details.
    Thanks & Regards,
    Srinivas.D
    Hi Sami,
    We can hide the collumns using the Transaction OQM1 and Program Name SAPLIQS0.
    Lets say Defect location need to be hidden, the field TXTCDOT need to have the radio button HIDE.
    Hope this will suffice your requirement.
    Kindly ask me if you need any other details.
    Thanks & Regards,
    Srinivas.D
    By double clicking the "DEFECTIVE QUANTITY (EXTERNAL), WE COULD NOT GET --> field TXTCDOT .
    Plese do the needful.
    We are using ECC6.0 Ehp3 and Ehp4.
    With Best Regards,
    Raghu Sharma

    Dear Pushpa,
    Transaction Code :SHD0 is working fine.
    Please accept my sincere thanks for your sharing your Knowledge.
    I am able to fulfill my
    Regarding the enhancement, I have not tried.
    Once I will complete, I will award the fulll marks to you.
    With Best Regards,
    Raghu Sharma

  • How to create a new workspace and change the name of the existing

    Hi,
    can any one help me how to create a new workspace in application express 3.1 on XE DB and how to change the name of a existing workspace.
    thanks
    Jana

    Jana,
    This is discussed at length in the User's Guide. See the section "Creating Workspaces".
    To rename a workspace using the admin application, edit the workspace attributes and type a new name in the field where the old name appears, then Apply Changes.
    Scott

  • How to create a new Oracle OSB project automaticaly with script without IDE

    Hello,
    I want to create automatically an "Oracle service bus project" and an "Oracle service bus configuration project" with scripts (ANT or Maven or ...) without using IDE, without using workshop or Eclipse. I want to create automatically (ANT or Maven) just a skeleton of an OSB project witch i can use after in workshop.
    I want to create 1 "Oracle service bus configuration project" with many "Oracle service bus project" automatically (ANT or Maven or scripts) witch i can use after in workshop. How to create a new Oracle OSB project automaticaly with script without IDE ? How can i do this ?
    I'm using Oracle service bus 10.3.1
    Thank you for your help.

    Thank you for your response,
    I do not want to just create the services (proxy services and business services) but I want to create a template for 40 OSB project with the same scripts ANT/Maven.
    Template="Oracle service bus configuration project" + "Oracle service bus project" + services of 40 OSB projects
    The goal is that I have more than 40 projects to create and just the name of the projects that changes (when I say the name of the project ie the name of the OSB project, the name of proxy services and the name of business services ).
    So I want to give my script (ANT/Maven) the name of 40 OSB project and the script must generate the skeleton of the 40 projects at once time and after generation of skeleton of the 40 project, I will import them in the workshop to add manually mapping and routing and other things that differs from one project to another.
    So i want to generate automatically a skeletons of 40 OSB projects using a script (ANT / Maven) and I give to the script juste the names of the 40 projects.
    I want to create a "Oracle service bus configuration project" and "Oracle service bus project" automatically of 40 OSB projects (ANT or Maven or scripts) witch i can use after in workshop.
    I want to create one 'template' of all 40 projects in the same time, with the same directory structure (Transforlation, Business services, proxy services, WSDL .....) and all 40 project have the same transport, just the names of projects and services witch changes and i can give to the script all names of projects and services and i can give also all WSDL.
    Regards,
    Tarik

  • How to create a new repository in EP 6

    I was wondering how to create a new repository in EP 6 SP2 CM.  I am farmiliar with using repository managers, but I just want to create a new repository similar to the dfaul repositories that are provided by sap, such as "discussions or documents".  The reason is that I want to be able to report "only on the size of this repository"
    Thanks
    Jeremy

    Jeremy -
    You can create a CM repository using the following path:
    System Administration -> System Configuration -> Knowledge Management -> Configuration -> Content Management -> Repository Managers -> CM Repository
    Click on the New button.
    Enjoy!
    Kyle

  • How to create a new place in iPhoto 11 without doing any harm?

    Yes, I know how to create a new place for a photo -- theoretically:
    Select the photo.
    Make sure the Info icon in the lower right portion of the iPhoto window is clicked and the too-tiny-for-any-but-the-youngest-eyes map is displaying.
    Click in "Assign a Place..." and begin typing a place that iPhoto will search for.  It searches in both "your places" (i.e., those that you have already defined) as well as in Google Maps.
    When you see a place in the search results list that you think might be close to the one you mean, select it.
    A pin appears on the itsy-bitsy map.  Move it to the exact place you mean.  You can make controls appear on the map by moving the mouse over the bottom of the map.  The controls allow you to zoom in and out, and to change views (Terrain, Satellite, Hybrid).  When the pin is where you want it, click it. The current name of the location appears.  Modify it to the name you want, then click the check mark.
    That's "all" there is to it ... except for a couple of "gotchas."
    There's a difference between what happens when you select a place that you've defined and when you select a place that Google found in the search results.  If it's a place that you've defined, and you then move the pin to a new location and/or change its name, this will affect all photos assigned to the custom place.  In effect, you are modifying the place.
    All places have a radius associated with them, thereby making them circles.  You can adjust the radius only in the Maintain My Places window.  In the itsy-bitsy map it doesn't even appear.  However, if the newly defined place overlaps existing ones, all the photos assigned to the overlapped places will be assigned to the new one.  Their pins will remain where they were.
    Now, before anybody suggests sending feedback to Apple, let me emphasize that I have been sending Apple feedback on the wrong-headed implementation of Places since iPhoto 9.0.  New versions have come and gone (the current one is 9.1.2), but these "features" have remained.  So my purpose in opening this thread is to consolidate work arounds to these "features" in one place.  My work around: 
    Whenever I define a new place, I select only a single photo.  I try to name my places so that I can distinguish them from those that Google finds.  In order to avoid Gotcha 1 I select a place that Google finds and try to place the pin close enough to where I want it, but far enough from any other places that I've defined.  I give it a name that I can easily find it Manage My Place.
    I immediately open Manage My Places and select the new place.  I first note the pins near it, then decrease its radius, move the pin to the desired location, note the nearby places, and give it its final name.
    I then view Places and navigate to the new place to view the photos assigned to it.  If I'm lucky, there's only one.  Otherwise, I have to reassign the other photos to their correct places.
    Richard

    So... in the hope it will not confuse folks more, let me be more specific of a procedure that works for me...
    Procedure to create a new My Places location.
    OK there is more you can do with a non-GPS Coord linked photo.
    Click Info and then click Assign a Place in the lower right of screen. (if your photo has a location linked to it already the Assign a Place will NOT show up.)
    Choose a location name near the actual location that Google Maps can find.
    Click that location in the Google Maps list that appears and your photo will be temporarily assigned to that location.
    Now  type over that  location name in order to make sure to give that location a unique name that will show up in your My Places list and click that name after you have typed it  to be sure it is accepted.
    Now in iPhoto click Window/Manage My Places and go the that newly named location in the large My Places map. There's no easy search. You have to run down through the alphabetical list.
    Drag the flag to the location you want this place to be and click Done.
    The location name is now in your My Places list at the location you dragged the flag to!
    It is important to note that only your unique named locations show up in your Places list, so if you want to modify the location coordinates you have to establish a unique name for it.
    This is much more complicated that previous iPhoto versions!
    But Yeah!!!!!!!!!!
    It really works!!!!!!!

  • How to create a new Condition for tax as VAT ( 4 % )  in SAP ? .

    Dear All ,
                           Pl guide that " How to create a new Condition for tax as VAT ( 4 % )  in SAP ? . What are all necessary requirements to do so , I need to have all steps so that i should feel very confident . For example what data is to be ticked in Control tab during cond. creation , in the same way how to put this cond. in Pricing procedure ? pl write all necessary thing which are required during this process .
    Thanx & deep regrads to all in adv.
    sap11

    In tax we can configure taxprocedure two types i.e., taxinn and tainj. If you adopt taxinn procedure if  it is other than VAT condition first you have to create the condition type and then you have to go to FTXP and assign the tax required VAT percentage to the repective % to ded or non ded VAT condion type. In second step you have to assign this tax code to respective company code.
    If you adopt taxinj procedure you have to a create tax code with FTXP T-code by assigning the values to the respective and save conditions.
    Regards,
    Bhuvan

  • How to create a new partion in my HP (Compaq LE1902x )PC that has already 4 primary partitions ?

    How to create a new partion (to save my files & Folders) in my HP (Compaq LE1902x )PC that has already 4 primary partitions ? when something goes wrong along with OS(C) drive my all files are lost. so i want to create a new partition & dedicate it to my files & folders.

    I would consider another problem. What if the hard drive (not the OS) fails. You'd lose all your data, all partitions. It seems better logic would be to copy your files and folders to either an external hard drive or USB thumb drive.
    I would not use the internal backup program, but would manually copy the data. I also would not leave such device attached to the computer.
    In my system I have a separate USB thumb drive that stored critical medical and legal documents. That way, I can travel with it, as needed. I also clone my primary desktop every 30-45 days. That way, if I get a failure, it's only that far back on lesser files.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • How to create a new tab in CRMD_ORDER for custom fields

    Hi Expert,
    I have added custom fields in crmd_customer_ i through EEWB .
    Now i want to display the fields in a new tab in CRMD_ORDER.
    can you please guide me how to create a new Tab step by step procedure.
    Thanks & Regards,
    Avi

    Dear Avi,
    please be aware that crmd_order is no longer supported since crm2007 (6.00). That means EEWB is not the right tool to add customer fields because only WEBUI is supported. There you can use the AET tool to create own fields or tables via configuration.
    However please see note 1037748 where you get more information and help.
    Best regards
    Rene

  • Crystal Reports XI - How  to create a new field using a formula field

    I'm quite new to CR, but have been learning quickly!
    I would like to know how to automatically create a new record/field based on another field in that row...
    I have a report showing the following data:
    Run Code     Start KM    Stop KM    Status 
    H2                 100            150           Partial
    H2                 150             155          Partial
    H2                 155             160          Partial
    S3                 120             150       Completed
    The status is generated by comparing the 'Start KM' and 'Stop KM' against fields in another table called 'Start Odo' and 'Stop Odo'
    In this example...
    H2 has 'Start Odo' and 'Stop Odo' values of 90 to 160, therefore there is still 90-100 to check.  The 'Start KM' and 'Stop KM'  is equal to the 'start Odo' and 'stop Odo' for S3, therefore it shows completed.
    My question is how do you create a formula field, which will add an entire row...displaying the values 90-100.
    I've been trying to use a conditional check in the 'Start KM' column, that sees if status is equal to partial than if start km is greater than start odo (Which is the reference km) then display the value of start odo in the new row. I'm stuck at how to create a new row.
    I want the final result to look like this...
    Run Code     Start KM    Stop KM    Status 
    H2                  90              100         Partial
    H2                 100             150          Partial
    H2                 150             155          Partial
    H2                 155             160          Partial
    S3                 120             150       Completed
    Any suggestions would be more than appreciated

    Hi Adi
    Looking at your examples it seems that you want to add a row to the existing recordset (rows fetched from the database).
    If it is the case (even if based on a formula) then you can not do it within crystal. Crystal is designed to display data and ideally it should not generate the new data.
    However, as per your requirement you can try to add this logic at database end. May be a command object within Crystal Reports can help you.
    Let me know if you do not understand anything.
    Regards
    Nikhil

Maybe you are looking for

  • Some apps stay open when trying to close more than one app at a time in ios 7

    I tried closing down 2 or 3 app at a time in IOS7 and there's always one or two that stay open. The icon at the bottom is still there but I've already swiped it up to close it. When I go out of the closing function and come back I see that they are s

  • G5 Dual 2.5GHz freezes with a very high pitch sound

    Hi My G5 Dual 2.5GHz freezes with a very high pitch sound from inside the comp. It happens occasionally after a few days of everything running smoothly. Someone can help ? PowerMac G5 Dual 2.5 GHz   Mac OS X (10.4.9)  

  • CRM 6.0 vs CRM 5.0 technical and Features & functionality difference.

    Hi, For Internet Sales i.e. B2B and B2C, Evaluating CRM 5.0 and 6.0 but dont know for which version we should select, Had search market place but here it seems to be it does not have much of difference between 5.0 and 6.0.. Please help to provide me

  • FLAC vs Apple Lossless file sizes

    I've been looking into moving up to lossless audio files. From what I've been able to discover, FLAC and Apple Lossless should be roughly the same file size, but I downloaded a 24-bit/44.1kHz FLAC from the Bowers & Wilkins site (about half-way down t

  • Adobe Fireworks CS3 Fonts

    on my schools computers we have different fonts then i do here on my home PC and a font im looking to get because im using it for a project is called 28 days later..how do i get the font and install it so i can use it in fireworks