Back Forum Reply New

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 #91;#91;ucl#93;helloService/hello.wsdl:0:#91;/ucl#93; error: src-resolve.a: Could not find type 'helloRequestType@2001/XMLSchema'. Do you mean to refer to the type named #91;email#93;helloRequestType@email#93;/hello/schemas (in hello.wsdl)?#93;, see error log for details
What is wrong in my xml schema or wsdl file Can you help me?

schema
------------------------------------------------------------------

Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;schema xmlns:xsd=quot;2001/XMLSchemaquot;
elementFormDefault=quot;qualifiedquot;
targetNamespace=quot;hello/schemasquot;
xmlns:hr=quot;hello/schemasquot;gt;

lt;xsd:element name=quot;helloRequestquot; type=quot;helloRequestTypequot; /gt;

lt;xsd:complexType name=quot;helloRequestTypequot;gt;
lt;xsd:sequencegt;
lt;xsd:element name=quot;first_namequot; type=quot;xsd:stringquot;/gt;
lt;xsd:element name=quot;last_namequot; type=quot;xsd:stringquot;/gt;
lt;/xsd:sequencegt;
lt;/xsd:complexTypegt;

lt;xsd:element name=quot;helloResponsequot; type=quot;helloResponseTypequot; /gt;

lt;xsd:complexType name=quot;helloResponseTypequot;gt;
lt;xsd:element name=quot;resultquot; type=quot;xsd:stringquot; /gt;
lt;/xsd:complexTypegt;
lt;/schemagt;
----------------------------------------------------------------------

