Error when emailing XML document

Hi there
I am trying to email an XML document to an external vendor by using the CL_DOCUMENT_BCS class.  The email is sent successfully and I receive it in the relevant mailbox.  To make it an XML document, I move 'XML' to the I_TYPE parameter of the class.  This sends it perfectly as an XML document.
The problem occurs when I receive the email and open the attachment.  When I open the attachment, I get the error "Whitespace is not allowed at this location".  To rectify this problem, I open the XML attachment in notepad, concatenate these lines by deleting the return characters and I save the file and open it again.  It then displays perfectly.
When I send the email as a normal text document and I change the extension manually to 'XML', the XML can be viewed perfectly. 
Can anyone assist in rectifying this so that there is no manual intervention?
Kind Regards
Gustav Coleske

Raja
The code is as follows:
FORM send_data_via_email .
  DATA:   new_object_id LIKE sofolenti1-object_id,
          l_idx         LIKE sy-tabix.
All activities done via facade CL_BCS!
  DATA: send_request              TYPE REF TO cl_bcs.
  DATA: text                      TYPE bcsy_text.
  DATA: document                  TYPE REF TO cl_document_bcs.
  DATA: sender                    TYPE REF TO cl_sapuser_bcs.
  DATA: recipient                 TYPE REF TO if_recipient_bcs.
  DATA: bcs_exception             TYPE REF TO cx_bcs.
  DATA: lt_contents               TYPE TABLE OF soli.
  DATA: lt_contents2              TYPE TABLE OF solix.
  DATA: lv_subject                TYPE sood-objdes VALUE 'Rental Units'.
  DATA: lv_length                 TYPE i.
  DATA: lv_receiver_email_address TYPE adr6-smtp_addr.
  DATA: lv_string                 TYPE string.
Select the record for email address to send to off parameter table
  SELECT SINGLE value FROM zca_partr INTO gs_real_recipients-receiver
    WHERE progid = sy-repid
    AND   id     = 'OUT_EMAIL'.
  APPEND gs_real_recipients TO gt_real_recipients.
  CLEAR gs_real_recipients.
  CLEAR new_object_id.
  gv_items_sent = 'X'.
Send back non-delivery and delivery reports.
  LOOP AT gt_real_recipients INTO gs_real_recipients.
    gs_real_recipients-notif_del  = 'X'.
    gs_real_recipients-notif_ndel = 'X'.
    gs_real_recipients-express    = gv_express.
    MODIFY gt_real_recipients FROM gs_real_recipients.
  ENDLOOP.
  gt_contents[] = gt_xml_out[].
Set the subject of the email
  lv_subject                   = 'Rental Units for rent'.
  gs_packing_list-mail_subject = lv_subject.
  gs_packing_list-doc_type     = 'XML'.
  TRY.
Create persistent send request
      send_request = cl_bcs=>create_persistent( ).
