You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mirco Dunker <so...@gmx.net> on 2012/04/10 11:23:36 UTC

wsdl2java Problem

Hi folks,

I want to generate a CXF Client for the HP Operation Manager System. The Operation Manager provides me 9 WSDL Files and 16 XSD Files (see appendix). And there are generated axis2 client sources. But I want to use CXF instead ot axis. So I tried to generate my own cxf client.

Now I got an error using the wsdl2java generator:

Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -client -d C:\Data\Workspace\Eclipse_Indigo_x86\HpOmuWsClient\.cxftmp/src -classdir C:\Data\Workspace\Eclipse_Indigo_x86\HpOmuWsClient\target\classes -p http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident=com.hp.schemas.ism.serviceoperation.incidentmanagement.1.incident -impl -validate -exsh false -dns true -dex true -wsdlLocation http:/xxx/opr-webservice/Incident.svc?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 file:/C:/Data/Workspace/Eclipse_Indigo_x86/HpOmuWsClient/src/main/resources/wsdls/IncidentService.wsdl
wsdl2java - Apache CXF 2.5.1


WSDLToJava Error: 
 Summary:  Failures: 1, Warnings: 0

 <<< ERROR! 
Invalid WSDL, Operation SubscriptionEndOp in PortType {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident}IncidentAccess not request-response or one-way

Non unique body parts, operation [ Put ] and  operation [ Create ] in binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident}WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident}Incident



org.apache.cxf.tools.common.ToolException: 
 Summary:  Failures: 1, Warnings: 0

 <<< ERROR! 
Invalid WSDL, Operation SubscriptionEndOp in PortType {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident}IncidentAccess not request-response or one-way

Non unique body parts, operation [ Put ] and  operation [ Create ] in binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident}WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident}Incident


	at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:137)
	at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:201)
	at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:61)
	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:177)
	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
	at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)

I can't believe that I have to change the standard HP WSDL Files to generate a cxf client. Is there a way to avoid this error and gerate a working cxf client?

Thanks in advance, 
Mirco

Re: wsdl2java Problem

Posted by Daniel Kulp <dk...@apache.org>.
As Freeman said, this WSDL is really not valid per "modern" WSI-Basic 
Profile standards which CXF and modern toolkits adhere to.   You could 
likely grab local copies of the wsdl and make modifications to them that may 
help.  For example, removing that "out only" operation entirely from the 
WSDL would get you past that.  Since it's not a usable operation, removing 
it should have no affect on your usage of the generated code.

Dan


