Problem creating a web service from a WSDL

ChadNC picture ChadNC · Dec 17, 2009 · Viewed 19.3k times · Source

The problem I'm having is that when I attempt to create a web service in netbeans using this wsdl, netbeans says that there is no service defined. I'm new to the whole wsdl thing but as far as I can tell there is one defined.

The wsdl is:

 <?xml version="1.0" encoding="UTF-8"?>
 <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://discoveryinsurance.com/DicQuoteSvc/AgencyQuote.wsdl" xmlns:ns="http://discoveryinsurance.com/DicQuoteSvc/schemas/DicAcordQuoteRq.xsd" xmlns:na="http://discoveryinsurance.com/DicQuoteSvc/schemas/DicAcordQuoteRs.xsd" targetNamespace="http://discoveryinsurance.com/DicQuoteSvc/AgencyQuote.wsdl">
<wsdl:import namespace="http://discoveryinsurance.com/DicQuoteSvc/schemas/" location="DicAcordQuoteRq.xsd"/>
<wsdl:import namespace="http://discoveryinsurance.com/DicQuoteSvc/schemas/" location="DicAcordQuoteRs.xsd"/>
<wsdl:types>
    <xs:schema targetNamespace="http://discoveryinsurance.com/DicQuoteSvc/schemas/" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="NewMessageRequest">
    <wsdl:part name="parameter" element="ns:ACORD"/>
</wsdl:message>
<wsdl:message name="NewMessageResponse">
    <wsdl:part name="parameter" element="na:ACORD"/>
</wsdl:message>
<wsdl:portType name="QuotePortType">
    <wsdl:operation name="RequestQuote">
        <wsdl:input message="tns:NewMessageRequest"/>
        <wsdl:output message="tns:NewMessageResponse"/>
    </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="QuoteBinding" type="tns:QuotePortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="RequestQuote">
        <soap:operation soapAction="http://discoveryinsurance.com/DicQuoteSvc/AgencyQuote" style="rpc"/>
        <wsdl:input>
            <soap:body use="literal"/>
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal"/>
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="AgencyQuote">
    <wsdl:port name="QuotePortType" binding="tns:QuoteBinding">
        <soap:address  location="http://discoveryinsurance.com/DicQuoteSvc/"/>
    </wsdl:port>
</wsdl:service>

XMLSpy says that the wsdl is valid but it fails when i try to create the web service from it. Any help would be appreciated even constructive criticism.

EDIT

Using wsimport from the commmand line I get.

[ERROR] Invalid wsdl:operation "RequestQuote": its a rpc-literal operation, mes sage part must refer to a schema type declaration line 16 of file:/D:/projects/DICACORD/QuoteRq2.wsdl

Does that mean that even though the two xsd's are imported I still have to define the types in the wsdl?

Update 2

The schema for the request->. Schema at pastie

Addition

Does anyone see anything wrong with the xsd imports and/or how they are being used?

Answer

maximdim picture maximdim · Dec 17, 2009

Easiest way to verify that wsdl is valid is to run from command line:

wsimport yourservice.wsdl

and see if it gives you any errors. wsimport comes with JDK 1.6

WSDL you submitted is not complete as it has references to external schema files (XSD) so there is no way for me to validate it.