Create and set document
Create document from internal table with lt_content
      lt_contents[] = gt_contents[].
      DESCRIBE TABLE lt_contents[] LINES lv_length.
      gs_packing_list-doc_size = lv_length * 255.
      document = cl_document_bcs=>create_document(
                      i_type     = gs_packing_list-doc_type
                      i_text     = lt_contents
                      i_length   = gs_packing_list-doc_size
                      i_subject  = lv_subject
                      i_language = sy-langu
Set the subject for the sending of mails.
      lv_string = gs_packing_list-mail_subject.
      TRY .
          CALL METHOD send_request->set_message_subject
            EXPORTING
              ip_subject = lv_string.
        CATCH cx_sy_dyn_call_illegal_method .
      ENDTRY.
Add document to send request
      CALL METHOD send_request->set_document( document ).
Do send delivery info for successful mails
      CALL METHOD send_request->set_status_attributes
        EXPORTING
          i_requested_status = 'E'
          i_status_mail      = 'A'.
Set sender
      sender = cl_sapuser_bcs=>create( sy-uname ).
      CALL METHOD send_request->set_sender
        EXPORTING
          i_sender = sender.
Add recipients (e-mail addresses)
      LOOP AT gt_real_recipients INTO gs_real_recipients.
Create recipient
        lv_receiver_email_address = gs_real_recipients-receiver.
        CHECK lv_receiver_email_address IS NOT INITIAL.
        recipient = cl_cam_address_bcs=>create_internet_address(
                                          lv_receiver_email_address ).
Add recipient with its respective attributes to send request
        CALL METHOD send_request->add_recipient
          EXPORTING
            i_recipient  = recipient
            i_express    = 'X'
            i_blind_copy = gs_real_recipients-blind_copy.
      ENDLOOP.
Send document
      CALL METHOD send_request->send(
        EXPORTING
          i_with_error_screen = 'X'
        RECEIVING
          result              = gv_sent_to_all ).
Exception handling
    CATCH cx_bcs INTO bcs_exception.
      WRITE: text-001 , bcs_exception->error_type.
      EXIT.
  ENDTRY.
  COMMIT WORK.
ENDFORM.                    " send_data_via_email
I am not using the add_attachment method as the normal document create automatically creates the attachment.  Would using this method be critical?
Kind Regards
Gustav

Similar Messages

  • Error when email enabling a document library

    Hi - I've checked through other threads re errors when email enabling a doc library, but our scenario is a bit different. We have some custom code that creates sites based on a site template and uses data from a 3rd party system to define the site
    name, permissions etc. I don't think that the process for creating the sites is relevant to the issue, but mentioning that anyway to be complete. As part of the site creation workflow, one of the document libraries is email enabled. However, on one specific
    site, the document library was not email enabled. When I try and do this manually, I get the following error:
    Error in the application.   at
    Microsoft.SharePoint.SPList.UpdateDirectoryManagementService(String oldAlias,
    String newAlias)
       at Microsoft.SharePoint.SPList.Update(Boolean
    bFromMigration)
       at Microsoft.SharePoint.SPList.Update()
       at
    Microsoft.SharePoint.ApplicationPages.EmailSettingsPage.SubmitButton_Click(Object
    sender, EventArgs args)
       at
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       at
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument)
       at
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint)
    Other tests/observations:
    On the problem site, I get the same error when trying to email enable other document libraries
    Other sites on the same site collection have been created using the same process/site template, and the appropriate document library was email enabled automatically (sites created both before and subsequent to this problem site)
    I have successfully managed to manually email enable a document library on an different existing site
    I have manually created a new site using the same site template and successfully managed to manually email enable a document library on that site
    So I am fairly certain that it is nothing to do with permissions as other posts relating to this issue have suggested. Does anyone have any ideas on what is happening, how to resolve or further checks I can make? Many thanks

    Hi qaaweb,
    based on my experience, the issue itself may be caused by some triggers, 
    the permission is one of them only, 
    to narrow down usually, we try to update credential first, that at some environment may less impact.
    example:
    based on: http://technet.microsoft.com/en-us/library/cc262947.aspx, to configure email, if already configured then skip.
    make sure that application pool account that is used for central admin to be the same for central admin, site and the web application.
    make sure SQL server and granted DBCreator , Serveradmin, Setupadmin on service account. 
    remove old database and sync:
    C:\program files\common files\Microsoft shared\web server extensions\12\bin>stsadm -o sync -listolddatabases 0
    C:\program files\common files\Microsoft shared\web server extensions\12\bin>stsadm -o sync -deleteolddatabases 0
    Update farm credentials, http://support.microsoft.com/kb/934838 
    if needed: central administration > Operation > Authentication provider and changed Kerberos to NTLM on central admin site.
    Login service account on the SharePoint server and enable IncomingEmail settings on the web application 
    please let us know if the workaround is not applicable
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Got error message when store XML documents into XML DB repository, via WebD

    Hi experts,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I got error message when store XML documents into XML DB repository, via WebDAV.
    I have successfully registered 5 related schemas and generated 1 table.
    I have inserted 40 .xml files into this auto generated table.
    using these data I created relational view successfully.
    but since I couldn't store XML documents into XML DB repository, via WebDAV
    when I query using below code:
    SELECT rv.res.getClobVal()
    FROM resource_view rv
    WHERE rv.any_path = '/home/DEV/messages/4fe1-865d-da0db9212f34.xml';
    I got nothing.
    My ftp code is listed below:
    ftp> open localhost 2100
    Connected to I0025B368E2F9.
    220- C0025B368E2F9
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 I0025B368E2F9 FTP Server (Oracle XML DB/Oracle Database) ready.
    User (I0025B368E2F9:(none)): fda_xml
    331 pass required for FDA_XML
    Password:
    230 FDA_XML logged in
    ftp> cd /home/DEV/message
    250 CWD Command successful
    ftp> pwd
    257 "/home/DEV/message" is current directory.
    ftp> ls -la
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 .
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 ..
    226 ASCII Transfer Complete
    ftp: 115 bytes received in 0.00Seconds 115000.00Kbytes/sec.
    250 SET_CHARSET Command Successful
    ftp> put C:\ED\SPL\E_Reon_Data\loaded\4fe1-865d-da0db9212f34.xml
    200 PORT Command successful
    150 ASCII Data Connection
    550- Error Response
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [], [], [], [], [], [], [], []
    550 End Error Response
    ftp: 3394 bytes sent in 0.00Seconds 3394000.00Kbytes/sec.
    I have tried all suggestion from another thread such as:
    alter system set events ='31150 trace name context forever, level 0x4000'
    SQL> alter system set shared_servers = 1;
    but failed.
    is there anyone can help?
    Thanks.
    Edited by: Cow on Mar 29, 2011 12:58 AM

    Hi experts,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I got error message when store XML documents into XML DB repository, via WebDAV.
    I have successfully registered 5 related schemas and generated 1 table.
    I have inserted 40 .xml files into this auto generated table.
    using these data I created relational view successfully.
    but since I couldn't store XML documents into XML DB repository, via WebDAV
    when I query using below code:
    SELECT rv.res.getClobVal()
    FROM resource_view rv
    WHERE rv.any_path = '/home/DEV/messages/4fe1-865d-da0db9212f34.xml';
    I got nothing.
    My ftp code is listed below:
    ftp> open localhost 2100
    Connected to I0025B368E2F9.
    220- C0025B368E2F9
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 I0025B368E2F9 FTP Server (Oracle XML DB/Oracle Database) ready.
    User (I0025B368E2F9:(none)): fda_xml
    331 pass required for FDA_XML
    Password:
    230 FDA_XML logged in
    ftp> cd /home/DEV/message
    250 CWD Command successful
    ftp> pwd
    257 "/home/DEV/message" is current directory.
    ftp> ls -la
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 .
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 ..
    226 ASCII Transfer Complete
    ftp: 115 bytes received in 0.00Seconds 115000.00Kbytes/sec.
    250 SET_CHARSET Command Successful
    ftp> put C:\ED\SPL\E_Reon_Data\loaded\4fe1-865d-da0db9212f34.xml
    200 PORT Command successful
    150 ASCII Data Connection
    550- Error Response
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [], [], [], [], [], [], [], []
    550 End Error Response
    ftp: 3394 bytes sent in 0.00Seconds 3394000.00Kbytes/sec.
    I have tried all suggestion from another thread such as:
    alter system set events ='31150 trace name context forever, level 0x4000'
    SQL> alter system set shared_servers = 1;
    but failed.
    is there anyone can help?
    Thanks.
    Edited by: Cow on Mar 29, 2011 12:58 AM

  • Heap space error while creating XML document from Resultset

    I am getting Heap space error while creating XML document from Resultset.
    It was working fine from small result set object but when the size of resultset was more than 25,000, heap space error
    I am already using -Xms32m -Xmx1024m
    Is there a way to directly write to xml file from resultset instead of creating the whole document first and then writing it to file? Code examples please?
    here is my code:
    stmt = conn.prepareStatement(sql);
    result = stmt.executeQuery();
    result.setFetchSize(999);
    Document doc = JDBCUtil.toDocument(result, Application.BANK_ID, interfaceType, Application.VERSION);
    JDBCUtil.write(doc, fileName);
    public static Document toDocument(ResultSet rs, String bankId, String interfaceFileType, String version)
        throws ParserConfigurationException, SQLException {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element results = doc.createElement("sims");
            results.setAttribute("bank", bankId);
            results.setAttribute("record_type", "HEADER");
            results.setAttribute("file_type", interfaceFileType);
            results.setAttribute("version", version);
            doc.appendChild(results);
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            String columnName="";
            Object value;
            while (rs.next()) {
                Element row = doc.createElement("rec");
                results.appendChild(row);
                for (int i = 1; i <= colCount; i++) {
                    columnName = rsmd.getColumnLabel(i);
                    value = rs.getObject(i);
                    Element node = doc.createElement(columnName);
                    if(value != null)
                        node.appendChild(doc.createTextNode(value.toString()));
                    else
                        node.appendChild(doc.createTextNode(""));
                    row.appendChild(node);
            return doc;
    public static void write(Document document, String filename) {
            //long start = System.currentTimeMillis();
            // lets write to a file
            OutputFormat format = new OutputFormat(document); // Serialize DOM
            format.setIndent(2);
            format.setLineSeparator(System.getProperty("line.separator"));
            format.setLineWidth(80);
            try {
                FileWriter writer = new FileWriter(filename);
                BufferedWriter buf = new BufferedWriter(writer);
                XMLSerializer FileSerial = new XMLSerializer(writer, format);
                FileSerial.asDOMSerializer(); // As a DOM Serializer
                FileSerial.serialize(document);
                writer.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            //long end = System.currentTimeMillis();
            //System.err.println("W3C File write time :" + (end - start) + "  " + filename);
        }

    you can increase your heap size..... try setting this as your environment variable.....
    variable: JAVA_OPTS
    value: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

  • I'm getting an error message "There was an error when opening this document. Access denied" on some PDF's that I was able to open in past. Uninstalled XI and installed X but same problem. Any thoughts?

    I'm getting an error message "There was an error when opening this document. Access denied" on some PDF's that I was able to open in past. Uninstalled XI and installed X but same problem. How can I access these files?

    I have exactly the same problem. The interesting thing is that the file opens when I attach it to an email and open it out of the email. I already saw the advice you provided in  similar post from Aug last year and checked the security settings of the file and the folder. But according to that I have all rights.
    My OS is Windows 7 Enterprise.

  • I am getting error when hovering on document in sharepoint online "sorry there was a problem and we can't open this document.If this happens again, try opening the document in Microsoft Word"

     I am getting error when hovering on document in sharepoint online "sorry there was a problem and we can't open this document.If this happens again, try opening the document in Microsoft Word".I am sure that document is not corrupted and
    all. something it showing the preview and sometimes it throwing this error. I hope this error is intermident. When clicking on the link also it throws this error but on refreshing it working fine. I dont know why it is happening. Please helpme  to resolve
    this issue. 

    Hi Waqas
    Thanks for your help with this. I had a look at both posts, the URL works fine from the WAC server and I am not using a System account to test docs.
    Also, this is a production site that is accessible over the Internet, so we are using https therefore the WOPIZone is external-https.
    Issue #3 in the above blog link does not reflect the same error I see on my servers.
    I also had a look at the information in this link: http://technet.microsoft.com/en-us/library/ff431687.aspx#oauth
    Problem: You receive a "Sorry, there was a problem and we can't open this document" error when you try to view an Office document in Office Web Apps.
    If you added domains to the Allow List by using the
    New-OfficeWebAppsHost cmdlet, make sure you’re accessing Office Web Apps from a host domain that’s in the Allow List. To view the host domains in the Allow List, on the Office Web Apps Server open the Windows PowerShell prompt as an administrator and run
    the Get-OfficeWebAppsHost cmdlet. To add a domain to the Allow List, use the
    New-OfficeWebAppsHost cmdlet.
    I have not added any domains to the Allow list so this did not help either. Should I add the domain?
    Any further help with this is much appreciated.
    Thanks again.
    Yoshi

  • Soap response Error when processing XML CF.

    Hello,
    I have problems with soap response and wondered if you could give some advice.
    Every time I send my message via soap I get the following error:
    com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Error when processing XML CF.
    Is it possible that the communication is aborted and  my response message mapping is never started?
    (Additional info: I tried to create an integration process and am not able to evaluate the response.)
    Thanks a lot for your help.
    Regards,
    Julia

    hi,
    do you see any more error details in :
    http://xiserver:port/MessagingSystem/monitor
    did you check logs in visual admin ?
    >>>>Is it possible that the communication is aborted and my response message mapping is never started?
    yes - if the response is not ok the mapping may not be started
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Error while getting xml document  with default connection in 8iJServer

    I had used GZIP utility to zip and store the document in
    the CLOB. If i use thin drivers and GZIP to retieve this document it works fine.
    instead of thin drivers if i use oracle8iJserver defalut
    connection i get the follwing error
    :Error while getting xml document Not in GZIP format.
    your response is appreciated.
    thanks
    sanjay.

    Hi Yepin Jin,
    I am facing the same issue did you solved it?
    Regards,
    Orlando Covault

  • Error when  importing xml data

    I am getting the following error when loading xml datafile to my Oracle XE database table. This data I exported from htmldb.oracle.com.
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00222: error received from SAX callback function
    please help
    George

    George,
    I expect that this is simply an incompatibility with the date format that was used for XML Import/Export as part of XE Beta. This is a bug that has been fixed for XE production and you will be able to freely export from HTML DB 2.0 and import into XE and vice versa.
    Your NLS settings do not control this. The date format used for XML Export is fixed - a canonical date format is always used.
    If you want to be able to import into XE Beta, your date fields probably look like:
    <HIREDATE>2005-12-03T00:00:00.000</HIREDATE>Just remove the trailing .000 from your date entries.
    <HIREDATE>2005-12-03T00:00:00</HIREDATE>
    Note: This will only be necessary for XE Beta. You should not have to do this for XE Production.
    Joel

  • Error when open fdf document from Safari

    Reproduced on
    * Adobe reader 9.1.0
    * Acrobat Pro 8.1.3
    NOT reproduced with Acrobat Pro 8.0.0( withou updates )
    have simple fdf document for example in root of disk c:
    =============
    %FDF-1.2
    1 0 obj
    <<
    /FDF
    <<
    /F (1.pdf)
    /JavaScript
    <<
    /After 2 0 R
    >>
    >>
    >>
    endobj
    2 0 obj
    <<
    >>
    stream
    endstream
    endobj
    trailer
    <<
    /Root 1 0 R
    >>
    %%EOF
    ================
    when open it with IE or FF, al works fine. but when try to open in safari  messagebox shown
    "There was an error when open this document. This file cannot be found."

    minified version of not worked fdf
    %FDF-1.2
    1 0 obj
    <<
    /FDF <</F (pdf.pdf) >>
    >>
    endobj
    trailer
    <<
    /Root 1 0 R
    >>
    %%EOF

  • Error when sending a document link via email

    Hi people,
    I am on SAP EP 6.0 SP15 and below I describe my scenario.
    I have some documents created in some KM folders. Today, I tried to send one of those documents via email to another portal user. If I go through Send To > Send Copy..., that other portal user receives the email with the document attached and he is able to open it... so far so good.
    However, if i try to send the same document but now using a link (Send To > Send Link...), the other guy receives the email, but the link results in a 404 error when clicked.
    I investigated a little and found that the link sent contains "" signals to indicate spaces in the folder names, instead of "%20". I believe this is the issue, because if I change manually the "" signals to "%20", the link works perfectly.
    My question is: is there a way to configure the sistem to use "%20" instead of "+" to represent spaces? Or I will have to remove the spaces from ALL my folder names?
    Thanks
    Fernando Urzedo

    Hi Fernando,
    this seems to be a bug. In the release notes of KMC SPS16 incl. P1, this is not reported as fixed (on the other hand, not every fixed bug gets reported in the release notes).
    You could try to patch your portal first; if you don't can do this at the moment or if the bug persists after patching, please open an OSS message.
    Hope it helps
    Detlev

  • Error while building xml document

    Hi Everyone,
    I have a problem while building xml document.
    I have developed my java files using IBM Eclipse 3.0 and i had no problem while executing the files.
    But while i am trying to execute the same code in jdk/bin, xml document is not working..
    No error encountered while compiling but while executing when i try to print the xml string it just gives the root element name like [root : null]
    Can anyone suggest some solution?

    To the values element add xmlns:xsi and xsi:noNamespaceSchemaLocation.
    <values xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:noNamespaceSchemaLocation="file:///c:/schema.xsd">schema.xsd is schema file.

  • Error when uploading a document to SharePoint

    When uploading a file into a document library using the copy service CopyIntoItems method, I get a "There is an error in XML document (6, 3763)" (numbers variable) when the file has illegal characters in the comments of the file properties.
    e.g., "ø;". Removing the comments from the file properties fixes the problem.
    I don't need the comments to get uploaded, so how do I copy the file and ignore the comments?

    Hello,
    I think you can't ignore file properties but you can clean them. Use FileInfo class to extract file properties then remove special char. You also need to make sure that there is no special char in file name as well.
    Refer this link:
    http://charlesemes.blogspot.sg/2011/08/moving-crm-attachments-to-sharepoint.html
    http://sharepoint.stackexchange.com/questions/34953/uploading-files-to-sharepoint-containing-the-ampersand-character
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Very urgent help needed- Error while passing XML document to Oracle stored

    Hi !
    I have been struggling a lot to call Oracle 9i stored procedure passing Stringbuilder object type from ASP.NET
    I am using Visual Studio 2008 Professional, OS: Windows XP and Oracle: 9.2.0.1.0
    Following is the procedure:
    CREATE or REPLACE PROCEDURE loadCompanyInfo (clobxml IN clob) IS
    -- Declare a CLOB variable
    ciXML clob;
    BEGIN
    -- Store the Purchase Order XML in the CLOB variable
    ciXML := clobxml;
    -- Insert the Purchase Order XML into an XMLType column
    INSERT INTO companyinfotbl (companyinfo) VALUES (XMLTYPE(ciXML));
    commit;
    --Handle the exceptions
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20101, 'Exception occurred in loadCompanyInfo procedure :'||SQLERRM);
    END loadCompanyInfo ;
    And following is the ASP.net code:
    StringBuilder b = new StringBuilder();
    b.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
    b.Append("<item>");
    b.Append("<price>500</price>");
    b.Append("<description>some item</description>");
    b.Append("<quantity>5</quantity>");
    b.Append("</item>");
    //Here you'll have the Xml as a string
    string myXmlString1 = b.ToString();
    //string result;
    using (OracleConnection objConn = new OracleConnection("Data Source=testdb; User ID=testuser; Password=pwd1"))
    OracleCommand objCmd = new OracleCommand();
    objCmd.Connection = objConn;
    objCmd.CommandText = "loadCompanyInfo";
    objCmd.CommandType = CommandType.StoredProcedure;
    //OracleParameter pmyXmlString1 = new OracleParameter("pmyXmlString1", new OracleString(myXmlString1));
    objCmd.Parameters.Add("myXmlString1", OracleType.clob);
    objCmd.Parameters.Add(myXmlString1).Direction = ParameterDirection.Input;
    //objCmd.Parameters.Add("result", OracleType.VarChar).Direction = ParameterDirection.Output;
    try
    objConn.Open();
    objCmd.ExecuteNonQuery();
    catch (Exception ex)
    Label1.Text = "Exception: {0}" + ex.ToString();
    objConn.Close();
    When I am trying to execute it, I am getting the following error:
    Exception: {0}System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'LOADCOMPANYINFO' ORA-06550: line 1, column 7: PL/SQL: Statement ignored at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) at System.Data.OracleClient.OracleCommand.ExecuteNonQuery() at Default.Button1Click(Object sender, EventArgs e)
    I understand from this that the .net type is not the correct one, but I am not sure how to correct it. I could not find any proper example in any documentation that I came across. Most of the examples give information on how to read but not how to insert XML into Oracle table by calling Stored Procedure.
    Can you please help me to solve this problem? I hope that you can help solve this.
    Also, can you please give me an example of passing XML document XMLdocument to Oracle Stored procedure.
    In both the cases, if you can provide the working code then it would be of great help.
    Thanks,

    Hi ,
    Additional to the Above error details my BPEL code looks like this:
    <process name="BPELProcess1"
    targetNamespace="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:client="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <partnerLinks>
    <partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>
    </partnerLinks>
    <variables>
    <variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>
    <variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>
    </variables>
    <sequence name="main">
    <receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>
    <invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>
    </sequence>
    </process>
    Kindly help if anyone has faced this Issue before.
    Regards,
    Rakshitha

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

Maybe you are looking for

  • Questions on LOV

    I have two questions on LOV. 1. How to sort the elements in an LOV? I could not find any property in Designer to specify the order. 2. How do I prepopulate the "Find" field of an LOV programmatically? Please help!

  • Resetting this reverse document is not possible - FBRA

    Hi, I'm trying to reset the cleared items with Tcode FBRA also system is throwing error like below ================================================================================================== Resetting this reverse document is not possible Mess

  • Web sites won't recognize photos added to iPhoto since migrating data

    So, I'm stymied. I haven't seen a solution or question already asked that is precisely like my problem, so I thought I'd just ask it myself. A couple months ago, I did something to bork up the permissions in Lion - if I could be more specific I would

  • TS3297 please contact iTunes support to complete transaction, iPad 3

    I've got money in my account from an iTunes card that I redeemed but it keeps coming up please contact iTunes support to complete the transaction, can any1 help me with this

  • How to use Photoshop CS6

    Hi Peeps, I have been using Photoshop Elements 4.0 but now I have to switch to Photoshop CS6 as there are some printing issues with Elements 4.0. I would like to seek for your kind advices how to use Photoshop CS6 as I can't seems to find the answer