Print label image in GIF format returned by Web Service XML string.

Hi All
I have extremely interesting situations and have been struggling with this for a past week. I have been looking everywhere but nobody seems to have an answer. This is my last resort.
Detail -
I am consuming UPS web service from my ABAP program. Everything works fine until I have to print UPS label.  The label image is returned to my ABAP program via XML by the UPS reply transaction as a GIF image.
When I download this image to my PC I can see it and print it, but for the love of god I cannot print this image from my ABAP program. The GIF image is passed to me as a binary data string it looks like bunch on numbers - (2133FFDGFGFGFHHu2026..) very long string about 89800 bites. I cannot use smart forms since smart form requires to have graphic stored in  SAP before smart form print, so this is not possible. I need help figuring out how print GIF image form ABAP or any other SAP method dynamically.  Any ideas are extremely appreciated. I am just puzzled that I cannot find any info on something like this. I cannot be the first one who needs to print GIF image in SAP.

Hi all,
I understand this thread was started long back. But wanted to share this solution since I see the same question in many forums without any particular conclusive answer. So the steps I am explaining here, if it helps in some way, I will be really happy. I won't say this is the perfect solution. But it definitely helps us to print the images. This solution is infact implemented successfully in my client place & works fine.
And please note there may be  better solutions definitely available in ECC6 or other higher releases. This solution is mainly for lesser versions, for people don't have ADOBE forms or other special classes.
Important thing here is binary string is converted to postscript here. So you need to make sure your printer supports postscripts. (Ofcourse, if anybody is interested, they can do their R&D on PCL conversion in the same way...and pls let me know). Once the binary data is converted to postscript, we are going to write it in the binary spool. so you will still see junk characters (or numberssss) in spool. But when you print it in postscript printer , it should work.
First step, assuming you have your binary data ready from tiff or pdf based on your requirement.
Basically below compress/decompress function modules convert the binary data from lt_bin (structure TBL1024) to target_tab (structure SOLIX). From Raw 1024 to Raw 255
DATA: aux_tab LIKE soli OCCURS 10. - temp table
Compress table
              CALL FUNCTION 'TABLE_COMPRESS'
                TABLES
                  in             = lt_bin
                  out            = aux_tab
                EXCEPTIONS
                  compress_error = 1
                  OTHERS         = 2.
Decompress table
              CALL FUNCTION 'TABLE_DECOMPRESS'
                TABLES
                  in                   = aux_tab
                  out                  = target_tab
                EXCEPTIONS
                  compress_error       = 1
                  table_not_compressed = 2
                  OTHERS               = 3.
In my case, since I have to get it from archived data using function module, ARCHIV_GET_TABLE which gives RAW 1024, above conversion was necessary.
Second step: Application server temporary files for tif/postscript files.
We need two file names here for tif file & for converted postscript file. Please keep in mind, if you are running it in background, user should have authorization to read/write/delete this file.
Logical file name just to make sure the file name is maintainable. Hard code the file name if you don't want to use logical file name.
              CALL FUNCTION 'FILE_GET_NAME'
                EXPORTING
                  logical_filename = 'ABCD'
                  parameter_1      = l_title
                  parameter_2      = sy-datum
                  parameter_3      = sy-uzeit
                IMPORTING
                  file_name        = lv_file_name_init
                EXCEPTIONS
                  file_not_found   = 1
                  OTHERS           = 2.
              IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
Now concatenate with the different extensions to get two different files.
              CONCATENATE lv_file_name_init '.tif' INTO lv_file_name_tif.
              CONCATENATE lv_file_name_init '.ps' INTO  lv_file_name_ps.
Third step: Write the target_tab to tif file.
Open dataset for writing the tif file.
              OPEN DATASET lv_file_name_tif FOR OUTPUT IN BINARY MODE.
              IF NOT sy-subrc IS INITIAL.
                RAISE open_failed.
              ELSE.
                LOOP AT target_tab INTO w_target_tab.
                  CATCH SYSTEM-EXCEPTIONS dataset_write_error = 1
                                          OTHERS = 4.
                    TRANSFER w_target_tab TO lv_file_name_tif.
                  ENDCATCH.
                  IF NOT sy-subrc IS INITIAL.
                    RAISE write_failed.
                  ENDIF.
                ENDLOOP.
                CATCH SYSTEM-EXCEPTIONS dataset_cant_close = 1
                                        OTHERS = 4.
                  CLOSE DATASET lv_file_name_tif.
                ENDCATCH.
              ENDIF.
