How to attach a DOM object as stream to SOAP message?

Hi friends,
I want to attach a parsed XML document (DOM object) to SOAP message, but but I do not want to attach it as a String, instead, I want to attach it as a binary format, given a DOM object.
Any one can help tell me what can I do for it? and what is the content type it should be?
Thanks!

I knew the Java Doc API, actually I can attach text string format, but since what I want is binary data (i.e, serialize form of DOM stream), it does not seem to work as attachment.
1).if I use:
attachment.setContent(doc, "application/octec-stream");it throws:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octec-stream
2). if I use:
attachment.setContent(doc, "application/xml");it still throws:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octec-stream
3). if I use serailized form of the document String docString = DOMUtil.serializeDocument(doc);
attachment.setContent(docString, "text/xml");I checked the docString, which is like this form:
<?xml version="1.0"?>
<a xmlns="http://foo.org">
<b>text</b>
</a>
but it throws:
java.io.IOException: Unable to run the JAXP transformer on a stream null
3). it only works if I use serailized form of the document, and set content-type to "text/plain"
String docString = DOMUtil.serializeDocument(doc);
attachment.setContent(docString, "text/plain");Any idea what is wrong here?
Thanks!

Similar Messages

  • How can i convert an object to stream of chars or bytes?

    how can i convert an object to stream of chars or bytes?

    One way is the serialization mechanism. There are examples and explanations of it in the Java tutorial: http://java.sun.com/docs/books/tutorial/essential/io/serialization.html

  • How To : Call External Webservice from BPEL and pass SOAP Message to the WS

    Hello All-
    Greetings to all BPEL gurus. I am currently facing difficulties in calling an External Webservice from my BPEL Process and passing SOAP Message to it. The details are below:
    <strong>1. The BPEL process, using database polling feature of DB Adapter, will get the records from the database.</strong>
    <strong>2. Transform the message</strong>
    <strong>3. Call the External Webservice and pass the transformed message as the input to it. However the Webservice expects the BPEL process to send SOAP headers in the input message.</strong>
    I am struggling on how to put the transformed message within a SOAP envelope in the BPEL process.
    If anyone had similar requirements and have successfully been able to send SOAP messages from BPEL process to an external webservice, kindly let me know.
    Also if there is some kind of documentation or any link in the forum that I can refer, please let me know that as well.
    I am new to Webservice integration using BPEL and would really appreciate your help.
    Thanks In Advance
    Regards,
    Dibya

    Hi Dharmendra,
    I am trying to send a SOAP message from my BPEL process to a web service. I have a complete SOAP message in a complex variable defined in the wsdl for the partnerlink (web service). My problem is that when I invoke the partnerlink it fails even though the content shown in the BPEL console looks valid.
    I have set up obtunnel to see what I am actually sending out from BPEL. You mention that BPEL creates the SOAP envelope automatically.
    I think that my problem is a result of this automatic SOAP envelope that BPEL is creating. Do you know if there is a way to turn it off?
    This is what I see in the TCP monitor, please note the double SOAP env:Body:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <RCMR_IN000002NR01 xmlns="urn:hl7-org:v3" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <env:Header>
    <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://testhost/CCS/Service_Endpoint</wsa:To>
    <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://localhost/CCS/Service_Endpoint</wsa:Address>
    <wsa:Metadata>
    <device xmlns:hl7="urn:hl7-org:v3">
    </device>
    </wsa:Metadata>
    </env:Header>
    <env:Body>
    <RCMR_IN000002NR01>
    </RCMR_IN000002NR01>
    </env:Body>
    </RCMR_IN000002NR01>
    </env:Body>
    </env:Envelope>
    Any help is appreciated.
    Regards,
    Aagaard
    Edited by: Aagaard on Oct 30, 2008 8:59 PM
    Should have mentioned. I am using BPEL 10.1.3.4
    Edited by: Aagaard on Oct 31, 2008 8:43 AM
    I have opened a new thread for this question so as to not confuse the issue more than necessary.
    How many SOAP envelopes do you really need?

  • How to Call web service operation by creating plain SOAP message in client?

    Hi
    Thank you for reading my post.
    I have some questions about using web methods of a web service which i would be very gratfull if you could answer.
    I should implement a web service that should receive a file with some other parameters from client and another web service which should receive some parameters and return a file.
    I used a mechanism like the following one to handle the condition and it just works. But I have a problem, I need to create dynamic invocation and I must create soap message and send it to webservice (no IDE generated code)
    What i need is one or two tips or a sample that shows how we can send and receive files by web services.
    I want to know how we can create the SOAP message ourself and then send it to the web service endpoint and it call the web method and ....
    Imagine the following web method, How i can invoke it by creating soap message myself and sending it to end point.
    @WebMethod
    public String saveFile(@WebParam(name = "fileName") String fileName, @WebParam(name = "fileContent") byte[] fileContent) {
    // TODO implement operation
    return "Something";
    Another question is :
    Does this mechanism that i used to transfer files is OK?
    Is it optimized or there are some other ways to do this job.
    I should say that i put one week on handlers to use soap attachments and i get no result.
    So, Please let me know if you know or have some sample that show me how to do the above job.
    Thanks.

    Hi
    From NW04s SP8 you can create webservice systems from within VC , and you will have the option of adding a user and password to authenticate. You can find it at Tools>>Define web service system. You will see a check box url requires user and password.
    If for some reason you can not do it in VC then you should create the system in the portal and fill out the usermapping screens.
    Jarrod Williams

  • How to attach programatically the object form itself?

    I want to attach the object form to the form with javascript. Is this possible?
    Thanx in advance

    Hi,
    Call a PERFORM in ur form with 2 Using paramters (&RESBD-MENGE(C)&, &RESBD-GPREIS&) and use another changing parameter to get the value after multiplying above two. Define this PERFORM in driver program.
    Eg:
    In Script:
    DEFINE : &tot_value&
    PERFORM z_total_value IN PROGRAM z_cal_total USING &RESBD-MENGE& &RESBD-GPREIS&
                                        changing &tot_value&
    In Program z_cal_total:
    FORM z_total_value using in_tab structure itcsy
                               changing out_tab structure itcsy.
    data : lv_menge TYPE resbd-menge,
              lv_gpreis TYPE resbd-gpreis,
              lv_total TYPE resbd-menge.
    READ table in_tab with KEY name = 'RESBD-MENGE'.
    IF sy-subrc EQ 0
      lv_menge = in_tab-value.
    ENDIF.
    READ table in_tab with KEY name = 'RESBD-GPREIS'.
    IF sy-subrc EQ 0
      lv_gpreis = in_tab-value.
    ENDIF.
    READ table out_tab with KEY name = 'TOT_VLAUE'.
    IF sy-subrc EQ 0.
      lv_total = lv_menge * lv_gperis.
       out_tab-value = lv_total.
    MODIFY out_tab transporting fields value.
    ENDIF.
    ENDFORM.
    Hope it helps!!
    Rgds,
    Pavan

  • Writing LARGE DOM objects

    Hi All,
    Any one has clue on how to write large DOM objects on to the HTTP response's Output stream.
    When i tried doing that I converted it to string and then transformed wrote to the stream.
    The problem is when I have a query that returns me around 8000 or more records the string is not fully formed. We get some malformed xml sent to the browser. So we are not able to view it using the stye sheets on the web browser.

    Hello Reflex,
    Do you mean you have any memory problem ?
    It looks like you are fetching data from database and sending it to browser like following:
    1) Convert ResultSet to DOM
    2) DOM to String
    3) String is directed to OutputStream/Writer of ServletResponse.
    You can see 1 and 2 are just waste of memory.
    Try knocking off any one or both of them. For Example,
    1) DOM object can directly written to OutputStream.
    2) You can use TransformerHandler to read database and directly write XML to OutputStream in terms of SAX events.

  • Attaching the WebUtil object group to a form

    Hi. I'm hoping for some help on how to attach the WebUtil object group to a form. I go to the Object Groups node in the object navigator and click the '+' button, but I'm not prompted to attach .olb files. How do I do this? Without it attached I'm receiving the message "The WebUtil object group is not available in this form. WebUtil cannot work." when I run my application. Thanks in advance.

    Okay I opened the .obl and it appears under the Object Libraries Node. Then I double-click on the Object Groups node in my form and it simply creates a new object named OBJECT_GROUP100. I can't seem to drag and drop from the Libraries Node to the Object Groups node in my form. It just shows a circle with a line through it indicating that I can't drag it. Any suggestions? (Sorry, I've not done this before).

  • How to attach more files in Mail?

    Can anyone please tell me how to attach more than one file to an email message in the iPhone Mail app? I've read the whole manual, so I'm not sure if I missed the part or if this feature actually lacks...??

    I agree with you on this one.. It is very inconventient to send attachments one e-mail at a time. I don't think Apple was really paying attention to what the customers needs were regarding e-mail. Also Apple need to fix the problem with Text messaging signatures. Currently you cannot add a signature to text messages. Every other phone in the world offers this feature!

  • HT2128 Does any one know how to attach a document from your mail, while you are already in your e-mail, meaning not having to look for your file first and then open the e-mail.

    Does any one know how to attach a document from your mail, while you are already in your e-mail, meaning not having to look for your file first and then open the e-mail.

    Luis
    Good question - and one that a lot of (business) people would like solved!
    Your question prompted me to do some research, and I found this workaround posted by Scott Grossberg:
    His solution actually addresses a second problem too - how to attach a document when replying to an email message. In your case you may not need to consider the "reply" aspect - but if not right now, it'll come in useful someday!
    I've pasted it verbatim - if it works for you (it does for me) then all credit goes to Scott for solving the problem. There's just one thing I'd add to his solution: you will probably want to rename the message, as by default Goodreader gives it the Subject line: Mail with GoodReader attachments.
    THE GOODREADER OPTION
    1.  CREATE the document you want to send.
    2.  SAVE it to GoodReader (this will require you to buy and install the app).
    3.  Go to your email and OPEN the email thread to which you want to Reply and attach your file.
    4.  COMPOSE your Reply.
    5.  DOUBLE TAP the message.
    6.  TAP SELECT ALL. This will copy the entire email thread.
    7.  OPEN GOODREADER on the iPad and go to the file you want to send as part of your Reply.
    8.  At the bottom of the GoodReader screen you will see an EXPORT icon (it looks like a rectangle with an arrow pointing to the right).
    9.  TAP the Export button.
    10.  TAP EMAIL FILE. Depending on your needs, tap either SEND FILE “AS IS” or “FLATTEN ANNOTATIONS.” This will open a compose message screen with the chosen document already attached.
    11.  TAP in the body of the email screen. TAP PASTE. This will place your composed Reply and the prior email thread into the message.
    12.  ENTER the Recipients’ names in the TO: field of your message.
    13.  SEND your email Reply.
    The modified version (= when composing a new message rather than a reply):
    1 Make sure that the doc you want to attach is saved in GoodReader
    2 In the message you are composing, double tap, select all, and then copy.
    3 Open GoodReader and select the file you want to attach
    4 Select the export button at the bottom of screen
    5 Select e-mail file
    6 Position cursor in body of the email message, tap and paste. You may want to delete the "sent from GoodReader" text that precedes the attachment.
    7 Rename your message (as by default it will be Mail with GoodReader attachments)
    8 Add the recipient's address in the To field.
    Hope this helps! All thanks to Scott for this workaround.

  • How to run SPAU & Custom Objects Mod

    Hi
    I am new to upgrade , Can anyone guide me how to run
    SPAU & Custom Objects Mod
    Thanks
    Parin
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Oct 30, 2011 10:41 AM

    Hi Ramana,
    what kind of report you want to  execute? the report is Executable Report or Modulepool prog. ??
    if it is a executable program so when u execute (F8) from SE38 when u find the selection-screen in the menu bar ->Program ->Execute in Background( F9) option exits there u can schedule your report in Background or else use toce SM36 ( Define Background Job).
    Why you want to run it in background with transaction code if you have this options?
    Regards,
    Sunil kairam.

  • How to attached CLAD logo

    my dear readers,
    I might classified myself as the least person for not knowing this but since I am "newly CLAD passer", (I just received the result TODAY!) then it will be my 1st time to have a logo here in the discussion forum.
    I know it will be a big responsibility for being certified (since they expect us to be better than average), but this is how CLAD passer became more responsible in their chosen career, and a challenge to be a better programmer each passing days.
    feels good to be CLAD certifified, but feels better than best to the undeserving ones'!
    with all of this introductions, I just want to share my hapiness here in the forum.
    Please dont forget teach me how to include the CLAD logo. haha.
    thank you and regards,
    ivel
    Ivel R. | CLAD

    Hello guys,
    based on what i understand, this was done in LV programming code? thanks for the additional very helpful hints. for now, I just want to customize my picture here, and to know how to attach some logo in the footer of my message (just being curious how others have done this). my question points out how to customize my signature and image in this forum (unrelated to LV codes).
    but if your messages are dealing exactly on what i need, please assist me on further details. my bad.
    For clarity, i attached two files that locates where i want to put my logo.
    regards, 
    ivel
    Ivel R. | CLAD
    Attachments:
    3.jpg ‏16 KB
    1.jpg ‏25 KB

  • How to include XML Prolog in BPEL SOAP message.

    Hi,
    I'm using SOA Suite 11g on WebLogic and have a BPEL Process in a composite application that is calling a third party SOAP Web Service.
    Whilst it is standard for a SOAP service to not care whether or not the SOAP message includes an XML Prolog (<?xml version="1.0" encoding="utf-8"?>) this third party service rejects the message if the prolog is not included.
    Unfortunately the partner link in my BPEL process is not adding the prolog when invoking the service and I cannot get the third party service changed to accept messages without it.
    Does anyone know how I can make BPEL include the prolog in SOAP messages?
    Currently the SOAP message looks like this:-
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header/>
    <soap:Body>
    </soap:Body>
    </soap:Envelope>
    What I would like it to look like is this :-
    *<?xml version="1.0" encoding="utf-8"?>*
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header/>
    <soap:Body>
    </soap:Body>
    </soap:Envelope>
    Thanks in advance...

    Hi swigg,
    It's not the partnerlink input variable that I want to manipulate, it's the SOAP Envelope that the Partner Link generates when it is invoked.
    I know that you can manipulate the SOAP Header by adding properties to the Partnerlink but it's the Envelope that surrounds both the Header and the Body that I want to set the prolog on.
    It can be done in java and .NET (WCF) by setting a property on the SOAP Envelope class, but I can't see a way to do it for a partner link in BPEL which is a shame.
    To be honest it looks like Oracle have let me down here so I'll have to use some other technology to call this service which unfortunately plays into the hands of those that didn't think I should use Oracle's BPEL offering in the first place.
    Thanks.

  • How to create a view object and attach with extended AM

    Hi,
    I tried to create new vo and attach this vo with the extended AM. But it is throwing error like 'PC.NAME : invalid identifier' (Actually this PC.NAME is exiting one).
    Now i want to know how to create a view object similar like seeded one but with one additional condition in the where clause.
    It is possible though extension, but i want to create two view object similar like seeded one, one with some other condition in the where clause
    and another one with some other condition.
    So for my requirement, i'll extend one VO and i'll add my condition but how to do it for second condition.
    But i want same seeded VO with two different condition.
    Any suggestions please,
    SAN

    SAN,
    There is no need to attach the newly created VO with extended AM. You need to attach the same with the standard AM.
    Regards,
    Gyan

  • How to expose something as a DOM object in a browser window

    Hi all,
    I am working on a E-Learning platform which adheres to the SCORM Runtime Environment (http://www.adlnet.org/library/documents/scorm/scormexamples/SCORM1_2_SampleRTE1_2.zip).
    From the SCORM Runtime Environment spec [page 3-6]:
    "(1) The LMS (Learning Managment System) must launch the SCO [Sharable Content Object] in a browser window that is a child window or a child frame of the LMS window that exposes the API Adapter as a Document Object Model (DOM) Object. The API Adapter must be provided by the LMS.
    (2) It is the responsibility of the SCO to recursively search the parent and/or opener window hierarchy until the API adapter is found."
    I think that I know how to do (2), but can anybody help with (1) ?
    Thanks

    well half an hour after posting this question I found out the ADL has finally put a sample implementation written in Java onto the web (http://www.adlnet.org/library/documents/scorm/scormexamples/SCORM1_2_SampleRTE1_2.zip). I think this will cover all of my questions ;-)

  • How to call GOS(Generic Object service) attachment ( BMP file ) into SAP

    How to call GOS(Generic Object service) attachment ( BMP file ) into SAP script
    Example: MM02 Service object there attaching the bmp file the same file i need to call script based on the material number
    Please provide the procedure and  coding.
    Thanks in advance
    Raju

    Hi,
    The following link may be useful to u.
    help.sap.com/printdocu/.../BCSRVOBS.pdf

Maybe you are looking for

  • How to create multiple pages within one navbar entry

    I'm trying to revamp my site to include specific information and files for the classes I teach at the university. What I'd like to do is to have one entry on the navbar entitled "University Classes" or some such, and have it lead to a page where I ca

  • G/L Account Issue

    Dear Expert, In VKOA  account determination i assigned G/L account to respective char of acoounts..etc. when i am creating billing G/L acouunt showing differnet. there is any other place where we can assigne G/L Account instead of VKOA. Regards Ajit

  • Count distinct values in report builder

    i have a situation where i have to count distinct number of customers. i have a query which returns the list of values of bill_to_customer_id from ra_customer_trx_all table and i have to display only the number of distinct customers. i cant do this i

  • What is the best way to deploy a cert office wide

    We need to find a way to deploy a cert to 400 systems. What would be the best way to go about this please and thanks

  • Detail Button in Web Dynpro ALV

    Hi at all, when I create an ALV in Standard ABAP there is a small "Detail" button on the left side of the button row without any additional complex programming. How can I get this button in Web Dynpro ALV? Dirk