I am extremely puzzled as to how to instantiate a Service instance in which
I specify the location of a WSDL file.

The Service constructors take a QName as a second parameter that identifies
the service name. Perhaps I am not creating the QName with the proper
arguments, but I keep on getting a javax.xml.rpc.ServiceException stating
that it cannot find the service that I specify. I have tried every possible
combination of parameters when creating the QName, but have failed
miserably. Any help would greatly be appreciated. What I am looking for it
to get the following command right:

   QName serviceName = new QName( XXX, YYY );
   Service service = new Service ( wsdlLocation, serviceName );
   ...

What should I use instead of XXX and YYY when my WSDL document is ...

<?xml version="1.0" encoding="UTF-8"?>
<definitions
        name="CCBookStore"
        targetNamespace="http://www.capeclear.com/CCBookStore.wsdl";
        xmlns:xsd1="http://www.capeclear.com/CCBookStore.xsd";
        xmlns:tns="http://www.capeclear.com/CCBookStore.wsdl";
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns="http://schemas.xmlsoap.org/wsdl/";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<types>
<xsd:schema
                        targetNamespace="http://www.capeclear.com/CCBookStore.xsd";
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
<xsd:complexType name="PriceQuote">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="price" type="xsd:double"/>
<xsd:element
                                                maxOccurs="1"
                                                minOccurs="1"
                                                nillable="true"
                                                name="isbn"
                                                type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="storeID" type="xsd:int"/>
<xsd:element
                                                maxOccurs="1"
                                                minOccurs="1"
                                                nillable="true"
                                                name="storeDescription"
                                                type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Customer">
<xsd:sequence>
<xsd:element
                                                maxOccurs="1"
                                                minOccurs="1"
                                                nillable="true"
                                                name="firstName"
                                                type="xsd:string"/>
<xsd:element
                                                maxOccurs="1"
                                                minOccurs="1"
                                                nillable="true"
                                                name="lastName"
                                                type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="getString"/>
<message name="getStringResponse">
<part name="return" type="xsd:string"/>
</message>
<message name="getPrice">
<part name="arg0" type="xsd:string"/>
</message>
<message name="getPriceResponse">
<part name="return" type="xsd1:PriceQuote"/>
</message>
<message name="placeOrder">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd1:Customer"/>
</message>
<message name="placeOrderResponse"/>
<portType name="AxisBookStore">
<operation name="getString">
<input message="tns:getString"/>
<output message="tns:getStringResponse"/>
</operation>
<operation name="getPrice">
<input message="tns:getPrice"/>
<output message="tns:getPriceResponse"/>
</operation>
<operation name="placeOrder">
<input message="tns:placeOrder"/>
<output message="tns:placeOrderResponse"/>
</operation>
</portType>
<binding name="AxisBookStoreBinding" type="tns:AxisBookStore">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getString">
<soap:operation
soapAction="capeconnect:CCBookStore:AxisBookStore#getString"/>
<input>
<soap:body
                                        use="encoded"
                                        
namespace="capeconnect:CCBookStore:AxisBookStore"
                                        
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body
                                        use="encoded"
                                        
namespace="capeconnect:CCBookStore:AxisBookStore"
                                        
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="getPrice">
<soap:operation
soapAction="capeconnect:CCBookStore:AxisBookStore#getPrice"/>
<input>
<soap:body
                                        use="encoded"
                                        
namespace="capeconnect:CCBookStore:AxisBookStore"
                                        
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body
                                        use="encoded"
                                        
namespace="capeconnect:CCBookStore:AxisBookStore"
                                        
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="placeOrder">
<soap:operation
soapAction="capeconnect:CCBookStore:AxisBookStore#placeOrder"/>
<input>
<soap:body
                                        use="encoded"
                                        
namespace="capeconnect:CCBookStore:AxisBookStore"
                                        
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body
                                        use="encoded"
                                        
namespace="capeconnect:CCBookStore:AxisBookStore"
                                        
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="CCBookStore">
<documentation>CCBookStore</documentation>
<port name="AxisBookStore" binding="tns:AxisBookStoreBinding">
<soap:address location="http://FlatBug:8000/ccx/CCBookStore"/>
</port>
</service>
</definitions>
*******************************************************
 Kyle Lomel�
 Software Developer
 Deitel & Associates, Inc.
 www.deitel.com

 Register now for the DEITEL BUZZ e-mail newsletter at
 http://www.deitel.net/newsletter/subscribe.html
*******************************************************

Reply via email to