| Author |
Problem creating java web service client from a wsdl
|
William J Ihle
Greenhorn
Joined: May 09, 2011
Posts: 1
|
|
wsimport => ERROR - Invalid wsdl peration : its a document-literal operation
I'm attempting to create a java web service client from a wsdl (provided by a 3rd party dev team for a project I'm working on; their webservice is written in python) by using the wsimport tool. When I run the wsimport command I get the following result:
wsimport -keep -verbose wattapi.wsdl
parsing WSDL...
[WARNING] R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for soapbind:body: "calculatepower"
line 85 of file:/C:/Users/Bill/Desktop/PVMonitor%20webservice/wattapi.wsdl
[WARNING] R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for soapbind:body: "calculatepower"
line 88 of file:/C:/Users/Bill/Desktop/PVMonitor%20webservice/wattapi.wsdl
[ERROR] Invalid wsdl peration "calculatepower": its a document-literal operation, message part must refer to a schema element declaration
line 72 of file:/C:/Users/Bill/Desktop/PVMonitor%20webservice/wattapi.wsdl
I'm not sure where the problem lies, it's either in the wsdl itself or maybe I'm not using the wsimport tool correctly, but here is the command I'm entering at the prompt:
wsimport -keep -verbose wattapi.wsdl
Something in the portType is triggering the error => Invalid wsdl peration "calculatepower": its a document-literal operation, message part must refer to a schema element declaration
I have indicated the line numbers here on purpose...
<portType name='pvpowerinterface'>
<operation name='calculatepower'> <= line 72
<input message='tns:pvpowerrequest'/>
<output message='tns:pvpowerresponse'/>
</operation>
</portType>
I really have no idea how to fix this problem. I suspect it's an issue with the wsdl itself but I really don't know. Is there something odd about this wsdl or am I doing something wrong with the wsimport tool? Any help would be greatly appreciated as I'm stuck on this problem.
Here is the contents of the entire wsdl file (wattapi.wsdl):
=======================================================================
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions
name ='pvmonitor'
targetNamespace ='http://www.pvwizard.com/soap'
xmlns:tns ='http://www.pvwizard.com/soap'
xmlns:soap ='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd ='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc ='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:soapenv ='http://schemas.xmlsoap.org/soap/envelope'
xmlns:wsdl ='http://schemas.xmlsoap.org/wsdl/'
xmlns ='http://schemas.xmlsoap.org/wsdl/'
>
<types>
<xsd:schema targetNamespace='http://www.pvwizard.com/soap'>
<xsd:complexType name='pvinputs'>
<xsd:all>
<xsd:element name='longitude' type='xsd:decimal'/>
<xsd:element name='latitude' type='xsd:decimal'/>
<xsd:element name='panelmaker' type='xsd:string'/>
<xsd:element name='panelmodel' type='xsd:string'/>
<xsd:element name='panelcount' type='xsd:integer'/>
<xsd:element name='arraytilt' type='xsd:integer'/>
<xsd:element name='arrayazimuth' type='xsd:integer'/>
<xsd:element name='siteefficiency' type='xsd:decimal'/>
<xsd:element name='time' type='xsd:string'/>
<xsd:element name='timezone' type='xsd:string'/>
<xsd:element name='celltemp' type='xsd:decimal'/>
<xsd:element name='irradiance' type='xsd:decimal'/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name='pvoutputs'>
<xsd:all>
<xsd:element name='power' type='xsd:decimal'/>
<xsd:element name='solarelevation' type='xsd:decimal'/>
<xsd:element name='solarazimuth' type='xsd:decimal'/>
<xsd:element name='incidence' type='xsd:decimal'/>
<xsd:element name='gmtdate' type='xsd:date'/>
<xsd:element name='gmttime' type='xsd:time'/>
<xsd:element name='localdate' type='xsd:date'/>
<xsd:element name='localtime' type='xsd:time'/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>
<message name='pvpowerrequest'>
<part name='pvinput' type='tns:pvinputs'/>
</message>
<message name='pvpowerresponse'>
<part name='pvoutput' type='tns:pvoutputs'/>
</message>
<portType name='pvpowerinterface'>
<operation name='calculatepower'>
<input message='tns:pvpowerrequest'/>
<output message='tns:pvpowerresponse'/>
</operation>
</portType>
<binding name='pvpowerbinding' type='tns:pvpowerinterface'>
<soap:binding
style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='calculatepower'>
<soap peration soapAction='http://www.pvwizard.com/soap'/>
<input message='tns:pvpowerrequest'>
<soap:body use='literal' namespace='http://www.pvwizard.com/soap'/>
</input>
<output message='tns:pvpowerresponse'>
<soap:body use='literal' namespace='http://www.pvwizard.com/soap'/>
</output>
</operation>
</binding>
<service name='pvpowerservice'>
<port
name='pvpowerport'
binding='tns:pvpowerbinding'>
<soap:address location='http://www.pvwizard.com/soap/wattsoap.php'/>
</port>
</service>
</definitions>
======================================================================
|
 |
 |
|
|
subject: Problem creating java web service client from a wsdl
|
|
|