Set xsi:type attribute

Hi All,
I have a requirement where I need to set the xsi:type attribute to some value before I submit the SOAP request from SAP PI.  I have not been able to figure out where how to set the value of this attribute.  I have an XSD that I am using to generate the request, but I do not see anywhere in the mapping tools where I can assign this value.  I tried using MAP Force to do XSLT mapping but couldn't really make that happen using that either...
This is how I would like the request message type to have...
<m:sObjects xsi:type="ns3:Account" xmlns:ns3="urn:sobject.enterprise.soap.sforce.com">
but this is how it comes...
<m:sObjects>
Any tips and ideas to make this happen would be highly appreciated...
Regards,
Jawwad

hi,
there are at least two places where you can do it:
a) inside a mapping using XSLT
b) write an adapter module that will add this to your call and put it in receiver soap adapter
Regards,
Michal Krawczyk

Similar Messages

  • JAXB 1.6 and xsi:type attribute

    Does JAXB version 1.6 suppurt xsi:type attribute? I have mapped schema to Java classes and when I marshall it to xml, xsi:type attribute is missing.

    I found one workaround for the problem,
    "<from variable="StopSeq"/>"
    As of now , StopSeq was a variable created by me in BPEL file.
    I was using this variable to do some calculations.
    As a workaround of the problem, I created a schema with "StopSeqType" as a simple int type element.
    Then inside the BPEL, I marked the the existing variable "StopSeq" as a type of "StopSeqType" of my new schema.
    After this change I found the expected result.
    Now my doubt is , Is it the case for all variables created in BPEL ?
    If yes , how we can prevent this ?

  • Web Services, Schemas, and the xsi:type attribute

    Hi List,
    I have several questions reqarding web services, schemas, and the use of the xsi:type
    attribute in messages.
    Schemas:
    Q1: How complex can a web service schema be?
    Q2: Is it reasonable for a schema to contain derived types by extension [1]?
    Q3: Could you use the International Purchase Order Schema [2] with a web service?
    xsi:type
    Q1: Is it reasonable for a web service to use the xsi:type attribute in the message(s)?
    If I am interpreting Section 4.1.15 of the BasicProfile-1.0a [3] correctly, this
    appears to be appropriate in certain circumstances.
    Q2: When is it appropriate to use the xsi:type attribute? If a schema contains
    derived types by extension [1]? If a schema contains xsd:anyType?
    Q3: How does using the xsi:type attribute affect interoperability?
    And finally,
    Q4: Are there any examples available demonstrating the use of the xsi:type attribute
    in messages?
    Whew !!!
    TIA,
    Kent
    [1] http://www.w3.org/TR/xmlschema-0/#DerivExt
    [2] http://www.w3.org/TR/xmlschema-0/#ipo.xsd
    [3] http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html

    Hi Kent,
    A few answers inline...
    HTH,
    Bruce
    Kent Kvarfordt wrote:
    >
    Hi List,
    I have several questions reqarding web services, schemas, and the use of the xsi:type
    attribute in messages.
    Schemas:
    Q1: How complex can a web service schema be?There are limits in converting the schema between language
    representations, see this section [a] in the docs on roundtripping
    generated data types.
    [a]
    http://edocs.bea.com/wls/docs81/webserv/assemble.html#1074725
    Q2: Is it reasonable for a schema to contain derived types by extension [1]?
    Q3: Could you use the International Purchase Order Schema [2] with a web service?
    xsi:type
    Q1: Is it reasonable for a web service to use the xsi:type attribute in the message(s)?
    If I am interpreting Section 4.1.15 of the BasicProfile-1.0a [3] correctly, this
    appears to be appropriate in certain circumstances.I've not seen this used.
    http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html#refinement34259632
    >
    Q2: When is it appropriate to use the xsi:type attribute? If a schema contains
    derived types by extension [1]? If a schema contains xsd:anyType?
    Q3: How does using the xsi:type attribute affect interoperability?My thought is that since this is not commonly used, then your risk of
    interop failure is high.
    >
    And finally,
    Q4: Are there any examples available demonstrating the use of the xsi:type attribute
    in messages?Sorry, I looked and could not find any examples.
    >
    Whew !!!
    TIA,
    Kent
    [1] http://www.w3.org/TR/xmlschema-0/#DerivExt
    [2] http://www.w3.org/TR/xmlschema-0/#ipo.xsd
    [3] http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html

  • Did not find needed xsi:type attribute on element anyType

    The followings exception is thrown when using the access a web service using the
    proxy jar.
    The return xml contains
    <debts xm:bind="debts is return.safaccount.debts">
    <anyType xm:multiple="debt in return.safaccount.debts">{debt}</anyType>
    </debts>
    debts is a vector contains Serializable Object class.
    How do you resolve this?
    <Nov 14, 2002 2:36:27 PM ICT> <Error> <HTTP> <101019> <[ServletContext(id=553030
    0,name=EAIService,context-path=/EAIService)] Servlet failed with IOException
    java.rmi.RemoteException: web service invoke failed; nested exception is:
    javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.sch
    ema.binding.DeserializationException: did not find needed xsi:type attribute on
    element <anyType>
    javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.bind
    ing.DeserializationException: did not find needed xsi:type attribute on element
    <anyType>
    at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:296)
    at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:35
    9)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
    a:465)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav

    Hi Daniel,
    This is really an "constructing and XMLMap issue" with WebLogic Workshop, so I
    would post it on that newsweb group:
    weblogic.developer.interest.workshop
    BTW: Serialization/Deserialization required instanciable classes with no-arg constructors.
    You should attach the WSDL for this web service, so that folks can see what Workshop
    generated for the schema element(s). This (the schema elements) is probably where
    the problem starts :-) Also, state if that is the default xmlmap generated by
    Workshop, or a custom one.
    Regards,
    Mike Wooten
    "daniel" <[email protected]> wrote:
    >
    The followings exception is thrown when using the access a web service
    using the
    proxy jar.
    The return xml contains
    <debts xm:bind="debts is return.safaccount.debts">
    <anyType xm:multiple="debt in return.safaccount.debts">{debt}</anyType>
    </debts>
    debts is a vector contains Serializable Object class.
    How do you resolve this?
    <Nov 14, 2002 2:36:27 PM ICT> <Error> <HTTP> <101019> <[ServletContext(id=553030
    0,name=EAIService,context-path=/EAIService)] Servlet failed with IOException
    java.rmi.RemoteException: web service invoke failed; nested exception
    is:
    javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.sch
    ema.binding.DeserializationException: did not find needed xsi:type attribute
    on
    element <anyType>
    javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.bind
    ing.DeserializationException: did not find needed xsi:type attribute
    on element
    <anyType>
    at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:296)
    at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:35
    9)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
    a:465)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav

  • Setting xsi:type in XMLBeans

    I'm trying to create a schema with an abstract class and two subclasses. (see
    below)
    The xml saves fine, but when I try to load it the parser doesn't resolve the classes
    to the subclass. Is there a way of setting the xsi:type as an attribute so that
    when the file is loaded the classes are resolved to their correct type. Is there
    a better way of doing this?
    Thanks in advance,
    Andrew
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.books.org"
    xmlns="http://www.books.org"
    elementFormDefault="unqualified">
    <xsd:complexType name="PublicationType" abstract="true">
    <xsd:sequence>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Author" type="xsd:string" maxOccurs="unbounded"/>
    <xsd:element name="Date" type="xsd:year"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType">
    <xsd:sequence>
    <xsd:element name="ISBN" type="xsd:string"/>
    <xsd:element name="Publisher" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="MagazineType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType">
    <xsd:sequence>
    <xsd:element name="A" type="xsd:string"/>
    <xsd:element name="B" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="BookStore">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Publication" maxOccurs="unbounded" type="PublicationType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    Andrew,
    I'm not clear on what you mean when you ask "try to load it ... doesn't
    resove the classes to the subclass."
    Can you post a code snip here and what you would expect to see?
    Roger
    "Andrew" <[email protected]> wrote in message news:3f4494e2$[email protected]..
    >
    I'm trying to create a schema with an abstract class and two subclasses.(see
    below)
    The xml saves fine, but when I try to load it the parser doesn't resolvethe classes
    to the subclass. Is there a way of setting the xsi:type as an attribute sothat
    when the file is loaded the classes are resolved to their correct type. Isthere
    a better way of doing this?
    Thanks in advance,
    Andrew
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.books.org"
    xmlns="http://www.books.org"
    elementFormDefault="unqualified">
    <xsd:complexType name="PublicationType" abstract="true">
    <xsd:sequence>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Author" type="xsd:string"maxOccurs="unbounded"/>
    <xsd:element name="Date" type="xsd:year"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType">
    <xsd:sequence>
    <xsd:element name="ISBN" type="xsd:string"/>
    <xsd:element name="Publisher" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="MagazineType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType">
    <xsd:sequence>
    <xsd:element name="A" type="xsd:string"/>
    <xsd:element name="B" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="BookStore">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Publication" maxOccurs="unbounded"type="PublicationType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • "xsi:type" attribute coming automatically in XML by using Assign activity

    Hi,
    I am using below copy operation in assign activity
    *<copy>*
    *<from variable="StopSeq"/>*
    *<to variable="InvokeGlog_IV" part="Transmission"*
    *query="/ns2:Transmission/ns2:TransmissionBody/ns2:GLogXMLElement/ns2:ActualShipment/ns2:Shipment    /ns2:ShipmentStop[bpws:getVariableData('SCounter')]/ns2:StopSequence"/>*
    *</copy>*
    which is copying from one local variable(StopSeq of int type ) to another variable(StopSequence of string type).
    It was working fine in SOA 11.1.1.3 and I was getting result as below
    Expected Result *<StopSequence>1</StopSequence>*
    But recently we have migrated from 11.1.1.3 to 11.1.1.5 and we started to get below output for the same assign activity.
    Current Result *<StopSequence xsi:type="ns:int">1</StopSequence>*
    Please suggest.
    Thanks

    I found one workaround for the problem,
    "<from variable="StopSeq"/>"
    As of now , StopSeq was a variable created by me in BPEL file.
    I was using this variable to do some calculations.
    As a workaround of the problem, I created a schema with "StopSeqType" as a simple int type element.
    Then inside the BPEL, I marked the the existing variable "StopSeq" as a type of "StopSeqType" of my new schema.
    After this change I found the expected result.
    Now my doubt is , Is it the case for all variables created in BPEL ?
    If yes , how we can prevent this ?

  • BC4j-- unable to set date type attribute in a row

    when i m set a attribute which is of date type in row of a view.
    it is giving me error " cannot create object of date type"
    i'll apreciate the answer to this problem
    thanx

    <%
    SimpleDateFormat databaseFormat = new SimpleDateFormat();
    SimpleDateFormat viewFormat = new SimpleDateFormat();
    databaseFormat.applyPattern("yyyy-MM-dd");
    viewFormat.applyPattern("MM/dd/yyyy");
    // to convert &#8220;MM/dd/yyyy&#8221; to &#8220;yyyy-MM-dd&#8221; for updating database
    String date_view=&#8221;12/31/2001&#8221;;
    String date_db=new String(databaseFormat.format(viewFormat.parse
    (date_view)));
    ...setAttribute(column_name,date_db);
    %>

  • XPath Question related to xsi:type

    I have the response of a service callout that I need to process. The service callout response uses xsi:type to specify the type of the object being returned. I need to use the value of the xsi:type attribute to collect the xml elements.
    Here is the xpath that I am trying to use:
    $addAssetInfoResponse/ast:addAssetInfoResponse/ast:result/ast:asset\[local-name-from-QName(attribute::xsi:type)='Customer'\]
    (ast: is mapped to http://www.fatspaniel.com/ws/asset/)
    When I test this XPath with the following XML fragement as value of addAssetInfoResponse variable:
    <env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <ns2:addAssetInfoResponse xmlns:ns2="http://www.fatspaniel.com/ws/asset/" >
    <ns2:result>
    <ns2:status>SUCCESS</ns2:status>
    <ns2:asset xsi:type="ns4:Customer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="http://www.fatspaniel.com/ws/sysobj/" >
    <entityId>106934</entityId>
    <type>Customer</type>
    <name>AAI Customer - 200909081651</name>
    </ns2:asset>
    </ns2:result>
    </ns2:addAssetInfoResponse>
    </env:Body>
    I get the following error:
    Error executing the transformation: {err}XP0021: "ns4:Customer": can not cast to {http://www.w3.org/2001/XMLSchema}QName: error: Invalid QName value: Can't resolve prefix 'ns4'
    Have I made a mistake in the xpath ? Is there a better way for extracting assets elements of certain type ?
    Thank you.
    Rahul Phadnis
    Edited by: RahulPhadnis on Sep 15, 2009 10:57 AM

    John Spencer wrote:
    Unless I missed something in the 11g new features, the maximum line length in DBMS_OUTPUT.Put_Line is still 255 characters.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> set serveroutput on
    SQL> exec dbms_output.put_line(lpad('X',512,'X'));
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    PL/SQL procedure successfully completed.
    SQL> SY.

  • XMLBeans and xsi:type overrides

    The issue is one of the split of responsibility for the XML meta-data and the XML info-set. The XMLBeans classes are allowed to choose XML namespace prefixes at will (following the usual rules about uniqueness) and drop unused namespace prefixes. However the XMLBeans are not allowed to change the values of any elements or attributes which would alter the info-set.
    The XML schema type attribute is held in the XML info-set as an attribute and therefore cannot be changed by the XMLBeans, however it also contains details of the namespace prefix.
    For example the following piece of XML shows the usage of a xsi:type qualifier :
    <v11:createOrderByValueRequest
    xmlns:v1="http://videonetworks.com/ServiceActivation/v1-0"
    xmlns:v11="http://ossj.org/xml/ServiceActivation/v1-1">
    <v11:orderValue xsi:type="v1:VNLCreateOrderValue"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <v11:description>IPTV Consumer Order for WO999</v11:description>
    </v11:orderValue>
    </v11:createOrderByValueRequest>
    If we extract the order value from the createOrderByValueRequest object as the only use of the namespace v1 is within the info-set, under the xsi:type attribute the newly created xml-fragment may look like the following :
    <xml-fragment xsi:type="v1:VNLCreateOrderValue"
    xmlns="http://ossj.org/xml/ServiceActivation/v1-1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
    <description>IPTV Consumer Order for WO999</description> </orderValue>
    This no longer validates as the v1 namespace prefix is not defined. As a workaround we have created a method which checks for xsi:type attributes and inserts the namespaces required based on a set of types and namespaces we are using. The output would then look like :
    <xml-fragment xsi:type="v1:VNLCreateOrderValue"
    xmlns="http://ossj.org/xml/ServiceActivation/v1-1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:v1="http://videonetworks.com/ServiceActivation/v1-0">
    <description>IPTV Consumer Order for WO999</description> </orderValue>

    Of course this is a namespace issue. But how can i solve it?
    In jdeveloper a see all the variables and just use the graphical assign.
    This writes
    <to variable="inputVariable" part="payload" query="/payload/client:Reference/client:my_nte"/>
    If i change from client: to anything else the workflow does not compile anymore...

  • InfoPath 2010: Problem with xsi:type on import

    I'd like to create a form based on an XML file, but the XML file contains lots of xsi:type attributes, and this seems to cause an error. Is there any work around to this?  Does anyone know if 2013 version has this problem?

    Hi John,
    I couldn't find much more information about the xsi:type used in InfoPath 2010 and 20113, only the following articles you can see if it could help, and for more questions about this topic you can post in Office forum (Office
    for IT pro, or
    Office for Dev) for a better assistance.
    http://msdn.microsoft.com/en-us/library/office/bb608317(v=office.11).aspx
    http://msdn.microsoft.com/en-us/library/office/ee526359.aspx
    Elements with an Abstract Complex Type
    InfoPath 2003
    If an element is defined as having an abstract type, then the element cannot appear in the instance document as an instance of that type; rather, it must be specified as a type deriving from the abstract type. For the schema to validate correctly, the instance
    of that element must use a different type and must specify that type with an xsi:type attribute. The type referenced in this attribute must derive from the abstract type.
    Without InfoPath SP 1 installed, you cannot design a form against a schema that uses this construct. One workaround is to change the element type to a derived type of the abstract type in the schema itself.
    Thanks
    Daniel Yang
    TechNet Community Support

  • Set type attribute search help in Web UI

    Hello,
    I've created a set type attribute in the SAP GUI in CRM 2007 which links to value table BUT000. On the product in the SAP GUI, the F4 search help brings up the standard BP search help (COM_PARTNER).
    I've assigned the attribute to the web UI, and the field displays correctly, however when I click on the F4 help, the system only shows me a list of BP numbers without even a description description, and not the standard search help. The response to my OSS message is that this is "standard".
    Any suggestions as to how to enable the correct search help for this?
    Thanks,
    Alison

    Hello,
    This is an example :
      READ TABLE lt_multivalues WITH KEY fieldname = 'ZOPERATION_ID'
      INTO ls_multivalues.
      IF sy-subrc NE 0.
        READ TABLE lt_multivalues WITH KEY fieldname = 'ZKIT_ID'
        INTO ls_multivalues.
      ENDIF.
      IF sy-subrc EQ 0.
    Z search
        CALL METHOD me->search_by_kit
          EXPORTING
            it_search_tab          = it_search_tab
            it_multivalues         = lt_multivalues
            iv_number              = iv_number
            iv_item                = iv_item
            iv_archive             = iv_archive
            iv_call_authority_badi = iv_call_authority_badi
          IMPORTING
            et_guidlist            = et_guidlist
            et_return              = et_return.
      ELSE.
    Standard search
        CALL METHOD me->search_standard
          EXPORTING
            it_search_tab          = it_search_tab
            it_multivalues         = lt_multivalues
            iv_number              = iv_number
            iv_item                = iv_item
            iv_archive             = iv_archive
            iv_call_authority_badi = iv_call_authority_badi
          IMPORTING
            et_guidlist            = et_guidlist
            et_return              = et_return.
      ENDIF.
    You have to fill et_guidlist with the results.
    Benoî

  • How to change set type attribute of a product

    Hi ;
    I created additional fields for products by using "COMM_ATTRSET". It created a table and functions but I dont know how to change this additional attributes.I cant use these attribute set functions because i dont know fragment_id yet. I think there must be a function encapsulates them.
    Is there any BAPI to change set type attributes?
    PS: In forums , I found an FM "COM_PRODUCT_MAINTAIN_MULT_API" but I think it hasnt been used anymore in CRM7.0
    Thanks

    Thanks for your reply ;
    but FM 'COM_PRODUCT_UI_MAINTAIN' doesnt have any generic import parameters to send my data to it in form of  newly created attribute set type table "ZPRODUCT".
    I want to set some fields of ZPRODUCT and i need to send them in this structure,  this table has column FRG_ID , if you set an additional  parameter for the first time , it generates new GUID..I think  'COM_PRODUCT_UI_MAINTAIN'  generates this GUID but i dont know how to use it.
    Can you give an example about using this FM?

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

  • Set xsi:nill="true" attribute in XML

    Hi,
    I'm trying to set the xsi:nill attribute in an XML element by scripting. (Javascript)
    The setAttribute method doesn't work. And manually adding a new and empty element doesn't work either.
    When I leave a field which has binding empty, the nill attribute is automatically set to true.
    Why can't I reproduce this by scripting? Does someone have a clue?
    Thanks in advance!
    Regards,
    Kristof

    Hi Kristof,
    I think you can only do this with a loadXML method, makes it very clumsy by the following code;
    var dataItems = xfa.datasets.createNode("dataGroup","items");
    xfa.datasets.data.nodes.append(dataItems);
    dataItems.loadXML('<item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>',false,true);
    Will produce the following xml
    <items>
          <item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    </items>
    Good Luck
    Bruce

  • URGENT HELP! - The prefix "xsi" for attribute "xsi:type" is not bound

    Hi! i createD a WebService using the JWSDP 1.2. In the server-side i read a xml file, create another empty Document and using the importNode() method i populate the empty created doc. The problem is when i try to send client this created document. I'm using the DOMSource to send it to client side. Both client and WS method code are below! Does anyone know the answer??
    And I'm getting this error:
    [java] Endpoint address = http://localhost:8080/cm/ContextManager
    [java] [Fatal Error] :2:42: The prefix "xsi" for attribute "xsi:type" is not bound.
    [java] javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The prefix "xsi" for attribute "xsi:type" is not bound.
    [java] at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:469)
    [java] at contextclient.CMClient.main(Unknown Source)
    [java] Caused by: org.xml.sax.SAXParseException: The prefix "xsi" for attribute "xsi:type" is not bound.
    [java] at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1139)
    [java] at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452)
    [java] ... 1 more
    [java] ---------
    [java] org.xml.sax.SAXParseException: The prefix "xsi" for attribute "xsi:type" is not bound.
    [java] at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1139)
    [java] at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:452)
    [java] at contextclient.CMClient.main(Unknown Source)
    ====================CLIENT CODE================================
    Source getdevice = manager.getDevice("How");
    DOMResult domResult = new DOMResult();
    // getting a transformation factory instance
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    transformer.transform(getdevice, domResult);
    Node node = domResult.getNode();
    DOMSource domSRC = new DOMSource(node);               
    StreamResult streamResult = new StreamResult(System.out);
    transformer.transform(domSRC, streamResult);
    ===============================================================
    ===================WebService Method CODE======================
         public Source getDevice(String primaryContext)
              Source src = null;
              try
                   String uri = "C:\\foo\\DeviceInstance.xml";
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   //create the first Document
                   Document doc1 = builder.parse(uri);
                   //create the second Document
                   Document doc2 = builder.newDocument();
                   //create the second doc's root element and append it
                   Element rootDoc2 = (Element)doc2.createElement("device");
                   doc2.appendChild(rootDoc2);               
                   //get root of first document
                   Element rootDoc1 = doc1.getDocumentElement();
                   NodeList list = rootDoc1.getElementsByTagName(primaryContext);
                   for(int i = 0; i < list.getLength(); i++)
                        Element nodeToMove = (Element) list.item(i);
                        Node newNode = doc2.importNode(nodeToMove, true);
                        rootDoc2.appendChild(newNode);
                   src = new DOMSource(doc2);          
              catch(DOMException dome)
                   dome.printStackTrace();
              catch(Exception e)
                   e.printStackTrace();
              return src;
    ===============================================================
    Does anyone know what could it be? Please, it's very urgent!
    Tks in Advance,
    Rodrigo.

    The xml i'm trying to send is below. It's important explain that in a standalone app it works perfectly. Unfortunately, when i perform the same actions in the WS world, it doesn't work. See, i tried to put the attributes inside the root element with the setAttributeNS() method but i got the same error again. How could i bound the attribute with no errors like that said before???
    <?xml version="1.0" encoding="UTF-8"?>
    <device xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="context.xsd">
    <Identity xsi:type="fooType">
                   <Name>
                        <GivenName>Rodrigo</GivenName>
                        <FamilyName>Felicio</FamilyName>
                   </Name>
              </Identity>
    <Identity xsi:type="foowType">
                   <DeviceID>dev00345</DeviceID>
              </Identity>
    </device>
    Regards,
    Rodrigo.

Maybe you are looking for

  • Printing from a Stored Procedure on HP-UX

    We've created a Stored Procedure on Our Oracle 8 Database and we need to print an order form to a remote print on a Windows Network. How can I do this.

  • Lost WP Text = Recovery Possible?

    I've lost text in an AppleWorks Word Processing file. Here's what happened: I opened a new file, gave it a name, and saved it to my desktop. I wrote and perodically saved my work from the keyboard using Command-S. While the document was open, I then

  • How to create an Object array(two dimensional) from a properties file..

    Hi All.. I have a typical problem.. I have a properties file with key/value pairs . Now what I want to do is.. I need to read all the keys and the values corresponding to that keys and then create a two dimensional array.. Like.. Properties props; Ob

  • Should the Software update website be country awar...

    It goes against the grain a little, but if there is a risk that people updating thier handsets from outside the UK are losing languages etc... Maybe the Nokia site should only allow access to PCs connecting to the internet within the UK. Phone List:

  • Nokia E61i+Holux M241

    in Holux coordinates are shown in degrees, minutes and seconds.in E61i-decimal degrees. one question- how to tracsfer from one to other.other question- how to enter coordinates of the object? my steps: -navigation -searching device -choice of Holux -