IBM Support

DFHPI9027E XML parser error when adding attributes to elements in a WSDL

Troubleshooting


Problem

You are unable to get the CICS Web services assistant, DFHWS2LS, to accept a modification to a Web services assistant generated WSDL, DFHLS2WS. You would like to edit the WSDL created by the Web services assistant to include attribute definitions in a couple of the elements in the request. When you attempt to do this you receive message DFHPI9027E.

Symptom

You have an XML interface to your on-line (CICS) system. Unfortunately, you do not have WSDLs that define your services. You do have sample messages and schemas (of sorts) that describe the messaging. You used a sample message to create a COBOL copybook 'mapping' the elements in the message. You created (using the Web services assistant) a 'local' provider Web service representing the client company service. You used the WSDL to create the requester Web service. You have two CICS regions using the service.

You would like to use attributes in a couple of the elements in the request. The process you used above does not allow you to 'create' attributes. You would like to edit the WSDL created by the Web services assistant to include the attribute definitions. Here's a sample of the message you are trying to support:


<Request Echo="false" RequestID="1234567" TypeOfRequest="SignOnRequest">
 <SignOnRequest>
  <Sssn00iRequestData>
   <SignonName>Test User</SignonName>
   <SignonPassword>Testpwd01</SignonPassword>
  </Sssn00iRequestData>
 </SignOnRequest>
</Request>


Here is an example of the error messages you are getting:

DFHPI9027E The XML parser error has found an error: "XSD: The element
'http://www.w3.org/2001/XMLSchema#attribute' is not permitted as constrained by 'http://www.w3.org/2001/XMLSchema#explicitGroup';
expecting group | choice | sequence | element | any | annotation | nothing" at line "19" and column "22" in document "file:/app/sbend/mort/test/webservices/cpswsdl/cpss9001.wsdl".

Original text from the WSDL:

<xsd:complexType abstract="false" block="#all" final="#all" mixed="false" name="ProgramInterface">
 <xsd:sequence>
  <xsd:element name="Request" nillable="false">
   <xsd:complexType mixed="false">
    <xsd:sequence>
     <xsd:element name="SignOnRequest" nillable="false">
      <xsd:complexType mixed="false">

Attribute definition you would like to add to the 'Request' element:

<xsd:attribute name="TypeOfRequest" type="xsd:string" use="required" fixed="SignOnRequest" />

Cause

Attributes were not added correctly to the WSDL.

Resolving The Problem

Include the attributes inside the complexType and after the sequence defining the sub elements. For example, an element with two sub elements and an attribute with the name of "FirstAttr" would look like this:

<xs:element name="First" minOccurs="0" maxOccurs="5">
 <xs:complexType>
  <xs:sequence>
   <xs:element name="FirstString" type="xs:string"/>
   <xs:element name="FirstNum" type="xs:decimal"/>
  </xs:sequence>
  <xs:attribute name="FirstAttr" type="xs:string" use="required"/>
 </xs:complexType>
</xs:element>

[{"Product":{"code":"SSGMGV","label":"CICS Transaction Server"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Web Services","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"5.1;4.2;4.1;3.2;3.1","Edition":"","Line of Business":{"code":"LOB70","label":"Z TPS"}}]

Product Synonym

CICS/TS CICS TS CICS Transaction Server

Document Information

Modified date:
05 January 2026

UID

swg21254993