On Wednesday, April 11, 2012 04:21:20 PM Freeman Fang wrote:
> Hi,
> 
> And the second error here
> Non unique body parts, operation [ Put ] and  operation [ Create ] in
> binding
> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident
> }WsManIncidentBinding have the same body block:
> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident
> }Incident
> If you don't use -validate flag, you won't see it. However, this error
> means the on-wire soap payload of method invocation "Put" and "Create"
> would be exactly same,  then how the server side can determine which
> method should get invoked in this case?
> 
> Seems the wsdl you get here is quite old, it doesn't follow some good
> practice in the way that you should compose a wsdl.
> 
> Freeman
> 
> On 2012-4-11, at 下午4:05, Freeman Fang wrote:
> > Hi,
> > 
> > I did a quick check at the wsdl you append, it's an invalid wsdl
> > indeed per jaxws
> > <wsdl:operation name="SubscriptionEndOp">
> > 
> >      <wsdl:output message="wse:SubscriptionEnd"
> >      
> >         wsa:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subsc
> >         riptionEnd> 
> > " />
> > 
> >  </wsdl:operation>
> > 
> > This operation has no input message, generally this kind of
> > operation is considered as notification, but it's not supported by
> > jaxws. And generally you can use callback to send a notification
> > from server to client as a solution(we have a callback example
> > shipped with kit which you may wanna take a look), but this kind of
> > wsdl isn't supported in jaxws, jaxws requires input message anyway.
> > 
> > Freeman
> > 
> > On 2012-4-10, at 下午5:23, Mirco Dunker wrote:
> >> Hi folks,
> >> 
> >> I want to generate a CXF Client for the HP Operation Manager
> >> System. The Operation Manager provides me 9 WSDL Files and 16 XSD
> >> Files (see appendix). And there are generated axis2 client sources.
> >> But I want to use CXF instead ot axis. So I tried to generate my
> >> own cxf client.
> >> 
> >> Now I got an error using the wsdl2java generator:
> >> 
> >> Loading FrontEnd jaxws ...
> >> Loading DataBinding jaxb ...
> >> wsdl2java -client -d C:\Data\Workspace
> >> \Eclipse_Indigo_x86\HpOmuWsClient\.cxftmp/src -classdir C:\Data
> >> \Workspace\Eclipse_Indigo_x86\HpOmuWsClient\target\classes -p
> >> http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incide
> >> nt=com.hp.schemas.ism.serviceoperation.incidentmanagement.1.incident>> 
> >>  -impl -validate -exsh false -dns true -dex true -wsdlLocation
> >> 
> >> http:/xxx/opr-webservice/Incident.svc?wsdl -verbose -defaultValues -
> >> fe jaxws -db jaxb -wv 1.1 file:/C:/Data/Workspace/
> >> Eclipse_Indigo_x86/HpOmuWsClient/src/main/resources/wsdls/
> >> IncidentService.wsdl
> >> wsdl2java - Apache CXF 2.5.1
> >> 
> >> 
> >> WSDLToJava Error:
> >> Summary:  Failures: 1, Warnings: 0
> >> 
> >> <<< ERROR!
> >> Invalid WSDL, Operation SubscriptionEndOp in PortType
> >> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incid
> >> ent }IncidentAccess not request-response or one-way
> >> 
> >> Non unique body parts, operation [ Put ] and  operation [ Create ]
> >> in binding
> >> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incid
> >> ent }WsManIncidentBinding have the same body block:
> >> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incid
> >> ent }Incident
> >> 
> >> 
> >> 
> >> org.apache.cxf.tools.common.ToolException:
> >> Summary:  Failures: 1, Warnings: 0
> >> 
> >> <<< ERROR!
> >> Invalid WSDL, Operation SubscriptionEndOp in PortType
> >> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incid
> >> ent }IncidentAccess not request-response or one-way
> >> 
> >> Non unique body parts, operation [ Put ] and  operation [ Create ]
> >> in binding
> >> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incid
> >> ent }WsManIncidentBinding have the same body block:
> >> {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incid
> >> ent }Incident
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf
> >> .tools
> >> .validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:137)
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf
> >> .tools
> >> .wsdlto
> >> .frontend
> >> .jaxws
> >> .wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:
> >> 201)
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf
> >> .tools
> >> .wsdlto
> >> .frontend
> >> .jaxws
> >> .wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:
> >> 61)
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf
> >> .tools
> >> .wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:177)
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf
> >> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:
> >> 138)
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf
> >> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:
> >> 286)
> >> 
> >> 	at
> >> 
> >> org
> >> .apache
> >> .cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
> >> 
> >> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
> >> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
> >> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
> >> 
> >> I can't believe that I have to change the standard HP WSDL Files to
> >> generate a cxf client. Is there a way to avoid this error and
> >> gerate a working cxf client?
> >> 
> >> Thanks in advance,
> >> Mirco
> >> <HPOM.zip>
> > 
> > ---------------------------------------------
> > Freeman Fang
> > 
> > FuseSource
> > Email:ffang@fusesource.com
> > Web: fusesource.com
> > Twitter: freemanfang
> > Blog: http://freemanfang.blogspot.com
> > http://blog.sina.com.cn/u/1473905042
> > weibo: http://weibo.com/u/1473905042
> 
> ---------------------------------------------
> Freeman Fang
> 
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
-- 
Daniel Kulp
dan@kulp.com
http://dankulp.com/blog

