Open kkirakosyan opened 9 years ago
I need to push that issue. We have tracked down the reason and can give an example WSDL with following ComplexType, where this Problem occurs for us
<xsd:simpleType name="mediumBlob">
<xsd:restriction base="xsd:base64Binary">
<xsd:maxLength value="16384" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Identity">
<xsd:sequence>
<xsd:element name="data_A" type="xsd:base64Binary" minOccurs="0" maxOccurs="10"/>
<xsd:element name="data_B" type="tns:mediumBlob" minOccurs="0" maxOccurs="10"/>
<xsd:element name="data_C" type="tns:mediumBlob" minOccurs="0" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>
In our code we set all elements and they data into a String HashMap to put them into the Operation later-on:
HashMap<String, String> data = new HashMap<>();
data.put("xpath:/MyOperation/id/data_A[1]", "###");
data.put("xpath:/MyOperation/id/data_A[2]", "XXX");
data.put("xpath:/MyOperation/id/data_B[1]", "###");
data.put("xpath:/MyOperation/id/data_B[2]", "XXX");
data.put("xpath:/MyOperation/id/data_C", "###");
msg_MyOperation.addData(data);
This generates following Request content:
<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>
<s11:Body>
<ns1:MyOperation xmlns:ns1='https://www.MyNameSpace.tld/abc'>
<id>
<data_A>###</data_A>
<data_A>XXX</data_A>
<data_B></data_B>
<data_C>###</data_C>
</id>
</ns1:MyOperation>
</s11:Body>
</s11:Envelope>
But expected was:
<data_A>###</data_A>
<data_A>XXX</data_A>
<data_B>###</data_B>
<data_B>XXX</data_B>
<data_C>###</data_C>
While generating the request, during the creation of BuildInSchemaType-Objects, matching Xpath-Elements are identified by a Regular Expression. During that creation of SimpleType-Objekts only 1-to-1 matches are searched.
Hi,
thanks for your valueable description of the bug. It will take some time till we will fix that is SOA Model. Feel free to create a pull-request yourself if you want to. The code fort he RequestCreator is at the file:
Cheers,
Thomas
Am 04.08.16, 13:45 schrieb "psytester" notifications@github.com:
I need to push that issue. We have tracked down the reason and can give an example WSDL with following ComplexType, where this Problem occurs for us
CreateSOAPRequest run result not correct (there are no data in element
<dependency>
<groupId>com.predic8</groupId>
<artifactId>soa-model-core</artifactId>
<version>1.6.0</version>
</dependency>
result is:
<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>
<s11:Body>
<ns1:create xmlns:ns1='http://predic8.com/wsdl/material/ArticleService/1/'>
<article>
<ns2:name xmlns:ns2='http://predic8.com/material/1/'>foo2</ns2:name>
<ns2:description xmlns:ns2='http://predic8.com/material/1/'>bar2</ns2:description>
<ns2:price xmlns:ns2='http://predic8.com/material/1/'>
<!-- This element is required and should be filled. -->
<ns3:amount xmlns:ns3='http://predic8.com/common/1/' />
<ns3:currency xmlns:ns3='http://predic8.com/common/1/'></ns3:currency>
</ns2:price>
<ns2:id xmlns:ns2='http://predic8.com/material/1/'>2</ns2:id>
</article>
<article>
<ns2:name xmlns:ns2='http://predic8.com/material/1/'>foo1</ns2:name>
<ns2:description xmlns:ns2='http://predic8.com/material/1/'>bar1</ns2:description>
<ns2:price xmlns:ns2='http://predic8.com/material/1/'>
<!-- This element is required and should be filled. -->
<ns3:amount xmlns:ns3='http://predic8.com/common/1/' />
<ns3:currency xmlns:ns3='http://predic8.com/common/1/'></ns3:currency>
</ns2:price>
<ns2:id xmlns:ns2='http://predic8.com/material/1/'>1</ns2:id>
</article>
</ns1:create>
</s11:Body>
</s11:Envelope>
I am trying the CreateSOAPRequest example that I got from downloads part on 1.5.4 version of soa-model-core. So I have problems related multiple items of same type: for example
we have multiple articles and multiple prices. After running example I got this result
but it should be
I didn't change anything in source code.