I am trying to use the element redefine in my xsd. I have tried different combinations but still don't seem to get this error resolved. The error shows up when i try to load the WSDL including the redefined schema into SOAP UI. Also, it doesnt show up in the design for the xsd in eclipse.
WSDL -> Imports TestService.xsd -> Imports CreateTest.xsd -> Contains a definition of CreateTestRequestType.
When i load this into my SOAPUI, everything looks good and no errors.
Now, I am trying to redefine the type CreateTestRequestType in another xsd called CreateRedefineTest.xsd and import this xsd into the TestService.xsd (The import statement is comemented, but i necessarily just uncomment this import and comment the other one for testing). But when i load the WSDL into SOAP UI, i get the below error:
Source: null Error: URL "CreateTest.xsd" is not well-formed
EDIT1: I am able to resolve this error by giving an absolute path. Is it possible to make it work with relative path?
EDIT2 I looked at w3 article about this element and the example does use a relative path. But i tried to replicate but it still doesnt work. The example is available at the this location.
I think i am missing some rule, but i have tried multiple things and dont seem to be able to resolve this.
Below is the source code for the WSDL and XSD's.
WSDL:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions
xmlns:test="http://test.com/TESTServices/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tes="http://test.com/TestService/Test/"
name="TestService"
targetNamespace="http://test.com/TESTServices/">
<wsdl:types>
<xsd:schema targetNamespace="http://test.com/TestService/Test/">
<xsd:include schemaLocation="TestService.xsd" />
</xsd:schema>
</wsdl:types>
<!-- Create Test -->
<wsdl:message name="CreateTestRequest">
<wsdl:part element="tes:CreateTestRequest" name="parameters" />
</wsdl:message>
<wsdl:message name="CreateTestResponse">
<wsdl:part element="tes:CreateTestResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="TESTHeader">
<wsdl:part name="request_header" element="tes:testHeader"/>
</wsdl:message>
<wsdl:message name="TestFault">
<wsdl:part name="testFault" element="tes:testFault"></wsdl:part>
</wsdl:message>
<wsdl:portType name="TestServices_v4_0">
<!-- Create Party -->
<wsdl:operation name="CreateTest">
<wsdl:input message="test:CreateTestRequest" />
<wsdl:output message="test:CreateTestResponse" />
<wsdl:fault name="fault" message="test:TestFault"></wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestServicesSOAP_v4_0" type="test:TestServices_v4_0">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<!-- Create Party -->
<wsdl:operation name="CreateTest">
<soap:operation soapAction="http://firstniagara.com/PartyService/CreateTest" />
<wsdl:input>
<soap:header message="test:TESTHeader" part="request_header"
use="literal" />
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:header message="test:TESTHeader" part="request_header"
use="literal" />
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="fault">
<soap:fault name="fault" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestServices_v4_0">
<wsdl:port binding="test:TestServicesSOAP_v4_0" name="TestServicesSOAP">
<soap:address location="http://localhost/TEST/ESB" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
This WSDL Imports TestService.xsd, which contains below code:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ct="http://test.com/TestService/CreateTest/"
targetNamespace="http://test.com/TestService/Test/"
elementFormDefault="qualified">
<xsd:import namespace="http://test.com/TestService/CreateTest/" schemaLocation="CreateTest.xsd" />
<!-- <xsd:import namespace="http://test.com/TestService/CreateTest/" schemaLocation="CreateRedefineTest.xsd" /> -->
<!-- CreateParty -->
<xsd:element name="CreateTestRequest" type="ct:CreateTestRequestType" />
<xsd:element name="CreateTestResponse" type="ct:CreateTestResponseType" />
<xsd:element name="testHeader" type="xsd:string" />
<xsd:element name="testFault" type="xsd:string" />
</xsd:schema>
TestService.xsd contains CreateTest.xsd, which contains the below code and has a type CreateTestRequestType defined:
<xsd:schema
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://test.com/TestService/CreateTest/"
elementFormDefault="qualified">
<!-- Create Test-->
<xsd:complexType name="CreateTestRequestType">
<xsd:sequence>
<xsd:element name="RequestId" type="xsd:string" minOccurs="1"/>
<xsd:element name="TestRecord" type="xsd:string" minOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CreateTestResponseType">
<xsd:sequence>
<xsd:element name="RequestId" type="xsd:string" minOccurs="1"/>
<xsd:element name="Messages" type="xsd:string" minOccurs="0"/>
<xsd:element name="TestIdentifier" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Trying to redefine CreateTestRequestType in CreateRedefineTest.xsd as below:
<xsd:schema
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cp="http://test.com/TestService/CreateTest/"
targetNamespace="http://test.com/TestService/CreateTest/"
elementFormDefault="qualified">
<xsd:redefine schemaLocation="CreateTest.xsd">
<xsd:complexType name="CreateTestRequestType">
<xsd:complexContent>
<xsd:extension base="cp:CreateTestRequestType">
<xsd:sequence>
<xsd:element name="country" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:redefine>
</xsd:schema>
<xs:redefine>
. The thing is if I use an absolute path forschemaLocation
inxs:redefine
using the follow notationfile:///C:/Path_to_xsd
seems that non error is thrown an the WSDL is load. However then when I create the request and add manually the new element<country>
and I validate the request with SOAPUI it says that element is not allowed. So with the full path wsdl loads without error but loads incorrectly... hope you'll be lucky finding a solution. – albciff:)
– albciff