How to fix "Field not found" error in case using two XPath expressions in single report? - xpath

I've been struggling with my problem since 7 days.
I have 1 XML input data and want to convert that into desired PDF file with line chart
XML
<?xml version="1.0" encoding="utf-8"?>
<sample-data xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:ht="urn:xyz.com/xslt/extensions">
<section name="relative-performance">
<historic-valuations>
<valuation-list>
<valuation>
<value>890000</value>
<date>2014-12-01T00:00:00</date>
</valuation>
<valuation>
<value>923789</value>
<date>2015-12-01T00:00:00</date>
</valuation>
<valuation>
<value>897978</value>
<date>2016-12-01T00:00:00</date>
</valuation>
<valuation>
<value>957883</value>
<date>2017-12-01T00:00:00</date>
</valuation>
<valuation>
<value>919203</value>
<date>2018-12-01T00:00:00</date>
</valuation>
<valuation>
<value>950000</value>
<date>2019-12-01T00:00:00</date>
</valuation>
</valuation-list>
</historic-valuations>
<local-market-index>
<local-market>HA7 3</local-market>
<index-value-list>
<index-value>
<value>890000</value>
<date>2014-12-01T00:00:00</date>
</index-value>
<index-value>
<value>931069</value>
<date>2015-12-01T00:00:00</date>
</index-value>
<index-value>
<value>912244</value>
<date>2016-12-01T00:00:00</date>
</index-value>
<index-value>
<value>980893</value>
<date>2017-12-01T00:00:00</date>
</index-value>
<index-value>
<value>948882</value>
<date>2018-12-01T00:00:00</date>
</index-value>
<index-value>
<value>988654</value>
<date>2019-12-01T00:00:00</date>
</index-value>
</index-value-list>
</local-market-index>
</section>
</sample-data>
My JRXML
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.11.0.final using JasperReports Library version 6.11.0-0c4056ccaa4d25a5a8c45672d2f764ea3498bebb -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f3e693aa-b906-4972-95b4-4a7430cabd45">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="NewData"/>
<subDataset name="subData" uuid="87538cc6-4a9e-4953-acaa-3190030517a8">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="NewData"/>
<queryString language="xPath">
<![CDATA[/sample-data/section[#name='relative-performance']/historic-valuations/valuation-list/valuation]]>
</queryString>
<field name="value" class="java.lang.Integer">
<property name="net.sf.jasperreports.xpath.field.expression" value="value"/>
<fieldDescription><![CDATA[value]]></fieldDescription>
</field>
<field name="date" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="date"/>
<fieldDescription><![CDATA[date]]></fieldDescription>
</field>
</subDataset>
<queryString language="xPath">
<![CDATA[/sample-data/section[#name='relative-performance']/local-market-index/index-value-listindex-value]]>
</queryString>
<field name="value1" class="java.lang.Integer">
<property name="net.sf.jasperreports.xpath.field.expression" value="value1"/>
<fieldDescription><![CDATA[value]]></fieldDescription>
</field>
<field name="date1" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="date1"/>
<fieldDescription><![CDATA[date]]></fieldDescription>
</field>
<detail>
<band height="370" splitType="Stretch">
<lineChart>
<chart evaluationTime="Report">
<reportElement x="0" y="40" width="550" height="290" uuid="9bdc21fd-9b73-4ea9-919e-2c8807153f78"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<categoryDataset>
<dataset resetType="Report"/>
<categorySeries>
<seriesExpression><![CDATA["Estimated capital value"]]></seriesExpression>
<categoryExpression><![CDATA[$F{date}]]></categoryExpression>
<valueExpression><![CDATA[$F{value}]]></valueExpression>
<labelExpression><![CDATA[""]]></labelExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA["Local market index"]]></seriesExpression>
<categoryExpression><![CDATA[$F{date1}]]></categoryExpression>
<valueExpression><![CDATA[$F{value1}]]></valueExpression>
<labelExpression><![CDATA[""]]></labelExpression>
</categorySeries>
</categoryDataset>
<linePlot>
<plot/>
<categoryAxisFormat>
<axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/>
</categoryAxisFormat>
<valueAxisFormat>
<axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/>
</valueAxisFormat>
</linePlot>
</lineChart>
</band>
</detail>
</jasperReport>
I searched a lot and come to know that In my situation I need to make subDataSource so I did from
How to use multiple xpath datasets on XML datasource using PHP Jasper?
But I'm still getting this error
There are compilation error please fix the design
Field not found:date ---net.sf.jasperreports.xpath.field.expression#95d1b2c
Field not found:date ---net.sf.jasperreports.xpath.field.expression#62032410
I want to make line chart in jasper report then make it pdf in java which is another part but main issue is I'm not able to make a desired PDF which is

Related

Unable to toggle editor style after manually editing xcdatamodel/content file

After manually editing the xcdatamodel/content due to a merge conflict I'm able to open and run the project just fine, but I'm unable to toggle the toggle the editor style to show the "object relations diagram"
I'm using Xcode 13.4.1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="21279" systemVersion="21G115" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="Foo" representedClassName=".foo" syncable="YES">
...
</entity>
<entity name="Bar" representedClassName=".bar" syncable="YES">
...
</entity>
<entity name="FooBar" representedClassName=".fooBar" syncable="YES">
...
<fetchIndex name="fooie">
<fetchIndexElement property="fooeee" type="Binary" order="ascending"/>
</fetchIndex>
</entity>
<entity name="BarFoo" representedClassName=".barFoo" syncable="YES">
<fetchIndex name="byPropertyIndex">
<fetchIndexElement property="bla bla bla" type="Binary" order="descending"/>
</fetchIndex>
</entity>
<elements>
<element name="Foo" positionX="0" positionY="0" width="0" height="0"/>
<element name="Bar" positionX="0" positionY="0" width="0" height="0"/>
<element name="FooBar" positionX="0" positionY="0" width="0" height="0"/>
<element name="BarFoo" positionX="0" positionY="0" width="0" height="0"/>
</elements>
</model>
Any Idea what is going on here? How can I get xcode to open the object Diagram for this model version?

Is there a REST call to extract xml file from Talend ETL?

Does Talend ETL have a REST API call to extract xml, sample below:
Here is a sample xml:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:TalendMetadata="http://www.talend.org/metadata/connection/2010">
<TalendMetadata:XmlFileConnection xmi:id="_xz3RkGD7EeCFQbmPuExx4A" dataPackage="_xz3RkWD7EeCFQbmPuExx4A" XmlFilePath="/home/nfrancisco/Talend/Projets/TalendDemoJava/talend_files_0.1/in/XML/sample.xml" Encoding="ISO-8859-1">
<schema xmi:id="_xz34o2D7EeCFQbmPuExx4A" LimitBoucle="5000" AbsoluteXPathQuery="/root/biblio/book">
<schemaTargets xmi:id="_xz3RnWD7EeCFQbmPuExx4A" RelativeXPathQuery="#id" TagName="id"/>
<schemaTargets xmi:id="_xz3RnmD7EeCFQbmPuExx4A" RelativeXPathQuery="title/#subtitle" TagName="subtitle"/>
<schemaTargets xmi:id="_xz34oGD7EeCFQbmPuExx4A" RelativeXPathQuery="author" TagName="author"/>
<schemaTargets xmi:id="_xz34oWD7EeCFQbmPuExx4A" RelativeXPathQuery="volumes/volume/#VolumeNo" TagName="VolumeNo"/>
<schemaTargets xmi:id="_xz34omD7EeCFQbmPuExx4A" RelativeXPathQuery="volumes/volume/#nbPages" TagName="nbPages"/>
</schema>
</TalendMetadata:XmlFileConnection>
<TalendMetadata:GenericPackage xmi:id="_xz3RkWD7EeCFQbmPuExx4A" dataManager="_xz3RkGD7EeCFQbmPuExx4A">
<ownedElement xsi:type="TalendMetadata:MetadataTable" xmi:id="_xz3RnGD7EeCFQbmPuExx4A" id="_doC6wCLkEd-O8r6_89nfnA" label="metadata">
<feature xsi:type="TalendMetadata:MetadataColumn" xmi:id="_xz3RkmD7EeCFQbmPuExx4A" name="" label="id" length="1" talendType="id_Integer" pattern=""dd-MM-yyyy"">
<initialValue xmi:id="_xz3Rk2D7EeCFQbmPuExx4A" body=""/>
</feature>
<feature xsi:type="TalendMetadata:MetadataColumn" xmi:id="_xz3RlGD7EeCFQbmPuExx4A" name="" label="subtitle" length="15" talendType="id_String" pattern=""dd-MM-yyyy"">
<initialValue xmi:id="_xz3RlWD7EeCFQbmPuExx4A" body=""/>
</feature>
<feature xsi:type="TalendMetadata:MetadataColumn" xmi:id="_xz3RlmD7EeCFQbmPuExx4A" name="" label="author" length="7" talendType="id_String" pattern=""dd-MM-yyyy"">
<initialValue xmi:id="_xz3Rl2D7EeCFQbmPuExx4A" body=""/>
</feature>
<feature xsi:type="TalendMetadata:MetadataColumn" xmi:id="_xz3RmGD7EeCFQbmPuExx4A" name="" label="VolumeNo" length="1" talendType="id_Integer" pattern=""dd-MM-yyyy"">
<initialValue xmi:id="_xz3RmWD7EeCFQbmPuExx4A" body=""/>
</feature>
<feature xsi:type="TalendMetadata:MetadataColumn" xmi:id="_xz3RmmD7EeCFQbmPuExx4A" name="" label="nbPages" length="2" talendType="id_Integer" pattern=""dd-MM-yyyy"">
<initialValue xmi:id="_xz3Rm2D7EeCFQbmPuExx4A" body=""/>
</feature>
</ownedElement>
</TalendMetadata:GenericPackage>
</xmi:XMI>

Jasper Report how to get a sibling node with parameter of another sibling?

I am working on a new Jaspert Report. It should print all data of a xml text.
The xml text looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<invoice:invoiceMessage>
<invoice>
<invoiceIdentification></invoiceIdentification>
<seller>
<address>
<name></name>
<city></city>
<cityCode></cityCode>
</address>
</seller>
</invoice>
</invoice:invoiceMessage>
And the Jasper Report looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 7.1.0.final using JasperReports Library version 6.4.3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="main_report_xml1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="24a4119c-6e8f-4411-bbb5-c069ab379330">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<property name="ireport.jasperserver.url" value="http://10.100.10.236/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="reko"/>
<property name="ireport.jasperserver.reportUnit" value="/Reko/main_report_xml1"/>
<subDataset name="pageHeader" uuid="cf87fcbb-cbcd-4c3b-bf87-3cf147854adb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<queryString language="xPath">
<![CDATA[//seller/address]]]>
</queryString>
<field name="name" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="name"/>
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<field name="streetAdressOne" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="streetAdressOne"/>
<fieldDescription><![CDATA[streetAdressOne]]></fieldDescription>
</field>
<field name="cityCode" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="cityCode"/>
<fieldDescription><![CDATA[cityCode]]></fieldDescription>
</field>
<field name="city" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="city"/>
<fieldDescription><![CDATA[city]]></fieldDescription>
</field>
</subDataset>
<parameter name="xmlString" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[xmlText]]></defaultValueExpression>
</parameter>
<parameter name="XML_INPUT_STREAM" class="java.io.InputStream">
<defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{xmlString}.getBytes("ISO-8859-1"))]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[/invoiceMessage/invoice[invoiceIdentification/entityIdentification=9000009029]]]>
</queryString>
<field name="value" class="java.lang.String">
<fieldDescription><![CDATA[creationDateTime]]></fieldDescription>
</field>
<pageHeader>
<band height="38"/>
</pageHeader>
<columnHeader>
<band height="31" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="488" splitType="Stretch">
<componentElement>
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="21" width="552" height="30" isRemoveLineWhenBlank="true" uuid="fc7d22c7-8c60-4ecb-974f-c842becc4bf7"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="pageHeader" uuid="1e20fa2b-bb3a-475f-b721-5a13d3c374eb">
<datasetParameter name="XML_DATE_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_DATE_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_NUMBER_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_NUMBER_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_LOCALE">
<datasetParameterExpression><![CDATA[$P{XML_LOCALE}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_TIME_ZONE">
<datasetParameterExpression><![CDATA[$P{XML_TIME_ZONE}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//*[entityIdentification=9000009029]/parent::*/seller")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="552" height="15" uuid="eac696b9-e20f-48a3-b70d-b186f5e649d6"/>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</detail>
</jasperReport>
My question is:
What should my dataSourceExpression in the componentElement be, so I can get the data out of it?
I also have some data in the invoice node that I need to show and thats why i set it like this in the query string. And I need to filter by the parameter that is stored inside of invoiceIdentification node.

Passing a bearer token in a 'Web Test' without Visual Studio?

I want to import a ".webtest" in Azure's Application Insights availability feature. I dont have a test edition of Visual Studio, but this MSDN article suggests using Fiddler as another option to creating web tests.
I need to perform 2 requests on a REST API:
Request a bearer token from the connect/token endpoint.
Perform a GET at api/resources with the bearer token (retrieved from the above request) in the header.
It's a typical client credentials OAuth 2 flow.
I cannot seem to figure out how to do this with Fiddler. Basically I need to extract a value from the response body of request 1 and use it as the header value in request 2.
This is what the web test looks like without passing the token:
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
Assuming this comes back as the following example you can use a regex extraction to get it.
{"token_type":"Bearer","scope":"user_impersonation","expires_in":"3600 ... "access_token":"{{TOKEN}}", ...}
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
To compliment James Davis's answer, if you need to login to https://yourapp.com/auth/login by posting the JSON:
{
user: 'youruser',
password: 'yourpassword'
}
first base64 encode the json:
> echo "{user: 'youruser', password: 'yourpassword'}" | base64
e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K
Then pass this base64 value in a StringHttpBody tag
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="login-healthcheck" Id="e91b6e1d-3fa0-475f-a18b-b694b463589c" Owner="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="POST" Guid="ef9d1d00-5663-476a-a3cb-ccf49c4d2229" Version="1.1" Url="https://yourapp.com/auth/login" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Content-Type" Value="application/json" />
</Headers>
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<StringHttpBody ContentType="application/json" InsertByteOrderMark="False">e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K</StringHttpBody>
</Request>
<Request Method="GET" Guid="d566422f-af74-47bf-90aa-0c66db6ef567" Version="1.1" Url="https://yourapp.com/api/v1/healthcheck" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</WebTest>
Worked for me on Azure Application Insights Availability checking

How to customize the schema inlined inside an imported WSDL

I have a.wsdl & b.wsdl where a.wsdl imports b.wsdl.
Now I have to customize the schema inside b.wsdl using wsimport and JAXB. but using below customization is giving error that "XPath evaluation of "wsdl:definitions/wsdl:types/xsd:schema[#targetNamespace='b']" results in an empty target node
I am not able to find a way to customize the inlined schema in imported b.wsdl when generating the client code using wsimport.
<jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema[#targetNamespace='b']"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<jaxb:globalBindings>
<jaxb:javaType name="java.util.Calendar" xmlType="xsd:dateTime"
parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
printMethod="javax.xml.bind.DatatypeConverter.printDateTime" />
</jaxb:globalBindings>
</jaxws:bindings>
A.wsdl
<definitions targetNamespace="a"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:interface="b">
<import location="b.wsdl" namespace="b"/>
<service name="Service">
<port binding="interface:Binding" name="Port">
<soap:address location="https://localhost/sdk/vpxdService" />
</port>
</service>
</definitions>
B.wsdl
<definitions targetNamespace="b"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:b="b"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<schema
targetNamespace="b"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:b="b"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<complexType name="XYZ">
<sequence>
<element name="dynamicType" type="xsd:string" minOccurs="0" />
<element name="val" type="xsd:anyType" maxOccurs="unbounded" />
</sequence>
</complexType>
</types>
</schema>
</definitions>
After going through given website I modified the external binding file to use wsdlLocation="b.wsdl" instead of node="wsdl:definitions/wsdl:types/xsd:schema[#targetNamespace='b']" which did the magic.
This will make sure that the inline schema defined in WSDL will customized as required.
<bindings
xmlns="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl"
version="2.0">
<bindings wsdlLocation="b.wsdl">
<globalBindings>
<javaType name="java.util.Calendar" xmlType="xsd:dateTime"
parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
printMethod="javax.xml.bind.DatatypeConverter.printDate"
/>
</globalBindings>
</bindings>
</bindings>
http://fusesource.com/docs/framework/2.1/jaxws/JAXWSCustomTypeMappingOverview.html
Have you tried adding the following attributes to the <jaxws:bindings> element?
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
and
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
You're referencing the xsd and wsdl namespaces in your xpath expression, but until you define the URI's for them, they won't match up with the URI's in the target documents.

Resources