Skip to content

Commit

Permalink
Fix path separator in the WsdlLocation part of the generated client. …
Browse files Browse the repository at this point in the history
…Previously it would use the default path separator, which on Windows is \ but should always be / instead.
  • Loading branch information
nc-bmv committed Oct 29, 2019
1 parent 2778805 commit bc59f14
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Apply the plugin ID "com.github.bjornvester.wsdl2java" as specific in the [Gradl

```kotlin
plugins {
id("com.github.bjornvester.wsdl2java")
id("com.github.bjornvester.wsdl2java") version "0.3"
}
```

Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.github.bjornvester"
version = "0.2"
version = "0.3"

repositories {
jcenter()
Expand Down Expand Up @@ -37,7 +37,8 @@ pluginBundle {
(plugins) {
"wsdl2JavaPlugin" {
displayName = "Gradle Wsdl2Java plugin"
description = "Changes: Support relocated project directories"
description = "Changes: \n" +
"- Fix path separator in the WsdlLocation for the generated client when building on Windows"
tags = listOf("wsdl2java", "cxf", "wsimport")
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="HelloWorldAbstractService"
targetNamespace="http://github.com/bjornvester"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://github.com/bjornvester"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xs:schema targetNamespace="http://github.com/bjornvester"
xmlns="http://github.com/bjornvester"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="sayHi">
<xs:sequence>
<xs:element name="arg0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sayHiResponse">
<xs:sequence>
<xs:element name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="sayHi" nillable="true" type="sayHi"/>
<xs:element name="sayHiResponse" nillable="true" type="sayHiResponse"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="sayHi">
<wsdl:part element="tns:sayHi" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sayHiResponse">
<wsdl:part element="tns:sayHiResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="HelloWorldAbstract">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:sayHi" name="sayHi">
</wsdl:input>
<wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldAbstractServiceSoapBinding" type="tns:HelloWorldAbstract">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="sayHi">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHiResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- No service element -->
</wsdl:definitions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="HelloWorldNestedService"
targetNamespace="http://github.com/bjornvester"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://github.com/bjornvester"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xs:schema targetNamespace="http://github.com/bjornvester"
xmlns="http://github.com/bjornvester"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="sayHi">
<xs:sequence>
<xs:element name="arg0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sayHiResponse">
<xs:sequence>
<xs:element name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="sayHi" nillable="true" type="sayHi"/>
<xs:element name="sayHiResponse" nillable="true" type="sayHiResponse"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="sayHi">
<wsdl:part element="tns:sayHi" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="sayHiResponse">
<wsdl:part element="tns:sayHiResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="HelloWorldNested">
<wsdl:operation name="sayHi">
<wsdl:input message="tns:sayHi" name="sayHi">
</wsdl:input>
<wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloWorldNestedServiceSoapBinding" type="tns:HelloWorldNested">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHi">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="sayHi">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHiResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloWorldNestedService">
<wsdl:port name="HelloWorldNestedPort" binding="tns:HelloWorldNestedServiceSoapBinding">
<soap:address location="http://localhost:8080/MyCXFWebService/services/HelloWorldNestedPort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ open class Wsdl2JavaTask : DefaultTask() {
val args = arrayOf(
"-verbose",
"-wsdlLocation",
wsdlFile.relativeTo(wsdlInputDir.asFile.get()).path,
wsdlFile.relativeTo(wsdlInputDir.asFile.get()).invariantSeparatorsPath,
"-suppress-generated-date",
"-autoNameResolution",
"-d",
Expand Down

0 comments on commit bc59f14

Please sign in to comment.