Reputation: 294
I am trying to write a simple wsdl file that has a inline xsd. I am showing with the below errors.I refered other stackoverflow question, but none helped on this issue.Any help is appreciated. Below is the code
<wsdl:types>
<!-- <xsd:schema targetNamespace="http://www.example.org/createEmployee/">
<xsd:import schemaLocation="..\schema\Employee.xsd"/>
</xsd:schema> -->
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/Employee"
xmlns:tns="http://www.example.org/Employee" elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee" type="tns:EmployeeRequestType"></xsd:element>
<xsd:complexType name="EmployeeRequestType">
<xsd:all>
<xsd:element name="fname" type="string" maxOccurs="1" minOccurs="1"></xsd:element>
<xsd:element name="lname" type="string" maxOccurs="1" minOccurs="1"></xsd:element>
<xsd:element name="salary" type="double" maxOccurs="1" minOccurs="1"></xsd:element>
<xsd:element name="type" type="string" maxOccurs="1" minOccurs="1"></xsd:element>
</xsd:all>
</xsd:complexType>
<xsd:element name="EmployeeResponse" type="tns:EmployeeResponseType"></xsd:element>
<xsd:complexType name="EmployeeResponseType">
<xsd:all>
<xsd:element name="EmpId" type="string" maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="type" type="string" maxOccurs="1" minOccurs="1"></xsd:element>
</xsd:all>
</xsd:complexType>
<wsdl:message name="addEmployeeRequest">
**<wsdl:part name="parameters" element="tns:Employee"/>**
</wsdl:message>
<wsdl:message name="addEmployeeResponse">
**<wsdl:part name="parameters" element="tns:EmployeeResponse"/>**
</wsdl:message>
<wsdl:portType name="addEmployeePortType">
<wsdl:operation name="addEmployee">
<wsdl:input message="tns:addEmployeeRequest"/>
<wsdl:output message="tns:addEmployeeResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="addEmp_Binding" type="tns:addEmployeePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="addEmployee">
**<soap:operation style="document" soapAction="http://www.example.org/createEmployee/addEmployee" />**
<wsdl:input name="addEmployeeRequest">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="addEmployeeResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="addEmployeeService">
<wsdl:port name="addEmployeePort" binding="tns:addEmp_Binding">
<soap:address
location="http://localhost:8080/service/addEmployee" />
</wsdl:port>
</wsdl:service>
Errors :
Below are the errors at highlighted
1. The part 'parameters' has an invalid value 'Employee' defined for its element. Element declarations must refer to valid values defined in a schema.
The part 'parameters' has an invalid value 'EmployeeResponse' defined for its element. Element declarations must refer to valid values defined in a schema.
Upvotes: 1
Views: 3046
Reputation: 294
Answer to my question is that there was an issue with namespaces. Once I corrected the namespaces, the below errors were resolved:
"The part 'parameters' has an invalid value 'Employee' defined for its element. Element declarations must refer to valid values defined in a schema."
"The part 'parameters' has an invalid value 'EmployeeResponse' defined for its element. Element declarations must refer to valid values defined in a schema."
Upvotes: 1