Announcement Announcement Module
Collapse
No announcement yet.
xml schema or wsdl error? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • xml schema or wsdl error?

    hi,
    I am writing an xml schema, java codes,and deploy project to tomcat server.
    After that I use Altova xml spy to create a soap request from this project wsdl.
    I got an error :
    HTML Code:
    Fri Sep 21 16:25:35 EEST 2007:ERROR:An error occured [[url]http://localhost:8080/helloService/hello.wsdl:0:[/url] error: src-resolve.a: Could not find type 'helloRequestType@http://www.w3.org/2001/XMLSchema'. Do you mean to refer to the type named [email]helloRequestType@http://ilterkaracay.com[/email]/hello/schemas (in hello.wsdl)?], see error log for details
    What is wrong in my xml schema or wsdl file Can you help me?

    schema
    ------------------------------------------------------------------
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://ilterkaracay.com/hello/schemas"
    xmlns:hr="http://ilterkaracay.com/hello/schemas">
    
    	<xsd:element name="helloRequest" type="helloRequestType" />
    
    	<xsd:complexType name="helloRequestType">
    		<xsd:sequence>
    			<xsd:element name="first_name" type="xsd:string"/>
    			<xsd:element name="last_name" type="xsd:string"/>
    		</xsd:sequence>
    	</xsd:complexType>
    	
    	<xsd:element name="helloResponse" type="helloResponseType" />
    	
    	<xsd:complexType name="helloResponseType">
    		<xsd:element name="result" type="xsd:string" />
    	</xsd:complexType>
    </schema>
    ----------------------------------------------------------------------
    Code:
    wsdl file:
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:schema="http://ilterkaracay.com/hello/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://ilterkaracay.com/hello/schemas">
    - <wsdl:types>
    - <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ilterkaracay.com/hello/schemas" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ilterkaracay.com/hello/schemas">
      <element name="helloRequest" type="helloRequestType" /> 
    - <complexType name="helloRequestType">
    - <sequence>
      <element name="first_name" type="string" /> 
      <element name="last_name" type="string" /> 
      </sequence>
      </complexType>
      <element name="helloResponse" type="helloResponseType" /> 
    - <complexType name="helloResponseType">
      <element name="result" type="string" /> 
      </complexType>
      </schema>
      </wsdl:types>
    - <wsdl:message name="helloResponse">
      <wsdl:part element="schema:helloResponse" name="helloResponse" /> 
      </wsdl:message>
    - <wsdl:message name="helloRequest">
      <wsdl:part element="schema:helloRequest" name="helloRequest" /> 
      </wsdl:message>
    - <wsdl:portType name="helloService">
    - <wsdl:operation name="hello">
      <wsdl:input message="schema:helloRequest" name="helloRequest" /> 
      <wsdl:output message="schema:helloResponse" name="helloResponse" /> 
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="helloServiceBinding" type="schema:helloService">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <wsdl:operation name="hello">
      <soap:operation soapAction="" /> 
    - <wsdl:input name="helloRequest">
      <soap:body use="literal" /> 
      </wsdl:input>
    - <wsdl:output name="helloResponse">
      <soap:body use="literal" /> 
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="helloServiceService">
    - <wsdl:port binding="schema:helloServiceBinding" name="helloServicePort">
      <soap:address location="http://localhost:8080/helloService/" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    --------------------------------------------------------------

  • #2
    You probably need to specify the namespace prefix in the type-attribute of the helloRequest- and helloResponse-elements declarations in the xsd. Like so:

    Code:
    <xsd:element name="helloRequest" type="hr:helloRequestType" />
    ...
    <xsd:element name="helloResponse" type="hr:helloResponseType" />
    And re-generate/change the wsdl accordingly.

    Comment


    • #3
      Complete wsdl w/internal schema

      Here's the completed wsdl with a correct version of the internal schema

      Of course I used XMLSpy 2008 Enterprise Edition to edit and validate this.

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:schema="http://ilterkaracay.com/hello/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://ilterkaracay.com/hello/schemas">
      	<wsdl:types>
      		<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:hr="http://ilterkaracay.com/hello/schemas" targetNamespace="http://ilterkaracay.com/hello/schemas" elementFormDefault="qualified">
      	<element name="helloRequest" type="hr:helloResponseType"/>
      	<complexType name="helloRequestType">
      		<sequence>
      			<element name="first_name" type="string"/>
      			<element name="last_name" type="string"/>
      		</sequence>
      	</complexType>
      	<complexType name="helloResponseType"/>
      	<element name="helloResponse" type="hr:helloResponseType"/>
      	<element name="result" type="string"/>
      </schema>
      	</wsdl:types>
      	<wsdl:message name="helloResponse">
      		<wsdl:part name="helloResponse" element="schema:helloResponse"/>
      	</wsdl:message>
      	<wsdl:message name="helloRequest">
      		<wsdl:part name="helloRequest" element="schema:helloRequest"/>
      	</wsdl:message>
      	<wsdl:portType name="helloService">
      		<wsdl:operation name="hello">
      			<wsdl:input name="helloRequest" message="schema:helloRequest"/>
      			<wsdl:output name="helloResponse" message="schema:helloResponse"/>
      		</wsdl:operation>
      	</wsdl:portType>
      	<wsdl:binding name="helloServiceBinding" type="schema:helloService">
      		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      		<wsdl:operation name="hello">
      			<soap:operation soapAction=""/>
      			<wsdl:input name="helloRequest">
      				<soap:body use="literal"/>
      			</wsdl:input>
      			<wsdl:output name="helloResponse">
      				<soap:body use="literal"/>
      			</wsdl:output>
      		</wsdl:operation>
      	</wsdl:binding>
      	<wsdl:service name="helloServiceService">
      		<wsdl:port name="helloServicePort" binding="schema:helloServiceBinding">
      			<soap:address location="http://localhost:8080/helloService/"/>
      		</wsdl:port>
      	</wsdl:service>
      </wsdl:definitions>
      Best Regards,

      Jerry Sheehan

      http://www.altova.com/

      Comment

      Working...
      X