Webservice returning string (but I need XML for XSLT Tranformation)

Hello everybody,
I have configured an ip with a webservice. So far so good - everything works fine.
Now I want to transform the output of the webservice with xslt. The webservice returns the data as a String in form of XML.
e.g.
    <!XML>
<!String>
<!String> </b>
</Bill> <!XML>
But XSLT don't find e.g the node , because it is a String. I think the right way is first to transform the String into XML. I tried this step with Java with the method
public void execute(InputStream inputStream, OutputStream outputStream)
        throws StreamTransformationException {
but it doesn't work. I am not sure, if this is the right way.I have searched for a code sample, but I didn't find anything.
What do you think?
Do you have a code sample?
This would be great!
Best regards,
Jürgen

Hello Bhavesh,
thx very much for your help.
Here is my Java Mapping:
public class ModusLebenTransformation implements StreamTransformation
public static byte[] readStream(InputStream in, boolean close)
    throws IOException
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    int c = in.read();
    while (c > -1)
        out.write(c);
        c = in.read();
    out.flush();
    byte[] result = out.toByteArray();
    out.close();
    if (close)
        in.close();
    return result;
public void setParameter(Map map) {
public void execute(InputStream inputStream, OutputStream outputStream)
        throws StreamTransformationException {
   try {
TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer();
   StreamResult result = new StreamResult(outputStream);
String input = new String(readStream(inputStream,true));
transformer.transform(new StreamSource(input), result);      
  } catch (Exception e) {
             throw new StreamTransformationException("Mapping failed", e);
But I don't know if this code is enough to convert the String( from the webservice) into XML.
And then I would like to use XSLT for transformation in a new mapping step.
Do you think this is possible?
Do you have a code sample, that will tranform the String (from the webservice) into XML?
This would be very helpful!
regards,
Jürgen

Similar Messages

  • I accidentally purchased Adobe Photoshop and Premiere Elements for Windows, but I need it for Mac. Please advise.

    I accidentally purchased Adobe Photoshop and Premiere Elements for Windows, but I need it for Mac. Please advise.

    Return, cancel, or exchange an Adobe order

  • Why won't Verizon return a phone to a customer if it was damaged during returned shipping BUT will charge you for it  $300   .... I would like the phone back and repair it...

    why won't Verizon return a phone to a customer if it was damaged during returned shipping BUT will charge you for it  $300   ....
    I would like the phone back and repair it...
    they lie say they cant... when they actually can... it is just a policy they have that says CANT.... 

    Standard operating procedures.  All about the Benjamins baby. Don't send a damaged phone for warrant claim if that's what happened file an ins. Claim or have it repaired.

  • Can firefox exist side by side w/IE? IE is the office explorer but I need firefox for school- can both exist on the same desktop?

    My employer uses Internet Explorer, and our infoweb is on that homepage. I need firefox for graduate school. (My home internet w/firefox is via satellite which won't fully meet the needs). Can I download firefox to my office desktop without removing Internet Explorer? Can both browsers exist "side-by-side"?

    Hi,
    Firefox can be installed just like any other programs for the Windows OS. The only constraint may be the office IT policy / restrictions. You can download the latest version here: https://www.mozilla.org/en-US/firefox/new/
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • Nolonger have iclould email address but I need it for my password to change

    I no longer have the email address attached to the icloud account to gt email, but I need to change my password..help plese?

    Start here, change your country if necessary and go to manage your account
    You should then be able to change your associated email address.

  • What is a good free substitute for Adobe Flash Player? Apple will not download this but I need it for several things I want to do?

    What is a good "free" substitute for Adobe Flash Player? I need this for photos to be developed.

    link5645 wrote:
    You cannot substitute another app for Flash because it is proprietary technology. Apple is adamant about keeping Flash out of their phones and tablets, hence why you will not find it in the App Store. If you want to be able to use Flash on-the-go, consider purchasing an Android device.
    Doesn't matter at this point.  Android 4.0.3 is the last OS he'll have if he wants flash.  Adobe has already stopped development for their mobile flash player.

  • Photoshop Element 12 for Windows but I need one for Mac.

    Good afternoon, I bought Photoshop Element 12. But after buying it was a version for Windows and I use Mac. I can return the product to the store I bought it. So can you help me, for example to get a Mac link for my product, so I can install it?

    Hi, Photoinf. This is the user to user forum. You need to contact adobe sales directly. This happens all the time, so they should be used to dealing with it by now.

  • Hi guys I need to restrict access to the settings with a passcode but also need passcode for the screen lock due to MS Exchange. Can these codes be different?

    We are introducing iPhonse into the business but have a question regarding security. We need to restrict user access to the settings on the iphone  probably via a passcode. We also need the user to have access to their emails (which when using exchange enforces a passcode). Is this the same passcode that is used for both by default? Because if it is then by allowing the user access to their emails they would by default have access to the code that allows them to change the settings of the iphone?
    Does anyone have any knowledge of this or how I can achieve something similar.
    Thanks
    Paul

    Hi,
    Thanks for your reply
    Could you by any chance provide a few simple steps on how to do this as i not too sure how you differentiate creating a passcode for restrictions and creating a passcode for lock screen?
    Kind Regards,
    Paul

  • I went to the apple store to get a power cord for my husband's mac pro and the technician gave me a power adapter instead. My husband has a conference call before the stores open and I can exchange the adapter but he needs power for his computer before th

    My husband needs a new power cord for his Mac Pro. I went to the apple store and the clerk gave me a power adapter by mistake. He has a conference call before the store opens and I can't get him another power cord. Is there a way to power up his computer?

    You posted in the MacBookPro forum. Is this a Mac Pro or MacBook Pro? If it's the latter, it has a battery.

  • I am in need of a weather and stock widget, similiar to the ones on the iphone 4s, that allow you to display current stocks and weather in the notification window but i need it for the ipad2.

    the iphone 4s came with a weather and a stock widget.  these could be configured in notifications to CONSTANTLY display stock prices and the days weather whenever you pulled down the notification window.  the ipad2 doesn't have these programs and i have spend a small fortune and time looking for this same feature.  does anyone out there know off a weather and stock program that will let you program stocks into the notification window and then stream the stocks and prices acrossthe screen continously when you open the notification window.  Also does anyone know of a weather program that will display the days current conditions ALL THE TIME, not just when the wind picks up or it snows.
    the ipad2 doesn't have these built in programs and i can't find similiar ones in the app store.
    Thanks for your help.
    [email protected]

    I have this question too. Have you had any replies?

  • Need Authentication for SMTP Access

    I have this Java program (SendMail.java) for sending email; however, my ISP requires authentication for SMTP server access, i.e. I receive a 550 Authentication Required error. Does anyone know how to go about coding authentication into a program like SendMail so that the userID and password can be sent back to the server?
    * SendMail.java
    * Created on July 13, 2005, 8:09 PM
    * To change this template, choose Tools | Options and locate the template under
    * the Source Creation and Management node. Right-click the template and choose
    * Open. You can then make changes to the template in the Source Editor.
    * @author Owner
    // SendMail by Tony Swain.
    // Send mail via SMTP
    // To do Appletisize it.
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import java.util.StringTokenizer;
    import java.net.Authenticator;
    import java.net.*;
    // To do. Finish multiThreading &| write que Thread.
    // this programs sends mail Via SMTP as defined in RFC 821.
    // ftp://ftp.isi.edu/in-notes/rfc821.txt
    public class SendMail   
    Object mailLock              = null;  //In case we want a multi-threaded mailer
    public String mailServerHost = "";
    public String from           = "";
    public String to             = "";
    public String replyTo        = "";
    public String subject        = "Java is Fun";
    public String mailData       =
       "HyperSendMail";
    public String errorMsg = "";
    public Socket mailSendSock = null;
    public  BufferedReader inputStream = null;
    public PrintStream outputStream    =  null;
    public String serverReply          = "";
    SendMail()
       // Doesn't do anything but we need this for extension purposes.
    // Server, from,to,subject, data
    SendMail(String server,String tFrom,String tTo,String sub,String sendData)
       mailServerHost = server;
       mailLock=this; // Thread Monitor passed constructor later. Default this Monitor.
       from = tFrom;
       to   = tTo;
       if(sendData != null)
          mailData = sendData; 
    /*  Just a note to remind myself to add this for cross app./Applet & Runnable.
       & Threadsafe readLine()  I'm too lazy ATM
    SendMail()
       if(mailLock != null)
          if(mailLock instanceof Applet)
             Applet app = (Applet)
    public void send()
       if(!open())          //Yikes! get out of here.
          return;    
       try
          outputStream.println("HELO sendMail");
          serverReply = inputStream.readLine(); 
       catch(Exception e0)
          e0.printStackTrace();
       try
          outputStream.println("MAIL FROM: "+from);
          serverReply = inputStream.readLine();
            // I cheat and don't look for the whole 550
            // we know 5 is an error anyway. Add it in if you want.
          if(serverReply.startsWith("5"))
             close("FROM: Server error :"+serverReply);
             return;
       // Note the switch here. we could get mail from somewhere and by
       // pre setting replyTo reply somewhere else :)
          if(replyTo == null)
             replyTo = from;
          outputStream.println("RCPT TO: <"+to+">");
           // Ya got me! I didn't look for any  250 OK messages. Add it in if you really want.
           // A real programmer will spend 30 hours writing self modifying code in order
           // to save 90 nano seconds ;)  we assume if it did't give an error it must be OK.
          serverReply = inputStream.readLine();
          if(serverReply.startsWith("5"))
             close("Reply error:"+serverReply);
             return;
          outputStream.println("DATA");
          serverReply = inputStream.readLine();
          if(serverReply.startsWith("5"))
             close("DATA Server error : "+serverReply);
             return;
          outputStream.println("From: "+from);
          outputStream.println("To: "+to);
          if(subject != null)
             outputStream.println("Subject: "+subject);
          if(replyTo != null)
             outputStream.println("Reply-to: "+replyTo);
          outputStream.println("");
          outputStream.println(mailData);
          outputStream.print("\r\n.\r\n");
          outputStream.flush();
          serverReply = inputStream.readLine();
          if(serverReply.startsWith("5"))
             close("DATA finish server error: "+serverReply);
             return;
          outputStream.println("quit");
          serverReply = inputStream.readLine();
          if(serverReply.startsWith("5"))
             close("Server error on QUIT: "+serverReply);
             return;
          inputStream.close();
          outputStream.close();
          mailSendSock.close();
       catch(Exception any)
          any.printStackTrace();
          close("send() Exception");
       close("Mail sent");
    public boolean open()
       synchronized(mailLock)
          try
             mailSendSock = new Socket(mailServerHost, 25);
             outputStream = new PrintStream(mailSendSock.getOutputStream());
             inputStream = new BufferedReader(new InputStreamReader(
              mailSendSock.getInputStream()));
             serverReply = inputStream.readLine();
             if(serverReply.startsWith("4"))
                errorMsg = "Server refused the connect message : "+serverReply;
                return false;
          catch(Exception openError) 
             openError.printStackTrace();
             close("Mail Socket Error");
             return false;
          System.out.println("Connected to "+mailServerHost);
          return true;
    public void close(String msg)
              //try to close the sockets
       System.out.println("Close("+msg+")");
       try
          outputStream.println("quit");
          inputStream.close();
          outputStream.close();
          mailSendSock.close();
       catch(Exception e)
          System.out.println("Close() Exception");
         // We are closing so see ya later anyway
    public static void main(String Args[])
    SendMail sm = new
    // * NOTE:
    // Erase these values right away! Just to show you how it is done.
    // Whatever you do don' release it with my mail server hardcoded.
    // last thing I need is 10 million Java mail test spams :)
    SendMail(
              "outgoing.myISP.net",         //Mail Server
              "[email protected]",       // sender
              "[email protected]",       // Recipient
              "Java mail test",               // Subject
              "test test test!");             // Message Data
              sm.send();                      // Send it!
    }

    There is no one in the forum who can shed some light on my problem?

  • Typecasting string to integer. need help

    Hi,
    I have the following statement which returns a String but i need to convert to an integer .
    properties.getProperty("MAXWIDTH");
    Can i do it this way,
    int width = (Integer) properties.getProperty("MAXWIDTH");
    But it gives me error stating that it cannot convert string to integer.
    Please help
    Purnima

    That's because the value returned from the
    getProperty() method is a String. You can convert it
    to an int, like this:int width =
    Integer.parseInt(properties.getProperty("MAXWIDTH"));[
    /code]oh so simple thanks
    Purnima

  • Need advice for escalating warranty repair

    hi all,
    around easter I noticed my daughters 2007 C2D macbook(white) developing hairline cracks in the backcase near three stress points, near the tabs on both sides that hold it off the topcase and in the middle from constant opening of the machine. the local genius said applecare would cover it but she needed it for school so I delayed sending it in. My Bad. She comes home with a chip in the topcase and about 12-14 dead pixels in the display. Sent it off for repair and Apple said the screen showed signs of abuse( not completely out of the question) due to one section that seems to have been "bruised" and is leaking. Unless she or a spurned lover took an icepick to the screen I don't see how she caused over a dozen pixels scattered all over the display to fail but I am not an engineer. The problem is they will not perform the case repair unless I agree to the $800 LCD replacement. The reason being they can't perform a partial repair. The way I heard it is until I replace the LCD at my expense apple in unable to do any warranty repairs and i have 14 Months of Applecare left. My local apple store is closed for renovations or I would go there where they recognize me for advice. Powerbook Medic quotes $250 for screen replacement. should I do that and then resubmit the machine to Apple for case repair? Is there a Phone number for customer service other than tech support I could try to escalate this case with? The only one I see is the Apple Store CS for orders and such. Anyone have any thoughts or recommendations?
    Thanks,
    Frank

    Is there a Phone number for customer service other than tech support
    You call the support line and asked to be transferred to customer relations.

  • How can I unlock my iPhone is with tmobile and I need it for att

    How can I use my iPhone 5 it was from t mobile store but I need it for AT&amp;T

    Since you bought it from T-Mobile, T-Mobile will unlock the iPhone if you have had service wit T-Mobile for 45 days and the phone must be paid off through T-Mobile with no balance owed.
    This is for US bought T-Mobile iPhones in the US.

  • How do I change the User Agent for Safari on my iPad?  I need this for a specific website for work.

    How do I change the user agent for Safari on my iPad?  I know how to do it on my desktop version, but I need it for my iPad.

    You can rename the iPad here:
    Settings - General - About - Name
    For Siri make sure he has himself as a contact in the Contacts app then:
    Settings - General - Siri - My Info and select his contact info

Maybe you are looking for

  • How to set up the number of tabs restored at once after a reboot?

    I usually have opened one or two windows with a total of 15-20 tabs at once. When I restart Firefox, it loads the tabs in the background, but only three at a time. It can get a while to load all of them, and it is sluggy while loading. I have a four

  • Issue in IDOC : Outbound

    Hi All, I am trying to send an outbound IDOC, the data is filled successfully and IDOC is generated...But the status is set to 30: and not 53(successfully).... I checked the log: Below is the IDOC log: Receiver exists , No filters , No conversion , N

  • What's the significance of the letter -p in the JRE installables

    Hi, Can anybody please let me know what is the significance of the letter "-p" in the JRE installables as i could see that till JRE 1.6.0_13 the name for the Window offline installable has -p {for eg: jre-6u12-windows-i586-p.exe} where as for the hig

  • Firefox says "Unable to connect" but Interent Explorer works fine

    Randomly one day, opened up firefox and it was unable to connect. I have gone to the support sites I have followed everything, yet nothing works. Internet Explorer works just fine so its not my connection. I have also uninstalled and re-installed the

  • TS3276 Mail will not quit

    Mail will not give the option to quit.  Cannot turn off computer without closing mail but it will not highlight that option so that it can be clicked on.  Any suggestions?