Fourth Step: Convert the tiff file to postscript file.
This is the critical step. Create an external command (SM49/SM69) for this conversion. In this example, Z_TIFF2PS is created. Infact, I did get help from our office basis gurus in this. so I don't have the exact code of this unix script. You can refer the below link or may get some help from unix gurus.
http://linux.about.com/library/cmd/blcmdl1_tiff2ps.htm
Since my external command needs .ps file name and .tif file name as input, concatenate it & pass it as additional parameter. Command will take care of the conversion & will generate the .ps file.
   CONCATENATE lv_file_name_ps lv_file_name_tif INTO lw_add SEPARATED BY space.
Call the external command with the file paths.
              CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
                EXPORTING
                  commandname           = 'Command name'
                  additional_parameters = lw_add
                TABLES
                  exec_protocol         = t_comtab.
Fifth step: Read the converted ps file and convert it to RAW 255.
  DATA:lw_content TYPE xstring.
Open dataset for reading the postscript (ps) file
              OPEN DATASET lv_file_name_ps FOR INPUT IN BINARY MODE.
Check whether the file is opened successfully
              IF NOT sy-subrc IS INITIAL.
                RAISE open_failed.
              ELSE.
                READ DATASET lv_file_name_ps INTO lw_content.
              ENDIF.
Close the dataset
              CATCH SYSTEM-EXCEPTIONS dataset_cant_close = 1
                                      OTHERS = 4.
                CLOSE DATASET lv_file_name_ps.
              ENDCATCH.
Make sure you delete the temporary files so that you can reuse the same names again & again for next conversions.
              DELETE DATASET lv_file_name_tif.
              DELETE DATASET lv_file_name_ps.
Convert the postscript file to RAW 255
              REFRESH target_tab.
              CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
                EXPORTING
                  buffer     = lw_content
                TABLES
                  binary_tab = target_tab.
Sixth step: Write the postscript data to binary spool by passing the correct print parameters.
              IF NOT target_tab[] IS INITIAL.
                PERFORM spo_job_open_cust USING l_device
                                                     l_title
                                                     l_handle
                                                     l_spoolid
                                                     lw_nast.
                LOOP AT target_tab INTO w_target_tab.
                  PERFORM spo_job_write(saplstxw) USING l_handle
                                                        w_target_tab
                                                      l_linewidth.
                ENDLOOP.
                PERFORM spo_job_close(saplstxw) USING l_handle
                                                      l_pages.
                IF sy-subrc EQ 0.
                  MESSAGE i014 WITH
                   'Spools for'(019) lw_final-vbeln
               'created successfully.Check transaction SP01'(020).
                ENDIF.
              ENDIF.
Please note the parameters when calling function module RSPO_SR_OPEN. Change the print parameters according to your requirement. This is very important.
FORM spo_job_open_cust USING value(device) LIKE tsp03-padest
                        value(title) LIKE tsp01-rqtitle
                        handle  LIKE sy-tabix
                        spoolid LIKE tsp01-rqident
                        lw_nast TYPE nast.
  DATA: layout LIKE tsp01-rqpaper,
        doctype LIKE tsp01-rqdoctype.
  doctype = 'BIN'.
  layout = 'G_RAW'.
  CALL FUNCTION 'RSPO_SR_OPEN'
      EXPORTING
        dest                   = device "Printer name
    LDEST                  =
        layout                 = layout
    NAME                   =
        suffix1                = 'PDF'
    SUFFIX2                =
    COPIES                 =
     prio                   = '5'
       immediate_print        = 'X'
immediate_print        = lw_nast-dimme
        auto_delete            = ' '
        titleline              = title
    RECEIVER               =
    DIVISION               =
    AUTHORITY              =
    POSNAME                =
    ACTTIME                =
    LIFETIME               = '8'
        append                 = ' '
        coverpage              = ' '
    CODEPAGE               =
        doctype                = doctype
    ARCHMODE               =
    ARCHPARAMS             =
    TELELAND               =
    TELENUM                =
    TELENUME               =
      IMPORTING
        handle                 = handle
        spoolid                = spoolid
      EXCEPTIONS
        device_missing         = 1
        name_twice             = 2
        no_such_device         = 3
        operation_failed       = 4.
  CASE sy-subrc.
    WHEN 0.
      PERFORM msg_v1(saplstxw) USING 'S'
                       'RSPO_SR_OPEN o.k., Spoolauftrag $'(128)
                       spoolid.
      sy-subrc = 0.
    WHEN 1.
      PERFORM msg_v1(saplstxw)  USING 'E'
                           'RSPO_SR_OPEN Fehler: Gerät fehlt'(129)
                           space.
      sy-subrc = 1.
    WHEN 2.
      PERFORM msg_v1(saplstxw)  USING 'E'
                         'RSPO_SR_OPEN Fehler: Ungültiges Gerät $'(130)
                         device.
      sy-subrc = 1.
    WHEN OTHERS.
      PERFORM msg_v1(saplstxw)  USING 'E'
                           'RSPO_SR_OPEN Fehler: $'(131)
                           sy-subrc.
      sy-subrc = 1.
  ENDCASE.
