CF MX inserting xmlns:xsi into my WSDL

CF MX is over-riding my WSDL definitions.  Where I have:
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://developer.intuit.com/">
<s:element name="serverVersion">
</s:element>
        <s:element name="serverVersionResponse">
        <s:complexType>
            <s:sequence>
                <s:element minOccurs="1" maxOccurs="1" name="serverVersionResult" type="s:string" />
              </s:sequence>
        </s:complexType>
</s:element>
The Service Call results in:
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
  <ns1:serverVersionResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://qbwc.opensource">
   <serverVersionReturn xsi:type="xsd:string">Testing</serverVersionReturn>
  </ns1:serverVersionResponse>
</soapenv:Body>
</soapenv:Envelope>
What is going on???

Hi Again
I have more info on the issue...
I tried to reach the the webservice from OAS/HTTP with mod_plsql directly. At first I was not able to.
A firewall request was completed and now I am sure the http server can reach the webservice in question.
Unfortunatley creating a webservice either manually or through a wsdl is still not working! Please Help , what else can I check.
Also
I'm confused ..taken from APEX 4.0 online documenation
SOAP offers two primary advantages:
SOAP is based on XML, and therefore easy to use.
SOAP messages are not blocked by firewalls because this protocol uses simple transport protocols, such as HTTP.
I can't see why it would be a firewall issue based on the statement above.
Thanks Again
Moe
-- just added to my post. Issue still unresolved
I'vw been trying to troubleshoot it myself.
From my database server -
I'm not able to use utl_http - example
set serveroutput on
DECLARE
req utl_http.req;
resp utl_http.resp;
value VARCHAR2(32000);
BEGIN
req := utl_http.begin_request('http://www.psoug.org');
resp := utl_http.get_response(req);
value := utl_http.request('http://www.psoug.org/');
dbms_output.put_line(value);
utl_http.end_response(resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
END;
error received is
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-12535: TNS:operation timed out
ORA-06512: at line 6
Using ping
ping www.psoug.orgPING 66.221.222.85: 64 byte packets
----66.221.222.85 PING Statistics----
16 packets transmitted, 0 packets received, 100% packet loss
However I'm confused if I'm using Oracle Application Server 10g Release 3 (10.1.3.1)/Apache
Should I need to modify the firewall on the database side to access a webservice? Does it need to be port 80?
Getting frustrated by my ignorance
Thanks
Moe
Edited by: user570478 on Jul 28, 2011 2:23 PM

Similar Messages

  • How to include validation attribute (xmlns:xsi) into the resulting XML ?

    Hi,
    I'm having a problem including the validation schema attribute (xmlns:xsi) into the resulting XML.
    For example, if I have the following schema:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xs:element name="A" />
    </xs:schema>
    And I use the following code to get the XML:
    XmlOptions ops = new XmlOptions();
    ADocument ad = ADocument.Factory.newInstance();
    ADocument.A a = ad.addNewSubscriptionNotification();
    System.out.println(ad.xmlText(ops));
    I will get something like:
    <A />
    I'd like to have:
    <A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://a.com/a.xsd"/>
    How do I make this happen? Some xmlOptions, different kind of schema...?

    Use
                 <fx:resources>
                    <fx:fileset dir="${basedir}/${dist.dir}" includes="*.jar"/>
                    <fx:fileset dir="${basedir}/${dist.dir}" includes="lib/*.jar"/>
                </fx:resources>or simply
          <fx:fileset dir="${basedir}/${dist.dir}" includes="**/*.jar"/>Filed http://javafx-jira.kenai.com/browse/RT-24757 to update the docs.
    Edited by: igor on Sep 5, 2012 2:23 PM

  • OSB how to avoid insertion of xmlns:xsi="xsi" in balise

    Hi,
    We have web services with saml tag.
    When proxy service process the datas, the SAML assertion have been modified with en added namespace : xmlns:xsi="xsi" or xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    Does it possible to avoid that OSB add this namespace when it process data?
    thanks in advance,

    1) Convert the xml to string
    let $strContent := fn-bea:serialize($body)
    2) Replace the ref: with ns1:
    return fn-bea:inlinedXML(fn:replace( $strContent, "ref:", "ns1:") )
    This is a temporary solution but should solve your issue if XML is not huge (huge XML will consume lot of cpu for this transformation ) .Ideally I would recommend changing the behavior of the message consumer.
    Re: Namespace replace/rename issue in ALSB
    http://forums.oracle.com/forums/thread.jspa?messageID=4018989�
    Namespace declarations
    Manoj
    Edited by: Manoj Neelapu on Apr 13, 2010 2:52 PM

  • Insert XML data into a diferents fiels in a TABLE.

    We have an xml to import in to a table with XMLType of fields.
    The xml file has on field that the content of that field is a full xml file.
    Example.
    <BD>
    <J>
    <T> 1212 </T>
    </J>
    <BDI>
    <INFO><?xml version="1.0" encoding="UTF-8"?> <BuriedDropTask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="buriedDropSchema.xsd"> <TaskName>UTFS277779</TaskName>.......
    <PhoneNumber>303303033</PhoneNumber>......
    </INFO>
    </BDI>
    </BD>
    This is just an idea and not the actual document.
    We need to insert in a table the data from <J> </J> and some fields of the ineer document like <BuriedDropTask> </BuriedDropTask> to other field in the same table to process the data.
    What is the rigth process to follow?
    The previus programmer was using utl_http.request_pieces to read the xml from an url and acummulated in a varchar2 variable. But the process is not working.
    Thank you for your help in advance.
    Jose Galan

    The XML file with <?xml?> somewhere inside the tags is not valid.
    I think, at first stage the unneeded garbage should be striped of with replace/instr/whatever.
    Then extract() functions should be applied to bulk process the XML.
        insert into tasks (id, t, task_name)
        select tasks_seq.nextval
               t,
               task_name
          from (
            select extractvalue(xml, '//J/T') t,
                   extractvalue(xml, '//BDI/INFO/TaskName') task_name
              from (
                  select extract(xml, '/BD') xml from xml_table
          )

  • Error in inserting Japanese charcters into XMLDB -[b]Urgent[/b]

    Hi,
    I have set database charcterset as 'UTF-8' and I saved the xml file in server with 'UTF-8' encoding, the inerstion works for english, but if I inlucde japanese charcters I get the following error (please find below), we use Oracle 9i for developement.Since this is very urgent and critical,kindly help us, we are thankful for the earlier responses got for our diferent queries.
    This is XML Schema we registered.
    XML SCHEMA:
    ==========
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema id="Dp_Pref_mst" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="PrefMaster">
    <xs:complexType>
    <xs:choice maxOccurs="unbounded">
    <xs:element name="StateDetails">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Pref_code" type="xs:string" minOccurs="0" />
    <xs:element name="Pref_desc" type="xs:string" minOccurs="0" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    Schema registration:
    ===================
    begin
    dbms_xmlschema.registerSchema( 'sample.xsd', getFileContent('sample.xsd','DP','UTF8'));
    end;
    Table creation :
    ===============
    Create table states of XMLType XMLSCHEMA "sample.xsd" ELEMENT "PrefMaster";
    This is XML we try to insert
    XML :
    ====
    <?xml version="1.0" encoding="UTF-8"?>
    <PrefMaster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sample.xsd">
    <StateDetails>
    <Pref_code>1</Pref_code>
    <Pref_desc>小川鐵工所</Pref_desc>
    </StateDetails>
    <StateDetails>
    <Pref_code>2</Pref_code>
    <Pref_desc>Honshu</Pref_desc>
    </StateDetails>
    <StateDetails>
    <Pref_code>3</Pref_code>
    <Pref_desc>Nagasaki</Pref_desc>
    </StateDetails>
    <StateDetails>
    <Pref_code>4</Pref_code>
    <Pref_desc>Osaka</Pref_desc>
    </StateDetails>
    </PrefMaster>
    CREATE OR REPLACE FUNCTION getFileContent(filename varchar2,directoryName varchar2 default USER,
    charset varchar2 default 'AL32UTF8')
    return CLOB
    is
    fileContent CLOB := NULL;
    file bfile := bfilename(directoryName,filename);
    dest_offset number := 1;
    src_offset number := 1;
    lang_context number := 0;
    conv_warning number := 0;
    begin
    DBMS_LOB.createTemporary(fileContent,true,DBMS_LOB.SESSION);
    DBMS_LOB.fileopen(file, DBMS_LOB.file_readonly);
    DBMS_LOB.loadClobfromFile
    fileContent,
    file,
    DBMS_LOB.getLength(file),
    dest_offset,
    src_offset,
    nls_charset_id(charset),
    lang_context,
    conv_warning
    DBMS_LOB.fileclose(file);
    return fileContent;
    end;
    our insert statement
    ====================
    Insert into states values (XMLType(getFileContent('sample.xml','DP','UTF8')));
    The error we are getting
    =======================
    Error
    =====
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '¿'
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    Any help in resolving this would be highly appriciated.
    Thank you
    Kathiresan.

    COMMIT is an SQL command and I don't think it will have any effect on you dataset. I think this should work:
    FORM f_write_aufk.
      CLEAR: gv_error, gv_reccnt, gv_t_amt, gv_t_qty,
      gv_t_docs, gv_previous_rec_id, gv_passcnt.
    *--------Open in compress mode ----------------------------------------*
      DATA: gc_commit dafault '1000'.
      OPEN DATASET lv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT FILTER
              'compress'.
      IF sy-subrc = 0.
        SELECT aufnr auart autyp ernam aenam aedat ktext
        FROM aufk INTO gs_aufk
        WHERE aufnr IN s_aufnr.
          PERFORM f_transfer_dataset
            USING p_f_aufk gs_aufk CHANGING gv_error.
        ENDSELECT.
        PERFORM f_closedataset USING p_f_aufk CHANGING gv_error.
      ENDIF.
    ENDFORM.                    "F_WRITE_AUFK
    Rob

  • Insert XML String into XML file at a certain position

    Hello,
    I have this xml string:
    <jdbc-driver-params>
    <url>jdbc:oracle:thin:@localhost:1521:mydb</url>
    <driver-name>oracle.jdbc.OracleDriver</driver-name>
    <properties>
    <property>
    <name>user</name>
    <value>myuser</value>
    </property>
    </properties>
    <password-encrypted>myuser</password-encrypted>
    </jdbc-driver-params>and i need to insert it into an xml file at a certain position (as child for a node)
    The xml file looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90"
        xmlns:sec="http://www.bea.com/ns/weblogic/90/security"
        xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
        <name>myDB</name>
        <jdbc-data-source-params>
            <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
        </jdbc-data-source-params>
    </jdbc-data-source>And this is how I would like to get it in the end:
    <?xml version='1.0' encoding='UTF-8'?>
    <jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
      <name>mydb</name>
      <jdbc-driver-params>
        <url>jdbc:oracle:thin:@localhost:1521:myDB</url>
        <driver-name>oracle.jdbc.OracleDriver</driver-name>
        <properties>
          <property>
            <name>user</name>
            <value>myuser</value>
          </property>
        </properties>
        <password-encrypted>myuser</password-encrypted>
      </jdbc-driver-params>
      <jdbc-connection-pool-params>
        <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
      </jdbc-connection-pool-params>
      <jdbc-data-source-params>
        <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
      </jdbc-data-source-params>
    </jdbc-data-source>So, I obtain the node for the given xml string, the jdbc-data-source node from the xml file and i attempt the appendChild. The problem is that nothing really gets inserted into the xml file.
    Someone, any idea?
    My code:
    try
                   DOMParser parser = new DOMParser();
                   parser.parse(xmlFileName);
                   Document doc = parser.getDocument(); // the document we will insert node into
                   Node root = doc.getElementsByTagName("jdbc-data-source").item(0);
                   //get XML string node
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = factory.newDocumentBuilder();
                   InputSource inStream = new InputSource();
                   inStream.setCharacterStream(new StringReader(xmlString));
                   Document doc4XMLString = db.parse(inStream);
                   Node rootXMLString = doc4XMLString.getElementsByTagName("jdbc-driver-params").item(0);
                   root.appendChild(doc.importNode(rootXMLString, true));
                   return true;
              catch (Exception e)
                   e.printStackTrace();
              }Thanks,
    johnny
    Edited by: smeag0l on Aug 6, 2008 5:08 PM
    Edited by: smeag0l on Aug 6, 2008 5:43 PM

    Well, you helped me again :-) Thank you very much!
    Here is how the code should look:
                            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db4XMLFile = factory.newDocumentBuilder();
                   Document doc4XMLFile = db4XMLFile.parse(xmlFileName);
                   Node root4XMLFile = doc4XMLFile.getElementsByTagName(rootNodeName).item(0);
                   DocumentBuilder db4XMLString = factory.newDocumentBuilder();
                   InputSource inStream = new InputSource();
                   inStream.setCharacterStream(new StringReader(xmlString));
                   Document doc4XMLString = db4XMLString.parse(inStream);
                   Node root4XMLString = doc4XMLString.getElementsByTagName(xmlStringNodeName).item(0);
                   root4XMLFile.appendChild(doc4XMLFile.importNode(root4XMLString, true));
                   File file = new File(xmlFileName);
                            Result result = new StreamResult(file.toURI().getPath());
                   Source source = new DOMSource(doc4XMLFile);
                   Transformer xformer = TransformerFactory.newInstance().newTransformer();
                      xformer.transform(source, result);

  • Custom PL/SQL API that inserts the data into a custom interface table.

    We are developing a custom Web ADI integrator for importing suppliers into Oracle.
    The Web ADI interface is a custom PL/SQL API that inserts the data into a custom interface table. We have defined the content, uploader and an importer. The importer is again a custom PL/SQL API that will process the records inserted into the custom table and updates the STATUS column of the custom interface table. We want to show the status column back on the spreadsheet.
    Defined the 'Document Row' import rule and added the rows that would identify the unique record.
    Errored row import rule, we are using a SELECT * from custom_table where status<>'Success' and vendor_name=$param$.vendor_name
    The source of this parameter is import.vendor_name
    We have also defined an Error lookup.
    After the above setup is completed, we invoke the create document and click on Oracle->Upload.
    The records are getting imported, but the importer program is failing with An error has occurred while running an API import. The ERRORED_ROWS step 20003:ER_500141, parameter number 1 must contain the value BIND in attribute 1.'

    The same issue.
    Need help.
    Also checked bne.log, no additional information.
    <bne:document xmlns:bne="http://www.oracle.com/bne">
    <bne:message bne:type="DATA" bne:text="BNE_VALID_ROW_COUNT" bne:value="11" />
    <bne:message bne:type="DATA" bne:text="BNE_INVALID_ROW_COUNT" bne:value="0" />
    <bne:message bne:type="ERROR" bne:text="An error has occurred while running an API import"
    bne:cause="The ERRORED_ROWS step 20003:ER_500165, parameter number 1 must contain the value BIND in attribute 1."
    bne:action="" bne:source="BneAPIImporter" >
    <bne:context bne:collection="collection_1" />
    </bne:message><bne:message bne:type="STATUS"
    bne:text="No rows uploaded" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message>
    <bne:message bne:type="STATUS" bne:text="0 rows were invalid" bne:value="" >
    <bne:context bne:collection="collection_1" /></bne:message></bne:document>

  • Steps to insert xml data into oracle

    Please give me next steps to insert xml data into oracle 9i:
    i've been doing this steps :
    1. create folder in oracle port:8080
    2. copy xsd into folder
    3. register schema
    4. Give me next step...
    5.
    6.
    Thanks

    this is my complete xmlschema
    <?xml version = "1.0" encoding = "UTF-8"?>
    <xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
         <xs:element name = "A3A8Vers" type = "xs:string"/>
         <xs:element name = "F1F5Vers" type = "xs:string">
         </xs:element>
         <xs:element name = "sequence" type = "xs:string">
         </xs:element>
         <xs:element name = "amf" type = "xs:string">
         </xs:element>
         <xs:element name = "trnsKeyNumber" type = "xs:string">
         </xs:element>
         <xs:element name = "mac" type = "xs:string">
         </xs:element>
         <xs:element name = "encryptionKey" type = "xs:string">
         </xs:element>
         <xs:element name = "signature" type = "xs:string">
         </xs:element>
         <xs:element name = "signer">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref = "entityNumber"/>
                        <xs:element ref = "keyNumber"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name = "entityNumber" type = "xs:string">
         </xs:element>
         <xs:element name = "keyNumber" type = "xs:string">
         </xs:element>
         <xs:element name = "pblKey">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref = "entityNumber"/>
                        <xs:element ref = "entityRole"/>
                        <xs:element ref = "keyNumber"/>
                        <xs:element ref = "publicKeyVal"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name = "ntrTime" type = "xs:string">
         </xs:element>
         <xs:element name = "deActionTime" type = "xs:string">
         </xs:element>
         <xs:element name = "actionTime" type = "xs:string">
         </xs:element>
         <xs:element name = "entityRole">
              <xs:complexType>
                   <xs:attribute name = "role" default = "INVALID">
                        <xs:simpleType>
                             <xs:restriction base = "xs:NMTOKEN">
                                  <xs:enumeration value = "TKD"/>
                                  <xs:enumeration value = "SKD"/>
                                  <xs:enumeration value = "INVALID"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:attribute>
              </xs:complexType>
         </xs:element>
         <xs:element name = "publicKeyVal">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref = "exponent"/>
                        <xs:element ref = "mod"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name = "exponent" type = "xs:string">
         </xs:element>
         <xs:element name = "mod" type = "xs:string">
         </xs:element>
         <xs:element name = "encriptionTransKey" type = "xs:string">
         </xs:element>
         <xs:element name = "keyType" type = "xs:string">
         </xs:element>
    </xs:schema>.
    I use command to create table :
    create table elements of xmltype
    xmlschema "http://192.168.1.1:8080/test.xsd"
    element "publicKey"
    . But why the result,table as object type. so i cant use command "desc <table_name>;"

  • Script to insert file name into keywords field of same file

    Hello,
    search a solution, a Script or another, which writes the file name into keywords field of same file (Metadata: Description/Keywords) in "photoshop", "bridge" or better in "Lightroom" .
    I found this topic from Mike Hale http://www.ps-scripts.com/bb/viewtopic.php?t=1330
    It's possible this script to change this in such a way that it does this:
    "script to insert file name into keywords field of same file"
    Thanks and best greetings
    Wolfgang

    This works in CS2:-
    #target bridge
       if( BridgeTalk.appName == "bridge" ) {
    nameDescription = MenuElement.create("command", "AddName to Description", "at the beginning of Thumbnail");
    nameDescription .onSelect = function () {
         nameToDescription();
    function nameToDescription(){
    var items = app.document.selections;
          for (var i = 0; i < items.length; ++i) {
             var item = items[i];   
    var m = item.synchronousMetadata;
    filenameToDesc(m, item.name.slice(0,-4));
    function filenameToDesc(metadata, Description) {
    var strTmpl = "name2Desc";
    var strUser = Folder.userData.absoluteURI;
    var filTmpl = new File(strUser + "/Adobe/XMP/Metadata Templates/" + strTmpl + ".xmp");
    var fResult = false;
    try
    { if (filTmpl.exists)
    filTmpl.remove();
    fResult = filTmpl.open("w");
    if (fResult) {
    filTmpl.writeln("<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"3.1.2-113\">");
    filTmpl.writeln(" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">");
    filTmpl.writeln(" <rdf:Description rdf:about=\"\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">");
    filTmpl.writeln("<dc:description>");
    filTmpl.writeln("<rdf:Alt>");
    filTmpl.writeln("<rdf:li xml:lang=\"x-default\">"+Description+"</rdf:li>");
    filTmpl.writeln("</rdf:Alt>");
    filTmpl.writeln("</dc:description>");
    filTmpl.writeln(" </rdf:Description>");
    filTmpl.writeln(" </rdf:RDF>");
    filTmpl.writeln("</x:xmpmeta>");
    fResult = filTmpl.close();
    metadata.applyMetadataTemplate(strTmpl, "replace");
    filTmpl.remove();
    catch(e)
    { fResult = false; }
    return fResult;

  • Insert a Picture into the Picture/Image Content Control using Open XML SDK 2.0

    I have created a word template as follows
    Here PizzaPicture is a Picture Content Control, PizzaName is a Plain Text Content Control and PizzaDescription is a Rich Text Content Control
    I am able to assign text to PizzaName and PizzaDescription Easily but not able to even locate the PizzaPicture. Here is my code
    using (WordprocessingDocument document = WordprocessingDocument.Open(@".\test.docx", true)) {
    MainDocumentPart mainPart = document.MainDocumentPart;
    DocumentFormat.OpenXml.Wordprocessing.Text text = null;
    SdtContentBlock pizzaNameBlock = null;
    SdtContentBlock pizzaDescriptionBlock = null;
    //SdtContentBlock pizzaPictureBlock = null;
    List<SdtBlock> sdtList = mainPart.Document.Descendants<SdtBlock>().ToList();
    foreach (SdtBlock sdt in sdtList)
    Console.WriteLine(sdt.SdtProperties.GetFirstChild<Tag>().Val.Value);
    SdtBlock s1 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaName").Single();
    SdtBlock s2 = mainPart.Document.Body.Descendants<SdtBlock>().Where(r => r.SdtProperties.GetFirstChild<Tag>().Val == "PizzaDescription").Single();
    SdtBlock s3 = mainPart.Document.Body.Descendants<SdtBlock>().FirstOrDefault(r =>
    SdtProperties p = r.Elements<SdtProperties>().FirstOrDefault();
    if (p != null)
    Console.WriteLine("P is not null");
    // Is it a picture content control?
    SdtContentPicture pict =
    p.Elements<SdtContentPicture>().FirstOrDefault();
    if (pict != null) Console.WriteLine("Pict is not null");
    // Get the alias.
    SdtAlias a = p.Elements<SdtAlias>().FirstOrDefault();
    if (pict != null && a.Val == "PizzaPicture")
    return true;
    return false;
    if (s3 == null) {
    Console.Write(" s3 is Null");
    } else {
    Console.WriteLine("s3 not null");
    if (s1 != null) {
    pizzaNameBlock = s1.Descendants<SdtContentBlock>().FirstOrDefault();
    text = pizzaNameBlock.Descendants<DocumentFormat.OpenXml.Wordprocessing.Text>().FirstOrDefault();
    // here you can set the current time
    text.Text = "Peperoni";
    Console.WriteLine(text.Text);
    string embed = null;
    if (s3 != null)
    Drawing dr = s3.Descendants<Drawing>().FirstOrDefault();
    if (dr != null)
    Blip blip = dr.Descendants<Blip>().FirstOrDefault();
    if (blip != null)
    embed = blip.Embed;
    if (embed != null)
    IdPartPair idpp = document.MainDocumentPart.Parts
    .Where(pa => pa.RelationshipId == embed).FirstOrDefault();
    if (idpp != null)
    ImagePart ip = (ImagePart)idpp.OpenXmlPart;
    using (FileStream fileStream =
    File.Open(@"c:\temp\pepperoni.jpg", FileMode.Open))
    ip.FeedData(fileStream);
    if (s2 != null) {
    pizzaDescriptionBlock = s2.Descendants<SdtContentBlock>().FirstOrDefault();
    string altChunkId = "AltChunkId12345";
    AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.Xhtml, altChunkId);
    chunk.FeedData(File.Open(@".\html.txt", FileMode.Open));
    AltChunk altChunk = new AltChunk();
    altChunk.Id = altChunkId;
    ////Replace content control with altChunk information
    OpenXmlElement parent = pizzaDescriptionBlock.Parent;
    parent.InsertAfter(altChunk, pizzaDescriptionBlock);
    pizzaDescriptionBlock.Remove();
    mainPart.Document.Save();
    document.Close();
    Here the call mainPart.Document.Descendants<SdtBlock>().ToList(); returns me only 2 items PizzaName, PizzaDescription but
    no PizzaPicture.
    Secondly the line   SdtContentPicture pict =  p.Elements<SdtContentPicture>().FirstOrDefault();
    returns NULL. So it seems that there is no element of type SdtContentPicture.
    What am I doing wrong? I am pretty sure that I have put PizzaPicture as a Picture content control.
    My objective is to locate this control in the document and then insert an image into it programmatically.
    MSDNStudent Knows not much!

    Hi,
    I'm running some test on your code, and I'll come back as soon as I get some update. But before that, I would recommend you to bind customXMLPart with the content controls via Content Control Tool Kit,
    which enables us to bind customXMLPart with CC by dragging and dropping.
    After binding, you can change contents of the template via OpenXML SDK easily as the following code:
    private void button1_Click(object sender, EventArgs e)
    string fileName = @"C:\CCTest.docx";
    WordprocessingDocument wordDoc = WordprocessingDocument.Open(fileName, true);
    MainDocumentPart mainPart = wordDoc.MainDocumentPart;
    CustomXmlPart customPart = mainPart.CustomXmlParts.FirstOrDefault();
    //convert image into string
    string picName = @"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg";
    System.IO.FileStream fileStream = System.IO.File.Open(picName, System.IO.FileMode.Open);
    System.IO.BinaryReader br = new System.IO.BinaryReader(fileStream);
    byte[] byteArea;
    byteArea = br.ReadBytes(System.Convert.ToInt32(fileStream.Length));
    string picString = System.Convert.ToBase64String(byteArea);
    //Load the XML template
    string DataString = Properties.Resources.XMLData;
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(DataString);
    //change the value
    XmlNodeList xmlNode = xmlDoc.GetElementsByTagName("pizzaPic");
    xmlNode[0].InnerText = picString;
    xmlNode = xmlDoc.GetElementsByTagName("pizzaName");
    xmlNode[0].InnerText = "Pizza Name";
    xmlNode = xmlDoc.GetElementsByTagName("pizzaDescription");
    xmlNode[0].InnerText = "Pizza Description";
    //write the custom xml data into the customxmlpart
    System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(customPart.GetStream(System.IO.FileMode.Create), System.Text.Encoding.UTF8);
    writer.WriteRaw(xmlDoc.InnerXml);
    writer.Flush();
    writer.Close();
    fileStream.Close();
    br.Close();
    mainPart.Document.Save();
    wordDoc.Close();
    and the XML template of the project would something like:
    <?xml version="1.0"?>
    <Pizza xmlns="http://Test/ContentControls/Pizzas">
    <pizzaPic></pizzaPic>
    <pizzaName></pizzaName>
    <pizzaDescription></pizzaDescription>
    </Pizza>
    I hope this helps.
    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

  • Additional attributes (such as "xmlns:xsi") in document

    How can I add some additional attributes in in my toplevel element when creating
    a new XML document from scratch using XMLBeans. For example the attributes "xmlns:xsi"
    and "xsi:schemaLocation" in the sample below:
    <?xml version="1.0" encoding="UTF-8"?>
    <MyDoc xmlns="http://www.xxx.nl/yyy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.xxx.nl/yyy myXsd.xsd">
    <..../>
    <..../>
    </MyDoc>
    XML does add the "xmlns" attribute itself. How can I add the two other attributes?
    Currently I have a workaround. I read an "empty" XML-file containing these attributes
    using XMLBeans (parse) and then I fill the empty structure. But I feel that there
    has to be a better solution. Unfortunately I cannot find it.
    Any help is appreciated. Thank you in advance.

    Hello Olaf -- You might trying using an XML cursor. So assuming you've
    compiled a schema to generate XMLBeans types, you might do something like
    the following.
    MyDocDocument myDocDoc = MyDocDocument.Factory.newInstance();
    MyDoc myDoc = MyDocDocument.getMyDoc();
    // Create a cursor and move it to where you want to start inserting
    attributes.
    XmlCursor cursor = myDoc.newCursor();
    cursor.toFirstContentToken();
    cursor.toLastAttribute();
    // Insert your attributes.
    cursor.insertAttributeWithValue("schemaLocation","http://www.w3.com/2001/XML
    Schema-instance", "http://www.xxx.nl/yyy myXsd.xsd");
    // ...add other attributes in a similar way...
    // Dispose of the cursor.
    cursor.dispose();
    Without a schema, you'd be working with the XmlObject returned from your
    newInstance or parse method.
    Steve
    "Olaf Wienk" <[email protected]> wrote in message
    news:4029ee05$[email protected]..
    >
    How can I add some additional attributes in in my toplevel element whencreating
    a new XML document from scratch using XMLBeans. For example the attributes"xmlns:xsi"
    and "xsi:schemaLocation" in the sample below:
    <?xml version="1.0" encoding="UTF-8"?>
    <MyDoc xmlns="http://www.xxx.nl/yyy"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.xxx.nl/yyy myXsd.xsd">
    <..../>
    <..../>
    </MyDoc>
    XML does add the "xmlns" attribute itself. How can I add the two otherattributes?
    >
    Currently I have a workaround. I read an "empty" XML-file containing theseattributes
    using XMLBeans (parse) and then I fill the empty structure. But I feelthat there
    has to be a better solution. Unfortunately I cannot find it.
    Any help is appreciated. Thank you in advance.

  • Urgent -please- how can I insert my context into proxy request ?

    here is par of my request after I have transformed it, to the bs request.
    Routed Service
              Route to: "SkatEtilAndelsbogAnmeldelseSvarService"
         $outbound:
         <con:endpoint      name="BusinessService$dk.skat.etil$bz$SkatEtilAndelsbogAnmeldelseSvarService" xmlns:con="http://www.bea.com/wli/sb/context">
         <con:service>
         <con:operation>getAnmeldelseKvitteringModtag</con:operation>
         </con:service>
         <con:transport>
         <con:mode>request-response</con:mode>
         <con:qualityOfService>best-effort</con:qualityOfService>
         <con:request      xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <tran:headers      xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
         <http:Content-Type>text/xml</http:Content-Type>
         <http:SOAPAction>
         "http://skat.dk/etil/2011/02/11/getAnmeldelseKvitteringModtag"
         </http:SOAPAction>
         </tran:headers>
         </con:request>
         </con:transport>
         <con:security>
         <con:doOutboundWss>true</con:doOutboundWss>
         </con:security>
         </con:endpoint>
         $body (request):
         <soapenv:Body      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <ns:Kontekst      xmlns:ns20="http://skat.dk/etil/2011/02/11/" xmlns:ns="http://rep.oio.dk/cpr.dk/xml/schemas/core/2005/03/18/">
         <TransaktionsID>34c768d8-4f6d-4194-93b7-e77ffa8c76e6</TransaktionsID>
         <TransaktionsTid>2011-06-30T14:40:15.105+02:00</TransaktionsTid>
         </ns:Kontekst>
         <ns:AnmeldelseKvitteringModtag_I      xmlns:ns="http://skat.dk/etil/2011/02/11/">
         <ns1:AnmeldelseKvitteringModtag      xmlns:ns1="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">
    my problem is how can I insert the
    <ns:Kontekst      xmlns:ns20="http://skat.dk/etil/2011/02/11/" xmlns:ns="http://rep.oio.dk/cpr.dk/xml/schemas/core/2005/03/18/">
         <TransaktionsID>34c768d8-4f6d-4194-93b7-e77ffa8c76e6</TransaktionsID>
         <TransaktionsTid>2011-06-30T14:40:15.105+02:00</TransaktionsTid>
         </ns:Kontekst>
    inside
    <ns:AnmeldelseKvitteringModtag_I      xmlns:ns="http://skat.dk/etil/2011/02/11/">
    The context is generated using this:
    <ns:Kontekst xmlns:ns20="http://skat.dk/etil/2011/02/11/">
    <TransaktionsID>{fn-bea:uuid()}</TransaktionsID>
    <TransaktionsTid>{fn:current-dateTime()}</TransaktionsTid>
    </ns:Kontekst>

    request before context:
    <ns2:AnmeldelseKvitteringModtag xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:xd="http://www.w3.org/2000/09/xmldsig#" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">
    <ns:AnmeldelseIdentifikator>string</ns:AnmeldelseIdentifikator>
    <ns:AktoerReference>
    <ns:AktoerID>string</ns:AktoerID>
    <ns:KorrelationID>string</ns:KorrelationID>
    </ns:AktoerReference>
    <!--Optional:-->
    <ns:SagsReference>string</ns:SagsReference>
    <ns1:KoeIndikator>false</ns1:KoeIndikator>
    <ns1:ProeveTinglysningIndikator>true</ns1:ProeveTinglysningIndikator>
    <xd:Signature Id="string">
    <xd:SignedInfo Id="string">
    <xd:CanonicalizationMethod Algorithm="http://www.your.org/aeoliam/quae">
    ventos
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    verrantque
    </xd:CanonicalizationMethod>
    <xd:SignatureMethod Algorithm="http://www.sample.org/turbine/circum">
    regemque
    <!--Optional:-->
    <xd:HMACOutputLength>100</xd:HMACOutputLength>
    nimborum
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    fremunt
    </xd:SignatureMethod>
    <!--1 or more repetitions:-->
    <xd:Reference Id="string" URI="http://www.my.com/profundum/sceptra" Type="http://www.test.com/iovis/flammato">
    <!--Optional:-->
    <xd:Transforms>
    <!--1 or more repetitions:-->
    <xd:Transform Algorithm="http://www.sample.com/bella/nubibus">
    flammas
    <!--You have a CHOICE of the next 2 items at this level-->
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    <xd:XPath>string</xd:XPath>
    ac
    </xd:Transform>
    </xd:Transforms>
    <xd:DigestMethod Algorithm="http://www.my.com/ac/caelumque">
    speluncis
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    circum
    </xd:DigestMethod>
    <xd:DigestValue>YXJpcw==</xd:DigestValue>
    </xd:Reference>
    </xd:SignedInfo>
    <xd:SignatureValue Id="string">Y29uaXVueA==</xd:SignatureValue>
    <!--Optional:-->
    <xd:KeyInfo Id="string">
    praeterea
    <!--You have a CHOICE of the next 8 items at this level-->
    <xd:KeyName>string</xd:KeyName>
    <xd:KeyValue>
    arce
    <!--You have a CHOICE of the next 3 items at this level-->
    <xd:DSAKeyValue>
    <xd:P>Y2xhdXN0cmE=</xd:P>
    <xd:Q>Y2lyY3Vt</xd:Q>
    <!--Optional:-->
    <xd:G>aW1wZXJpbw==</xd:G>
    <xd:Y>Y2VydG8=</xd:Y>
    <!--Optional:-->
    <xd:J>cXVpc3F1YW0=</xd:J>
    <xd:Seed>ZXQ=</xd:Seed>
    <xd:PgenCounter>YWM=</xd:PgenCounter>
    </xd:DSAKeyValue>
    <xd:RSAKeyValue>
    <xd:Modulus>ZmV0YQ==</xd:Modulus>
    <xd:Exponent>YWM=</xd:Exponent>
    </xd:RSAKeyValue>
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    sed
    </xd:KeyValue>
    <xd:RetrievalMethod URI="http://www.test.org/pectore/austris" Type="http://www.your.gov/certo/dare">
    <!--Optional:-->
    <xd:Transforms>
    <!--1 or more repetitions:-->
    <xd:Transform Algorithm="http://www.any.com/volutans/dedit">
    faciat
    <!--You have a CHOICE of the next 2 items at this level-->
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    <xd:XPath>string</xd:XPath>
    magno
    </xd:Transform>
    </xd:Transforms>
    </xd:RetrievalMethod>
    <xd:X509Data>
    <!--You have a CHOICE of the next 6 items at this level-->
    <xd:X509IssuerSerial>
    <xd:X509IssuerName>string</xd:X509IssuerName>
    <xd:X509SerialNumber>100</xd:X509SerialNumber>
    </xd:X509IssuerSerial>
    <xd:X509SKI>ZXQ=</xd:X509SKI>
    <xd:X509SubjectName>string</xd:X509SubjectName>
    <xd:X509Certificate>YWM=</xd:X509Certificate>
    <xd:X509CRL>ZXQ=</xd:X509CRL>
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    </xd:X509Data>
    <xd:PGPData>
    <!--You have a CHOICE of the next 2 items at this level-->
    <xd:PGPKeyID>cmVnZW1xdWU=</xd:PGPKeyID>
    <!--Optional:-->
    <xd:PGPKeyPacket>YW5ub3M=</xd:PGPKeyPacket>
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    <xd:PGPKeyPacket>aW5maXhpdA==</xd:PGPKeyPacket>
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    </xd:PGPData>
    <xd:SPKIData>
    <xd:SPKISexp>dmVudG9z</xd:SPKISexp>
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    </xd:SPKIData>
    <xd:MgmtData>string</xd:MgmtData>
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    tenens
    </xd:KeyInfo>
    <!--Zero or more repetitions:-->
    <xd:Object Id="string" MimeType="string" Encoding="http://www.my.org/rapidum/habenas">
    insuper
    <!--You may enter ANY elements at this point-->
    <AnyElement/>
    mollitque
    </xd:Object>
    </xd:Signature>
    </ns2:AnmeldelseKvitteringModtag>
    This is after the transformation.
    Routed Service
              Route to: "SkatEtilAndelsbogAnmeldelseSvarService"
         $outbound:
         <con:endpoint      name="BusinessService$dk.skat.etil$bz$SkatEtilAndelsbogAnmeldelseSvarService" xmlns:con="http://www.bea.com/wli/sb/context">
         <con:service>
         <con:operation>getAnmeldelseKvitteringModtag</con:operation>
         </con:service>
         <con:transport>
         <con:mode>request-response</con:mode>
         <con:qualityOfService>best-effort</con:qualityOfService>
         <con:request      xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <tran:headers      xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
         <http:Content-Type>text/xml</http:Content-Type>
         <http:SOAPAction>
         "http://skat.dk/etil/2011/02/11/getAnmeldelseKvitteringModtag"
         </http:SOAPAction>
         </tran:headers>
         </con:request>
         </con:transport>
         <con:security>
         <con:doOutboundWss>true</con:doOutboundWss>
         </con:security>
         </con:endpoint>
         $body (request):
         <soapenv:Body      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         <ns:Kontekst      xmlns:ns20="http://skat.dk/etil/2011/02/11/" xmlns:ns="http://rep.oio.dk/cpr.dk/xml/schemas/core/2005/03/18/">
         <TransaktionsID>93235d7a-131d-45a7-a36b-34fd9c83343f</TransaktionsID>
         <TransaktionsTid>2011-06-30T15:35:55.567+02:00</TransaktionsTid>
         </ns:Kontekst>
         <ns:AnmeldelseKvitteringModtag_I      xmlns:ns="http://skat.dk/etil/2011/02/11/">
         <ns1:AnmeldelseKvitteringModtag      xmlns:ns1="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">
         <ns2:AnmeldelseIdentifikator      xmlns:ns2="http://rep.oio.dk/tinglysning.dk/schema/model/1/">string</ns2:AnmeldelseIdentifikator>
         <ns2:AktoerReference      xmlns:ns2="http://rep.oio.dk/tinglysning.dk/schema/model/1/">
         <ns3:AktoerID      xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/" xmlns:xd="http://www.w3.org/2000/09/xmldsig#" xmlns:ns3="http://rep.oio.dk/tinglysning.dk/schema/model/1/">string</ns3:AktoerID>
         <ns3:KorrelationID      xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/" xmlns:xd="http://www.w3.org/2000/09/xmldsig#" xmlns:ns3="http://rep.oio.dk/tinglysning.dk/schema/model/1/">string</ns3:KorrelationID>
         </ns2:AktoerReference>
         <ns2:SagsReference      xmlns:ns2="http://rep.oio.dk/tinglysning.dk/schema/model/1/">string</ns2:SagsReference>
         <ns2:KoeIndikator      xmlns:ns2="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/">false</ns2:KoeIndikator>
         <ns2:ProeveTinglysningIndikator      xmlns:ns2="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/">true</ns2:ProeveTinglysningIndikator>
         <xd:Signature      Id="string" xmlns:xd="http://www.w3.org/2000/09/xmldsig#">
         <xd:SignedInfo      Id="string" xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">
         <xd:CanonicalizationMethod      Algorithm="http://www.your.org/aeoliam/quae">
         ventos
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         verrantque
         </xd:CanonicalizationMethod>
         <xd:SignatureMethod      Algorithm="http://www.sample.org/turbine/circum">
         regemque
         <!--Optional:-->
         <xd:HMACOutputLength>100</xd:HMACOutputLength>
         nimborum
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         fremunt
         </xd:SignatureMethod>
         <!--1 or more repetitions:-->
         <xd:Reference      Id="string" URI="http://www.my.com/profundum/sceptra" Type="http://www.test.com/iovis/flammato">
         <!--Optional:-->
         <xd:Transforms>
         <!--1 or more repetitions:-->
         <xd:Transform      Algorithm="http://www.sample.com/bella/nubibus">
         flammas
         <!--You have a CHOICE of the next 2 items at this level-->
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         <xd:XPath>string</xd:XPath>
         ac
         </xd:Transform>
         </xd:Transforms>
         <xd:DigestMethod      Algorithm="http://www.my.com/ac/caelumque">
         speluncis
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         circum
         </xd:DigestMethod>
         <xd:DigestValue>YXJpcw==</xd:DigestValue>
         </xd:Reference>
         </xd:SignedInfo>
         <xd:SignatureValue      Id="string" xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">Y29uaXVueA==</xd:SignatureValue>
         <!--Optional:-->
         <xd:KeyInfo      Id="string" xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">
         praeterea
         <!--You have a CHOICE of the next 8 items at this level-->
         <xd:KeyName>string</xd:KeyName>
         <xd:KeyValue>
         arce
         <!--You have a CHOICE of the next 3 items at this level-->
         <xd:DSAKeyValue>
         <xd:P>Y2xhdXN0cmE=</xd:P>
         <xd:Q>Y2lyY3Vt</xd:Q>
         <!--Optional:-->
         <xd:G>aW1wZXJpbw==</xd:G>
         <xd:Y>Y2VydG8=</xd:Y>
         <!--Optional:-->
         <xd:J>cXVpc3F1YW0=</xd:J>
         <xd:Seed>ZXQ=</xd:Seed>
         <xd:PgenCounter>YWM=</xd:PgenCounter>
         </xd:DSAKeyValue>
         <xd:RSAKeyValue>
         <xd:Modulus>ZmV0YQ==</xd:Modulus>
         <xd:Exponent>YWM=</xd:Exponent>
         </xd:RSAKeyValue>
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         sed
         </xd:KeyValue>
         <xd:RetrievalMethod      URI="http://www.test.org/pectore/austris" Type="http://www.your.gov/certo/dare">
         <!--Optional:-->
         <xd:Transforms>
         <!--1 or more repetitions:-->
         <xd:Transform      Algorithm="http://www.any.com/volutans/dedit">
         faciat
         <!--You have a CHOICE of the next 2 items at this level-->
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         <xd:XPath>string</xd:XPath>
         magno
         </xd:Transform>
         </xd:Transforms>
         </xd:RetrievalMethod>
         <xd:X509Data>
         <!--You have a CHOICE of the next 6 items at this level-->
         <xd:X509IssuerSerial>
         <xd:X509IssuerName>string</xd:X509IssuerName>
         <xd:X509SerialNumber>100</xd:X509SerialNumber>
         </xd:X509IssuerSerial>
         <xd:X509SKI>ZXQ=</xd:X509SKI>
         <xd:X509SubjectName>string</xd:X509SubjectName>
         <xd:X509Certificate>YWM=</xd:X509Certificate>
         <xd:X509CRL>ZXQ=</xd:X509CRL>
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         </xd:X509Data>
         <xd:PGPData>
         <!--You have a CHOICE of the next 2 items at this level-->
         <xd:PGPKeyID>cmVnZW1xdWU=</xd:PGPKeyID>
         <!--Optional:-->
         <xd:PGPKeyPacket>YW5ub3M=</xd:PGPKeyPacket>
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         <xd:PGPKeyPacket>aW5maXhpdA==</xd:PGPKeyPacket>
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         </xd:PGPData>
         <xd:SPKIData>
         <xd:SPKISexp>dmVudG9z</xd:SPKISexp>
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         </xd:SPKIData>
         <xd:MgmtData>string</xd:MgmtData>
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         tenens
         </xd:KeyInfo>
         <!--Zero or more repetitions:-->
         <xd:Object      Id="string" MimeType="string" Encoding="http://www.my.org/rapidum/habenas" xmlns:ns1="http://rep.oio.dk/tinglysning.dk/schema/anmeldelse/1/" xmlns:ns="http://rep.oio.dk/tinglysning.dk/schema/model/1/" xmlns:ns2="http://rep.oio.dk/tinglysning.dk/svarservice/message/anmeldelse/1/">
         insuper
         <!--You may enter ANY elements at this point-->
         <AnyElement/>
         mollitque
         </xd:Object>
         </xd:Signature>
         </ns1:AnmeldelseKvitteringModtag>
         </ns:AnmeldelseKvitteringModtag_I>
         </soapenv:Body>

  • Insert Multiple Rows into a Database

    Hi,
    I've been working on a project that takes an xml document from JMS queue and inserts the data into db. But the problem here is that there can be any number of data sets. I've been using OEPE for my task, but no matter what I do, the data simply isn't inserted. Could any body please help me? Here is a sample message that I'm trying to insert, as well as the XSDs for the JCA and the input documents.
    XSD for JMS Message:
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:element name="cannonical">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="orders">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="data" maxOccurs="unbounded">
         <xsd:complexType>
              <xsd:sequence>
                   <xsd:element name="rowCode" type="xsd:string"/>
                   <xsd:element name="productNumber" type="xsd:string"/>
                   <xsd:element name="attributeType" type="xsd:string"/>
                   <xsd:element name="attributeCode" type="xsd:string"/>
                   <xsd:element name="transactionType" type="xsd:string"/>
                   <xsd:element name="timestamp" type="xsd:dateTime"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    JCA XSD:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="OrderDataCollection" type="OrderDataCollection"/>
    <xs:complexType name="OrderDataCollection">
    <xs:sequence>
    <xs:element name="OrderData" type="OrderData" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="OrderData">
    <xs:sequence>
    <xs:element name="prodnum" type="xs:decimal"/>
    <xs:element name="attrtype" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="attrcode" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="transtype" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="1"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="ordertime" type="xs:dateTime" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    Sample Input:
    <?xml version="1.0" encoding="windows-1252"?>
    <ProductData>
    <header>
    <rowCode>H</rowCode>
    <interfaceCode>H6D9J7</interfaceCode>
    <createdOn>
    <date>
    <year>2011</year>
    <month>05</month>
    <day>23</day>
    </date>
    <time>
    <hour>02</hour>
    <minute>05</minute>
    <seconds>11</seconds>
    </time>
    </createdOn>
    <description>Front Shop Item Attributes from FMS to JDA PMM</description>
    </header>
    <body>
    <data>
    <rowCode>D</rowCode>
    <productNumber>0004567</productNumber>
         <attributeType>TTTTTT</attributeType>
    <attributeCode>CCCCCCCjjj</attributeCode>
         <transactionType>A</transactionType>
    <timestamp>
    <date>
              <year>2011</year>
    <month>02</month>
              <day>19</day>
         </date>
         <time>
         <hour>02</hour>
    <minute>05</minute>
    <seconds>11</seconds>
    </time>
    </timestamp>
    </data>
         <data>
    <rowCode>D</rowCode>
    <productNumber>0004567</productNumber>
    <attributeType>TTTTTT2</attributeType>
    <attributeCode>CCCCCCjjj2</attributeCode>
    <transactionType>A</transactionType>
    <timestamp>
    <date>
              <year>2011</year>
    <month>02</month>
              <day>19</day>
         </date>
         <time>
         <hour>02</hour>
    <minute>05</minute>
    <seconds>11</seconds>
    </time>
    </timestamp>
    </data>
    </body>
    <footer>
    <rowCode>Z</rowCode>
    <interfaceCode>H6D9J7</interfaceCode>
    <numberOfRows>000000000002</numberOfRows>
    </footer>
    </ProductData>
    I'll be really grateful if anybody can help me out. Thank you.

    Check below link it may help you out
    how to Insert multiple records using single DB Adapter
    Thanks
    AJ

  • Using Cursor and FOR LOOP to INSERT the data into table

    Hi all,
    I have SELECT statement that returns 3 rows:
    PROCESSNAME
    PROTDATE
    IMM
    2013-12-18
    Metrology
    2013-11-18
    CT
    2013-12-04
    SELECT  processName, MAX(NVL(protStartDate, protCreateDate)) AS protDate
        FROM TABLE(SEM_MATCH("{
                ?ipc rdf:type s:Protocol .
                ?ipc s:protocolNumber ?protNum .
                ?ipc s:protocolCreateDate ?protCreateDate .
                OPTIONAL {?ipc s:protocolSchedStartDate ?protStartDate }
                ?ipra rdf:type s:ProcessAggregate .
                ?ipra s:hasProtocol ?iprot .
                ?iprot s:protocolNumber ?protNum .
                ?ipra s:processAggregateProcess ?processName.
        }",sem_models("PROTS", "LINEARS"),NULL, SEM_ALIASES(SEM_ALIAS("","http://VISION/Data/SEMANTIC#"),SEM_ALIAS("s","http://VISION/DataSource/SEMANTIC#")),NULL))
            Group by processName
    Now I need to INSERT these values into the table along with the other values.
    these other values come from different table.
           INSERT INTO MODEL_CLASS_COUNTS (MODEL_NAME, CLASS_NAME, INS_COUNT, COUNT_DATETIME, PROCESS_NAME, PROT_DATE)
           VALUES
           ("$MODEL",     
                "${i}",
            (SELECT COUNT (DISTINCT S)  FROM TABLE(SEM_MATCH(
                            "{?s rdf:type :${i} . }",SEM_Models("$MODEL"),NULL, SEM_ALIASES(SEM_ALIAS("","http://VISION/DataSource/SEMANTIC#")),NULL))),
             SYSTIMESTAMP, %%here need to insert PROCESSNAME, PROTDATE%%
    t was giving me error:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    so i enclosed sparql query into single quotes.
    The code is as follows:
    declare
    type c_type is REF CURSOR;
    cur c_type;
    v_process varchar2(200);
    v_pdate varchar2(200);
    begin
    open cur for
           ' SELECT processName,  MAX(NVL(protStartDate, protCreateDate)) AS protDate   <-- it's complaining about this being too long identifier, i think...
            FROM TABLE
              (SEM_MATCH (
                            ?ipc rdf:type s:Protocol .
                            ?ipc s:protocolNumber ?protNum .
                            ?ipc s:protocolCreateDate ?protCreateDate .
                            OPTIONAL {?ipc s:protocolSchedStartDate ?protStartDate }
                            ?ipra rdf:type s:ProcessAggregate .
                            ?ipra s:hasProtocol ?iprot .
                            ?iprot s:protocolNumber ?protNum .
                            ?ipra s:processAggregateProcess ?processName.
                        }",SEM_Models("XCOMPASS", "XPROCESS"),NULL,    
              SEM_ALIASES(SEM_ALIAS("","http://VISION/Data/SEMANTIC#"),
              SEM_ALIAS("s", "http://VISION/DataSource/SEMANTIC#")),NULL))
               Group by processName';  
    loop
    fetch cur into v_process, v_pdate;
    exit when cur%NOTFOUND;
    --here I need to insert v_process , v_pdate into my table along with other values...
    dbms_output.put_line('values for process and prod_date are: ' || v_process || v_pdate );
    end loop;
    close cur;
    end;
    exit;
    Now, I get an error:
    ORA-00972: identifier is too long
    Does anyone know way around this?

    Hi,
      I tested something similar with insert into select  and it worked fine :
    insert into t_countries(ID,CITY ,POPULATION, DESCRIPTION, located, insdate )
    SELECT 1 id, city, o , city||' is a nice city' description,  max(nvl(locatedAt,'unknown')) as located,
      SYSTIMESTAMP
      FROM TABLE(SEM_MATCH(
        '{GRAPH :gCH {<http://www.semwebtech.org/mondial/10/countries/CH/> :hasCity ?cityID .
           ?cityID :name ?city .
           OPTIONAL{?cityID :locatedAt ?locatedAt .}
           ?cityID :population ?o .
        SEM_Models('VIRT_MODEL_MONDIAL'),
        SEM_Rulebases(null),
        SEM_ALIASES(SEM_ALIAS('','http://www.semwebtech.org/mondial/10/meta#'),
        SEM_ALIAS('prv','http://www.semwebtech.org/mondial/10/countries/CH/provinces/')
        null))
        group by city,o
        order by city;
    Or with execute immediate :
    declare
      v_country varchar2(200) :='http://www.semwebtech.org/mondial/10/countries/F/';
      v_text varchar2(2000);
    begin
    v_text := 'insert into t_countries(ID,CITY ,POPULATION, DESCRIPTION, located, insdate )
    SELECT 1 id, city, o , city||'' is a nice city'' description,  max(nvl(locatedAt,''unknown'')) as located,
      SYSTIMESTAMP
      FROM TABLE(SEM_MATCH(
        ''{<'||v_country||'> :hasCity ?cityID .
           ?cityID :name ?city .
           OPTIONAL{?cityID :locatedAt ?locatedAt .}
           ?cityID :population ?o .
        SEM_Models(''VIRT_MODEL_MONDIAL''),
        SEM_Rulebases(null),
        SEM_ALIASES(SEM_ALIAS('''',''http://www.semwebtech.org/mondial/10/meta#'') ),
        null))
        group by city,o
        order by city';
        dbms_output.put_line(v_text);
        delete from t_countries;
        execute immediate v_text ;
        commit;
    end;
    Marc

  • How to insert column values into database as rows

    Hi,
    I have 8 columns and some not null columns. Based on not null columns I want to insert into table as rows. The 8 columns may contain values or no value. If the first column contains data, then I have to insert into one row. if the second column contains data I have to insert a row and in second column. respectively...So How can I insert column values into rows. Can I write 8 insert statements. (OR) is it possible to insert data from columns using where clause.
    Please help me out....
    Thanks in Advance

    Lines Table:
    line_id, orcl_bank_account_num, product_type, service_type, lease_type,
    funding_type, cpi, billing_frequency_unit_cd , annual_due_date ,
    pricing_start_date, pricing_end_date, install_date, contract_end_date ,
    prdct_replacement_cost_amt, cradle_replacement_amt, supranet_contract,
    issuance_fee, board_inactive_date, header_id, creation_date, last_modified_date,
    created_by_nam, modified_by_nam, activeinactive_flg, prdct_bill_amt_yr1,
    prdct_bill_amt_yr2, prdct_bill_amt_yr3, prdct_bill_amt_yr4, prdct_bill_amt_yr5,
    prdct_bill_amt_yr6, prdct_bill_amt_yr7, prdct_bill_amt_yr8, activation_fee_yr1,
    activation_fee_yr2, activation_fee_yr3, activation_fee_yr4, activation_fee_yr5,
    activation_fee_yr6, activation_fee_yr7, activation_fee_yr8,
    In this table the columns structure is :
    -- PRDCT_BILL_AMT_YR (1 to 8) NUMBER(14,4)
    -- ACTIVATION_FEE_YR (1 to 8) NUMBER(8,2)
    I have one more table:
    PRDCT_INS_AMT               NUMBER(14,4)
    ACTIVATION_FEE_AMT          NUMBER(14,4)
    I want to insert prdct_bill_amt_yr (1 to 8) columns data into PRDCT_INS_AMT column. similarly activation_fee (1 to 8) columns data.
    But the data should be inserted based product_type, service_type, lease_type columns values. (These 3 columns may contain upto 45 combinations).

Maybe you are looking for