Code:
wsdl file:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot; ?gt;
- lt;wsdl:definitions xmlns:wsdl=quot;wsdl/quot; xmlns:schema=quot;hello/schemasquot; xmlns:soap=quot;wsdl/soap/quot; targetNamespace=quot;hello/schemasquot;gt;
- lt;wsdl:typesgt;
- lt;schema xmlns=quot;2001/XMLSchemaquot; xmlns:tns=quot;hello/schemasquot; attributeFormDefault=quot;qualifiedquot; elementFormDefault=quot;qualifiedquot; targetNamespace=quot;hello/schemasquot;gt; lt;element name=quot;helloRequestquot; type=quot;helloRequestTypequot; /gt;
- lt;complexType name=quot;helloRequestTypequot;gt;
- lt;sequencegt; lt;element name=quot;first_namequot; type=quot;stringquot; /gt;  lt;element name=quot;last_namequot; type=quot;stringquot; /gt;  lt;/sequencegt; lt;/complexTypegt; lt;element name=quot;helloResponsequot; type=quot;helloResponseTypequot; /gt;
- lt;complexType name=quot;helloResponseTypequot;gt; lt;element name=quot;resultquot; type=quot;stringquot; /gt;  lt;/complexTypegt; lt;/schemagt; lt;/wsdl:typesgt;
- lt;wsdl:message name=quot;helloResponsequot;gt; lt;wsdl:part element=quot;schema:helloResponsequot; name=quot;helloResponsequot; /gt;  lt;/wsdl:messagegt;
- lt;wsdl:message name=quot;helloRequestquot;gt; lt;wsdl:part element=quot;schema:helloRequestquot; name=quot;helloRequestquot; /gt;  lt;/wsdl:messagegt;
- lt;wsdl:portType name=quot;helloServicequot;gt;
- lt;wsdlperation name=quot;helloquot;gt; lt;wsdl:input message=quot;schema:helloRequestquot; name=quot;helloRequestquot; /gt;  lt;wsdlutput message=quot;schema:helloResponsequot; name=quot;helloResponsequot; /gt;  lt;/wsdlperationgt; lt;/wsdl:portTypegt;
- lt;wsdl:binding name=quot;helloServiceBindingquot; type=quot;schema:helloServicequot;gt; lt;soap:binding style=quot;documentquot; transport=quot;soap/fromquot; /gt;
- lt;wsdlperation name=quot;helloquot;gt; lt;soapperation soapAction=quot;quot; /gt;
- lt;wsdl:input name=quot;helloRequestquot;gt; lt;soap:body use=quot;literalquot; /gt;  lt;/wsdl:inputgt;
- lt;wsdlutput name=quot;helloResponsequot;gt; lt;soap:body use=quot;literalquot; /gt;  lt;/wsdlutputgt; lt;/wsdlperationgt; lt;/wsdl:bindinggt;
- lt;wsdl:service name=quot;helloServiceServicequot;gt;
- lt;wsdl:port binding=quot;schema:helloServiceBindingquot; name=quot;helloServicePortquot;gt; lt;soap:address location=quot;helloService/quot; /gt;  lt;/wsdl:portgt; lt;/wsdl:servicegt; lt;/wsdl:definitionsgt;
--------------------------------------------------------------

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:
lt;xsd:element name=quot;helloRequestquot; type=quot;hr:helloRequestTypequot; /gt;
...
lt;xsd:element name=quot;helloResponsequot; type=quot;hr:helloResponseTypequot; /gt;
And re-generate/change the wsdl accordingly.

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:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;wsdl:definitions xmlns:wsdl=quot;wsdl/quot; xmlns:schema=quot;hello/schemasquot; xmlns:soap=quot;wsdl/soap/quot; targetNamespace=quot;hello/schemasquot;gt;
lt;wsdl:typesgt;
lt;schema xmlns=quot;2001/XMLSchemaquot; xmlns:hr=quot;hello/schemasquot; targetNamespace=quot;hello/schemasquot; elementFormDefault=quot;qualifiedquot;gt;
lt;element name=quot;helloRequestquot; type=quot;hr:helloResponseTypequot;/gt;
lt;complexType name=quot;helloRequestTypequot;gt;
lt;sequencegt;
lt;element name=quot;first_namequot; type=quot;stringquot;/gt;
lt;element name=quot;last_namequot; type=quot;stringquot;/gt;
lt;/sequencegt;
lt;/complexTypegt;
lt;complexType name=quot;helloResponseTypequot;/gt;
lt;element name=quot;helloResponsequot; type=quot;hr:helloResponseTypequot;/gt;
lt;element name=quot;resultquot; type=quot;stringquot;/gt;
lt;/schemagt;
lt;/wsdl:typesgt;
lt;wsdl:message name=quot;helloResponsequot;gt;
lt;wsdl:part name=quot;helloResponsequot; element=quot;schema:helloResponsequot;/gt;
lt;/wsdl:messagegt;
lt;wsdl:message name=quot;helloRequestquot;gt;
lt;wsdl:part name=quot;helloRequestquot; element=quot;schema:helloRequestquot;/gt;
lt;/wsdl:messagegt;
lt;wsdl:portType name=quot;helloServicequot;gt;
lt;wsdlperation name=quot;helloquot;gt;
lt;wsdl:input name=quot;helloRequestquot; message=quot;schema:helloRequestquot;/gt;
lt;wsdlutput name=quot;helloResponsequot; message=quot;schema:helloResponsequot;/gt;
lt;/wsdl:operationgt;
lt;/wsdl:portTypegt;
lt;wsdl:binding name=quot;helloServiceBindingquot; type=quot;schema:helloServicequot;gt;
lt;soap:binding style=quot;documentquot; transport=quot;soap/fromquot;/gt;
lt;wsdl:operation name=quot;helloquot;gt;
lt;soap:operation soapAction=quot;quot;/gt;
lt;wsdl:input name=quot;helloRequestquot;gt;
lt;soap:body use=quot;literalquot;/gt;
lt;/wsdl:inputgt;
lt;wsdl:output name=quot;helloResponsequot;gt;
lt;soap:body use=quot;literalquot;/gt;
lt;/wsdl:outputgt;
lt;/wsdl:operationgt;
lt;/wsdl:bindinggt;
lt;wsdl:service name=quot;helloServiceServicequot;gt;
lt;wsdl:port name=quot;helloServicePortquot; binding=quot;schema:helloServiceBindingquot;gt;
lt;soap:address location=quot;helloService/quot;/gt;
lt;/wsdl:portgt;
lt;/wsdl:servicegt;
lt;/wsdl:definitionsgt;
Best Regards,

Jerry Sheehan
¥
Back Forum Reply New