Hi,

My comment inline
On 2010-12-15, at 上午10:15, sfierro wrote:


I am trying to use cxf WSDLToJava to generate soap bindings. I had to make some minor modifications (locally reference imports, add wsdl:service, etc.)
when I try to run the WSDL2Java with the following parameters:
-verbose -sn sparql-protocol-query-11 -validate -server -impl - client -keep
-d src wsdl/sparql-protocol-query-11.wsdl
I get the error:
WSIBP Validator found <QuerySoapBinding> is NOT a SOAP binding

WSDLToJava Error: No service was found in wsdl: sparql-protocol- query-11

This error is caused by you specify servicename(-sn) as parql-protocol- query-11, but in the wsdl the service name actually is SparqlQuery, WSDL2java tool will look for the service name you specified from wsdl, so the mismatch cause error.


Freenab

org.apache.cxf.tools.common.ToolException: No service was found in wsdl:
sparql-protocol-query-11
   at
org .apache .cxf .tools .wsdlto.WSDLToJavaContainer.getServiceQName(WSDLToJavaContainer.java: 311)
   at
org .apache .cxf .tools .wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:185)
   at
org .apache .cxf .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 128)
   at
org .apache .cxf .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 271)
   at
org .apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java: 103)
   at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
   at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
   at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)

I have tried quite a few modifications but was unable to get it to validate
without that error.

Here are the files:
sparql-protocol-query-11.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://www.w3.org/2005/08/sparql-protocol-query/ #"
    xmlns:tns="http://www.w3.org/2005/08/sparql-protocol-query/#";

    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";

    xmlns:st="http://www.w3.org/2005/09/sparql-protocol-types/#";

    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";

    xmlns:xs="http://www.w3.org/2001/XMLSchema";


 <wsdl:types>
   <xs:schema
targetNamespace="http://www.w3.org/2005/08/sparql-protocol-query/#";>
     <xs:import
namespace="http://www.w3.org/2005/09/sparql-protocol-types/#";
                schemaLocation="sparql-protocol-types.xsd" />
        </xs:schema>
 </wsdl:types>

 <wsdl:message name="queryRequest">
   <wsdl:part name="query" element="st:query-request"/>
 </wsdl:message>

 <wsdl:message name="queryResponse">
   <wsdl:part name="response" element="st:query-result"/>
 </wsdl:message>

 <wsdl:message name="malformedQueryFault">
     <wsdl:part name="malformedQueryFaultPart"
element="st:malformed-query"/>
 </wsdl:message>

 <wsdl:message name="queryRequestRefusedFault">
     <wsdl:part name="queryRequestRefusedFaultPart"
element="st:query-request-refused"/>
 </wsdl:message>

 <wsdl:portType name="SparqlQueryInterface">
   <wsdl:operation name="query">
     <wsdl:input  message="tns:queryRequest"/>
     <wsdl:output message="tns:queryResponse"/>
     <wsdl:fault  message="tns:malformedQueryFault"
name="malformedQueryFault" />
     <wsdl:fault  message="tns:queryRequestRefusedFault"
name="queryRequestRefusedFault" />
   </wsdl:operation>
 </wsdl:portType>

<wsdl:binding name="QuerySoapBinding" type="tns:SparqlQueryInterface">
   <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
   <wsdl:operation name="query">
   <soap:operation style="document" />
     <wsdl:input>
       <soap:body use="literal"/>
     </wsdl:input>
     <wsdl:output>
       <soap:body use="literal"/>
     </wsdl:output>
     <wsdl:fault name="malformedQueryFault">
       <soap:fault use="literal" name="malformedQueryFault"/>
     </wsdl:fault>
     <wsdl:fault name="queryRequestRefusedFault">
       <soap:fault use="literal" name="queryRequestRefusedFault"/>
     </wsdl:fault>
   </wsdl:operation>
 </wsdl:binding>

 <wsdl:service name="SparqlQuery">
   <wsdl:port name="SparqlQueryPort" binding="QuerySoapBinding">
     <soap:address location="http://localhost:9090/SparqlQueryPort"; />
   </wsdl:port>
 </wsdl:service>

</wsdl:definitions>



sparql-protocol-types.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="$Id: sparql-protocol-types.xsd,v 1.17 2006/01/11
19:15:22 kclark Exp $"
   targetNamespace="http://www.w3.org/2005/09/sparql-protocol-types/#";
   xmlns:st="http://www.w3.org/2005/09/sparql-protocol-types/#";
   xmlns:xs="http://www.w3.org/2001/XMLSchema";
   xmlns:vbr="http://www.w3.org/2005/sparql-results#";
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>

 <xs:import namespace="http://www.w3.org/2005/sparql-results#";
              schemaLocation="result2.xsd" />

 <xs:import namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
              schemaLocation="rdf.xsd" />

 <xs:element name="query-request">
   <xs:complexType>
     <xs:sequence>
       <xs:element minOccurs="1" maxOccurs="1" name="query"
type="xs:string">
               <xs:annotation>
<xs:documentation>query is an xs:string constrained by the language
definition,
http://www.w3.org/TR/rdf-sparql-query/#grammar, as "a sequence
of characters in
the language defined by the [SPARQL] grammar, starting with the
Query production"
          </xs:documentation>
                    </xs:annotation>
       </xs:element>
       <xs:element minOccurs="0" maxOccurs="unbounded"
name="default-graph-uri" type="xs:anyURI"/>
       <xs:element minOccurs="0" maxOccurs="unbounded"
name="named-graph-uri" type="xs:anyURI"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 <xs:element name="query-result">
   <xs:annotation>
<xs:documentation>The type for serializing query results, either as
XML or RDF/XML.</xs:documentation>
   </xs:annotation>
       <xs:complexType>
         <xs:choice>
           <xs:element maxOccurs="1" ref="vbr:sparql"/>
           <xs:element maxOccurs="1" ref="rdf:RDF"/>
         </xs:choice>
       </xs:complexType>
   </xs:element>
 <xs:element type="xs:string" name="fault-details">
   <xs:annotation>
<xs:documentation> This element contains human-readable information
about the fault returned by
            the SPARQL query processing service.</xs:documentation>
   </xs:annotation>
 </xs:element>
 <xs:element name="malformed-query">
   <xs:complexType>
     <xs:all>
        <xs:element minOccurs="0" maxOccurs="1" ref="st:fault-details"/>
     </xs:all>
   </xs:complexType>
 </xs:element>
 <xs:element name="query-request-refused">
   <xs:complexType>
     <xs:all>
<xs:element minOccurs="0" maxOccurs="1" ref="st:fault- details"/>
     </xs:all>
   </xs:complexType>
 </xs:element>
</xs:schema>



I can post the imports from sparql-protocol-types.xsd if necessary.

Thanks.







--
View this message in context: 
http://cxf.547215.n5.nabble.com/WSIBP-Validator-found-QuerySoapBinding-is-NOT-a-SOAP-binding-tp3305658p3305658.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org

Reply via email to