Path fixing in Codecov: some files work others not - code-coverage

I have a project to casually play around with C++ test coverage. (https://github.com/adomasbaliuka/test_repository, question refers to commits 58e2802f76e8eb7819209c9d518b0ffe76690d15 and ca36a4fd0e38bc47204a155614c498936d43dc90)
The question concerns GitHub and Codecov.io, so maybe I should ask their support, but StackOverflor has tags for these things, so I assume it's OK.
The coverage with codecov.io is working (https://app.codecov.io/gh/adomasbaliuka/test_repository). However, I would like to see the actual source code and line coverage to also test this feature of codecov.io. It works fine on one of my files (test/test_main.cpp) but I can't get it to work on the other source file (src/version/version.cpp), even though codecov.io correctly displays both paths and the paths inside the uploaded codecov.xml file (which I print to console in my CI runs, so they can also be viewed in the GitHub Actions) look conceptually exactly the same:
(codecov.xml file contents:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE coverage SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-04.dtd'>
<coverage line-rate="0.7613636363636364" branch-rate="0.33962264150943394" lines-covered="67" lines-valid="88" branches-covered="36" branches-valid="106" complexity="0.0" timestamp="1631309448" version="gcovr 4.2">
<sources>
<source>../../</source>
</sources>
<packages>
<package name="test_repository.build._deps.googletest-src.googletest.include.gtest" line-rate="0.2857142857142857" branch-rate="0.0" complexity="0.0">
<classes>
<class name="gtest_h" filename="test_repository/build/_deps/googletest-src/googletest/include/gtest/gtest.h" line-rate="0.2857142857142857" branch-rate="0.0" complexity="0.0">
<methods/>
<lines>
<line number="427" hits="0" branch="false"/>
<line number="435" hits="0" branch="false"/>
<line number="440" hits="0" branch="false"/>
<line number="441" hits="0" branch="false"/>
<line number="522" hits="0" branch="false"/>
<line number="2489" hits="2" branch="false"/>
<line number="2490" hits="2" branch="false"/>
</lines>
</class>
</classes>
</package>
<package name="test_repository.build._deps.googletest-src.googletest.include.gtest.internal" line-rate="0.85" branch-rate="0.2" complexity="0.0">
<classes>
<class name="gtest-internal_h" filename="test_repository/build/_deps/googletest-src/googletest/include/gtest/internal/gtest-internal.h" line-rate="0.8947368421052632" branch-rate="0.2" complexity="0.0">
<methods/>
<lines>
<line number="454" hits="8" branch="false"/>
<line number="461" hits="4" branch="false"/>
<line number="472" hits="4" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="493" hits="4" branch="false"/>
<line number="494" hits="4" branch="false"/>
<line number="506" hits="16" branch="false"/>
<line number="508" hits="16" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="521" hits="4" branch="false"/>
<line number="525" hits="4" branch="false"/>
<line number="527" hits="4" branch="false"/>
<line number="529" hits="4" branch="true" condition-coverage="33% (2/6)">
<conditions>
<condition number="0" type="jump" coverage="33%"/>
</conditions>
</line>
<line number="532" hits="0" branch="true" condition-coverage="0% (0/10)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="534" hits="4" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="542" hits="4" branch="false"/>
<line number="546" hits="4" branch="false"/>
<line number="548" hits="4" branch="false"/>
<line number="550" hits="4" branch="true" condition-coverage="33% (2/6)">
<conditions>
<condition number="0" type="jump" coverage="33%"/>
</conditions>
</line>
<line number="553" hits="0" branch="true" condition-coverage="0% (0/10)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="555" hits="4" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
</lines>
</class>
<class name="gtest-port_h" filename="test_repository/build/_deps/googletest-src/googletest/include/gtest/internal/gtest-port.h" line-rate="0.0" branch-rate="0.0" complexity="0.0">
<methods/>
<lines>
<line number="974" hits="0" branch="false"/>
</lines>
</class>
</classes>
</package>
<package name="test_repository.test_repository.src.version" line-rate="0.717391304347826" branch-rate="0.4107142857142857" complexity="0.0">
<classes>
<class name="version_cpp" filename="test_repository/test_repository/src/version/version.cpp" line-rate="0.717391304347826" branch-rate="0.4107142857142857" complexity="0.0">
<methods/>
<lines>
<line number="22" hits="3" branch="false"/>
<line number="24" hits="6" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="25" hits="6" branch="false"/>
<line number="26" hits="3" branch="false"/>
<line number="27" hits="6" branch="true" condition-coverage="66% (4/6)">
<conditions>
<condition number="0" type="jump" coverage="66%"/>
</conditions>
</line>
<line number="28" hits="3" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="30" hits="6" branch="false"/>
<line number="34" hits="1" branch="false"/>
<line number="36" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="37" hits="1" branch="false"/>
<line number="40" hits="1" branch="false"/>
<line number="42" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="43" hits="1" branch="false"/>
<line number="46" hits="1" branch="false"/>
<line number="48" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="50" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="52" hits="0" branch="false"/>
<line number="56" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="58" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="59" hits="0" branch="false"/>
<line number="62" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="63" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="64" hits="0" branch="false"/>
<line number="66" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="71" hits="1" branch="false"/>
<line number="73" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="75" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="77" hits="0" branch="false"/>
<line number="81" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="83" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="84" hits="1" branch="false"/>
<line number="87" hits="0" branch="true" condition-coverage="0% (0/2)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="89" hits="0" branch="true" condition-coverage="0% (0/2)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="90" hits="0" branch="false"/>
<line number="92" hits="0" branch="true" condition-coverage="0% (0/2)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="97" hits="1" branch="false"/>
<line number="99" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="101" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="103" hits="0" branch="false"/>
<line number="107" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="109" hits="1" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="110" hits="1" branch="false"/>
<line number="113" hits="0" branch="true" condition-coverage="0% (0/2)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="115" hits="0" branch="true" condition-coverage="0% (0/2)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
<line number="116" hits="0" branch="false"/>
<line number="118" hits="0" branch="true" condition-coverage="0% (0/2)">
<conditions>
<condition number="0" type="jump" coverage="0%"/>
</conditions>
</line>
</lines>
</class>
</classes>
</package>
<package name="test_repository.test_repository.tests" line-rate="1.0" branch-rate="0.5" complexity="0.0">
<classes>
<class name="test_main_cpp" filename="test_repository/test_repository/tests/test_main.cpp" line-rate="1.0" branch-rate="0.5" complexity="0.0">
<methods/>
<lines>
<line number="12" hits="2" branch="false"/>
<line number="14" hits="2" branch="false"/>
<line number="15" hits="2" branch="false"/>
<line number="18" hits="8" branch="false"/>
<line number="21" hits="2" branch="false"/>
<line number="22" hits="2" branch="true" condition-coverage="50% (1/2)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="23" hits="2" branch="false"/>
<line number="24" hits="2" branch="false"/>
<line number="26" hits="8" branch="false"/>
<line number="27" hits="2" branch="true" condition-coverage="50% (2/4)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="28" hits="2" branch="true" condition-coverage="50% (2/4)">
<conditions>
<condition number="0" type="jump" coverage="50%"/>
</conditions>
</line>
<line number="30" hits="2" branch="false"/>
<line number="31" hits="2" branch="false"/>
<line number="32" hits="2" branch="false"/>
<line number="33" hits="2" branch="false"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>
In particular, the paths of the files inside this xml are test_repository/tests/test_main.cpp and test_repository/src/version/version.cpp. I totally don't understand the problem or difference that codecov.io could possibly see there.
Inside codecov.io, clicking on the file src/version/version.cpp gives me an error
GitHub API: Not Found
I tried doing some "path fixing", as suggested by codecov.io, which means including a top level file codecov.yml. I put inside this file
fixes:
- "test_repository/::"
which I assume replaces the name of the repository by "nothing" in the paths. The result of this was that the first file still worked, while for the second file the error message became
Well this is embarassing, looks like we had an error.
I don't depend on having this feature work on all my files, but this behaviour (difference between the files) is just bizarre to me. Any ideas?

Tom from Codecov here. I think you might need to do
fixes:
- "::/test_repository"
But I'll be totally honest, I don't think you need path fixes at all.

The answer is that the problematic file isn't even in the repository at all. It is instead generated ("configured") by CMake, in order to include the current version, which is extracted from git information.
In hindsight my question was really stupid and I am very sorry to have wasted anyone's time. Unfortunately, there probably isn't anything in this question that you can learn from.

Related

IIS Rewriting dosnt allow/breaks post requests

I have an IIS instance in front of my other non-iis web server hosting the site where the IIS is doing some AAR magic which is working good but for POST requests this dont seem to work for some reasons which mean any ajax calls by the application on the non IIS webserver end up broken. Any ideas on how to solve this? Below is the current rule setup.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="false" />
<rewrite>
<rules>
<clear />
<rule name="UrlWithPimRewrite" stopProcessing="true">
<match url="pim.*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
<action type="Rewrite" url="{C:1}://localhost:1512/{R:0}" appendQueryString="true" logRewrittenUrl="true" />
</rule>
<rule name="UrlWithoutPIM" enabled="true" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{URL}" pattern="/pim" negate="true" />
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
<action type="Rewrite" url="{C:1}://localhost:1512/pim/webaccess" appendQueryString="false" logRewrittenUrl="true" />
</rule>
</rules>
<outboundRules>
<clear />
<rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding" enabled="true">
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
</rule>
<preConditions>
<preCondition name="NeedsRestoringAcceptEncoding">
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
<directoryBrowse enabled="false" />
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,WebSocket" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="404" />
</add>
</traceFailedRequests>
</tracing>
</system.webServer>
</configuration>

Redirect https secondary domain web-config

I have one Secondary domain in my host
I want to read https : //Mydoaminname.com
but after add this code For redirect here is my problems address bar :
https : //Mydoaminname.com/Mydoaminname/
<configuration>
<system.web>
<httpRuntime enableVersionHeader="false" targetFramework="4.5" />
<compilation debug="true" targetFramework="4.5"/>
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files\(compressionType)\(AppPool)\(WebSite)\compressed files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true"/>
</system.webServer>
</configuration>
This rewrite code its work great for primary domain but for secondary its make address bar problems
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>

Compressing static files not working on MVC and IIS

I'm trying to enable compression on my ASP.NET MVC 5 application that is hosted on IIS 7.5 and I can't make it work.
I have both static and dynamic compression enabled on the website.
I have tried adding the following to my web.config file:
<staticContent>
<remove fileExtension=".js" />
<mimeMap fileExtension=".js" mimeType="text/javascript" />
</staticContent>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="text/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />

Cfx wsdl2java generates - 'The nested type Item cannot hide an enclosing type'

Im trying to generate a WS client using CXF, however the generated classes have errors, in particular I am getting the following error:
The nested type Item cannot hide an enclosing type
Are there anyone CXF settings to deal with such situations?
The wsdl that I am using is:
<?xml version ='1.0' encoding='UTF-8' ?>
<wsdl:types>
<xsd:schema targetNamespace="http://example.org/AppGateway">
<xsd:element name="ErrorResult">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" maxOccurs="unbounded"
minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="key">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="isSuccess" />
<xsd:enumeration value="errorCode" />
<xsd:enumeration value="errorMessage" />
<xsd:enumeration value="method" />
<xsd:enumeration value="msg" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="value">
<xsd:complexType mixed="true">
<xsd:sequence>
<xsd:element name="item" maxOccurs="unbounded"
minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="key" />
<xsd:element type="xsd:string" name="value" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<message name="TestApiRequest">
<part name="username" type="xsd:anyType" />
<part name="password" type="xsd:anyType" />
</message>
<message name="TestApiResponse">
<part name="Result" type="xsd:anyType" />
</message>
<message name="GetApiErrorListRequest">
<part name="username" type="xsd:string" />
<part name="password" type="xsd:string" />
</message>
<message name="GetApiErrorListResponse">
<wsdl:part name="Result" element="tns:ErrorResult"></wsdl:part>
</message>
<message name="AddTraderRecordRequest">
<part name="username" type="xsd:anyType" />
<part name="password" type="xsd:anyType" />
<part name="traderRecord" type="xsd:anyType" />
</message>
<message name="AddTraderRecordResponse">
<part name="Result" type="xsd:anyType" />
</message>
<portType name="AppGatewayPortType">
<operation name="TestApi">
<input message="tns:TestApiRequest" />
<output message="tns:TestApiResponse" />
</operation>
<operation name="GetApiErrorList">
<input message="tns:GetApiErrorListRequest" />
<output message="tns:GetApiErrorListResponse" />
</operation>
<operation name="AddTraderRecord">
<input message="tns:AddTraderRecordRequest" />
<output message="tns:AddTraderRecordResponse" />
</operation>
</portType>
<!-- Service definition -->
<wsdl:binding name="AppGatewayBinding" type="tns:AppGatewayPortType">
<soap:binding style="document"
required="true" />
<wsdl:operation name="TestApi">
<soap:operation soapAction="http://example.org/AppGateway/TestApi" style="document"/>
<wsdl:input>
<soap:body use="literal" type="soap:tBody"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" type="soap:tBody" required="true" parts="Result "/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetApiErrorList">
<soap:operation soapAction="http://example.org/AppGateway/GetApiErrorList" style="document"/>
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddTraderRecord">
<soap:operation soapAction="http://example.org/AppGateway/AddTraderRecord" style="document"/>
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AppGatewayEndpointService">
<wsdl:port name="AppGatewayService" binding="tns:AppGatewayBinding">
<http:address
location="https://myserviceprovider.com/v1.1/SoapServer.php?className=AppGateway" />
</wsdl:port>
</wsdl:service>

Create WSO2 Proxy based on WSDL with mandatory header

In my scenario a have a webservice "SolverDummyWS" running in WSO2-AS, and want to generate a Proxy for this Service inside WSO2 ESB.
Therefore I created a wsdl for the proxy manually, and added some mandatory header fields. So only the wsdl of the proxy should have this headers. The headers should all be mandatory and defined als EXPLICIT HEADERS.
Proxy-WSDL looks like this:
<wsdl:definitions name="SolverDummyProxy"
targetNamespace="http://de.unistuttgart.iaas" xmlns:tns="http://de.unistuttgart.iaas"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<schema targetNamespace="http://de.unistuttgart.iaas"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="createGrid">
<complexType>
<sequence>
<element minOccurs="0" name="milliseconds" type="long" />
</sequence>
</complexType>
</element>
<element name="createGridResponse">
<complexType>
<sequence>
<element minOccurs="0" name="return" type="string" />
</sequence>
</complexType>
</element>
<element name="requestHeader">
<complexType>
<sequence>
<element minOccurs="1" name="simulationId" type="long" />
<element minOccurs="1" name="activityId" type="long" />
<element minOccurs="1" name="requiredPolicy" type="anyType" />
<element minOccurs="1" name="requiredPortType" type="string" />
<element minOccurs="1" name="requiredScope" type="anyURI" />
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="createGridRequest">
<wsdl:part name="body" element="tns:createGrid" />
<wsdl:part name="reqHeader" element="tns:requestHeader" />
</wsdl:message>
<wsdl:message name="createGridResponse">
<wsdl:part name="body" element="tns:createGridResponse" />
</wsdl:message>
<wsdl:portType name="SolverDummyProxyWSPortType">
<wsdl:operation name="createGrid">
<wsdl:input message="tns:createGridRequest" />
<wsdl:output message="tns:createGridResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SolverDummyProxyWSSoap11Binding" type="tns:SolverDummyProxyWSPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="createGrid">
<wsdl:input>
<soap:body parts="body" use="literal" />
<soap:header message="tns:createGridRequest" part="reqHeader"
use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body parts="body" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SolverDummyProxyWSSoap12Binding" type="tns:SolverDummyProxyWSPortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="createGrid">
<wsdl:input>
<soap12:body parts="body" use="literal" />
<soap12:header message="tns:createGridRequest" part="reqHeader"
use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body parts="body" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SolverDummyProxyWS">
<wsdl:port name="SolverDummyProxyWSSoap11Endpoint" binding="tns:SolverDummyProxyWSSoap11Binding">
<soap:address location="http://localhost:8280/services/SolverDummyProxyWS.SolverDummyProxyWSSoap11Endpoint" />
</wsdl:port>
<wsdl:port name="SolverDummyProxyWSSoap12Endpoint" binding="tns:SolverDummyProxyWSSoap12Binding">
<soap12:address location="http://localhost:8280/services/SolverDummyProxyWS.SolverDummyProxyWSSoap12Endpoint" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
So i create a Proxy using the WSO2-ESB Webinterface. If I have a look at the actual WSDL of the created Proxy, I see that WSO2-ESB did some changes:
- Added HTTP Binding
- Removed header-part from createGridRequest message
- messed soap:input in bindings (there are two header definitions, and the body part was removed)
WSDL-modified by WSO2-ESB
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://de.unistuttgart.iaas" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://de.unistuttgart.iaas">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://de.unistuttgart.iaas">
<element name="createGrid">
<complexType>
<sequence>
<element minOccurs="0" name="milliseconds" type="long" />
</sequence>
</complexType>
</element>
<element name="createGridResponse">
<complexType>
<sequence>
<element minOccurs="0" name="return" type="string" />
</sequence>
</complexType>
</element>
<element name="requestHeader">
<complexType>
<sequence>
<element name="simulationId" type="long" />
<element name="activityId" type="long" />
<element name="requiredPolicy" type="anyType" />
<element name="requiredPortType" type="string" />
<element name="requiredScope" type="anyURI" />
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="createGridRequest">
<wsdl:part name="body" element="tns:createGrid" />
</wsdl:message>
<wsdl:message name="createGridResponse">
<wsdl:part name="body" element="tns:createGridResponse" />
</wsdl:message>
<wsdl:portType name="SolverDummyProxyHWSPortType">
<wsdl:operation name="createGrid">
<wsdl:input message="tns:createGridRequest" wsaw:Action="http://de.unistuttgart.iaas/SolverDummyProxyWSPortType/createGridRequest" />
<wsdl:output message="tns:createGridResponse" wsaw:Action="http://de.unistuttgart.iaas/SolverDummyProxyWSPortType/createGridResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SolverDummyProxyHWSSoap11Binding" type="tns:SolverDummyProxyHWSPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="createGrid">
<soap:operation soapAction="" style="document" />
<wsdl:input>
<soap:body use="literal" />
<soap12:header use="literal" part="reqHeader" message="tns:createGridRequest" />
<soap12:header use="literal" part="reqHeader" message="tns:createGridRequest" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SolverDummyProxyHWSSoap12Binding" type="tns:SolverDummyProxyHWSPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="createGrid">
<soap12:operation soapAction="" style="document" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header use="literal" part="reqHeader" message="tns:createGridRequest" />
<soap12:header use="literal" part="reqHeader" message="tns:createGridRequest" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SolverDummyProxyHWSHttpBinding" type="tns:SolverDummyProxyHWSPortType">
<http:binding verb="POST" />
<wsdl:operation name="createGrid">
<http:operation location="createGrid" />
<wsdl:input>
<mime:content type="text/xml" part="parameters" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SolverDummyProxyHWS">
<wsdl:port name="SolverDummyProxyHWSHttpSoap11Endpoint" binding="tns:SolverDummyProxyHWSSoap11Binding">
<soap:address location="http://Tobiass-MacBook-Pro.local:8280/services/SolverDummyProxyHWS.SolverDummyProxyHWSHttpSoap11Endpoint" />
</wsdl:port>
<wsdl:port name="SolverDummyProxyHWSHttpsSoap11Endpoint" binding="tns:SolverDummyProxyHWSSoap11Binding">
<soap:address location="https://Tobiass-MacBook-Pro.local:8243/services/SolverDummyProxyHWS.SolverDummyProxyHWSHttpsSoap11Endpoint" />
</wsdl:port>
<wsdl:port name="SolverDummyProxyHWSHttpSoap12Endpoint" binding="tns:SolverDummyProxyHWSSoap12Binding">
<soap12:address location="http://Tobiass-MacBook-Pro.local:8280/services/SolverDummyProxyHWS.SolverDummyProxyHWSHttpSoap12Endpoint" />
</wsdl:port>
<wsdl:port name="SolverDummyProxyHWSHttpsSoap12Endpoint" binding="tns:SolverDummyProxyHWSSoap12Binding">
<soap12:address location="https://Tobiass-MacBook-Pro.local:8243/services/SolverDummyProxyHWS.SolverDummyProxyHWSHttpsSoap12Endpoint" />
</wsdl:port>
<wsdl:port name="SolverDummyProxyHWSHttpsEndpoint" binding="tns:SolverDummyProxyHWSHttpBinding">
<http:address location="https://Tobiass-MacBook-Pro.local:8243/services/SolverDummyProxyHWS.SolverDummyProxyHWSHttpsEndpoint" />
</wsdl:port>
<wsdl:port name="SolverDummyProxyHWSHttpEndpoint" binding="tns:SolverDummyProxyHWSHttpBinding">
<http:address location="http://Tobiass-MacBook-Pro.local:8280/services/SolverDummyProxyHWS.SolverDummyProxyHWSHttpEndpoint" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This code does not have mandatory headers, so my initial purpose of creating initial headers was messed up by wso2-esb.
Can somebody tell my how I can add mandatory headers to a proxy service (this would be the case if my initial wsdl file has errors)?
If my initial wsdl-file was ok, how can I enforce wso2-esb to use this file, and do not modify it?!?
Last question, is there another way of creating mandatory headers, for a request to a proxy?
Thanks for your answers!
<parameter name="useOriginalwsdl">true</parameter>
Try to put this parameter to your proxy service to display the wsdl as it is. Processing the soap headers should be done at the proxy service level using mediators.

Resources