Search Results

Search found 503 results on 21 pages for 'xsi'.

Page 1/21 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Getting ActiveRecord (Rails) to_xml to use xsi:nil and xsi:type instead of nil and type

    - by nbeyer
    The default behavior of XML serialization (to_xml) for ActiveRecord objects will emit 'type' and 'nil' attributes that are similar to XML Schema Instance attributes, but aren't set in a XML Namespace. For example, a model might produce an output like this: <user> <username nil="true" /> <first-name type="string">Name</first-name> </user> Is there anyway to get to_xml to utilize the XML Schema Instance namespace and prefix the attributes and the values? Using the above example, I'd like to produce the following: <user xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xs="http://www.w3.org/1999/XMLSchema"> <username xsi:nil="true" /> <first-name xsi:type="xs:string">Name</first-name> </user>

    Read the article

  • Xerces SAX parser ignore the xmlxs:xsi attribute as an attribute of an element

    - by user603301
    Hi, Using Xerces SAX parser I try to retrieve all elements and their attributes of this XML file: -------------- Begin XML file to parse ---------------- <?xml version="1.0" encoding="UTF-8"?> <invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="my.xsd"> <parties> (...) -------------- End XML file to parse ---------------- When getting the attributes for the element 'invoice', Xerces++ does not insert the 'xmlns:xsi' attribute in the list of 'Attributes' for the element 'invoice'. However, the attribute 'xsi:noNamespaceSchemaLocation' is inserted in the list. Why? Is there a specific reason from an XML standard point of view ? Is there a way to configure Xerces++ SAX parser so that it inserts this attribute as well? (The documentation on setting the parser properties does not tell how). Thanks for your help.

    Read the article

  • Interchange xsd and xsi in the output of XmlSerializer

    - by Sri Kumar
    XmlSerializer serializer = new XmlSerializer(typeof(IxComment)); System.IO.StringWriter aStream = new System.IO.StringWriter(); serializer.Serialize(aStream,Comments); commentsString = aStream.ToString(); Here the commentsString has the the following element in it <IxComment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> Is there any possibility to interchange the xsi and xsd attribute and get the element as shown below <IxComment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > Will this cause any other issue? EDIT: Why do i need to do this? We are migrating an existing application from 1.1 to 3.0 and in the code there is a if loop int iStartTagIndex = strXMLString.IndexOf("<IxComment xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"); that check for the index of the IxComment. Here the o/p of the serializer and the condition differ in the position of xsd and xsi. So i am trying to know whether we can instruct the serializer to provided the o/p as required. I have another question here as this was an existing application does the serializer O/P differs with versions?

    Read the article

  • LinqToXML removing empty xmlns attributes &amp; adding attributes like xmlns:xsi, xsi:schemaLocation

    - by Rohit Gupta
    Suppose you need to generate the following XML: 1: <GenevaLoader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2: xsi:schemaLocation="http://www.advent.com/SchemaRevLevel401/Geneva masterschema.xsd" 3: xmlns="http://www.advent.com/SchemaRevLevel401/Geneva"> 4: <PriceRecords> 5: <PriceRecord> 6: </PriceRecord> 7: </PriceRecords> 8: </GenevaLoader> Normally you would write the following C# code to accomplish this: 1: const string ns = "http://www.advent.com/SchemaRevLevel401/Geneva"; 2: XNamespace xnsp = ns; 3: XNamespace xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance"); 4:  5: XElement root = new XElement( xnsp + "GenevaLoader", 6: new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName), 7: new XAttribute( xsi + "schemaLocation", "http://www.advent.com/SchemaRevLevel401/Geneva masterschema.xsd")); 8:  9: XElement priceRecords = new XElement("PriceRecords"); 10: root.Add(priceRecords); 11:  12: for(int i = 0; i < 3; i++) 13: { 14: XElement price = new XElement("PriceRecord"); 15: priceRecords.Add(price); 16: } 17:  18: doc.Save("geneva.xml"); The problem with this approach is that it adds a additional empty xmlns arrtribute on the “PriceRecords” element, like so : 1: <GenevaLoader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.advent.com/SchemaRevLevel401/Geneva masterschema.xsd" xmlns="http://www.advent.com/SchemaRevLevel401/Geneva"> 2: <PriceRecords xmlns=""> 3: <PriceRecord> 4: </PriceRecord> 5: </PriceRecords> 6: </GenevaLoader> The solution is to add the xmlns NameSpace in code to each child and grandchild elements of the root element like so : 1: XElement priceRecords = new XElement( xnsp + "PriceRecords"); 2: root.Add(priceRecords); 3:  4: for(int i = 0; i < 3; i++) 5: { 6: XElement price = new XElement(xnsp + "PriceRecord"); 7: priceRecords.Add(price); 8: }

    Read the article

  • Interchange xsd and xsi - XmlSerializer in c#

    - by Sri Kumar
    Hello All, XmlSerializer serializer = new XmlSerializer(typeof(IxComment)); System.IO.StringWriter aStream = new System.IO.StringWriter(); serializer.Serialize(aStream,Comments); commentsString = aStream.ToString(); Here the commentsString has the the following element in it <IxComment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> Is there any possibility to interchange the xsi and xsd attribute and get the element as shown below <IxComment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > Will this cause any other issue?

    Read the article

  • JAXB: How to avoid repeated namespace definition for xmlns:xsi

    - by sfussenegger
    I have a JAXB setup where I use a @XmlJavaTypeAdapter to replace objects of type Person with objects of type PersonRef that only contains the person's UUID. This works perfectly fine. However, the generated XML redeclares the same namespace (xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") every time it's used. While this is generally okay, it just doesn't feel right. How can I configure JAXB to declare xmlns:xsi at the very beginning of the document? Can I manually add namespace declarations to the root element? Here's an example of what I want to achive: Current: <person uuid="6ec0cf24-e880-431b-ada0-a5835e2a565a"> <relation type="CHILD"> <to xsi:type="personRef" uuid="56a930c0-5499-467f-8263-c2a9f9ecc5a0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </relation> <relation type="CHILD"> <to xsi:type="personRef" uuid="6ec0cf24-e880-431b-ada0-a5835e2a565a" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </relation> <!-- SNIP: some more relations --> </person> Wanted: <person uuid="6ec0cf24-e880-431b-ada0-a5835e2a565a" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <relation type="CHILD"> <to xsi:type="personRef" uuid="56a930c0-5499-467f-8263-c2a9f9ecc5a0"/> </relation> <relation type="CHILD"> <to xsi:type="personRef" uuid="6ec0cf24-e880-431b-ada0-a5835e2a565a"/> </relation> <!-- SNIP: some more relations --> </person>

    Read the article

  • Avoid extra xmlns:xsi while adding an attribute to XML root

    - by Rakesh kumar
    I am creating an xml file using this code: XmlDocument d = new XmlDocument(); XmlDeclaration xmlDeclaration = d.CreateXmlDeclaration("1.0", "utf-8", null); d.InsertBefore(xmlDeclaration,d.DocumentElement); XmlElement root = d.CreateElement("ITRETURN","ITR","http://incometaxindiaefiling.gov.in/ITR1"); XmlAttribute xsiNs = d.CreateAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"); xsiNs.Value = "http://incometaxindiaefiling.gov.in/main ITRMain10.xsd"; root.SetAttributeNode(xsiNs); //root.SetAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"); root.SetAttribute("xmlns:ITR1FORM", "http://incometaxindiaefiling.gov.in/ITR1"); root.SetAttribute("xmlns:ITR2FORM", "http://incometaxindiaefiling.gov.in/ITR2"); root.SetAttribute("xmlns:ITR3FORM", "http://incometaxindiaefiling.gov.in/ITR3"); root.SetAttribute("xmlns:ITR4FORM", "http://incometaxindiaefiling.gov.in/ITR4"); d.AppendChild(root); d.Save("c://myxml.xml"); and I am getting an output like this <?xml version="1.0" encoding="utf-8" ?> - <!-- Sample XML file generated by XMLSpy v2007 sp2 (http://www.altova.com) --> - <ITRETURN:ITR xsi:schemaLocation="http://incometaxindiaefiling.gov.in/main ITRMain10.xsd" xmlns:ITR1FORM="http://incometaxindiaefiling.gov.in/ITR1" xmlns:ITR2FORM="http://incometaxindiaefiling.gov.in/ITR2" xmlns:ITR3FORM="http://incometaxindiaefiling.gov.in/ITR3" xmlns:ITR4FORM="http://incometaxindiaefiling.gov.in/ITR4" xmlns:xsi="http://incometaxindiaefiling.gov.in/main ITRMain10.xsd" xmlns:ITRETURN="http://incometaxindiaefiling.gov.in/ITR1"> <ITR1FORM:ITR1>root node</ITR1FORM:ITR1> </ITRETURN:ITR> But my requirement is like <ITRETURN:ITR xsi:schemaLocation="http://incometaxindiaefiling.gov.in/main ITRMain10.xsd" xmlns:ITR1FORM="http://incometaxindiaefiling.gov.in/ITR1" xmlns:ITR2FORM="http://incometaxindiaefiling.gov.in/ITR2" xmlns:ITR3FORM="http://incometaxindiaefiling.gov.in/ITR3" xmlns:ITR4FORM="http://incometaxindiaefiling.gov.in/ITR4" xmlns:ITRETURN="http://incometaxindiaefiling.gov.in/main" xmlns:ITRForm="http://incometaxindiaefiling.gov.in/master" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <ITR1FORM:ITR1>any value </ITR1FORM:ITR1> </ITRETURN:ITR> What do I need to change in my code to get the desired output?

    Read the article

  • How change Castor mapping to remove "xmlns:xsi" and "xsi:type" attributes from element in XML output

    - by Derek Mahar
    How do I change the Castor mapping <?xml version="1.0"?> <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" "http://castor.org/mapping.dtd"> <mapping> <class name="java.util.ArrayList" auto-complete="true"> <map-to xml="ArrayList" /> </class> <class name="com.db.spgit.abstrack.ws.response.UserResponse"> <map-to xml="UserResponse" /> <field name="id" type="java.lang.String"> <bind-xml name="id" node="element" /> </field> <field name="deleted" type="boolean"> <bind-xml name="deleted" node="element" /> </field> <field name="name" type="java.lang.String"> <bind-xml name="name" node="element" /> </field> <field name="typeId" type="java.lang.Integer"> <bind-xml name="typeId" node="element" /> </field> <field name="regionId" type="java.lang.Integer"> <bind-xml name="regionId" node="element" /> </field> <field name="regionName" type="java.lang.String"> <bind-xml name="regionName" node="element" /> </field> </class> </mapping> to suppress the xmlns:xsi and xsi:type attributes in the element of the XML output? For example, instead of the output XML <?xml version="1.0" encoding="UTF-8"?> <ArrayList> <UserResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="UserResponse"> <name>Tester</name> <typeId>1</typeId> <regionId>2</regionId> <regionName>US</regionName> </UserResponse> </ArrayList> I'd prefer <?xml version="1.0" encoding="UTF-8"?> <ArrayList> <UserResponse> <name>Tester</name> <typeId>1</typeId> <regionId>2</regionId> <regionName>US</regionName> </UserResponse> </ArrayList> such that the element name implies the xsi:type.

    Read the article

  • xml validity with xsd with xsi:nillable element

    - by Laxmikanth Samudrala
    My XML file <tns:SampleInfoResponse xsi:schemaLocation="sampleNS test.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="sampleNS"> String String String String String String String String String String String String MY XSD file <xsd:schema targetNamespace="sampleNS" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="sampleNS" xmlns="http://www.w3.org/2001/XMLSchema"> parser is complaining on <tns:LSampleEnrlDetails/>, the XML file should be <tns:LSampleEnrlDetails xsi:nil="true"/> only for valid file ? By taking out the whole tag also the parser is complaining. I would like to know what possible cases for this tag makes the XML file valid according the above schema when i don't have the data to populate for tag

    Read the article

  • XMLBeans - xsi:type stripped using Axis2 and Tomcat?

    - by Matthew Gamble
    I’m new to XMLBeans and have been trying to use it to create an XML document as part of an axis2 web service. When I run my code as a standard Java application or as a standard servlet, the XML is correctly generated: <?xml version="1.0" encoding="UTF-8"?> <c:BroadsoftDocument protocol="OCI" xmlns:c="C"> <sessionId>000000001</sessionId> <command xsi:type="AuthenticationRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <userId>admin</userId></command> </c:BroadsoftDocument> However, when the exact same code is run under Axis2 & Tomcat in a servlet I get: <?xml version="1.0" encoding="UTF-8"?> <c:BroadsoftDocument protocol="OCI" xmlns:c="C"> <sessionId>000000001</sessionId> <command> <userId>admin</userId></command> </c:BroadsoftDocument> This of course isn’t valid – the xsi:type of the “command” element is stripped when the code is run under Tomcat. Does anyone have any suggestions of what I could be doing wrong that would cause this type of issue only when running under Axis2? At first I thought it was a Tomcat issue, but after creating a generic servlet and running the exact same code I don't have any issues. I've tried playing with the XMLOptions for XMLBeans, but couldn't seem to resolve the problem. The options I'm currently using are: xmlOptions = new XmlOptions(); xmlOptions.setCharacterEncoding("UTF-8"); xmlOptions.setUseDefaultNamespace(); xmlOptions.setSaveAggressiveNamespaces(); xmlOptions.setSavePrettyPrint();

    Read the article

  • Unknown attribute xsi:type in XmlSerializer

    - by vanccoon
    I am learning XML Serialization and meet an issue, I have two claess [System.Xml.Serialization.XmlInclude(typeof(SubClass))] public class BaseClass { } public class SubClass : BaseClass { } I am trying to serialize a SubClass object into XML file, I use blow code XmlSerializer xs = new XmlSerializer(typeof(Base)); xs.Serialize(fs, SubClassObject); I noticed Serialization succeed, but the XML file is kind of like ... If I use XmlSerializer xs = new XmlSerializer(typeof(Base)); SubClassObject = xs.Deserialize(fs) as SubClass; I noticed it will complain xsi:type is unknown attribute(I registered an event), although all information embedded in the XML was parsed successfully and members in SubClassObject was restored correctly. Anyone has any idea why there is error in parsing xsi:type and anything I did wrong? Thanks

    Read the article

  • How to solve validation error on xsi:noNamespaceSchemaLocation in jdoconfig.xml

    - by mamuso
    Since I updated today to GAE 1.7.2.1, I'm having validation errors in eclipse in all my jdoconfig.xml files. I have the default jdoconfig.xml content : [...] <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig"> [...] And eclipse validation throws: Referenced file contains errors (http://java.sun.com/xml/ns/jdo/jdoconfig). For more information, right click on the message in the Problems View and select "Show Details..." When clicking on details I can see a bunch of lines like: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'var_U = "undefined";'. In different lines and different content in "Saw ... " It occurs in every single project I start using the "New Web Application Project..." from the google plugin. So does anyone have this problem? Any fix?

    Read the article

  • avoid extra xmlns:xsi while adding a attribute to xml root element in C#.net

    - by Rakesh kumar
    Please help me. First pls forgive me if i am wrong. i am createing a xmlfile using c#.net . my Code is like XmlDocument d = new XmlDocument(); XmlDeclaration xmlDeclaration = d.CreateXmlDeclaration("1.0", "utf-8", null); d.InsertBefore(xmlDeclaration,d.DocumentElement); XmlElement root = d.CreateElement("ITRETURN","ITR","http://incometaxindiaefiling.gov.in/ITR1"); XmlAttribute xsiNs = d.CreateAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"); xsiNs.Value = "http://incometaxindiaefiling.gov.in/main ITRMain10.xsd"; root.SetAttributeNode(xsiNs); //root.SetAttribute("xsi:schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"); root.SetAttribute("xmlns:ITR1FORM", "http://incometaxindiaefiling.gov.in/ITR1"); root.SetAttribute("xmlns:ITR2FORM", "http://incometaxindiaefiling.gov.in/ITR2"); root.SetAttribute("xmlns:ITR3FORM", "http://incometaxindiaefiling.gov.in/ITR3"); root.SetAttribute("xmlns:ITR4FORM", "http://incometaxindiaefiling.gov.in/ITR4"); d.AppendChild(root); d.Save("c://myxml.xml"); and i am getting output like this - - root node But My requirement is like + any value please help

    Read the article

  • XML and XSD - use element name as replacement of xsi:type for polymorphism

    - by disown
    Taking the W3C vehicle XSD as an example: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cars.example.com/schema" xmlns:target="http://cars.example.com/schema"> <complexType name="Vehicle" abstract="true"/> <complexType name="Car"> <complexContent> <extension base="target:Vehicle"/> ... </complexContent> </complexType> <complexType name="Plane"> <complexContent> <extension base="target:Vehicle"/> <sequence> <element name="wingspan" type="integer"/> </sequence> </complexContent> </complexType> </schema> , and the following definition of 'meansOfTravel': <complexType name="MeansOfTravel"> <complexContent> <sequence> <element name="transport" type="target:Vehicle"/> </sequence> </complexContent> </complexType> <element name="meansOfTravel" type="target:MeansOfTravel"/> With this definition you need to specify the type of your instance using xsi:type, like this: <meansOfTravel> <transport xsi:type="Plane"> <wingspan>3</wingspan> </transport> </meansOfTravel> I would just like to acheive a 'name of type' - 'name of element' mapping so that this could be replaced with just <meansOfTravel> <plane> <wingspan>3</wingspan> </plane> </meansOfTravel> The only way I could do this until now is by making it explicit: <complexType name="MeansOfTravel"> <sequence> <choice> <element name="plane" type="target:Plane"/> <element name="car" type="target:Car"/> </choice> </sequence> </complexType> <element name="meansOfTravel" type="target:MeansOfTravel"/> But this means that I have to list all possible sub-types in the 'MeansOfTravel' complex type. Is there no way of making the XML parser assume that you mean a 'Plane' if you call the element 'plane'? Or do I have to make the choice explicit? I would just like to keep my design DRY - if you have any other suggestions (like groups or so) - i would love to hear them.

    Read the article

  • JAXB - How to add xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

    - by Anurag
    I am using JAXB to create XML file from a result set. I have created java/ /class files using the xsd with the help of xjc utiliy. Now I am trying to create the xml file using the Marshaller. In the XML file I do not see theh xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attribute with the root tag. My xsd Below is the code : public class JAXBConstructor { public void generateXMLDocument(File xmlDocument){ try { JAXBContext jaxbContext = JAXBContext.newInstance("com"); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); com.ObjectFactory factory = new com.ObjectFactory(); USERTASKSImpl userTasks =(USERTASKSImpl)(factory.createUSERTASKS()); USERTASKTypeImpl userTaskType = (USERTASKTypeImpl)(factory.createUSERTASKSTypeUSERTASKType()); userTaskType.setName("zmannan"); userTaskType.setCode("G5023920"); java.util.List userTaskList=userTasks.getUSERTASK(); userTaskList.add(userTaskType); marshaller.marshal(userTasks, new FileOutputStream("User_Task.xml")); } Output of the code : This does not contain the XMLSchema value - < ?xml version="1.0" encoding="UTF-8" standalone="yes"? < USER_TASKS xmlns="http://schemas.jpmchase.net/Recertification" < CodeG5023920< /Code < Namezmannan< /Name < /USER_TASK < /USER_TASKS Please help how can I add the schema-instance value in the rrot tag.

    Read the article

  • Using xsi:nil in XML

    - by Matt
    I am generating an XML file from a VB.NET app. The document was generating fine before I tried to add nillable elements. I am now testing putting in just one nil element as: <blah xsi:nil="true"></blah> Once this element is in place and I try to view the XML file in IE it is unable to display. I am receiving: > The XML page cannot be displayed > Cannot view XML input using XSL style > sheet. Please correct the error and > then click the Refresh button, or try > again later. > > -------------------------------------------------------------------------------- > > The operation completed successfully. > Error processing resource If I remove this one element it displays fine again. What am I missing here?

    Read the article

  • Suds array of arrays not nesting

    - by joshcartme
    Let me preface this by saying that I am still pretty new to SOAP and how things should work. I'm working with the Vertical Response API. I'm having trouble getting suds to construct the xml correctly for a request. Here is some code: from suds.client import Client url = 'https://api.verticalresponse.com/wsdl/1.0/VRAPI.wsdl' client = Client(url) vr = client.service ... test_list = ( ( { 'name' : 'email_address', 'value' : login['username'], }, { 'name' : 'First_Name', 'value' : 'VR_User', } ), ( { 'name' : 'email_address', 'value' : '[email protected]', }, { 'name' : 'First_Name', 'value' : login['username'], }, ), ) # sid and cid are correctly retrieved prior to this point print "Sending test message..." vr.sendEmailCampaignTest({ 'session_id' : sid, 'campaign_id' : cid, 'recipients' : test_list, }) In this context login['username'] is just an email address. That code raises this error: suds.WebFault: Server raised fault: 'Application failed during request deserialization: Too many elements in array. 4 instead of claimed 2 (2) Here is the the definition of sendEmailCampaignTest: http://developers.verticalresponse.com/api/soap/methods/campaigns/sendemailcampaigntest/ Here is the xml that logging outputs (I removed the session_id and list_id for display here): DEBUG:suds.client:headers = {'SOAPAction': u'"VR/API/1_0#sendEmailCampaignTest"', 'Content-Type': 'text/xml; charset=utf-8'} ERROR:suds.client:<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:ns3="http://api.verticalresponse.com/1.0/VRAPI.xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="VR/API/1_0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header/> <ns0:Body> <ns4:sendEmailCampaignTest> <args xsi:type="ns3:sendEmailCampaignTestArgs"> <session_id xsi:type="ns1:string">redacted</session_id> <campaign_id xsi:type="ns1:int">redacted</campaign_id> <recipients xsi:type="ns3:ArrayOfNVDictionary" ns2:arrayType="ns3:NVDictionary[2]"> <item> <name xsi:type="ns1:string">email_address</name> <value xsi:type="ns1:string">[email protected]</value> </item> <item> <name xsi:type="ns1:string">First_Name</name> <value xsi:type="ns1:string">VR_User</value> </item> <item> <name xsi:type="ns1:string">email_address</name> <value xsi:type="ns1:string">[email protected]</value> </item> <item> <name xsi:type="ns1:string">First_Name</name> <value xsi:type="ns1:string">[email protected]</value> </item> </recipients> </args> </ns4:sendEmailCampaignTest> </ns0:Body> </SOAP-ENV:Envelope> DEBUG:suds.client:http failed: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Application failed during request deserialization: Too many elements in array. 4 instead of claimed 2 (2) </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> a ruby script (provided by Vertical Response) that does the same things as the script I am working on in python outputs the following xml (I removed the session_id and list_id): <?xml version="1.0" encoding="utf-8" ?> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <n1:sendEmailCampaignTest xmlns:n1="VR/API/1_0" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <args xmlns:n2="http://api.verticalresponse.com/1.0/VRAPI.xsd" xsi:type="n2:sendEmailCampaignTestArgs"> <session_id xsi:type="xsd:string">redacted</session_id> <campaign_id xsi:type="xsd:int">redacted</campaign_id> <recipients xmlns:n3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="n3:Array" n3:arrayType="n2:NVDictionary[2]"> <item xsi:type="n3:Array" n3:arrayType="n2:NVPair[2]"> <item> <name xsi:type="xsd:string">email_address</name> <value href="#id9496430"></value> </item> <item> <name xsi:type="xsd:string">First_Name</name> <value xsi:type="xsd:string">VR_User</value> </item> </item> <item xsi:type="n3:Array" n3:arrayType="n2:NVPair[2]"> <item> <name xsi:type="xsd:string">email_address</name> <value xsi:type="xsd:string">[email protected]</value> </item> <item> <name xsi:type="xsd:string">First_Name</name> <value href="#id9496430"></value> </item> </item> </recipients> </args> </n1:sendEmailCampaignTest> <value id="id9496430" xsi:type="xsd:string" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">[email protected]</value> </env:Body> </env:Envelope> I understand that the error is in the construction of recipients. It should contain two items, each that contain two items but my python script using suds is setting it up to contain four unnested items. So my question is how can I get suds to correctly construct the xml?

    Read the article

  • How to select the value of the xsi:type attribute in SQL Server?

    - by kralizek
    Considering this xml document: DECLARE @X XML (DOCUMENT search.SearchParameters) = '< parameters xmlns="http://www.educations.com/Search/Parameters.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> < parameter xsi:type="category" categoryID="38" /> < /parameters>'; I'd like to access the value of the attribute "type". According to this blog post, the xsi:type attribute is special and can't be accessed by usal keywords/functions. How can I do it? PS: I tried with WITH XMLNAMESPACES ( 'http://www.educations.com/Search/Parameters.xsd' as p, 'http://www.w3.org/2001/XMLSchema-instance' as xsi ) SELECT @X.value('(/p:parameters/p:parameter/@xsi:type)[1]','nvarchar(max)') but it didn't work.

    Read the article

  • How to insert sub root node in xml file

    - by pravakar
    Hi guys hope all are doing good. I want to create one sub root node in my xml file like, <CapitalJobsList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <JobAds> -- element to create <JobAd> <AdvertiserDetails> <AdvertiserId>718508549</AdvertiserId> <AdvertiserName>ABC</AdvertiserName> </AdvertiserDetails> <ConsultantDetails> <ContactName>Naga Divakar</ContactName> <ContactPhone>6239 7755</ContactPhone> <ContactEmail>[email protected]</ContactEmail> <ContactFax>12345678912</ContactFax> </ConsultantDetails> <JobAdDetails> <DateEntered>2009-10-03T21:09:35.500</DateEntered> <AdvertiserJobRef>83754865</AdvertiserJobRef> <Title>IT Operations Manager</Title> <DescriptionShort>Large scale/exciting projects Mentor and manage o...</DescriptionShort> <Description>Large scale/exciting projects Mentor and manage others Management/technical mix This is a fantastic opportunity to join a high profile client who is active across both the commercial and Government domain. As the IT Operations Manager you will be responsible for leading and mentoring a small team of Infrastructure Engineers to ensure the availability and performance of the IT infrastructure. You w</Description> <SalaryMin>0.00</SalaryMin> <SalaryMax>0.00</SalaryMax> <WorkType xsi:nil="true" /> <Location>) as [JobAd/JobAdDetails/Bullets], isnull(Job</Location> <PostCode>2600</PostCode> <ClosingDate>2009-11-01T00:00:00</ClosingDate> <Keywords xsi:nil="true" /> <ApplyEmail xsi:nil="true" /> <ApplyURL>http://jobview.careerone.com.au/GetJob.aspx?JobID=83754865</ApplyURL> </JobAdDetails> <JobAdOptions> <BlindPost xsi:nil="true" /> <AdFormatType xsi:nil="true" /> <AdTemplateName xsi:nil="true" /> <ShowContactDetails xsi:nil="true" /> <ShowSalary xsi:nil="true" /> <HasVideo xsi:nil="true" /> <ResumeRequired>1</ResumeRequired> <ResidentsOnly>0</ResidentsOnly> </JobAdOptions> <CategoryList> <Category xsi:nil="true" /> </CategoryList> <RegionsList> <Region>ACT</Region> </RegionsList> <LevelsList> <Level xsi:nil="true" /> </LevelsList> </JobAd> <JobAd> <AdvertiserDetails> <AdvertiserId>718508549</AdvertiserId> <AdvertiserName>ABC</AdvertiserName> </AdvertiserDetails> <ConsultantDetails> <ContactName>Naga Divakar</ContactName> <ContactPhone>6239 7755</ContactPhone> <ContactEmail>[email protected]</ContactEmail> <ContactFax>12345678912</ContactFax> </ConsultantDetails> <JobAdDetails> <DateEntered>2009-10-03T21:09:35.530</DateEntered> <AdvertiserJobRef>83731488</AdvertiserJobRef> <Title>SAP Developers Required in Canberra - 12 month contract</Title> <DescriptionShort>My client, a large government department in Canbe...</DescriptionShort> <Description>My client, a large government department in Canberra, seeks two SAP Developers for 12 month ongoing contracts. Two SAP Developers Required Expert level ABAP programming skills Large SAP landscape - SAP R/3, SAP Web, SAP BI, SAP ITS My client, a large government department in Canberra, seeks two SAP Developers for 12 month ongoing contracts. My client is a large government department in Canberra, a</Description> <SalaryMin>0.00</SalaryMin> <SalaryMax>0.00</SalaryMax> <WorkType xsi:nil="true" /> <Location>) as [JobAd/JobAdDetails/Bullets], isnull(Job</Location> <PostCode>2600</PostCode> <ClosingDate>2009-11-01T00:00:00</ClosingDate> <Keywords xsi:nil="true" /> <ApplyEmail xsi:nil="true" /> <ApplyURL>http://jobview.careerone.com.au/GetJob.aspx?JobID=83731488</ApplyURL> </JobAdDetails> <JobAdOptions> <BlindPost xsi:nil="true" /> <AdFormatType xsi:nil="true" /> <AdTemplateName xsi:nil="true" /> <ShowContactDetails xsi:nil="true" /> <ShowSalary xsi:nil="true" /> <HasVideo xsi:nil="true" /> <ResumeRequired>1</ResumeRequired> <ResidentsOnly>0</ResidentsOnly> </JobAdOptions> <CategoryList> <Category xsi:nil="true" /> </CategoryList> <RegionsList> <Region>ACT</Region> </RegionsList> <LevelsList> <Level xsi:nil="true" /> </LevelsList> </JobAd> </JobAds> </CapitalJobsList> I have used the sql query for xml path like: select r.advid as [JobAd/AdvertiserDetails/AdvertiserId], CompanyName as [JobAd/AdvertiserDetails/AdvertiserName], firstname +'' ''+ lastname as [JobAd/ConsultantDetails/ContactName], WorkPhone as [JobAd/ConsultantDetails/ContactPhone], AdvEmail as [JobAd/ConsultantDetails/ContactEmail], FaxNo as [JobAd/ConsultantDetails/ContactFax], Job_CreatedDate as [JobAd/JobAdDetails/DateEntered], Job_Id as [JobAd/JobAdDetails/AdvertiserJobRef], Job_Title as [JobAd/JobAdDetails/Title], substring(Job_Description,0,50)+''...'' as [JobAd/JobAdDetails/DescriptionShort], Job_Description as [JobAd/JobAdDetails/Description], CONVERT(DECIMAL(10,2),MinSalary) as [JobAd/JobAdDetails/SalaryMin], CONVERT(DECIMAL(10,2),MaxSalary) as [JobAd/JobAdDetails/SalaryMax], Job_Type as [JobAd/JobAdDetails/WorkType], isnull(Job_Bullets,'') as [JobAd/JobAdDetails/Bullets], isnull(Job_Location,'') as [JobAd/JobAdDetails/Location], Job_PostCode as [JobAd/JobAdDetails/PostCode], Job_ExpireDate as [JobAd/JobAdDetails/ClosingDate], Job_Keywords as [JobAd/JobAdDetails/Keywords], ApplyEmail as [JobAd/JobAdDetails/ApplyEmail], Job_BrandURL+Job_Id as [JobAd/JobAdDetails/ApplyURL], BlindPost as [JobAd/JobAdOptions/BlindPost], AdFormatType as [JobAd/JobAdOptions/AdFormatType], AdTemplateName as [JobAd/JobAdOptions/AdTemplateName], ShowContactDetails as [JobAd/JobAdOptions/ShowContactDetails], ShowSalary as [JobAd/JobAdOptions/ShowSalary], HasVideo as [JobAd/JobAdOptions/HasVideo], ResumeRequired as [JobAd/JobAdOptions/ResumeRequired], ResidentsOnly as [JobAd/JobAdOptions/ResidentsOnly], Job_Category as [JobAd/CategoryList/Category], Job_Location_State as [JobAd/RegionsList/Region], [Level] as [JobAd/LevelsList/Level] from DR_Adv_Registration r, DR_CareerOne_ACTJobs j where r.Advid = j.Advid and job_location_city like(''%'+''+ @City +''+'%'') and job_location_state in('''+ @State +''') and job_status=1 for xml path(''''), Root(''CapitalJobsList''),ELEMENTS XSINIL So, suggest me how to get the sub root node. Thanks in advance

    Read the article

  • Array values disappear in PHP SoapClient call to Cisco phone system.

    - by Jamin
    I am attempting to consume a SOAP service provided by our Cisco phone system (documentation), to get the current status of a given set of phones. I have an array of phone names, which I'm trying to pass to the service, however, the values of the array are being eaten somewhere Array of items like so: $items = array( 0 => "SEP0004F2E57F8C", 1 => "SEP001111BF8758", 2 => "SEP001320BD485C" ); Attempting to call the method: $client = new SoapClient( "https://x.x.x.x/realtimeservice/services/RisPort?wsdl", array( "login" => "admin", "password"=> "xxxxx", "trace" => true ) ); $devices = $client->SelectCmDevice( "", array( "SelectBy" => "Name", "Status" => "Any", "SelectedItems" => $items ) ); When I debug the complete request I get the following: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope mlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.cisco.com/ast/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:SelectCmDevice> <StateInfo xsi:type="xsd:string"></StateInfo> <CmSelectionCriteria xsi:type="ns1:CmSelectionCriteria"> <MaxReturnedDevices xsi:nil="true"/> <Class xsi:nil="true"/> <Model xsi:nil="true"/> <Status xsi:type="xsd:string">Any</Status> <NodeName xsi:nil="true"/> <SelectBy xsi:type="xsd:string">Name</SelectBy> <SelectItems SOAP-ENC:arrayType="ns1:SelectItem[3]" xsi:type="ns1:SelectItems"> <item xsi:type="ns1:SelectItem"/> <item xsi:type="ns1:SelectItem"/> <item xsi:type="ns1:SelectItem"/> </SelectItems> </CmSelectionCriteria> </ns1:SelectCmDevice> </SOAP-ENV:Body> </SOAP-ENV:Envelope> The correct number of <Item elements were counted and inserted into the <SelectItems object, however, the actual item names themselves are gone. I would guess it needs to be <ItemSEP0004F2E57F8C</Item, etc., but I can't seem to figure out how to make it do that. Thank you in advance for any help!!!

    Read the article

  • Photobooth Program for Windows, and Cannon XSI that outputs to Picassa instead of a printer.

    - by Justin Dearing
    I am looking for a program that will allow a windows computer or a Windows CE device tethered to a Cannon xsi to act as a DIY photobooth. Price is not necessarily a factor, but I'd be quite interested in an open source solution. Instead of printing the photos I'd like to write them to a single Picassa album. If the software could be controlled by the Cannon's remote control. It would be a self serving photo booth for a wedding.

    Read the article

  • Is xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" a special case in XML?

    - by Bytecode Ninja
    When we use a namespace, we should also indicate where its associated XSD is located at, as can be seen in the following example: <?xml version="1.0"?> <Artist BirthYear="1958" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.webucator.com/Artist" xsi:schemaLocation="http://www.webucator.com/Artist Artist.xsd"> <Name> <Title>Mr.</Title> <FirstName>Michael</FirstName> <LastName>Jackson</LastName> </Name> </Artist> Here, we have indicated that Artist.xsd should be used for validating the http://www.webucator.com/Artist namespace. However, we are also using the http://www.w3.org/2001/XMLSchema-instance namespace, but we have not specified where its XSD is located at. How do XML parsers know how to handle this namespace? Thanks in advance.

    Read the article

  • Coldfusion Web Service Response Problem

    - by Ivan Paloscia
    I have a problem with the Web Service I recently developed. The problem is about the Web Service response. More precisely sometimes the Web Service sends back the following response: <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:GetConstants2Response soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://usermanagerwstest"> <GetConstants2Return xsi:type="ns2:CFComponentSkeleton" xmlns:ns2="http://rpc.xml.coldfusion"/> </ns1:GetConstants2Response> </soapenv:Body> </soapenv:Envelope> Instead the correct response (that sometimes shows up in an intermittent way) is reported below: <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:GetConstants2Response soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://usermanagerwstest"> <GetConstants2Return xsi:type="ns1:Constants2"> <BooleanTypeFalse xsi:type="xsd:string">0</BooleanTypeFalse> <BooleanTypeTrue xsi:type="xsd:string">1</BooleanTypeTrue> <GenderFemale xsi:type="xsd:string">F</GenderFemale> <GenderMale xsi:type="xsd:string">M</GenderMale> <LanguageEnglish xsi:type="xsd:string">inglese</LanguageEnglish> <LanguageItalian xsi:type="xsd:string">italiano</LanguageItalian> </GetConstants2Return> </ns1:GetConstants2Response> </soapenv:Body> </soapenv:Envelope> Where does the CFCComponentSkeleton comes from? I thank everybody in advance.

    Read the article

  • How do you get XML::Pastor to set xsi:type for programmatically generated elements?

    - by Derrick
    I'm learning how to use Perl as an automation test framework tool for a Java web service and running into trouble generating xml requests from the Pastor generated modules. The problem is that when including a type that extends from the required type for an element, the xsi:type is not included in the generated xml string. Say, for example, I want to generate the following xml request from the modules that XML::Pastor generated from my xsd: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <PromptAnswersRequest xmlns="http://mycompany.com/api"> <Uri>/some/url</Uri> <User ref="1"/> <PromptAnswers> <PromptAnswer xsi:type="textPromptAnswer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Prompt ref="2"/> <Children> <PromptAnswer xsi:type="choicePromptAnswer"> <Prompt ref="1"/> <Choice ref="2"/> </PromptAnswer> </Children> <Value>totally</Value> </PromptAnswer> </PromptAnswers> </PromptAnswersRequest> What I'm getting currently is this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <PromptAnswersRequest xmlns="http://mycompany.com/api"> <Uri>/some/url</Uri> <User ref="1"/> <PromptAnswers> <PromptAnswer> <Prompt ref="2"/> <Children> <PromptAnswer> <Prompt ref="1"/> <Choice ref="2"/> </PromptAnswer> </Children> <Value>totally</Value> </PromptAnswer> </PromptAnswers> </PromptAnswersRequest> Here are some relavent snippets from the xsd: <xs:complexType name="request"> <xs:sequence> <xs:element name="Uri" type="xs:anyURI"/> </xs:sequence> </xs:complexType> <xs:complexType name="promptAnswersRequest"> <xs:complexContent> <xs:extension base="api:request"> <xs:sequence> <xs:element name="User" type="api:ref"/> <xs:element name="PromptAnswers" type="api:promptAnswerList"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="promptAnswerList"> <xs:sequence> <xs:element name="PromptAnswer" type="api:promptAnswer" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="promptAnswer" abstract="true"> <xs:sequence> <xs:element name="Prompt" type="api:ref"/> <xs:element name="Children" type="api:promptAnswerList" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="textPromptAnswer"> <xs:complexContent> <xs:extension base="promptAnswer"> <xs:sequence> <xs:element name="Value" type="api:nonEmptyString" minOccurs="0"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> And here are relavent parts of the script: my $promptAnswerList = new My::API::Type::promptAnswerList; my @promptAnswers; my $promptAnswerList2 = new My::API::Type::promptAnswerList; my @textPromptAnswerChildren; my $textPromptAnswer = new My::API::Type::textPromptAnswer; my $textPromptAnswerRef = new My::API::Type::ref; $textPromptAnswerRef->ref('2'); $textPromptAnswer->Prompt($textPromptAnswerRef); my $choicePromptAnswer = new My::API::Type::choicePromptAnswer; my $choicePromptAnswerPromptRef = new My::API::Type::ref; my $choicePromptAnswerChoiceRef = new My::API::Type::ref; $choicePromptAnswerPromptRef->ref('1'); $choicePromptAnswerChoiceRef->ref('2'); $choicePromptAnswer->Prompt($choicePromptAnswerPromptRef); $choicePromptAnswer->Choice($choicePromptAnswerChoiceRef); push(@textPromptAnswerChildren, $choicePromptAnswer); $promptAnswerList2->PromptAnswer(@textPromptAnswerChildren); $textPromptAnswer->Children($promptAnswerList2); $textPromptAnswer->Value('totally'); push(@promptAnswers, $pulseTextPromptAnswer); push(@promptAnswers, $textPromptAnswer); I haven't seen this addressed anywhere in the documentation for the XML::Pastor modules, so if anyone can point me at a good reference for its use it would be greatly appreciated. Also, I'm only using XML::Pastor because I don't know of any other modules that can do this, so if any of you know of something either easier to use, or more well maintained, please let me know about that too!

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >