Skip to content

Commit

Permalink
Fix missing namespace declaration on array if the namespace is alread…
Browse files Browse the repository at this point in the history
…y declared with another prefix. (#923)
  • Loading branch information
Mik13 authored and herom committed Mar 15, 2017
1 parent bc6992a commit 3a1c6e9
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lib/wsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1817,10 +1817,13 @@ WSDL.prototype.objectToXML = function(obj, name, nsPrefix, nsURI, isFirst, xmlns
current: childNsPrefix,
parent: ns
};
} else {
//parent (array) already got the namespace
childXmlnsAttrib = null;
}

value = self.objectToXML(child, name, childNsPrefix, childNsURI,
false, null, resolvedChildSchemaObject, nsContext);
false, childXmlnsAttrib, resolvedChildSchemaObject, nsContext);
} else if (obj[self.options.attributesKey] && obj[self.options.attributesKey].xsi_type) {
//if parent object has complex type defined and child not found in parent
var completeChildParamTypeObject = self.findChildSchemaObject(
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><c:UniqueID source="TESTSOURCE">100</c:UniqueID></n:IDs><n:Addresses><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">Another Address</c:AddressLine></n:NameAddress><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">My Address</c:AddressLine></n:NameAddress></n:Addresses><n:Phones><n:NamePhone primary="true"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>123</c:PhoneNumber></c:PhoneData></n:NamePhone><n:NamePhone primary="false"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>456</c:PhoneNumber></c:PhoneData></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><c:UniqueID source="TESTSOURCE" xmlns:c="http://www.bigdatacollect.or/Common/Types">100</c:UniqueID></n:IDs><n:Addresses><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">Another Address</c:AddressLine></n:NameAddress><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">My Address</c:AddressLine></n:NameAddress></n:Addresses><n:Phones><n:NamePhone primary="true"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>123</c:PhoneNumber></c:PhoneData></n:NamePhone><n:NamePhone primary="false"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>456</c:PhoneNumber></c:PhoneData></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><c:UniqueID source="TESTSOURCE">100</c:UniqueID></n:IDs><n:Phones><n:NamePhone primary="true"><n:IDs><c:UniqueID source="TEST">1</c:UniqueID></n:IDs></n:NamePhone><n:NamePhone primary="false"><n:IDs><c:UniqueID source="TEST">2</c:UniqueID></n:IDs></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><c:UniqueID source="TESTSOURCE" xmlns:c="http://www.bigdatacollect.or/Common/Types">100</c:UniqueID></n:IDs><n:Phones><n:NamePhone primary="true"><n:IDs><c:UniqueID source="TEST" xmlns:c="http://www.bigdatacollect.or/Common/Types">1</c:UniqueID></n:IDs></n:NamePhone><n:NamePhone primary="false"><n:IDs><c:UniqueID source="TEST" xmlns:c="http://www.bigdatacollect.or/Common/Types">2</c:UniqueID></n:IDs></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:tns="http://www.bigdatacollect.or/Common/Types" xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.bigdatacollect.or/Common/Types" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:complexType name="Phone">
<xs:sequence>
<xs:element name="PhoneData">
<xs:complexType>
<xs:sequence>
<xs:element name="PhoneNumber" type="xs:string"/>
<xs:element name="Comment" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="phoneType" type="xs:string"/>
<xs:attribute name="phoneRole" type="xs:string"/>
</xs:complexType>
<xs:complexType name="ResultStatus">
<xs:sequence>
<xs:element name="IDs" type="tns:UniqueIDList" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="resultStatusFlag" type="tns:ResultStatusFlag"/>
</xs:complexType>
<xs:complexType name="UniqueID">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="source" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="UniqueIDList">
<xs:sequence>
<xs:element name="UniqueID" type="tns:UniqueID" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ResultStatusFlag">
<xs:restriction base="xs:string">
<xs:enumeration value="FAIL"/>
<xs:enumeration value="SUCCESS"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:common="http://www.bigdatacollect.or/Common/Types" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.bigdatacollect.or/Name/Types"
targetNamespace="http://www.bigdatacollect.or/Name/Types" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="http://www.bigdatacollect.or/Common/Types" schemaLocation="Common.xsd"/>
<xs:element name="Profile"/>
<xs:complexType name="NamePhone">
<xs:complexContent>
<xs:extension base="common:Phone">
<xs:sequence>
<xs:element name="IDs" type="common:UniqueIDList" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="primary" type="xs:boolean"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="NamePhoneList">
<xs:annotation>
<xs:documentation>Collection of NamePhone</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="NamePhone" type="tns:NamePhone" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Profile">
<xs:sequence>
<xs:element name="IDs" type="common:UniqueIDList" minOccurs="0"/>
<xs:element name="Phones" type="tns:NamePhoneList" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="UpdateProfileRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Profile" type="tns:Profile"/>
<xs:element name="ResortId" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdateProfileResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Result" type="common:ResultStatus"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"Profile": {
"IDs": {
"UniqueID": [
{
"attributes": {
"source": "TESTSOURCE"
},
"$value": 100
}
]
},
"Phones": {
"NamePhone": [
{
"attributes": {
"primary": true
},
"IDs": {
"UniqueID": [
{
"attributes": {
"source": "TEST"
},
"$value": 1
}
]
}
},
{
"attributes": {
"primary": false
},
"IDs": {
"UniqueID": [
{
"attributes": {
"source": "TEST"
},
"$value": 2
}
]
}
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><common:UniqueID source="TESTSOURCE" xmlns:common="http://www.bigdatacollect.or/Common/Types">100</common:UniqueID></n:IDs><n:Phones><n:NamePhone primary="true"><n:IDs><common:UniqueID source="TEST" xmlns:common="http://www.bigdatacollect.or/Common/Types">1</common:UniqueID></n:IDs></n:NamePhone><n:NamePhone primary="false"><n:IDs><common:UniqueID source="TEST" xmlns:common="http://www.bigdatacollect.or/Common/Types">2</common:UniqueID></n:IDs></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Result":{
"attributes": {
"resultStatusFlag": "SUCCESS"
},
"IDs": {
"UniqueID": {
"attributes": {
"source": "TESTSOURCE"
},
"$value": "100"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns3:UpdateProfileResponse xmlns:ns3="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Common/Types"><ns3:Result resultStatusFlag="SUCCESS"><IDs><UniqueID source="TESTSOURCE">100</UniqueID></IDs></ns3:Result></ns3:UpdateProfileResponse></S:Body></S:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.bigdatacollect.or"
xmlns:c="http://www.bigdatacollect.or/Common/Types"
xmlns:n="http://www.bigdatacollect.or/Name/Types"
xmlns:ns="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://www.bigdatacollect.or">
<wsdl:types>
<xs:schema>
<xs:import namespace="http://www.bigdatacollect.or/Common/Types" schemaLocation="Common.xsd"/>
<xs:import namespace="http://www.bigdatacollect.or/Name/Types" schemaLocation="Name.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="UpdateProfileRequest">
<wsdl:part name="UpdateProfileRequest" element="n:UpdateProfileRequest"/>
</wsdl:message>
<wsdl:message name="UpdateProfileResponse">
<wsdl:part name="UpdateProfileResponse" element="n:UpdateProfileResponse"/>
</wsdl:message>
<wsdl:portType name="NamePortType">
<wsdl:operation name="UpdateProfile">
<wsdl:input message="tns:UpdateProfileRequest"/>
<wsdl:output message="tns:UpdateProfileResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NameBinding" type="tns:NamePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="UpdateProfile">
<soap:operation soapAction="http://www.bigdatacollect.or#UpdateProfile" 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="BigDataCollectorService">
<wsdl:port name="NamePortType" binding="tns:NameBinding">
<soap:address location="http://www.bigdatacollect.or/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><c:UniqueID source="TESTSOURCE">100</c:UniqueID><c:UniqueID source="TESTSOURCE2">100</c:UniqueID><c:UniqueID source="TESTSOURCE3">100</c:UniqueID></n:IDs><n:Addresses><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">Another Address</c:AddressLine></n:NameAddress><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">My Address</c:AddressLine></n:NameAddress></n:Addresses><n:Phones><n:NamePhone primary="true"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>123</c:PhoneNumber></c:PhoneData></n:NamePhone><n:NamePhone primary="false"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>456</c:PhoneNumber></c:PhoneData></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.bigdatacollect.or" xmlns:c="http://www.bigdatacollect.or/Common/Types" xmlns:n="http://www.bigdatacollect.or/Name/Types"><soap:Body><n:UpdateProfileRequest xmlns:n="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Name/Types"><n:Profile><n:IDs><c:UniqueID source="TESTSOURCE" xmlns:c="http://www.bigdatacollect.or/Common/Types">100</c:UniqueID><c:UniqueID source="TESTSOURCE2" xmlns:c="http://www.bigdatacollect.or/Common/Types">100</c:UniqueID><c:UniqueID source="TESTSOURCE3" xmlns:c="http://www.bigdatacollect.or/Common/Types">100</c:UniqueID></n:IDs><n:Addresses><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">Another Address</c:AddressLine></n:NameAddress><n:NameAddress><c:AddressLine xmlns:c="http://www.bigdatacollect.or/Common/Types">My Address</c:AddressLine></n:NameAddress></n:Addresses><n:Phones><n:NamePhone primary="true"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>123</c:PhoneNumber></c:PhoneData></n:NamePhone><n:NamePhone primary="false"><c:PhoneData xmlns:c="http://www.bigdatacollect.or/Common/Types"><c:PhoneNumber>456</c:PhoneNumber></c:PhoneData></n:NamePhone></n:Phones></n:Profile></n:UpdateProfileRequest></soap:Body></soap:Envelope>

0 comments on commit 3a1c6e9

Please sign in to comment.