WebService Returning a String

Maybe I should know this but:
I'm calling a method of a webservice that returns a string.
Works great.
The string is essentially an XML document, but how can I use
that data (the string being returned from the call) or place that
data in a properly formatted XML? Because right now I'm getting
back one long string .. it's an Object but I want it to be
XML.

See this FB 2.0.1 help topic:
Handling results as XML with the e4x result format
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=dataservices_099_17.html
<mx:WebService
id="WS"
destination="stockservice" useProxy="true"
fault="Alert.show(event.fault.faultString), 'Error'">
<mx:operation name="GetQuote" resultFormat="e4x">
<mx:request>
<symbol>ADBE</symbol>
</mx:request>
</mx:operation>
</mx:WebService>

Similar Messages

  • 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

  • How to use a WebService Model with String Arrays as its input  parameter

    Hi All,
    I am facing the following scenario -
    From WebDynpro Java i need to pass 2 String Arrays to a Webservice.
    The Webservice takes in 2 input String Arrays , say, Str_Arr1[] and Str_Arr2[] and returns a string output , say Str_Return.
    I am consuming this WebService in WebDynpro Java using WEB SERVICE MODEL. (NWDS 04).
    Can you please help out in how to consume a WSModel in WD where the WS requires String Arrays?

    Hi Hajra..
    chec this link...
    http://mail-archives.apache.org/mod_mbox/beehive-commits/200507.mbox/<[email protected]>
    http://www.theserverside.com/tt/articles/article.tss?l=MonsonHaefel-Column2
    Urs GS

  • Webservice returned with exception in method 'isConnectionLoopbackAlive'

    Hello,
    during monitoring of last 24 hours logs i found message:
    <b>Webservice returned with exception in method 'isConnectionLoopbackAlive'
    category: /Applications/CAF/KM
    Application:  sap.com/irj
    Location:com.sap.portal.prt.cafkm.com.sap.caf.km.service.ConnectionTestService.isConnectionLookupAlive(String)
    </b>
    can anybody help me? what does it mean?
    Denis
    ip
    Edited by: Denis Yugay on Mar 18, 2008 5:10 AM

    Hello, Vincent.
    Situation is same after rebooting server.
    Denis
    Edited by: Denis Yugay on Mar 20, 2008 5:17 AM

  • How do I open a .nrl extension in firefox, currently it returns a string of text instead of opening the file with the default program.

    When I click on a .nrl file extension (belongs to Autonomy I-Manage Software) it returns a string of code (what is in the shortcut link) instead of following the link and returning the document. Is there a way to tell Forefox connect to the document that the shortcut is linked to? The .nrl file extension belongs to a piece of software called FileSite (document management system).

    '''Adding download actions''' is the relevant section of that article for your situation.
    Is the *.nrl file on a website or already saved to your PC?
    If it is on a website, the server may not be sending the appropriate Mime-Type telling Firefox how that file is to be handled - ''"Content-Disposition"''.
    Can you give us the URL of the webpage where you have this problem? <br />
    So we can see first hand what the issue is.

  • Returning XML String From Servlet

              Is there a simple way to disable the HTML character escaping when returning
              a string from a servlet. The returned string contains well formed XML, and
              I don't want the tags converted to > and < meta characters in the
              HTTP reply.
              The code is basically "hello world", version 7.0 SP2.
              Thanks
              > package xxx.servlet;
              >
              > import weblogic.jws.control.JwsContext;
              >
              >
              > /**
              > * @jws:protocol http-xml="true" form-get="false" form-post="false"
              > */
              > public class HelloWorld
              > {
              > /** @jws:context */
              > JwsContext context;
              >
              > /**
              > * @jws:operation
              > * @jws:protocol http-xml="false" form-post="true" form-get="false" soap-s
              tyle="document"
              > * @jws:return-xml xml-map::
              > * <HelloWorldResponse xmlns="http://www.xxx.com/">
              > * {return}
              > * </HelloWorldResponse>
              >
              > * ::
              > * @jws:parameter-xml xml-map::
              > * <HelloWorld xmlns="http://www.xxx.com/">
              > * <ix>{ix}</ix>
              > * <contents>{contents}</contents>
              > * </HelloWorld>
              >
              > * ::
              > */
              > public String HelloWorld(String s)
              > {
              > return "<a> xyz </a>";
              > }
              > }
              

              Radha,
              We have a client/server package which speaks SOAP over a
              streaming HTTP channel for which we are writing a WebLogic
              servlet. For reasons of efficiency, we want to deserialize
              only the very top-level tags of the messages as they pass
              through the servlet. Yes, in theory, we should probably
              deserialize and validate the entire message contents...
              When we add support for other clients, we will fully
              deserialize inside those servlets.
              I have not looked any further into how to stop the inner
              tags from being escaped yet -- it is an annoyance more than
              a disaster, since the client handle meta escapes.
              My current guess is to use ECMAScript mapping...
              -Tony
              "S.Radha" <[email protected]> wrote:
              >
              >"Tony Hawkins" <[email protected]> wrote:
              >>
              >>Is there a simple way to disable the HTML character escaping when returning
              >>a string from a servlet. The returned string contains well formed XML,
              >>and
              >>I don't want the tags converted to > and < meta characters in the
              >>HTTP reply.
              >>
              >>The code is basically "hello world", version 7.0 SP2.
              >
              >>
              >>Thanks
              >>
              >>> package xxx.servlet;
              >>>
              >>> import weblogic.jws.control.JwsContext;
              >>>
              >>>
              >>> /**
              >>> * @jws:protocol http-xml="true" form-get="false" form-post="false"
              >>> */
              >>> public class HelloWorld
              >>> {
              >>> /** @jws:context */
              >>> JwsContext context;
              >>>
              >>> /**
              >>> * @jws:operation
              >>> * @jws:protocol http-xml="false" form-post="true" form-get="false"
              >>soap-s
              >>tyle="document"
              >>> * @jws:return-xml xml-map::
              >>> * <HelloWorldResponse xmlns="http://www.xxx.com/">
              >>> * {return}
              >>> * </HelloWorldResponse>
              >>>
              >>> * ::
              >>> * @jws:parameter-xml xml-map::
              >>> * <HelloWorld xmlns="http://www.xxx.com/">
              >>> * <ix>{ix}</ix>
              >>> * <contents>{contents}</contents>
              >>> * </HelloWorld>
              >>>
              >>> * ::
              >>> */
              >>> public String HelloWorld(String s)
              >>> {
              >>> return "<a> xyz </a>";
              >>> }
              >>> }
              >>
              >>
              >Hi Tony,
              >
              > Can you let me know for what purpose you want to disable the
              >HTML character
              >escaping.In case if you
              >
              >have tried this using someway,pl. let me know.
              >
              >rgds
              >Radha
              >
              >
              

  • PI SOAP access to third party Webservice,Return ERROR

    Hi Experts,
    I have one soap synchronous scenario access to third party WEBSERVICE,Return error.While testing the wsdl in soap ui, I am getting response, messages showing successfully processed. I think it is pi to send  xmlns:ns1='http://tempuri.org/'  on both sides should not be a single quotation mark, but I don't know how to adjust  PI set. how do you see.
    1、SOAP UI submitted to Webserver XML
    [2014-05-26 08:47:24.662] --- Recv data from SocketId=272 Socket=10880
    POST /MWGate/wmgw.asmx HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "http://tempuri.org/MongateCsSpSendSmsNew"
    User-Agent: Jakarta Commons-HttpClient/3.1
    Host: 10.0.0.253:8082
    Content-Length: 520
    <soapen:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
        <soapen:Header />
        <soapen:Body>
            <tem:MongateCsSpSendSmsNew>
                <tem:userId>DOA001</tem:userId>
                <tem:password>dennis</tem:password>
                <tem:pszMobis>1313773654</tem:pszMobis>
                <tem:pszMsg>1111</tem:pszMsg>
                <tem:iMobiCount>1</tem:iMobiCount>
                <tem:pszSubPort>*</tem:pszSubPort>
            </tem:MongateCsSpSendSmsNew>
        </soapen:Body>
    </soapen:Envelope>
    2、PI submitted to Webserver XML
    [2014-05-26 08:36:08.725] --- Recv data from SocketId=271 Socket=10704
    POST /MWGate/wmgw.asmx HTTP/1.0
    Accept: */*
    Host: 10.0.0.253:8082
    User-Agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505
    CallingType: SA
    content-id: <[email protected]>
    Content-Type: text/xml; charset=utf-8
    Content-Length: 417
    SOAPACTION: "http://tempuri.org/MongateCsSpSendSmsNew"
        <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
            <SOAP:Header />
            <SOAP:Body>
                <ns1:MongateCsSpSendSmsNew xmlns:ns1='http://tempuri.org/'>
                    <ns1:userId>DOA001</ns1:userId>
                    <ns1:password>dennis</ns1:password>
                    <ns1:pszMobis>13637731567</ns1:pszMobis>
                    <ns1:pszMsg>Constant</ns1:pszMsg>
                    <ns1:iMobiCount>1</ns1:iMobiCount>
                    <ns1:pszSubPort>*</ns1:pszSubPort>
                </ns1:MongateCsSpSendSmsNew>
            </SOAP:Body>
        </SOAP:Envelope>
    3、SXI_MONITOR   Payloads content:
      <ns1:MongateCsSpSendSmsNew xmlns:ns1="http://tempuri.org/">
            <ns1:userId>DOA001</ns1:userId>
            <ns1:password>dennis</ns1:password>
            <ns1:pszMobis>13637731567</ns1:pszMobis>
            <ns1:pszMsg>Constant</ns1:pszMsg>
            <ns1:iMobiCount>1</ns1:iMobiCount>
            <ns1:pszSubPort>*</ns1:pszSubPort>
        </ns1:MongateCsSpSendSmsNew>
    4、PI channel

    Hi Nathan,
    Have you tried the SOAP HTTP Axis function.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b092777b-ee47-2a10-17b3-c5f59380957f?overridelayout=t…
    https://help.sap.com/saphelp_nw04/helpdata/en/45/a39e244b030063e10000000a11466f/content.htm
    Configuring the Receiver Axis SOAP Adapter (SAP Library - SAP Exchange Infrastructure)
    Regards,
    Jannus Botha

  • Queue returns blank strings from template VI

    I have created a master VI which creates a named queue, this VI then spawns multiple copies of a template VI. These sub VIs all gain access to the queue and try writing data to it. I understood that the queue VI was protected so this should not cause a problem. Infact this does not work at all, when i extract element within the master VI it only finds a few of the elements and returns blank strings between. Help what is going on. I am not destroying the queue or such, it seems to be a problem with the protection of the queue when using template VIs.
    Cheers Tom.

    I have not been able to reproduce the problem on LV 6.0.2 Win98. Do you check the error cluster when an empty element is returned? Posting your code might help to find the problem.
    LabVIEW, C'est LabVIEW

  • WINE err:"wine cmd.exe /c echo '%ProgramFiles%' returned empty string"

    So as the tittle states WINE is throiwng this error:
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    As for what might have caused it? probably the last system update which was performed a few days ago, my old prefix works fine but I have a habit of creating new prefixes for troublesome applications, or applications I am unsure of whether they will cause trouble or not.
    Hence I created a new prefix using:
    export WINEARCH=win32
    export WINEPREFIX=~/.problematic
    winecfg
    As for how wine is run, it's run as a normal, unprivileged, user.
    Oh and I also tried generating yet another prefix like this:
    $ WINEARCH=win32 WINEPREFIX=~/.problematic-new winetricks steam
    Executing w_do_call steam
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    Didn't work either.
    I'm at loss, any suggestion on how to fix it?
    Last edited by CubeGod (2014-06-29 15:48:05)

    $ WINEARCH=win32 WINEPREFIX=~/testprefix notepad.exe
    bash: notepad.exe: command not found
    So obviously I need to correct the command
    $ WINEARCH=win32 WINEPREFIX=~/testprefix wine notepad.exe
    wine: created the configuration directory '/home/shiina/testprefix'
    err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: cannot open shared object file: No such file or directory
    fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
    fixme:iphlpapi:NotifyAddrChange (Handle 0xece880, overlapped 0xece88c): stub
    wine: configuration in '/home/shiina/testprefix' has been updated.
    Wine cannot find the ncurses library (libncursesw.so.5).
    why is ncurses a dependency anyway? besides, wicd-curses works so this shouldn't be the case.
    Anyway, trying winetricks in the same prefix
    $ WINEARCH=win32 WINEPREFIX=~/testprefix winetricks steam
    Executing w_do_call steam
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    Anyway, I expected notepad to work since it resides in %WINDOWS% not %ProgramFiles%
    Is there any registry key I can set for this? all my google searching says this can cause with a mismatch of wine versions but why would that happen?
    Either way checking wine --version outputs wine-1.7.20 which is the same as it was pre-update (when it still worked).

  • Calling c function that return a string

    Hallo,
    I found an example for calling void c function(http://zone.ni.com/devzone/cda/epd/p/id/1513). I could adapt the example and make the function return an integer. the code of the adapted function would look like this:
     int __declspec(dllexport) multiply(int number) {return number*3; }
    But I have problems when I want to return a string. Does someone knows how I should do. I tried:
     char* __declspec(dllexport) say(int number) {return "hallo"; }  
    but won't compile.

    yes the question was  more a c question then a labview question. I found the solution anyway, the correct code in order to get string is:
    _declspec(dllexport) char* testchar2();_declspec(dllexport) char* testchar2() {      return "hallo"; }

  • Error returning large String arrays from web service

    Hi,
    I currently have an EJB that returns a String[] array that I have implemented as
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
    as long as the returned array is relatively small, but when the array starts to get
    a little larger (say 20 elements, about 30 chars each), I consistently get:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running under MS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
    array elements in one call. And since I am calling the same Weblogic EJB with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I might be doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

    Hi Steve,
    Sure we're interested...I'll pass this along to the XML folks.
    Thanks for the feedback,
    Bruce
    Steve Alexander wrote:
    In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
    - thinking it was a size issue when it actually was a data issue. On the calls where
    I was returning a large array, some of the array members were null. When I made them
    enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
    the nulls, whereas the MS parser doesn't care.
    "Steve Alexander" <[email protected]> wrote:
    Thanks Bruce,
    FYI - I have reproduced the problem on WL7.0. I have turned it in to support
    as you
    suggested.
    Steve
    Bruce Stephens <[email protected]> wrote:
    Hi Steve,
    This does not ring any bells, however I would suggest that you file a support
    case. If it
    is an option you might try a later release (7.0).
    Bruce
    Steve Alexander wrote:
    Hi,
    I currently have an EJB that returns a String[] array that I have implementedas
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
    as long as the returned array is relatively small, but when the arraystarts to get
    a little larger (say 20 elements, about 30 chars each), I consistentlyget:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running underMS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
    array elements in one call. And since I am calling the same Weblogic
    EJB
    with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I mightbe doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

  • Returning the string from the SimpleDateFormat

    Hi guys,
    Can someone tell me how to return the string from the SimpleDateFormat?
    I've created the method to do this, but i don't know the exact code to use. Here's my code so far...
        public String convert (Calendar gc)
            String s = convert(gc);
            return // I need to return the s here, but don't know how to code it.
        }BTW, i've already wrote the code for the SimpleDateFormat (so if you want me post that, i will).

    DrLaszloJamf wrote:
    LevelSix wrote:
    DrLaszloJamf wrote:
    No.Can you tell me what it is, because i've went through the API and i don't know.
    Have you looked for a tutorial: [http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html]
    Thanks a lot DrLaszloJamf, this is useful.
    DrClap wrote:
    Nope. Suppose you were on a construction site and the foreman told you to move a pile of concrete blocks from a truck into the building. What do you suppose would happen if you asked the foreman what a concrete block was, and where the building was, and whether you should drive the truck into the street, and then you tried to pick up the whole pile all at once, and then you asked if you could kick the blocks like footballs? This is what you're doing here. You'd be fired from the construction site within half an hour.Sir...

  • Import CSV Is Incorrect - Misinterprets RETURN within Strings as New Row

    When importing a CSV file into Numbers 3.0.1, it produces bad results, because it interprets RETURNs within strings as new rows, when it should ignore them.
    How can this be worked around?

    If the CSV is properly formatted and the strings that have the carriage return(s) are enclosed in quotes, it works fine  (at least it does for me). If the strings do not have quotes around them, the returns should be interpreted as a new row.
    The workaround would be to somehow get quotes around those strings before importing into Numbers. I'm not sure how to do that except manually in a text editor or for the app that created the CSV to format it correctly.

  • External Procedure Returns Bad String

    Hello,
    I have an strange issue. I have an external procedure that returns an string but when i call it Oracle gets an string of zero's ascii chars. The length it`s ok but the content not.... The wrapper function is
    PROCEDURE getString(returnValue OUT VARCHAR2) AS
    LANGUAGE C
    LIBRARY "UFDs"
    NAME "getString"
    WITH CONTEXT
    PARAMETERS (
    context,
    returnValue STRING,
    returnValue INDICATOR short,
    returnValue LENGTH int
    And the C code is
    DLLIMPORT void getString(OCIExtProcContext* context,
    char* returnValue,
    short* returnValue_ind,
    int* returnValue_len )
    returnValue = (char*)OCIExtProcAllocCallMemory(context, 13);
    //returnValue[0] = '\0';
    strcpy(returnValue,"hello from c");
    /* I have test this to gen a file an the string is OK
    char buffer[500];
    strcpy(buffer,"echo ");
    strcat(buffer,returnValue);
    strcat(buffer," >c:\\sal.txt");
    system(buffer);
    *returnValue_len = strlen(returnValue);
    *returnValue_ind = (short)OCI_IND_NOTNULL;
    return;
    When i call this from oracle i get an string of size 12 but the string has invalid chars (zero ascii chars). Could it be a problem with charset conversion? Anybody has an example or idea?.
    Regards

    Can you please post your query / stored procedure you are using? Very possible reason includes one among your substring (within the concat) is null and making the final output to be null. Size, esp 800 shouldn't matter.

  • Returning List String or String[][] in JNI

    Hi,
    I am calling a native function in C++ from Java which has to return List<String> or String[][]. Is this possible?
    The java declaration is - private native List<String> GetListNative();
    In C++ the declaration is:
    JNIEXPORT jobject JNICALL Java_com_GetListNative
    (JNIEnv *env, jobject obj);
    Please help!
    Thanks in advance...
    Message was edited by:
    arjundg

    try treating String[][] as array of arrays of strings
    I mean consider your 2D array as a 1D array and each of its elements is an array of Strings
    I think this will work

Maybe you are looking for

  • PDFs are not displaying thumbnails

    Help! PDFs are not displaying thmbnail images (Windows 7, 64-bit). The same document displays just fine on my 32-bit computer. Any suggestions from the geekiverse? (The odd thing is that just ONE pdf is displaying its thumbnail ok in 64-bit. Huh? How

  • Question re WebEx & WebEx Productivity Tools

    Hi, Hopefully this is a simple enough question to answer, but I can't get a clear picture from the last three release notes: Our WebEx site is finally moving from 28.11 to 28.12. We do not deploy the WebEx Client msi (to cut down on work when version

  • File Adapter Service

    Hi All, I am using BPEL File Adapter service to read a file then archive this file , is there any way to get the name of this archived file using XPath query functions?

  • Filesharing problem with one specific computer

    I have several macs on a network; all have filesharing and appletalk active, and all are communicating via either wired or airport extreme. I have one wayward system and I can't seem to figure out, though. I have a MBP Core2Duo machine that is visibl

  • ELM error in create TG

    HI Guru I am having issue with create Target Group while other steps have been executed successfully. I have tried creating target group manually and it works fine. Can someone guide? THe error that I get from ELM: Usage does not exist One or more er