You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2010/05/03 19:50:04 UTC

Re: Is is possible to have an operation with no input message ?

On Thursday 29 April 2010 5:39:02 am dmichel wrote:
> If I set a operation without an input message like so
> 
> 
>        <wsdl:operation name="GetImageCount">
>            <wsdl:output message="tns:GetImageCountOutput"/>
>         </wsdl:operation>
> 
> 
> I get this error message
> 
> <<< ERROR!
> Invalid WSDL, Operation GetImageCount in PortType
> {http://theSoftwareArchive.com}SoftwareArchivePortType not request-response
> or one-way
> 
> so, I assume, this is just not possible.

From  a strictly "is it legal wsdl", the answer is yes, it's legal.   However, 
there isn't really any definition on how it works in practice (and really 
wouldn't work at all for HTTP) so no-one supports it.


> 
> So, I tried "making up" and empty element and use that as a message
> 
>     <xs:element name="emptyElement">
>         <xs:complexType />
>     </xs:element>

Try changing to:

 <xs:element name="emptyElement">
         <xs:complexType >
              <xs:sequence/>
         </xs:complextType>
     </xs:element>

 
Dan


>     <wsdl:message name="empty">
>         <wsdl:part name="parameters" element="tns:emptyElement"/>
>     </wsdl:message>
> 
> wsdl2java generate the code fine with no warning/error message but then, as
> I run the client code, I get this:
> 
>      [java] Invoking getImageCount...
>      [java] Exception in thread "main"
> javax.xml.ws.soap.SOAPFaultException: wrong number of arguments while
> invoking public java.math.BigInteger
> com.thesoftwarearchive.SoftwareArchivePortTypeImpl.getImageCount(com.theso
> ftwarearchive.EmptyElement) with params null.
>      [java] 	at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
>      [java] 	at $Proxy37.getImageCount(Unknown Source)
>      [java] 	at
> com.thesoftwarearchive.SoftwareArchivePortType_SoftwareArchivePort_Client.m
> ain(SoftwareArchivePortType_SoftwareArchivePort_Client.java:71) [java]
> Caused by: org.apache.cxf.binding.soap.SoapFault: wrong number of
> arguments while invoking public java.math.BigInteger
> com.thesoftwarearchive.SoftwareArchivePortTypeImpl.getImageCount(com.thesof
> twarearchive.EmptyElement) with params null.
>      [java] 	at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalF
> ault(Soap11FaultInInterceptor.java:75)
> 
> 
> 
> Any idea what's wrong ? Is there a better way to deal with an operation
> with no input message ?
> 
> David

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Is is possible to have an operation with no input message ?

Posted by André Costa Lima <an...@gmail.com>.
Hi Alexey,

Yes. For instance, if you work on bare mode, wsdl2java can generate an
empty class. In case of wrapped mode, a method with no input arguments is
generated.

André Costa Lima
Em 22/01/2015 09:16, "Alexey Markevich" <am...@talend.com> escreveu:

> Hello,
>
> Its possible to have an operation with empty input message:
>
> <wsdl:message name="getRequest">
> </wsdl:message>
> <wsdl:message name="getResponse">
>     <wsdl:part element="tns:getResponse" name="parameters" />
> </wsdl:message>
>
> <wsdl:operation name="updateCustomer">
>     <wsdl:input message="tns:getRequest" name="getRequest" />
>     <wsdl:output message="tns:getResponse" name="getResponse" />
> ...
>
> On Thu, 22 Jan 2015 12:02:04 +0300, Andrei Shakirin <as...@talend.com>
> wrote:
>
>  Hi,
>>
>> Using Solicit-Response(Output-Input) and Notification (Output-Only)
>> operations are prohibited by WS-I Basic Profile 1.2 and not currently
>> supported by CXF:
>>
>> "4.5.2 Allowed Operations
>> Solicit-Response and Notification operations are not well defined by WSDL
>> 1.1; furthermore, WSDL 1.1 does not define bindings for them.
>> R2303 A DESCRIPTION MUST NOT use Solicit-Response and Notification type
>> operations in a wsdl:portType definition."
>>
>> However you can easily simulate Notification (Output-Only) operation by
>> placing CXF client to the service side and CXF service to the client side.
>>
>> Regards,
>> Andrei.
>>
>>  -----Original Message-----
>>> From: AlexA [mailto:alex.afros@ricoh.ca]
>>> Sent: Dienstag, 20. Januar 2015 23:06
>>> To: users@cxf.apache.org
>>> Subject: Re: Is is possible to have an operation with no input message ?
>>>
>>>  it's supported by axis2 for example I create java from wsdl using
>>> axis2-1.6.2,
>>> but exactly the same wsdl gives me the error if I use cxf:
>>> Microsoft Windows [Version 6.1.7601]
>>> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>>>
>>> >C:\apache-cxf-2.7.14\bin\wsdl2java wsdprin
>>> terservice.wsdl
>>>
>>> WSDLToJava Error:
>>>  Summary:  Failures: 6, Warnings: 0
>>>
>>>  <<< ERROR!
>>> Invalid WSDL, Operation PrinterStatusConditionEvent in PortType
>>> {http://schemas.
>>> microsoft.com/windows/2006/08/wdp/print}PrinterServiceType
>>> <http://microsoft.com/windows/2006/08/wdp/print%7DPrinterServiceType>
>>> not request-
>>> response or one-way Invalid WSDL, Operation JobEndStateEvent in PortType
>>> {http://schemas.microsoft.c
>>> om/windows/2006/08/wdp/print}PrinterServiceType not request-response or
>>> one-way Invalid WSDL, Operation PrinterStatusConditionClearedEvent in
>>> PortType {http://s
>>> chemas.microsoft.com/windows/2006/08/wdp/print}PrinterServiceType
>>> <http://chemas.microsoft.com/windows/2006/08/wdp/print%7DPrinterServiceType>
>>> not
>>> request-re sponse or one-way Invalid WSDL, Operation
>>> PrinterElementsChangeEvent in PortType {http://schemas.m
>>> icrosoft.com/windows/2006/08/wdp/print}PrinterServiceType
>>> <http://icrosoft.com/windows/2006/08/wdp/print%7DPrinterServiceType>
>>> not request-
>>> response o r one-way Invalid WSDL, Operation PrinterStatusSummaryEvent in
>>> PortType {http://schemas.mi
>>> crosoft.com/windows/2006/08/wdp/print}PrinterServiceType
>>> <http://crosoft.com/windows/2006/08/wdp/print%7DPrinterServiceType> not
>>> request-
>>> response or  one-way Invalid WSDL, Operation JobStatusEvent in PortType
>>> {http://schemas.microsoft.com
>>> /windows/2006/08/wdp/print}PrinterServiceType not request-response or
>>> one-
>>> way
>>>
>>>
>>>
>>>
>>> C:\Users\afrosa\Desktop\work\buildXML>
>>>
>>> the example of such wsdl I can get from microsoft:
>>> https://msdn.microsoft.com/en-
>>> us/library/windows/hardware/dn641604(v=vs.85).aspx
>>>
>>> just download the "Print Service Definition v1.2 for Web Services on
>>> Devices"
>>> (or v1.0) and try to run java2wsdl.
>>> here's the parts which throw exception
>>>      <operation name="PrinterStatusConditionEvent">
>>>             <output message="wprt:PrinterStatusConditionEventMsg"
>>>
>>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/
>>> wdp/print/Printe
>>> rStatusConditionEvent"
>>> />
>>>         </operation>
>>>         <operation name="PrinterStatusConditionClearedEvent">
>>>             <output message="wprt:PrinterStatusConditionClearedEventMsg"
>>>
>>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/
>>> wdp/print/Printe
>>> rStatusConditionClearedEvent"
>>> />
>>>         </operation>
>>>         <operation name="JobStatusEvent">
>>>             <output message="wprt:JobStatusEventMsg"
>>>
>>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/
>>> wdp/print/JobSta
>>> tusEvent"
>>> />
>>>         </operation>
>>>         <operation name="JobEndStateEvent">
>>>             <output message="wprt:JobEndStateEventMsg"
>>>
>>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobEn
>>> dStateEvent"
>>> />
>>>         </operation>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://cxf.547215.n5.nabble.
>>> com/Is-is-possible-
>>> to-have-an-operation-with-no-input-message-tp564160p5753333.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>
> --
> Regards, Alexey.
>

Re: Is is possible to have an operation with no input message ?

Posted by Alexey Markevich <am...@talend.com>.
Hello,

Its possible to have an operation with empty input message:

<wsdl:message name="getRequest">
</wsdl:message>
<wsdl:message name="getResponse">
     <wsdl:part element="tns:getResponse" name="parameters" />
</wsdl:message>

<wsdl:operation name="updateCustomer">
     <wsdl:input message="tns:getRequest" name="getRequest" />
     <wsdl:output message="tns:getResponse" name="getResponse" />
...

On Thu, 22 Jan 2015 12:02:04 +0300, Andrei Shakirin <as...@talend.com>  
wrote:

> Hi,
>
> Using Solicit-Response(Output-Input) and Notification (Output-Only)  
> operations are prohibited by WS-I Basic Profile 1.2 and not currently  
> supported by CXF:
>
> "4.5.2 Allowed Operations
> Solicit-Response and Notification operations are not well defined by  
> WSDL 1.1; furthermore, WSDL 1.1 does not define bindings for them.
> R2303 A DESCRIPTION MUST NOT use Solicit-Response and Notification type  
> operations in a wsdl:portType definition."
>
> However you can easily simulate Notification (Output-Only) operation by  
> placing CXF client to the service side and CXF service to the client  
> side.
>
> Regards,
> Andrei.
>
>> -----Original Message-----
>> From: AlexA [mailto:alex.afros@ricoh.ca]
>> Sent: Dienstag, 20. Januar 2015 23:06
>> To: users@cxf.apache.org
>> Subject: Re: Is is possible to have an operation with no input message ?
>>
>>  it's supported by axis2 for example I create java from wsdl using  
>> axis2-1.6.2,
>> but exactly the same wsdl gives me the error if I use cxf:
>> Microsoft Windows [Version 6.1.7601]
>> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>>
>> >C:\apache-cxf-2.7.14\bin\wsdl2java wsdprin
>> terservice.wsdl
>>
>> WSDLToJava Error:
>>  Summary:  Failures: 6, Warnings: 0
>>
>>  <<< ERROR!
>> Invalid WSDL, Operation PrinterStatusConditionEvent in PortType
>> {http://schemas.
>> microsoft.com/windows/2006/08/wdp/print}PrinterServiceType not request-
>> response or one-way Invalid WSDL, Operation JobEndStateEvent in PortType
>> {http://schemas.microsoft.c
>> om/windows/2006/08/wdp/print}PrinterServiceType not request-response or
>> one-way Invalid WSDL, Operation PrinterStatusConditionClearedEvent in
>> PortType {http://s
>> chemas.microsoft.com/windows/2006/08/wdp/print}PrinterServiceType not
>> request-re sponse or one-way Invalid WSDL, Operation
>> PrinterElementsChangeEvent in PortType {http://schemas.m
>> icrosoft.com/windows/2006/08/wdp/print}PrinterServiceType not request-
>> response o r one-way Invalid WSDL, Operation PrinterStatusSummaryEvent  
>> in
>> PortType {http://schemas.mi
>> crosoft.com/windows/2006/08/wdp/print}PrinterServiceType not request-
>> response or  one-way Invalid WSDL, Operation JobStatusEvent in PortType
>> {http://schemas.microsoft.com
>> /windows/2006/08/wdp/print}PrinterServiceType not request-response or  
>> one-
>> way
>>
>>
>>
>>
>> C:\Users\afrosa\Desktop\work\buildXML>
>>
>> the example of such wsdl I can get from microsoft:
>> https://msdn.microsoft.com/en-
>> us/library/windows/hardware/dn641604(v=vs.85).aspx
>>
>> just download the "Print Service Definition v1.2 for Web Services on  
>> Devices"
>> (or v1.0) and try to run java2wsdl.
>> here's the parts which throw exception
>>      <operation name="PrinterStatusConditionEvent">
>>             <output message="wprt:PrinterStatusConditionEventMsg"
>>
>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/Printe
>> rStatusConditionEvent"
>> />
>>         </operation>
>>         <operation name="PrinterStatusConditionClearedEvent">
>>             <output message="wprt:PrinterStatusConditionClearedEventMsg"
>>
>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/Printe
>> rStatusConditionClearedEvent"
>> />
>>         </operation>
>>         <operation name="JobStatusEvent">
>>             <output message="wprt:JobStatusEventMsg"
>>
>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobSta
>> tusEvent"
>> />
>>         </operation>
>>         <operation name="JobEndStateEvent">
>>             <output message="wprt:JobEndStateEventMsg"
>>
>> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobEn
>> dStateEvent"
>> />
>>         </operation>
>>
>>
>>
>> --
>> View this message in context:  
>> http://cxf.547215.n5.nabble.com/Is-is-possible-
>> to-have-an-operation-with-no-input-message-tp564160p5753333.html
>> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Regards, Alexey.

RE: Is is possible to have an operation with no input message ?

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

Using Solicit-Response(Output-Input) and Notification (Output-Only) operations are prohibited by WS-I Basic Profile 1.2 and not currently supported by CXF:

"4.5.2 Allowed Operations
Solicit-Response and Notification operations are not well defined by WSDL 1.1; furthermore, WSDL 1.1 does not define bindings for them.
R2303 A DESCRIPTION MUST NOT use Solicit-Response and Notification type operations in a wsdl:portType definition."

However you can easily simulate Notification (Output-Only) operation by placing CXF client to the service side and CXF service to the client side.

Regards,
Andrei.

> -----Original Message-----
> From: AlexA [mailto:alex.afros@ricoh.ca]
> Sent: Dienstag, 20. Januar 2015 23:06
> To: users@cxf.apache.org
> Subject: Re: Is is possible to have an operation with no input message ?
> 
>  it's supported by axis2 for example I create java from wsdl using axis2-1.6.2,
> but exactly the same wsdl gives me the error if I use cxf:
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
> 
> >C:\apache-cxf-2.7.14\bin\wsdl2java wsdprin
> terservice.wsdl
> 
> WSDLToJava Error:
>  Summary:  Failures: 6, Warnings: 0
> 
>  <<< ERROR!
> Invalid WSDL, Operation PrinterStatusConditionEvent in PortType
> {http://schemas.
> microsoft.com/windows/2006/08/wdp/print}PrinterServiceType not request-
> response or one-way Invalid WSDL, Operation JobEndStateEvent in PortType
> {http://schemas.microsoft.c
> om/windows/2006/08/wdp/print}PrinterServiceType not request-response or
> one-way Invalid WSDL, Operation PrinterStatusConditionClearedEvent in
> PortType {http://s
> chemas.microsoft.com/windows/2006/08/wdp/print}PrinterServiceType not
> request-re sponse or one-way Invalid WSDL, Operation
> PrinterElementsChangeEvent in PortType {http://schemas.m
> icrosoft.com/windows/2006/08/wdp/print}PrinterServiceType not request-
> response o r one-way Invalid WSDL, Operation PrinterStatusSummaryEvent in
> PortType {http://schemas.mi
> crosoft.com/windows/2006/08/wdp/print}PrinterServiceType not request-
> response or  one-way Invalid WSDL, Operation JobStatusEvent in PortType
> {http://schemas.microsoft.com
> /windows/2006/08/wdp/print}PrinterServiceType not request-response or one-
> way
> 
> 
> 
> 
> C:\Users\afrosa\Desktop\work\buildXML>
> 
> the example of such wsdl I can get from microsoft:
> https://msdn.microsoft.com/en-
> us/library/windows/hardware/dn641604(v=vs.85).aspx
> 
> just download the "Print Service Definition v1.2 for Web Services on Devices"
> (or v1.0) and try to run java2wsdl.
> here's the parts which throw exception
>      <operation name="PrinterStatusConditionEvent">
>             <output message="wprt:PrinterStatusConditionEventMsg"
> 
> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/Printe
> rStatusConditionEvent"
> />
>         </operation>
>         <operation name="PrinterStatusConditionClearedEvent">
>             <output message="wprt:PrinterStatusConditionClearedEventMsg"
> 
> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/Printe
> rStatusConditionClearedEvent"
> />
>         </operation>
>         <operation name="JobStatusEvent">
>             <output message="wprt:JobStatusEventMsg"
> 
> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobSta
> tusEvent"
> />
>         </operation>
>         <operation name="JobEndStateEvent">
>             <output message="wprt:JobEndStateEventMsg"
> 
> wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobEn
> dStateEvent"
> />
>         </operation>
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Is-is-possible-
> to-have-an-operation-with-no-input-message-tp564160p5753333.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Is is possible to have an operation with no input message ?

Posted by AlexA <al...@ricoh.ca>.
 it's supported by axis2 for example I create java from wsdl using
axis2-1.6.2, but exactly the same wsdl gives me the error if I use cxf:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

>C:\apache-cxf-2.7.14\bin\wsdl2java wsdprin
terservice.wsdl

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

 <<< ERROR!
Invalid WSDL, Operation PrinterStatusConditionEvent in PortType
{http://schemas.
microsoft.com/windows/2006/08/wdp/print}PrinterServiceType not
request-response
or one-way
Invalid WSDL, Operation JobEndStateEvent in PortType
{http://schemas.microsoft.c
om/windows/2006/08/wdp/print}PrinterServiceType not request-response or
one-way
Invalid WSDL, Operation PrinterStatusConditionClearedEvent in PortType
{http://s
chemas.microsoft.com/windows/2006/08/wdp/print}PrinterServiceType not
request-re
sponse or one-way
Invalid WSDL, Operation PrinterElementsChangeEvent in PortType
{http://schemas.m
icrosoft.com/windows/2006/08/wdp/print}PrinterServiceType not
request-response o
r one-way
Invalid WSDL, Operation PrinterStatusSummaryEvent in PortType
{http://schemas.mi
crosoft.com/windows/2006/08/wdp/print}PrinterServiceType not
request-response or
 one-way
Invalid WSDL, Operation JobStatusEvent in PortType
{http://schemas.microsoft.com
/windows/2006/08/wdp/print}PrinterServiceType not request-response or
one-way




C:\Users\afrosa\Desktop\work\buildXML>

the example of such wsdl I can get from microsoft:
https://msdn.microsoft.com/en-us/library/windows/hardware/dn641604(v=vs.85).aspx

just download the "Print Service Definition v1.2 for Web Services on
Devices" (or v1.0) and try to run java2wsdl.
here's the parts which throw exception
     <operation name="PrinterStatusConditionEvent">
            <output message="wprt:PrinterStatusConditionEventMsg"
                  
wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/PrinterStatusConditionEvent"
/>
        </operation>
        <operation name="PrinterStatusConditionClearedEvent">
            <output message="wprt:PrinterStatusConditionClearedEventMsg"
                  
wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/PrinterStatusConditionClearedEvent"
/>
        </operation>
        <operation name="JobStatusEvent">
            <output message="wprt:JobStatusEventMsg"
                  
wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobStatusEvent"
/>
        </operation>
        <operation name="JobEndStateEvent">
            <output message="wprt:JobEndStateEventMsg"
                  
wsa:Action="http://schemas.microsoft.com/windows/2006/08/wdp/print/JobEndStateEvent"
/>
        </operation>



--
View this message in context: http://cxf.547215.n5.nabble.com/Is-is-possible-to-have-an-operation-with-no-input-message-tp564160p5753333.html
Sent from the cxf-user mailing list archive at Nabble.com.