ENDFORM.                    "spo_job_open_cust
Thats it. We are done. If you open the spool, still you will see numbers/junk characters. if you print it in postscript printer, it will be printed correctly. If you try to print it PCL, you will get lot of pages wasted since it will print all junk characters. So please make sure you use postscript printer for this.
Extra step for mails (if interested):
Mails should work fine without any extra conversion/external command since it will be opened again using windows. So after the first step (compress & decompress)
Create attachment notification for each attachment
              objpack-transf_bin = 'X'.
              objpack-head_start = 1.
              objpack-head_num   = 1.
              objpack-body_start = lv_num + 1.
              DESCRIBE TABLE  lt_target_tab LINES objpack-body_num.
              objpack-doc_size   =  objpack-body_num * 255.
              objpack-body_num = lv_num + objpack-body_num.
              lv_num = objpack-body_num.
              objpack-doc_type   =  'TIF'.
              CONCATENATE 'Attachment_' l_object_id INTO objpack-obj_descr.
              reclist-receiver = l_email.
              reclist-rec_type = 'U'.
              reclist-express = 'X'.
              APPEND reclist.
              CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
                EXPORTING
                  document_data              = docdata
                  put_in_outbox              = 'X'
                  commit_work                = 'X'
                TABLES
                  packing_list               = objpack
                  contents_txt               = objtxt
                  contents_hex               = target_tab
                  receivers                  = reclist
                EXCEPTIONS
                  too_many_receivers         = 1
                  document_not_sent          = 2
                  document_type_not_exist    = 3
                  operation_no_authorization = 4
                  parameter_error            = 5
                  x_error                    = 6
                  enqueue_error              = 7
                  OTHERS                     = 8.
              IF sy-subrc <> 0.
                RAISE email_not_sent.
              ENDIF.
              COMMIT WORK.
Hope this helps. I am sure this (print/email both) can be improved further by removing some conversions/by using some other methods.Please check & let me know if you have any such suggestions or any other comments.
Regards,
Gokul
Edited by: Gokul R Nair on Nov 16, 2011 2:59 AM</pre>
Edited by: Gokul R Nair on Nov 16, 2011 3:01 AM
Edited by: Gokul R Nair on Nov 16, 2011 3:15 AM

