Support Article
PRPC SOAP Service - WSDL not getting generated properly
SA-19557
Summary
User is having SOAP services hosted in PRPC. User is generating WSDL by importing xsd file. When the WSDL file is imported through system generated URL (From Service Package) to another application like SOAPUI, it does not properly import the WSDl. Importing to netBeans, it displays errors in the WSDL.
Importing to SOAP UI, Namespace prefixes (“<NS1:xxx></NS1:xxx>”) was not there in the sample request and response generated in SOAP UI.
Because of this, external parties trying to call web service could not find the relevant namespace values needed to be passed in request.
Error Messages
When the wsdl is imported to JAVA IDE (NetBeans/Eclipse), below errors are displayed:
“Multiple annotations found at this line:
- s4s-elt-invalid-content.1: The content of 'Partytype2' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often.
- s4s-elt-invalid-content.1: The content of 'Holdingtype' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often.
- s4s-elt-invalid-content.1: The content of 'Lifetype' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often.
- sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://
xxx.org/Standards/Life/2'.
- s4s-elt-invalid-content.1: The content of 'Holdingtype2' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often.
- s4s-elt-invalid-content.1: The content of 'Partytype' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often.
- s4s-elt-invalid-content.1: The content of 'Lifetype2' is invalid. Element 'sequence' is invalid, misplaced, or occurs too often.
Steps to Reproduce
1) Import WS Schema (XSD) through Connector and Metadata wizard.
2) Create PRPC Soap service.
3) Include XML parser rules and Stream rules generated from wizard to Service.
4) Generate WSDL URL and import to SOAP UI.
Root Cause
The root cause of this problem is a defect in Pegasystems’ code/rules. The attribute comes before sequence in a complexType.
Also in the XSD used by user to generate WSDL, Life element has both LifeRequest and LifeResponse elements. So the generated stream and parse rules contains same root element name which is the root cause for generating incorrect wsdl.
<xsd:element name="Life" type="Life_Type"/>
<xsd:complexType name="Life_Type">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="LifeRequest"/>
</xsd:sequence>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="LifeResponse"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Version" type="xsd:string"/>
</xsd:complexType>
Resolution
Perform the following changes:
1. For the first issue where attribute comes before sequence in a complexType, apply HFix-23350 to resolve this behavior.
2. For the second issue where duplicate names are created:
a. Change the root element of either stream or parse rule and generate the WSDL.
b. Change the XSD file to avoid creating duplicate properties.
Published May 19, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.