Re: wsdl2java Problem

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

And the second error here
Non unique body parts, operation [ Put ] and  operation [ Create ] in  
binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
}WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
}Incident
If you don't use -validate flag, you won't see it. However, this error  
means the on-wire soap payload of method invocation "Put" and "Create"  
would be exactly same,  then how the server side can determine which  
method should get invoked in this case?

Seems the wsdl you get here is quite old, it doesn't follow some good  
practice in the way that you should compose a wsdl.

Freeman
On 2012-4-11, at 下午4:05, Freeman Fang wrote:

> Hi,
>
> I did a quick check at the wsdl you append, it's an invalid wsdl  
> indeed per jaxws
> <wsdl:operation name="SubscriptionEndOp">
>      <wsdl:output message="wse:SubscriptionEnd"
>         wsa:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd 
> " />
>  </wsdl:operation>
>
> This operation has no input message, generally this kind of  
> operation is considered as notification, but it's not supported by  
> jaxws. And generally you can use callback to send a notification  
> from server to client as a solution(we have a callback example  
> shipped with kit which you may wanna take a look), but this kind of  
> wsdl isn't supported in jaxws, jaxws requires input message anyway.
>
> Freeman
>
>
> On 2012-4-10, at 下午5:23, Mirco Dunker wrote:
>
>> Hi folks,
>>
>> I want to generate a CXF Client for the HP Operation Manager  
>> System. The Operation Manager provides me 9 WSDL Files and 16 XSD  
>> Files (see appendix). And there are generated axis2 client sources.  
>> But I want to use CXF instead ot axis. So I tried to generate my  
>> own cxf client.
>>
>> Now I got an error using the wsdl2java generator:
>>
>> Loading FrontEnd jaxws ...
>> Loading DataBinding jaxb ...
>> wsdl2java -client -d C:\Data\Workspace 
>> \Eclipse_Indigo_x86\HpOmuWsClient\.cxftmp/src -classdir C:\Data 
>> \Workspace\Eclipse_Indigo_x86\HpOmuWsClient\target\classes -p http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident=com.hp.schemas.ism.serviceoperation.incidentmanagement.1.incident 
>>  -impl -validate -exsh false -dns true -dex true -wsdlLocation  
>> http:/xxx/opr-webservice/Incident.svc?wsdl -verbose -defaultValues - 
>> fe jaxws -db jaxb -wv 1.1 file:/C:/Data/Workspace/ 
>> Eclipse_Indigo_x86/HpOmuWsClient/src/main/resources/wsdls/ 
>> IncidentService.wsdl
>> wsdl2java - Apache CXF 2.5.1
>>
>>
>> WSDLToJava Error:
>> Summary:  Failures: 1, Warnings: 0
>>
>> <<< ERROR!
>> Invalid WSDL, Operation SubscriptionEndOp in PortType {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
>> }IncidentAccess not request-response or one-way
>>
>> Non unique body parts, operation [ Put ] and  operation [ Create ]  
>> in binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
>> }WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
>> }Incident
>>
>>
>>
>> org.apache.cxf.tools.common.ToolException:
>> Summary:  Failures: 1, Warnings: 0
>>
>> <<< ERROR!
>> Invalid WSDL, Operation SubscriptionEndOp in PortType {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
>> }IncidentAccess not request-response or one-way
>>
>> Non unique body parts, operation [ Put ] and  operation [ Create ]  
>> in binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
>> }WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
>> }Incident
>>
>>
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .tools 
>> .validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:137)
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .tools 
>> .wsdlto 
>> .frontend 
>> .jaxws 
>> .wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java: 
>> 201)
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .tools 
>> .wsdlto 
>> .frontend 
>> .jaxws 
>> .wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java: 
>> 61)
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .tools 
>> .wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:177)
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
>> 138)
>> 	at  
>> org 
>> .apache 
>> .cxf 
>> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
>> 286)
>> 	at  
>> org 
>> .apache 
>> .cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
>> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
>> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
>> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
>>
>> I can't believe that I have to change the standard HP WSDL Files to  
>> generate a cxf client. Is there a way to avoid this error and  
>> gerate a working cxf client?
>>
>> Thanks in advance,
>> Mirco
>> <HPOM.zip>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
>
>
>
>
>
>
>
>
>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042











