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?
To answer my own question, the reason the web service was failing to be created from the wsdl was due to the use of
wsdl:import
instead ofxs:import
.I didn't know it but after doing some more research it seems that wsdl:import should be used when you want to import another wsdl but if you want to import a schema from a to use the types defined in it within the wsdl you need to use an
xsd:import
because if not wsimport will not find the types defined in the schema.I changed
to
and changed the imports from
to
Making these changes allowed the web service to build successfully and the classes were created based off of the two schemas. Hopefully when I begin testing the web service on Monday it will work as I want it to. Thanks all of you for the input you provided as it led me to look into other reasons why the creation of the web service from the wsdl was failing.
I did change the namespace that they are in but that was for different reasons and I did that after the web service had been created and deployed locally on my machine.
Happy Holidays Everyone.