You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Alan Shiers <as...@eastlink.ca> on 2012/07/25 19:30:09 UTC
newbie needs help with WSDL
Hi there,
I've created a wsdl file attached, and when I run WSDL2Java I get the
following error message.
C:\axis2-1.6.2\samples\pnskeywords>%AXIS2_HOME%\bin\WSDL2Java -uri
keyword.wsdl
-p com.personalnetsearch.plugin.keys.axis2 -pn "IndustryListPort" -d adb -s
Using AXIS2_HOME: C:\axis2-1.6.2
Using JAVA_HOME: C:\Program Files\Java\jdk1.7.0_05
Retrieving document at 'keyword.wsdl'.
log4j:WARN No appenders could be found for logger
(org.apache.axis2.description.
WSDL11ToAllAxisServicesBuilder).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:175)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.AxisFault: The binding operation getIndustryList
is
RPC/literal. The message parts for this operation must use the type
attribute as
specificed by WS-I Basic Profile specification (4.4.1). Message part,
ListItem
Array, violates this rule. Please remove the element attribute and use the
type
attribute.
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:411)
at
org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:169)
... 2 more
Caused by:
org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessin
gException: The binding operation getIndustryList is RPC/literal. The
message pa
rts for this operation must use the type attribute as specificed by WS-I
Basic P
rofile specification (4.4.1). Message part, ListItemArray, violatesthis
rule.
Please remove the element attribute and use the type attribute.
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addPartToElem
ent(WSDL11ToAxisServiceBuilder.java:2254)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.getNewComplex
tType(WSDL11ToAxisServiceBuilder.java:2112)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.createSchemaF
orPorttype(WSDL11ToAxisServiceBuilder.java:1852)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.generateWrapp
erSchema(WSDL11ToAxisServiceBuilder.java:1650)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:355)
... 4 more
I am lost. I have no idea what it wants me to do in the wsdl file to fix
this. Please advise.
Alan
RE: newbie needs help with WSDL
Posted by "Doughty, Michael" <Mi...@bmc.com>.
You're using rpc/literal bindings. This means that you will need to specify the type of the wsdl:part element instead of an element, which would be how you do it in document/literal, not rpc/literal. So define ListItem and ArrayOfListItem as complex types instead, then reference them as types:
Part 1 changes:
<xsi:complexType name="ListItem">
<xsi:sequence>
<xsi:element name="ItemID" type="soapenc:integer"/>
<xsi:element name="ItemName" type="soapenc:string"/>
</xsi:sequence>
</xsi:complexType>
<xsi:complexType name="ArrayOfListItem">
<xsi:sequence>
<xsi:element name="ListItem" type="tns:ListItem" minOccurs="0" maxOccurs="unbounded"/>
</xsi:sequence>
</xsi:complexType>
Part 2 changes;
<wsdl:message name="IndustryListOutput">
<wsdl:part name="ListItemArray" type="tns:ArrayOfListItem"/>
</wsdl:message>
Part 3 changes:
<wsdl:message name="CategoryListOutput">
<wsdl:part name="ListItemArray" type="tns:ArrayOfListItem"/>
</wsdl:message>
From: ashiers@eastlink.ca [mailto:ashiers@eastlink.ca]
Sent: Wednesday, July 25, 2012 12:30 PM
To: java-user@axis.apache.org
Subject: newbie needs help with WSDL
Hi there,
I've created a wsdl file attached, and when I run WSDL2Java I get the following error message.
C:\axis2-1.6.2\samples\pnskeywords>%AXIS2_HOME%\bin\WSDL2Java -uri keyword.wsdl
-p com.personalnetsearch.plugin.keys.axis2 -pn "IndustryListPort" -d adb -s
Using AXIS2_HOME: C:\axis2-1.6.2
Using JAVA_HOME: C:\Program Files\Java\jdk1.7.0_05
Retrieving document at 'keyword.wsdl'.
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.
WSDL11ToAllAxisServicesBuilder).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:175)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.AxisFault: The binding operation getIndustryList is
RPC/literal. The message parts for this operation must use the type attribute as
specificed by WS-I Basic Profile specification (4.4.1). Message part, ListItem
Array, violates this rule. Please remove the element attribute and use the type
attribute.
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:411)
at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:169)
... 2 more
Caused by: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessin
gException: The binding operation getIndustryList is RPC/literal. The message pa
rts for this operation must use the type attribute as specificed by WS-I Basic P
rofile specification (4.4.1). Message part, ListItemArray, violatesthis rule.
Please remove the element attribute and use the type attribute.
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addPartToElem
ent(WSDL11ToAxisServiceBuilder.java:2254)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.getNewComplex
tType(WSDL11ToAxisServiceBuilder.java:2112)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.createSchemaF
orPorttype(WSDL11ToAxisServiceBuilder.java:1852)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.generateWrapp
erSchema(WSDL11ToAxisServiceBuilder.java:1650)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:355)
... 4 more
I am lost. I have no idea what it wants me to do in the wsdl file to fix this. Please advise.
Alan