Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WSDL: make merging external schema works correctly (#1023)
- Remove $targetNamespace check, as the key in definitions.schemas already guarantee this. Fix importing schema with <wsdl:import> where namespace == schema's targetNamespace. - Also merge attributes from source schema. Otherwise, attributes such as elementFormDefault="qualified" specified in included schema will not work properly.
- Loading branch information
1 parent
0e8a3e6
commit 2f159d0
Showing
4 changed files
with
117 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Notice that targetNamespace matches import's namespace. | ||
Also notice elementFormDefault="qualified". --> | ||
<xsd:schema | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns:tns="urn:peat.def" | ||
targetNamespace="urn:peat.def" | ||
elementFormDefault="qualified" | ||
> | ||
|
||
<xsd:element name="AskPeat"> | ||
<xsd:complexType> | ||
<xs:sequence> | ||
<xsd:element name="Question" type="xsd:string" /> | ||
</xs:sequence> | ||
</xsd:complexType> | ||
</xsd:element> | ||
|
||
<xsd:element name="AskPeatResponse"> | ||
<xsd:complexType> | ||
<xs:sequence> | ||
<xsd:element name="Answer" type="xsd:string" /> | ||
</xs:sequence> | ||
</xsd:complexType> | ||
</xsd:element> | ||
|
||
</xsd:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<wsdl:definitions | ||
targetNamespace="urn:peat" | ||
xmlns:tns="urn:peat" | ||
xmlns:peatdef="urn:peat.def" | ||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | ||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" | ||
> | ||
|
||
<!-- Notice that namespace below matchs targetNamespace in def.xsd, triggering merge. --> | ||
<wsdl:import namespace="urn:peat.def" location="def.xsd" /> | ||
|
||
<wsdl:message name="AskPeatInput"> | ||
<wsdl:part name="body" element="peatdef:AskPeat"/> | ||
</wsdl:message> | ||
|
||
<wsdl:message name="AskPeatOutput"> | ||
<wsdl:part name="body" element="peatdef:AskPeatResponse"/> | ||
</wsdl:message> | ||
|
||
<wsdl:portType name="AskPeatPortType"> | ||
<wsdl:operation name="AskPeat"> | ||
<wsdl:input message="tns:AskPeatInput"/> | ||
<wsdl:output message="tns:AskPeatOutput"/> | ||
</wsdl:operation> | ||
</wsdl:portType> | ||
|
||
<wsdl:binding name="AskPeatSoapBinding" type="tns:AskPeatPortType"> | ||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> | ||
<wsdl:operation name="AskPeat"> | ||
<soap:operation soapAction="urn:peat/AskPeat"/> | ||
<wsdl:input> | ||
<soap:body use="literal"/> | ||
</wsdl:input> | ||
<wsdl:output> | ||
<soap:body use="literal"/> | ||
</wsdl:output> | ||
</wsdl:operation> | ||
</wsdl:binding> | ||
|
||
<wsdl:service name="AskPeatService"> | ||
<wsdl:port name="AskPeatPort" binding="tns:AskPeatSoapBinding"> | ||
<soap:address location="http://localhost:15099/peat"/> | ||
</wsdl:port> | ||
</wsdl:service> | ||
|
||
</wsdl:definitions> |