Similar Messages

  • Print label image in PDF format returned by Web Service XML string.

    Hi Experts,
    I have a scenario, where I am sending delivery details through IDOC and receives some labels to print in response from SAP PI. I am planning to print those labels from the inbound proxy.Is there any standard function module to print? I have gone through some function modules but no luck..could anybody help me on this? Give me some sample code..

    Hi Experts,
    I have a scenario, where I am sending delivery details through IDOC and receives some labels to print in response from SAP PI. I am planning to print those labels from the inbound proxy.Is there any standard function module to print? I have gone through some function modules but no luck..could anybody help me on this? Give me some sample code..

  • GTC Connector using SPML Format Provider and Web Services Transport Provide

    Hello All,
    Did any body create a GTC connector which uses SPML Format for Format Provider and Web Services format for Transport Provider?
    Is there any doc which talks about the same?
    I need to provision to a system over web services and I thought GTC using the above formats should be an easy approach. Am I right?
    I was trying to follow:
    http://download.oracle.com/docs/cd/E14571_01/doc.1111/e14309/devgtc.htm#BABDFDFE
    But Iam getting lost in the immerse details.
    Thanks in advance.

    Hi ,
    I tried creating one and am getting the following error while provisioning:
    SPML Response failed V2 schema validation
    Th eoracle document says :Ensure that the SPML response returned by the target system conforms to the SPML V2 standard specification
    Please help me with the same. What is it that needs to be done here.
    Thanks
    WIP

  • Web-services.xml, why is security not enforced (format improved)

    <pre>
    Hi,
    Sorry about the lack of formatting in previous post.
    Running weblogic 8.1SP5.
    Im having problems with the message style security, it doesn't seem to be enforced by weblogic.
    The intention of web-services.xml (below) is that weblogic should authenticate the user according to credential info in the request header.
    The console webservice testpage seem OK, it has user and password input boxes. But invocations fail with an obscure message involving
    AssertionError: Bad password type: wsse:PasswordText
    A simple Axis based client (see below) with no security tags in the header can invoke the service with no problems, would expect it to fail on athentication.
    Did I miss something in web-services.xml or does something general need to be set up in the server for this to work as intended?
    I am pulling my hair out on this one so any help will be greatly appreciated.
    Rgds.
    web-services.xml looks like this:
    <security>
    <user>
    <name>test_user</name>
    <password>test_password</password>
    </user>
    <spec:SecuritySpec xmlns:spec="http://www.openuri.org/2002/11/wsse/spec"
    Namespace="http://schemas.xmlsoap.org/ws/2002/07/secext"
    Id="_mySpec">
    <spec:UsernameTokenSpec xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
    PasswordType="wsse:PasswordText">
    </spec:UsernameTokenSpec>
    </spec:SecuritySpec>
    </security>
    <components>
    <stateless-ejb name="CaseConverter">
    <jndi-name path="CaseConverter"></jndi-name>
    </stateless-ejb>
    </components>
    <operations xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <operation
    component="CaseConverter"
    name="convertToUpper"
    method="convertToUpper"
    in-security-spec="_mySpec"
    >
    The client looks like this (Axis based):
    URL endpoint = new URL("http://127.0.0.1:7001/WebModule/CaseConverter");
    Service service = new Service();
    Call call = (Call)service.createCall();
    call.setTargetEndpointAddress(endpoint);
    call.setOperationName("convertToUpper");
    call.addParameter("inputString",XMLType.XSD_STRING,ParameterMode.IN);
    call.setReturnType(XMLType.XSD_STRING);
    String result = (String) call.invoke(new Object[] { "hello!" });
    System.out.println("Result: " + result);
    </pre>

    Hi
    I am also getting the same error. if anybody has some solution, pl. tell us

  • Can objects returned from web services be cast to strongly typed objects?

    Can objects returned from web services be cast to strongly
    typed objects?
    Last I tried this was with one of the beta of Flex2 and it
    did not work. You had to use ObjectProxy or something like that...
    Thanks

    Please post this question in the CRM On Demand Integration Development forum.

  • The format of XML file returned from web service

    Hi everyone,
    My web service (build in asp.net 2.0 with C#) returns the
    following xml file which is not what I want.
    <Root>
    <Root2>
    <Person> .... </Person>
    <Person> .... </Person>
    <Person> .... </Person>
    </Root2>
    </Root>
    But I want my web service to return the following xml file.
    How can I get the following xml file instead of the above xml file
    ? Thanks.
    <Root>
    <Person> .... </Person>
    <Person> .... </Person>
    <Person> .... </Person>
    </Root>

    Thanks for everyone's reply!
    Sorry, I don't know where to set resultFormat="e4x". Below is
    my code. And LINE 111 gives error. And the error message is below.
    And the xml returned from the web service is below.
    Error: Error #2093: The Proxy class does not implement
    getDescendants. It must be overridden by a subclass.
    at Error$/throwError()
    at flash.utils::Proxy/
    http://www.adobe.com/2006/actionscript/flash/proxy::getDescendants()
    at
    LogIn/loginHandler()[P:\JIMMY-FLEX\Flex_LogIn\LogIn.mxml:58]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    mx.rpc::AbstractService/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\A bstractService.as:232]
    at mx.rpc::AbstractOperation/
    http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\3.0.x\frameworks\pro jects\rpc\src\mx\rpc\AbstractOperation.as:193
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\3.0.x\frameworks\projec ts\rpc\src\mx\rpc\AbstractInvoker.as:191
    at
    mx.rpc::Responder/result()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:4 1]
    at
    mx.rpc::AsyncRequest/acknowledge()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:74]
    at
    DirectHTTPMessageResponder/completeHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\ messaging\channels\DirectHTTPChannel.as:381]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%" height="100%" xmlns:ns1="*">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    namespace FaciNS = "
    http://FaciNet.com/";
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.soap.WebService;
    //public var __xmlResult:XML;
    public var ws:WebService;
    public function Log_In(UN:String, PW:String):void
    ws.Login(UN, PW);
    public function getLoginData():void {
    loadWSDL();
    Log_In(UN.text, PW.text);
    public function loadWSDL():void
    ws = new mx.rpc.soap.WebService();
    ws.wsdl = "
    http://localhost:50779/VS2008_LogIn/Service.asmx?wsdl"
    ws.useProxy = false;
    ws.addEventListener("fault", faultHandler);
    ws.addEventListener("result", loginHandler);
    ws.loadWSDL();
    public function loginHandler(e:ResultEvent):void {
    var wkSouID:String = e.result[0]..SouID; // LINE 111
    trace(wkSouID);
    public function faultHandler(event:FaultEvent):void
    dispatchEvent(new Event("Error"));
    public function checkUser(UName:String, PWord:String):void {
    getLoginData();
    ]]>
    </mx:Script>
    <mx:Panel id="loginPanel" horizontalScrollPolicy="off"
    verticalScrollPolicy="off" width="400" height="200" x="97"
    y="66">
    <mx:Form id="loginForm" width="100%" height="100%">
    <mx:FormItem label="Username:" color="red">
    <mx:TextInput id="UN" />
    </mx:FormItem>
    <mx:FormItem label="Password:" color="red">
    <mx:TextInput id="PW"/>
    </mx:FormItem>
    </mx:Form>
    <mx:ControlBar>
    <mx:Spacer width="100%" id="spacer1"/>
    <mx:Button label="Login" id="loginButton"
    click="checkUser(UN.text, PW.text)" />
    </mx:ControlBar>
    </mx:Panel>
    </mx:Canvas>
    <?xml version="1.0" encoding="utf-8" ?>
    - <ArrayOfLogIn xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns="
    http://tempuri.org/">
    - <LogIn>
    <SouID>2</SouID>
    <LogInUserID>3</LogInUserID>
    <LogInUserName>samlam</LogInUserName>
    <Password>abc123</Password>
    <DialectID>4</DialectID>
    <CreatedByUserID>5</CreatedByUserID>
    <UpdatedByUserID>5</UpdatedByUserID>
    </LogIn>
    - <LogIn>
    <SouID>3</SouID>
    <LogInUserID>4</LogInUserID>
    <LogInUserName>samlam</LogInUserName>
    <Password>abc123</Password>
    <DialectID>4</DialectID>
    <CreatedByUserID>5</CreatedByUserID>
    <UpdatedByUserID>5</UpdatedByUserID>
    </LogIn>
    </ArrayOfLogIn>

  • How to publish an image and consume the same via web service?

    how to publish a soap web service which returns image and consume it via a client to display it properly?

    You could try to write a web service that returns a byte array and convert the image to bytes, and convert it back into an image again.

  • Web service - XML not in format

    Hi,
      i created one web service which has function returning integer. i called this WS in BLS. I saved response of function in xml file using XML saver action block. But i cant read this file in query template. i.e it is not in format. it shows as
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:col2Response xmlns:ns="http://ws.apache.org/axis2/xsd">
      <ns:return>32.0</ns:return>
      </ns:col2Response>
    in query template, test page doesnt show anything.
    what is the problem? how to solve it as to read thru query template?
    -senthil

    Senthil,
    There is no problem. Your web service is just returning the response as you have defined it. If you define your response in the Rowsets/Rowset/Row format then it should be fine to display in a query template.
    Otherwise, as it stands you would just have to create an IllumDoc and map the data from your web service call to it and then it will display. Just make sure to map the outputXML from the IllumDoc to a transaction property Ouput of XML data type.

  • Web service XML formatting?

    I have created a web service from PL/SQL and would like to invoke some sort of formatting on the XML output. Is there a way to force a web service to use a specific XSLT?
    Darren L. HLAVA

    Since I haven't had a response to this question, and my SR is not giving me anything I figured I would try here again. I would have though that someone would have used an XSL with a web service and had some ideas. So here's a change to my original question.
    I have started looking at the use of setXSLT within my PL/SQL. Unfortunately I am trying to use an XSLT that has been previously stored in a database table with a column of XMLType. Here's what I have created so far, but when I uncomment the setXSLT line what comes out in the web service that is executing is the actual XSL not the formatted XML as expected. Any thoughts?
    FUNCTION get_OneXML(p_ID IN CHAR,
    pNo_ID IN NUMBER
    ) RETURN XMLTYPE
    IS
    vOut XMLTYPE;
         vXSL_CLOB CLOB;
         qryctx Dbms_Xmlgen.ctxhandle;
         qryctxXSL Dbms_Xmlgen.ctxHandle;
    buf VARCHAR2(2000);     
    BEGIN
         qryctxXSL := Dbms_Xmlgen.NEWCONTEXT('SELECT xsl_doc
    FROM scott.xml_stylesheets
    WHERE ID=1');
    qryCtx := Dbms_Xmlgen.NEWCONTEXT(get_One(p_ID,pNo_ID));
    vXSL_CLOB := Dbms_Xmlgen.getXML(qryctxXSL);
    --     Dbms_Xmlgen.setXSLT(qryCtx,vXSL_CLOB);
    vOut := Dbms_Xmlgen.getXMLType (qryctx);
    RETURN vOut;
    end getFormattedXML;

  • Parsing xml returned by web service

    I am calling a web service from flash and the web service
    returns xml. The xml gets urlencoded when it's put inside the soap
    wrapping xml and I'm not sure how to get rid of the soap wrapping
    and unencode the returned xml. Thanks.

    Hi vtxr1300,
    I'm not sure if you meant to say "urlencoding" because that
    looks more
    like this:
    ?title=This is a test title&description=This is a test
    description of item 1
    What you're looking at here is pure XML (with namespaces but
    you can
    ignore them for the most part...we know this is SOAP!).
    Since you posted this in the ActionScript 3 forum, I'll
    assume you'll
    want AS3 code to deal with this. Luckily, AS 3 has made it
    incredibly easy
    to extract whetever you need out of this.
    First, you just need to get this data into a standard XML
    object is it's
    not already. So..something like this:
    //xString is your XML data...SOAP return data, string, or
    whatever
    var myXML:XML=new XML(xString.toString());
    The XML object retains its nesting properties so that, for
    example, to
    access the first '<desc>' node, you must access
    '<module>' before it,
    '<modules>' before that, and so on. This is
    accomplished using the "child"
    method associated with the XML object which uses the node
    name as a
    parameter. For the '<desc>' node, for example, this
    would look like:
    myXML.child("Body").child("GetTrainingResponse").child("GetTrainingResult").child("traini ng").child("modules").child("modile").child("desc");
    A bit lengthy, but it gets the job done. Typically I would
    store s
    reference to each of the resulting "child" calls. this has
    two benefits and
    uses: It's easier to organize and easier to read than one
    long instruction,
    and it allows you to parse through multiple nodes. Each
    "child" call returns
    an XMLList object, not necessarily a single node. If there
    are multiple
    sibling nodes with the same name, for example, calling the
    "child" method
    will return an XMLList with two object nodes, not just one.
    An XMLList can
    be used much like an array so you can simply loop through the
    results to see
    all of the nodes.
    The notation for ActionScript 3 has changed a bit for node
    attributes.
    An attribute name is now referenced via an '@' symbol. For
    example, to get
    the 'xmlns' attribute of the '<GetTrainingResponse>'
    node, you would use:
    myXML.child("Body").child("GetTrainingResponse").@xmlns;
    Finally, it's worthwhile noting that the XML container
    obejct reference
    has changed. In ActionScript 2.0, an XML object would point
    to the XML
    document. The "firstChild" property of the XML object would
    point to the
    first node ('<soap>' in this instance). In ActionScript
    3.0, the XML object
    point to the first node so that the first child of the object
    in this
    instance would be the '<soap:Body>' node.
    As mentioned, you can usually ignore namespaces for objects
    you're
    familiar with. The "soap" namespace, for example, can be
    assumed since we
    know this is a SOAP response.
    Hope this helps.
    Regards,
    Patrick Bay
    BAY NEW MEDIA
    "vtxr1300" <[email protected]> wrote in
    message
    news:[email protected]...
    > Here's what the web service is returning. If I create a
    local version of
    > the
    > xml without the soap wrapping and urlencoding I can get
    all the data I
    > need...
    > I just can't figure out how to urldecode it and get rid
    of the soap xml.
    > Can
    > anyone please offer some ideas? Thanks.
    >
    > <soap:Envelope xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/"
    > xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    > xmlns:xsd="
    http://www.w3.org/2001/XMLSchema">
    > <soap:Body>
    > <GetTrainingResponse xmlns="
    http://www.trainingondemand.com/">
    >
    <GetTrainingResult><training><modules><module><title>Item
    > 1</title><desc>This is a test description of
    the
    > item.</desc><purchaseurl>
    http://www.yahoo.com</purchaseurl><imageurl>http://www.
    >
    testsite.com/header.gif</imageurl></module><module><title>Item
    > 1</title><desc>This is a test description of
    the
    > item.</desc><purchaseurl>
    http://www.yahoo.com</purchaseurl><imageurl>http://www.
    >
    testsite.com/header.gif</imageurl></module><module><title>Item
    > 1</title><desc>This is a test description of
    the
    > item.</desc><purchaseurl>
    http://www.yahoo.com</purchaseurl><imageurl>http://www.
    >
    testsite.com/header.gif</imageurl></module><module><title>Item
    > 1</title><desc>This is a test description of
    the
    > item.</desc><purchaseurl>
    http://www.yahoo.com</purchaseurl><imageurl>http://www.
    >
    testsite.com/header.gif</imageurl></module></modules><colors><darkcolor>8396b0</
    >
    darkcolor><btngradientstart>2d6dc4<btngradientstart><btngradientend>17498f<btngr
    >
    adientend><btn2gradientstart>a5b5ca</btn2gradientstart><btn2gradientend>c4d0e0</
    >
    btn2gradientend></colors></training></GetTrainingResult>
    > </GetTrainingResponse>
    > </soap:Body>
    > </soap:Envelope>
    >

  • Return type Web Service

    Hello,
    I have a web service created in Java:
    @WebMethod
    public Vector<Data> getData();
    This is how I am connecting to the web service:
    public function connectWS():void{
         var cr:CallResponder = new CallResponder();
         cr.addEventListener(ResultEvent.RESULT, connectWSResult);
         cr.token = myWebService.getData();
    My vect variable above does not provide me with the correct Data object. vect is assigned null. How ever if I have:
    public function connectWSResult(event:ResultEvent);void{
         var arrCollect:ArrayCollection = event.result as ArrayCollection;
    arrCollection gives me correct value of Data object.
    I want the webService to return me a Vector. How can I go about that?
    -H

    If I understand you correctly (do not see a 'vect' variable anywhere), the web service is working perfectly.  The getData() function is non-blocking and does not "wait" for the response from the web service.  This is why you need to add an event listener, to listen for the "result" event.  When the reply comes in, the listener triggers the handler (connectWsResult) which you appear to have defined correctly.
    So I'm not sure what the problem is if you say the handler is returning the correct data.  Am I missing something?

  • Complex types returned from web services

    I'm having problems getting values from a complex type from a
    CFC web service. Are there any tutorials that show you how this is
    done? The only tutorials I've seen have been returning simple
    types.
    I have tried everything I know, which is not a lot I must
    admit, I'm just a beginner! *L*
    Thanks in advance.

    I'm having problems getting values from a complex type from a
    CFC web service. Are there any tutorials that show you how this is
    done? The only tutorials I've seen have been returning simple
    types.
    I have tried everything I know, which is not a lot I must
    admit, I'm just a beginner! *L*
    Thanks in advance.

  • Web Service XML Changes Return Table  Field Names

    I am writing a Web service to return a employee information from SAP using .Net Connector. My Webservice XML changes return table column names with few escape characters. Does anyone know why this happens? and How to prevent it?
    Every column name is changed: e.g. PERS_NO to PERS_--5fNO
    NCo -> 2.0
    RFC- > Custom Function module
    RFC Return Type -> ZFPSYNC
    VS.Net -> VS Studio 2003, ( C# Web service)
    Here is part of XML document:
      <?xml version="1.0" encoding="utf-8" ?>
    - <ArrayOfZFPSYNC xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
    - <ZFPSYNC>
      <PERS_5fNO>00100001</PERS_5fNO>
      <PDS_5fEMPID>00054740</PDS_5fEMPID>
      <SSN>001380261</SSN>
      <NAME_--5fPFX />
      <FIRST_5fNAME>Tuesday</FIRST_5fNAME>
      <LAST_5fNAME>October</LAST_5fNAME>
      <NAME_--5fSFX />
      <PRIOR_5fNAME>Tuesday October</PRIOR_5fNAME>
      <NICKNAME />
      <CO_5fCODE>TAX</CO_5fCODE>
      <CO_5fCODE_5fT>Tax LLP</CO_5fCODE_5fT>
      <CO_5fCTRY>US</CO_5fCTRY>
      <ORG_5fUNIT>50191687</ORG_5fUNIT>
      <ORG_5fUNIT_5fT>Northeast Region Lead Tax</ORG_5fUNIT_5fT>
      <EE_5fLEVEL>C1</EE_5fLEVEL>
      <EE_5fLEVEL_5fT>Firm Director</EE_5fLEVEL_5fT>
      <SRV_5fAREA>TAX</SRV_5fAREA>
      <SRV_5fAREA_5fT>Tax</SRV_5fAREA_5fT>
      <JOB_5fFAM>CS-TAX</JOB_5fFAM>
      <JOB_5fFAM_5fT>CS - Tax</JOB_5fFAM_5fT>
      <PER_5fAREA>BOSX</PER_5fAREA>
      <PER_5fAREA_5fT>Boston-Berkeley St-TAX</PER_5fAREA_5fT>
      <PER_5fADDR>200 Berkeley Street</PER_5fADDR>

    Please install patch from OSS note 506603. This should correct the problem.

  • Displaying Web Service XML Return

    Hi,
    I'm looking for some help with web services. I have created a web service based on a PL/SQL package (using JDeveloper wizards) and deployed this successfully to Oracle 10g App server.
    I can execute the webservice through a java client and get each of the attributes defined in the WSDL.
    Now my problem is that I need to be able to execute the webservice through a HTML page and have the resultant SOAP/XML passed through to the HTML page so it can be dealt with by the Stylesheet. I cannot get the XML to be passed through to the calling HTML page.
    I have a HTML/JS page that can execute the service - but it does not return anything which I think is because the webservice doesn't have an explict return in it.
    Any help would be most appreciated.
    Regards
    Neil Catton

    Please install patch from OSS note 506603. This should correct the problem.

  • Unable to retreive the fault message returned by web service

    Hi,
    We are working on Proxy to SOAP synchronous scenario. The WSDL provided by the third party has 3 messages - 1. for request structure, 2. response structure and 3. Error message to track the exceptions, if any.  The interface working fine for positive test cases but we are facing issues when trying to capture the error message returned by the web service.
    We have configured the error message(provided in WSDL) as fault message in our Inbound interface. In the outbound interface, we have configured standard Fault message type provided by XI. we have mapped the two structure.
    Now when error is returned by the web service, we are able to see the blank response structure in the payload in MONI in XI. Also the SOAP Error Message structure is there in XI.
    But when we trying to retrieve the same in our proxy, it is giving the blank structure.
    Please help how to get the error message returned by the web service in proxy....
    Please help..
    Thanks in advance.

    >>>I am getting the error message as the fault message, in the response from the web service.
    >>>Now I want to forward the same message to SAP R/3 system. For this I have configured the standard fault message in the >>>outbound interface and have mapped the same with the web service error message. So if I am not wrong, the transformed >>>>structure according to the rules in message mapping should be sent to SAP R/3 system. But I am unable to see the result >>>>of this mapping in XI MONI. Neither is this passed to Client proxy.
    You are consuming the third party webservice. Third party webservice WSDL has request, response and fault message. if the third party application logic capture the exception and pass the response as fault mesg, then the above specified target fault mesg mapping with your Standard fault message mapping will be sent to sender or client proxy.
    Suggestions:
    Having fault message in WSDL does not mean that target system sends fault message during application exception. Check in the SXMB_MONI whether your response during exception is occuring in the fault message structure publised as WSDL. If not then doing mapping will not help. It gives only blank.
    If you notice response in fault message structure from third party in SXMB_MONI, then you need to check that at the client proxy side, are you handling/done coding for fault message methods similar to response strucutre for capturing data.
    Hope that helps.

Maybe you are looking for

  • Help with Javascript/Calculations

    Hello, Have a building use policy for school. Need help with checkboxes and default values.  I can get javascript/math to work when I click check box. Someone wants to rent a room they check the rentRoom checkbox.  Then the enter how many rooms 1,2,3

  • Display "blank-out" when using Maya with a GF 7800?

    I have a problem where my LCD display occasionally blinks off for about 5-10 seconds when using Maya with a scene displaying about 100,000 polys. Has anyone else encountered this? This only seems to happen when I am quickly rotating the camera in a g

  • Thinkpad Yoga cooling fan issue

    Hi, my TPY had been working pretty well for several weeks but last few days I´m experiencing an annoying issue - the cooling fan doesn´t engage when TPY gets hot under load, even when the core gets to 100 degrees Celsius and all the bottom and right

  • How can I pull info into a report using just the first two characters of that field?

    I am trying to pull a total cost based upon locations in a particular area(s). Can I get the formula to just do this based on the first two characters of that field? Here is what I have so far: if {PACKED.LOCATIONS.NEXT OPERATION} = ["xx"] THEN {Job.

  • Java 2 v1.4.0 and Forte --- how to install on Win98?

    I just received the CD labelled "Forte for Java 4," intending to use this to learn the language. There are no instrauction with it, and even all the readmes fail to give actual directions. So I found what seemed to be the install executable for Java