I'm consuming a SOAP Web Service that requires the text ":com" in some of the tags. For example instead of
<soapenv:Envelope >
<soapenv:Body>
<RunSimpleTrip>
<c>
<CompanyCode>CompanyCode</CompanyCode>
<Password>Password</Password>
<Username>Username</Username>
</c>
<BasicTrip>
<Comments />
<Driver>Some Driver</Driver>
<EndOdometer />
...
</BasicTrip>
</RunSimpleTrip>
</soapenv:Body>
</soapenv:Envelope>
It needs to be
<soapenv:Envelope >
<soapenv:Body>
<RunSimpleTrip>
<c>
<com:CompanyCode>CompanyCode</com:CompanyCode>
<com:Password>Password</com:Password>
<com:Username>Username</com:Username>
</c>
<BasicTrip>
<com:Comments />
<com:Driver>Some Driver</com:Driver>
<com:EndOdometer />
...
</BasicTrip>
</RunSimpleTrip>
</soapenv:Body>
</soapenv:Envelope>
Notice how not all the tags need the prefix (like the c or BasicTrip tags). Just the inner ones, the fields of the objects.
Am I stuck with doing a StringReplace on each individual tag, or is there an option I'm missing? Is there some way to toggle the importer or WSDL .pas file to do this by itself?
This is the same question, which received no good answer at the time Delphi HttpRio SOAPHTTPClient does not add a prefix to namespaced variables . And just like the question, when I generate this via soapUI it places the ":com" on the needed tags.
Edit: Here's a snippet of the WSDL that describes a BasicTrip
<xs:complexType name="BaseTrip">
<xs:sequence>
<xs:element name="Comments" nillable="true" type="xs:string"/>
<xs:element name="Driver" nillable="true" type="xs:string"/>
<xs:element name="EndOdometer" type="xs:decimal"/>
<xs:element name="GetMapPoints" type="xs:boolean"/>
...
</xs:sequence>
</xs:complexType>
I've got two example files: note.xml and note.xsd. I would like to combine this two files using DataSet and create output XML file, based on this operation. How can i do it?
note.xml
<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
note.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com"
xmlns="https://www.w3schools.com"
elementFormDefault="qualified">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
UPDATE
Basically, i would like to combine XSD and XML and create output XML file. I want to use something like data table relations(DataSet)
Then after combine, we can decide based on data type(string, int..), which for example: dataform can store this.
I am implementing BizTalk 2010 Saleforce integration where I am purely using enterprise wsdl for calling its methods. No C# code for any operation.
I am successfully able to call login method and getting result back with all details. Now at the subsequent request where I am calling query method which does not take additional parameter for taking header. It is only taking query string as parameter shown below.
<element name='query'>
<complexType>
<sequence>
<element name='queryString' type='string' />
</sequence>
</complexType>
</element>
Now the problem is when I am calling this method it is giving me error for "Invalid Session and Illegal Session Header" because no header getting passed.
Alternative that I tried is constructing message and passing header with session id (taking from login result) explicitly as shown below.
Option 1.
varXMLDocument = new System.Xml.XmlDocument();
varXMLDocument.LoadXml("<ns0:Envelope xmlns:ns0='http://QuerySFDCVIAWSDL.QueryRequestSchema'><Body><query><queryString>SELECT "some fields xyz..." FROM Quote</queryString></query></Body></ns0:Envelope>");
msgSendQryToSalesforce = varXMLDocument;
//Setting Header
msgSendQryToSalesforce(WCF.Headers) = "<ns0:SessionHeader xmlns:ns0=\"urn:enterprise.soap.sforce.com\"><ns0:sessionId>" + SessionId + "</ns0:sessionId></ns0:SessionHeader>";
Option 2.
//Creating session header in same xml.
varXMLDocument.LoadXml("<ns0:Envelope xmlns:ns0='http://QuerySFDCVIAWSDL.QueryRequestSchema'><Header><SessionHeader><sessionId>"+SessionId+"</sessionId></SessionHeader></Header><Body><query><queryString>SELECT "some fields xyz..." FROM Quote</queryString></query></Body></ns0:Envelope>");
The problem with these approach is SessionHeader getting removed at runtime and only querystring getting passed to SFDC. Hence getting same result "Invalid Session and Illegal Session Header".
//Request From Orchestration Debugger where there is no session header after been passed explicitly, it is only taking querystring.
//Final Request
<ns0:query xmlns:ns1="urn:sobject.enterprise.soap.sforce.com" xmlns:ns0="urn:enterprise.soap.sforce.com"><ns0:queryString>SELECT "some fields xyz..." FROM Quote</ns0:queryString></ns0:query>
Can anybody please help me and assist me in finding out the appropriate solution so that at all subsequent request have session ids passed in session header.
From SoapUI tool when I am passing same xml with session header it is getting me result back.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader> <urn:sessionId>some id.......</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:query>
<urn:queryString>Select "some fields xyz..." from Quote</urn:queryString>
</urn:query>
</soapenv:Body>
</soapenv:Envelope>
Not able to understand why from BizTalk it is not working.
Just FYI my queryRequestSchema
Just FYI my queryRequestSchema
<?xml version="1.0"?>
<xs:schema targetNamespace="http://QuerySFDCVIAWSDL.QueryRequestSchema" xmlns="http://QuerySFDCVIAWSDL.QueryRequestSchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Envelope">
<xs:complexType>
<xs:sequence>
<xs:element name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="SessionHeader">
<xs:complexType>
<xs:sequence>
<xs:element name="sessionId" type="xs:string"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Body">
<xs:complexType>
<xs:sequence>
<xs:element name="query">
<xs:complexType>
<xs:sequence>
<xs:element name="queryString" type="xs:string"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Thanks in Advance.
Use the (WCF.CustomOutboundHeaders) context property.
Replace this line:
//Setting Header
msgSendQryToSalesforce(WCF.Headers) = "<ns0:SessionHeader xmlns:ns0=\"urn:enterprise.soap.sforce.com\"><ns0:sessionId>" + SessionId + "</ns0:sessionId></ns0:SessionHeader>";
With this
// Setting Header
msgSendQryToSalesforce(WCF.OutboundCustomHeaders) = "<ns0:SessionHeader xmlns:ns0=\"urn:enterprise.soap.sforce.com\"><ns0:sessionId>" + SessionId + "</ns0:sessionId></ns0:SessionHeader>";
If you're using a utilities class, it might be a good idea to store that header template in a public const string variable, or write a method to format it for you - assuming you'll be sending multiple messages to Salesforce, you'll be able to reuse it more easily:
msgSendQryToSalesforce(WCF.OutboundCustomHeaders) = Utilities.GetSalesforceHeader(SessionId);
and in your utilities class, have a method like
public static string GetSalesforceHeader(string sessionId)
{
return "<ns0:SessionHeader xmlns:ns0=\"urn:enterprise.soap.sforce.com\"><ns0:sessionId>" + sessionId + "</ns0:sessionId></ns0:SessionHeader>";
}
More information on setting SOAP headers in Orchestrations:
https://msdn.microsoft.com/en-us/library/bb246026.aspx (but note that you don't actually have to use an XmlDocument for this); this applies to 2010 even though it says its for 2013.
I have a few problems with the cxf + WSClient in soap.
I am writing a small tool in grails that must make SOAP calls to an existing service.
WSClient (groovyws-0.5.3-20100521.062225-1.jar) seemed like the perfect solution to my problem.
However when i tried to implement a call to one of the actions i get two problems.
Problem #1 NullPointerException when making a call to some of the actions.
I have tracked down the code that is throwing the exception inside of
AbstractCXFWSClient.invokeMethod(String methodName, Object args)
if (!operationToBeInvoked.isUnwrapped()){
//Operation uses document literal wrapped style.
inputMessageInfo = operationToBeInvoked.getWrappedOperation().getInput();
} else {
inputMessageInfo = operationToBeInvoked.getUnwrappedOperation().getInput();
}
specifically operationToBeInvoked.getWrappedOperation() I have isolated the code in a unit test and find that both operationToBeInvoked.getWrappedOperation() and operationToBeInvoked.getWrappedOperation() result in null objects. I have tried to figure out what is causing it however i think i have gotten to the end of my knowledge.
Problem #2 WSClient.create(String classname) is eating a ClassNotFoundException (and then throwing a NullPointerException)
Basicly when I make the following call
def event = client.create("com.mypackage.MyBean");
Same bean that i can see by browsing the services from the browser.
<xs:complexType name="myBean">
<xs:sequence>
<xs:element minOccurs="0" name="id" type="xs:long"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="facets" nillable="true" type="tns:beanBean"/>
<xs:element minOccurs="0" name="sortId" type="xs:string"/>
<xs:element minOccurs="0" name="itemId" type="xs:string"/>
<xs:element minOccurs="0" name="preview" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
I get a NPE. When i drill down to figure out why i get an NPE, I find that its because the classloader on the WSClient can't find "com.mypackage.MyBean" eats the ClassNotFoundException and then inevitably throws an NPE.
Edit: Should I be using a different client the WSClient/cxf ? I really wanted to avoid having to roll my own.....
Basicly I didn't find the answer. I basicly was forced to uninstall the two plugins and cxf and not using the groovy WSClient.
What i did was install the ws-client plugin for grails and that worked.
http://www.grails.org/plugin/ws-client
Try to remove the jaxen's jar in .grails lib cxf plugin folder in your project. It should solve your problem.
I have Hudson as continuous integration server and I want to use option 'Publish JUnit test result report'. But I don't use xUnit tools for testing, instead of that i have shell scripts which run tests and return results in simple format. I am thinking to make a script which transforms these results to the JUnit format. So i'm interesting how the JUnit file must look?
I did a similar thing a few months ago, and it turned out this simple format was enough for Hudson to accept it as a test protocol:
<testsuite tests="3">
<testcase classname="foo1" name="ASuccessfulTest"/>
<testcase classname="foo2" name="AnotherSuccessfulTest"/>
<testcase classname="foo3" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>
This question has answers with more details: Spec. for JUnit XML Output
I just grabbed the junit-4.xsd that others have linked to and used a tool named XMLSpear to convert the schema to a blank XML file with the options shown below. This is the (slightly cleaned up) result:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites disabled="" errors="" failures="" name="" tests="" time="">
<testsuite disabled="" errors="" failures="" hostname="" id=""
name="" package="" skipped="" tests="" time="" timestamp="">
<properties>
<property name="" value=""/>
</properties>
<testcase assertions="" classname="" name="" status="" time="">
<skipped/>
<error message="" type=""/>
<failure message="" type=""/>
<system-out/>
<system-err/>
</testcase>
<system-out/>
<system-err/>
</testsuite>
</testsuites>
Some of these items can occur multiple times:
There can only be one testsuites element, since that’s how XML works, but there can be multiple testsuite elements within the testsuites element.
Each properties element can have multiple property children.
Each testsuite element can have multiple testcase children.
Each testcase element can have multiple error, failure, system-out, or system-err children.
The top answer of the question Anders Lindahl refers to an xsd file.
Personally I found this xsd file also very useful (I don't remember how I found that one). It looks a bit less intimidating, and as far as I used it, all the elements and attributes seem to be recognized by Jenkins (v1.451)
One thing though: when adding multiple <failure ... elements, only one was retained in Jenkins. When creating the xml file, I now concatenate all the failures in one.
Update 2016-11 The link is broken now. A better alternative is this page from cubic.org: JUnit XML reporting file format, where a nice effort has been taken to provide a sensible documented example. Example and xsd are copied below, but their page looks waay nicer.
sample JUnit XML file
<?xml version="1.0" encoding="UTF-8"?>
<!-- a description of the JUnit XML format and how Jenkins parses it. See also junit.xsd -->
<!-- if only a single testsuite element is present, the testsuites
element can be omitted. All attributes are optional. -->
<testsuites disabled="" <!-- total number of disabled tests from all testsuites. -->
errors="" <!-- total number of tests with error result from all testsuites. -->
failures="" <!-- total number of failed tests from all testsuites. -->
name=""
tests="" <!-- total number of successful tests from all testsuites. -->
time="" <!-- time in seconds to execute all test suites. -->
>
<!-- testsuite can appear multiple times, if contained in a testsuites element.
It can also be the root element. -->
<testsuite name="" <!-- Full (class) name of the test for non-aggregated testsuite documents.
Class name without the package for aggregated testsuites documents. Required -->
tests="" <!-- The total number of tests in the suite, required. -->
disabled="" <!-- the total number of disabled tests in the suite. optional -->
errors="" <!-- The total number of tests in the suite that errored. An errored test is one that had an unanticipated problem,
for example an unchecked throwable; or a problem with the implementation of the test. optional -->
failures="" <!-- The total number of tests in the suite that failed. A failure is a test which the code has explicitly failed
by using the mechanisms for that purpose. e.g., via an assertEquals. optional -->
hostname="" <!-- Host on which the tests were executed. 'localhost' should be used if the hostname cannot be determined. optional -->
id="" <!-- Starts at 0 for the first testsuite and is incremented by 1 for each following testsuite -->
package="" <!-- Derived from testsuite/#name in the non-aggregated documents. optional -->
skipped="" <!-- The total number of skipped tests. optional -->
time="" <!-- Time taken (in seconds) to execute the tests in the suite. optional -->
timestamp="" <!-- when the test was executed in ISO 8601 format (2014-01-21T16:17:18). Timezone may not be specified. optional -->
>
<!-- Properties (e.g., environment settings) set during test
execution. The properties element can appear 0 or once. -->
<properties>
<!-- property can appear multiple times. The name and value attributres are required. -->
<property name="" value=""/>
</properties>
<!-- testcase can appear multiple times, see /testsuites/testsuite#tests -->
<testcase name="" <!-- Name of the test method, required. -->
assertions="" <!-- number of assertions in the test case. optional -->
classname="" <!-- Full class name for the class the test method is in. required -->
status=""
time="" <!-- Time taken (in seconds) to execute the test. optional -->
>
<!-- If the test was not executed or failed, you can specify one
the skipped, error or failure elements. -->
<!-- skipped can appear 0 or once. optional -->
<skipped/>
<!-- Indicates that the test errored. An errored test is one
that had an unanticipated problem. For example an unchecked
throwable or a problem with the implementation of the
test. Contains as a text node relevant data for the error,
for example a stack trace. optional -->
<error message="" <!-- The error message. e.g., if a java exception is thrown, the return value of getMessage() -->
type="" <!-- The type of error that occured. e.g., if a java execption is thrown the full class name of the exception. -->
></error>
<!-- Indicates that the test failed. A failure is a test which
the code has explicitly failed by using the mechanisms for
that purpose. For example via an assertEquals. Contains as
a text node relevant data for the failure, e.g., a stack
trace. optional -->
<failure message="" <!-- The message specified in the assert. -->
type="" <!-- The type of the assert. -->
></failure>
<!-- Data that was written to standard out while the test was executed. optional -->
<system-out></system-out>
<!-- Data that was written to standard error while the test was executed. optional -->
<system-err></system-err>
</testcase>
<!-- Data that was written to standard out while the test suite was executed. optional -->
<system-out></system-out>
<!-- Data that was written to standard error while the test suite was executed. optional -->
<system-err></system-err>
</testsuite>
</testsuites>
JUnit XSD file
<?xml version="1.0" encoding="UTF-8" ?>
<!-- from https://svn.jenkins-ci.org/trunk/hudson/dtkit/dtkit-format/dtkit-junit-model/src/main/resources/com/thalesgroup/dtkit/junit/model/xsd/junit-4.xsd -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="failure">
<xs:complexType mixed="true">
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="error">
<xs:complexType mixed="true">
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="message" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="properties">
<xs:complexType>
<xs:sequence>
<xs:element ref="property" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="property">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="skipped" type="xs:string"/>
<xs:element name="system-err" type="xs:string"/>
<xs:element name="system-out" type="xs:string"/>
<xs:element name="testcase">
<xs:complexType>
<xs:sequence>
<xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
<xs:element ref="error" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="assertions" type="xs:string" use="optional"/>
<xs:attribute name="time" type="xs:string" use="optional"/>
<xs:attribute name="classname" type="xs:string" use="optional"/>
<xs:attribute name="status" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="testsuite">
<xs:complexType>
<xs:sequence>
<xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
<xs:element ref="testcase" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
<xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="tests" type="xs:string" use="required"/>
<xs:attribute name="failures" type="xs:string" use="optional"/>
<xs:attribute name="errors" type="xs:string" use="optional"/>
<xs:attribute name="time" type="xs:string" use="optional"/>
<xs:attribute name="disabled" type="xs:string" use="optional"/>
<xs:attribute name="skipped" type="xs:string" use="optional"/>
<xs:attribute name="timestamp" type="xs:string" use="optional"/>
<xs:attribute name="hostname" type="xs:string" use="optional"/>
<xs:attribute name="id" type="xs:string" use="optional"/>
<xs:attribute name="package" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="testsuites">
<xs:complexType>
<xs:sequence>
<xs:element ref="testsuite" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="optional"/>
<xs:attribute name="time" type="xs:string" use="optional"/>
<xs:attribute name="tests" type="xs:string" use="optional"/>
<xs:attribute name="failures" type="xs:string" use="optional"/>
<xs:attribute name="disabled" type="xs:string" use="optional"/>
<xs:attribute name="errors" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:schema>
I couldn't find any good information on this, so I did some trial and error. The following attributes and fields (and only these) are recognized by Jenkins (v1.585).
<?xml version="1.0" encoding="UTF-8"?>
<testsuite>
<!-- if your classname does not include a dot, the package defaults to "(root)" -->
<testcase name="my testcase" classname="my package.my classname" time="29">
<!-- If the test didn't pass, specify ONE of the following 3 cases -->
<!-- option 1 --> <skipped />
<!-- option 2 --> <failure message="my failure message">my stack trace</failure>
<!-- option 3 --> <error message="my error message">my crash report</error>
<system-out>my STDOUT dump</system-out>
<system-err>my STDERR dump</system-err>
</testcase>
</testsuite>
(I started with this sample XML document and worked backwards from there.)
I've decided to post a new answer, because some existing answers are outdated or incomplete.
First of all: there is nothing like JUnit XML Format Specification, simply because JUnit doesn't produce any kind of XML or HTML report.
The XML report generation itself comes from the Ant JUnit task/ Maven Surefire Plugin/ Gradle (whichever you use for running your tests). The XML report format was first introduced by Ant and later adapted by Maven (and Gradle).
If somebody just needs an official XML format then:
There exists a schema for a maven surefire-generated XML report and it can be found here: surefire-test-report.xsd.
For an ant-generated XML there is a 3rd party schema available here (but it might be slightly outdated).
Hope it will help somebody.
Basic Structure
Here is an example of a JUnit output file, showing a skip and failed result, as well as a single passed result.
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="JUnitXmlReporter" errors="0" tests="0" failures="0" time="0" timestamp="2013-05-24T10:23:58" />
<testsuite name="JUnitXmlReporter.constructor" errors="0" skipped="1" tests="3" failures="1" time="0.006" timestamp="2013-05-24T10:23:58">
<properties>
<property name="java.vendor" value="Sun Microsystems Inc." />
<property name="compiler.debug" value="on" />
<property name="project.jdk.classpath" value="jdk.classpath.1.6" />
</properties>
<testcase classname="JUnitXmlReporter.constructor" name="should default path to an empty string" time="0.006">
<failure message="test failure">Assertion failed</failure>
</testcase>
<testcase classname="JUnitXmlReporter.constructor" name="should default consolidate to true" time="0">
<skipped />
</testcase>
<testcase classname="JUnitXmlReporter.constructor" name="should default useDotNotation to true" time="0" />
</testsuite>
</testsuites>
Below is the documented structure of a typical JUnit XML report. Notice that a report can contain 1 or more test suite. Each test suite has a set of properties (recording environment information). Each test suite also contains 1 or more test case and each test case will either contain a skipped, failure or error node if the test did not pass. If the test case has passed, then it will not contain any nodes. For more details of which attributes are valid for each node please consult the following section "Schema".
<testsuites> => the aggregated result of all junit testfiles
<testsuite> => the output from a single TestSuite
<properties> => the defined properties at test execution
<property> => name/value pair for a single property
...
</properties>
<error></error> => optional information, in place of a test case - normally if the tests in the suite could not be found etc.
<testcase> => the results from executing a test method
<system-out> => data written to System.out during the test run
<system-err> => data written to System.err during the test run
<skipped/> => test was skipped
<failure> => test failed
<error> => test encountered an error
</testcase>
...
</testsuite>
...
</testsuites>
There are multiple schemas for "JUnit" and "xUnit" results.
XSD for Apache Ant's JUnit output can be found at : https://github.com/windyroad/JUnit-Schema (credit goes to this answer: https://stackoverflow.com/a/4926073/1733117)
XSD from Jenkins xunit-plugin can be found at : https://github.com/jenkinsci/xunit-plugin/tree/master/src/main/resources/org/jenkinsci/plugins/xunit/types (under model/xsd)
Please note that there are several versions of the schema in use by the Jenkins xunit-plugin (the current latest version is junit-10.xsd which adds support for Erlang/OTP Junit format).
Some testing frameworks as well as "xUnit"-style reporting plugins also use their own secret sauce to generate "xUnit"-style reports, those may not use a particular schema (please read: they try to but the tools may not validate against any one schema). Python unittests in Jenkins? gives a quick comparison of several of these libraries and slight differences between the xml reports generated.
Good answers here on using python: (there are many ways to do it)
Python unittests in Jenkins?
IMHO the best way is write python unittest tests and install pytest (something like 'yum install pytest') to get py.test installed.
Then run tests like this: 'py.test --junitxml results.xml test.py'. You can run any unittest python script and get jUnit xml results.
https://docs.python.org/2.7/library/unittest.html
In jenkins build configuration Post-build actions Add a "Publish JUnit test result report" action with result.xml and any more test result files you produce.