Re: wsdl2java Problem

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

I did a quick check at the wsdl you append, it's an invalid wsdl  
indeed per jaxws
<wsdl:operation name="SubscriptionEndOp">
      <wsdl:output message="wse:SubscriptionEnd"
         wsa:Action="http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd 
" />
  </wsdl:operation>

This operation has no input message, generally this kind of operation  
is considered as notification, but it's not supported by jaxws. And  
generally you can use callback to send a notification from server to  
client as a solution(we have a callback example shipped with kit which  
you may wanna take a look), but this kind of wsdl isn't supported in  
jaxws, jaxws requires input message anyway.

Freeman


On 2012-4-10, at 下午5:23, Mirco Dunker wrote:

> Hi folks,
>
> I want to generate a CXF Client for the HP Operation Manager System.  
> The Operation Manager provides me 9 WSDL Files and 16 XSD Files (see  
> appendix). And there are generated axis2 client sources. But I want  
> to use CXF instead ot axis. So I tried to generate my own cxf client.
>
> Now I got an error using the wsdl2java generator:
>
> Loading FrontEnd jaxws ...
> Loading DataBinding jaxb ...
> wsdl2java -client -d C:\Data\Workspace 
> \Eclipse_Indigo_x86\HpOmuWsClient\.cxftmp/src -classdir C:\Data 
> \Workspace\Eclipse_Indigo_x86\HpOmuWsClient\target\classes -p http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident=com.hp.schemas.ism.serviceoperation.incidentmanagement.1.incident 
>  -impl -validate -exsh false -dns true -dex true -wsdlLocation http:/ 
> xxx/opr-webservice/Incident.svc?wsdl -verbose -defaultValues -fe  
> jaxws -db jaxb -wv 1.1 file:/C:/Data/Workspace/Eclipse_Indigo_x86/ 
> HpOmuWsClient/src/main/resources/wsdls/IncidentService.wsdl
> wsdl2java - Apache CXF 2.5.1
>
>
> WSDLToJava Error:
> Summary:  Failures: 1, Warnings: 0
>
> <<< ERROR!
> Invalid WSDL, Operation SubscriptionEndOp in PortType {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
> }IncidentAccess not request-response or one-way
>
> Non unique body parts, operation [ Put ] and  operation [ Create ]  
> in binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
> }WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
> }Incident
>
>
>
> org.apache.cxf.tools.common.ToolException:
> Summary:  Failures: 1, Warnings: 0
>
> <<< ERROR!
> Invalid WSDL, Operation SubscriptionEndOp in PortType {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
> }IncidentAccess not request-response or one-way
>
> Non unique body parts, operation [ Put ] and  operation [ Create ]  
> in binding {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
> }WsManIncidentBinding have the same body block: {http://schemas.hp.com/ism/ServiceOperation/IncidentManagement/1/Incident 
> }Incident
>
>
> 	at  
> org 
> .apache 
> .cxf 
> .tools 
> .validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:137)
> 	at  
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java: 
> 201)
> 	at  
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java: 
> 61)
> 	at  
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:177)
> 	at  
> org 
> .apache 
> .cxf 
> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
> 138)
> 	at  
> org 
> .apache 
> .cxf 
> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
> 286)
> 	at  
> org 
> .apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java: 
> 103)
> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
> 	at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
>
> I can't believe that I have to change the standard HP WSDL Files to  
> generate a cxf client. Is there a way to avoid this error and gerate  
> a working cxf client?
>
> Thanks in advance,
> Mirco
> <HPOM.zip>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042