You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Zarar Siddiqi <za...@gmail.com> on 2007/09/12 23:20:42 UTC

WSDL part name incorrect. How do you change it?

I'm seeing the following behavior.  I have an exception which is annotated
with:

@WebFault(name="WebServiceException")
@XmlType(name="WebServiceException", namespace="http://arsenalist.com")
public class MyWebServiceException extends Exception {...}

but the WSDL that is generated is:

wsdl:message name="MyWebServiceException">
<wsdl:part name="fault" type="ns1:WebServiceException"></wsdl:part>
</wsdl:message>

IMHO, the name of the part should be "WebServiceException" and not "fault". 
Is my thinking correct? If not, how do you change the WSDL part name?  Are
there any Aegis annotations that can be used at the class level to change
this?

Thanks,
Zarar
-- 
View this message in context: http://www.nabble.com/WSDL-part-name-incorrect.-How-do-you-change-it--tf4432101.html#a12644398
Sent from the cxf-user mailing list archive at Nabble.com.


Re: WSDL part name incorrect. How do you change it?

Posted by Zarar Siddiqi <za...@gmail.com>.
Well, in that case applying the patch over here shouldn't be an issue:

https://issues.apache.org/jira/browse/CXF-1002

Thoughts?

Zarar


dkulp wrote:
> 
> 
> Well, another issue is that according to the WSDL spec, the fault part 
> should be an element, not a type.   The "name" should then be 
> irrelevant.
> 
> Dan
> 
> 
> On Wednesday 12 September 2007, Zarar Siddiqi wrote:
>> I'm seeing the following behavior.  I have an exception which is
>> annotated with:
>>
>> @WebFault(name="WebServiceException")
>> @XmlType(name="WebServiceException",
>> namespace="http://arsenalist.com") public class MyWebServiceException
>> extends Exception {...}
>>
>> but the WSDL that is generated is:
>>
>> wsdl:message name="MyWebServiceException">
>> <wsdl:part name="fault" type="ns1:WebServiceException"></wsdl:part>
>> </wsdl:message>
>>
>> IMHO, the name of the part should be "WebServiceException" and not
>> "fault". Is my thinking correct? If not, how do you change the WSDL
>> part name?  Are there any Aegis annotations that can be used at the
>> class level to change this?
>>
>> Thanks,
>> Zarar
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/WSDL-part-name-incorrect.-How-do-you-change-it--tf4432101.html#a12676578
Sent from the cxf-user mailing list archive at Nabble.com.


Re: WSDL part name incorrect. How do you change it?

Posted by Daniel Kulp <dk...@apache.org>.
Well, another issue is that according to the WSDL spec, the fault part 
should be an element, not a type.   The "name" should then be 
irrelevant.

Dan


On Wednesday 12 September 2007, Zarar Siddiqi wrote:
> I'm seeing the following behavior.  I have an exception which is
> annotated with:
>
> @WebFault(name="WebServiceException")
> @XmlType(name="WebServiceException",
> namespace="http://arsenalist.com") public class MyWebServiceException
> extends Exception {...}
>
> but the WSDL that is generated is:
>
> wsdl:message name="MyWebServiceException">
> <wsdl:part name="fault" type="ns1:WebServiceException"></wsdl:part>
> </wsdl:message>
>
> IMHO, the name of the part should be "WebServiceException" and not
> "fault". Is my thinking correct? If not, how do you change the WSDL
> part name?  Are there any Aegis annotations that can be used at the
> class level to change this?
>
> Thanks,
> Zarar



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: WSDL part name incorrect. How do you change it?

Posted by Zarar Siddiqi <za...@gmail.com>.
I've created a JIRA and also supplied a patch which fixes this.  This is also
now backwards compatible with XFire.

https://issues.apache.org/jira/browse/CXF-1002

Thanks,
Zarar



Zarar Siddiqi wrote:
> 
> This has to be a problem because although the WSDL snippet is this:
> 
> <wsdl:message name="PersonWebServiceException">
> <wsdl:part name="fault" type="ns1:WebServiceException">
>     </wsdl:part>
> </wsdl:message>
> 
> during a fault the SOAP returned is this:
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>...</faultstring>
>          <detail>
>             <WebServiceException xmlns="http://arsenalist.com">
>                <code>5001</code>
>             </WebServiceException>
>          </detail>
>       </soap:Fault>
>    </soap:Body></soap:Envelope>
> 
> Now IMHO this is wrong because using any client the exception's QName is
> {http://arsenalist.com}fault but the actual QName that's needed to
> serialize it is {http://arsenalist.com}WebServiceException.  If I change
> the generated client code (try any client: XFire, CXF, Axis2 etc.) to have
> WebServiceException as the local part instead of fault, it works.
> 
> Any ideas?
> 
> 
> 
> 
> Zarar Siddiqi wrote:
>> 
>> I'm seeing the following behavior.  I have an exception which is
>> annotated with:
>> 
>> @WebFault(name="WebServiceException")
>> @XmlType(name="WebServiceException", namespace="http://arsenalist.com")
>> public class MyWebServiceException extends Exception {...}
>> 
>> but the WSDL that is generated is:
>> 
>> <wsdl:message name="MyWebServiceException">
>> <wsdl:part name="fault" type="ns1:WebServiceException"></wsdl:part>
>> </wsdl:message>
>> 
>> IMHO, the name of the part should be "WebServiceException" and not
>> "fault".  Is my thinking correct? If not, how do you change the WSDL part
>> name?  Are there any Aegis annotations that can be used at the class
>> level to change this?
>> 
>> Thanks,
>> Zarar
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WSDL-part-name-incorrect.-How-do-you-change-it--tf4432101.html#a12662501
Sent from the cxf-user mailing list archive at Nabble.com.


Re: WSDL part name incorrect. How do you change it?

Posted by Zarar Siddiqi <za...@gmail.com>.
This has to be a problem because although the WSDL snippet is this:

<wsdl:message name="PersonWebServiceException">
<wsdl:part name="fault" type="ns1:WebServiceException">
    </wsdl:part>
</wsdl:message>

during a fault the SOAP returned is this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>...</faultstring>
         <detail>
            <WebServiceException xmlns="http://arsenalist.com">
               <code>5001</code>
            </WebServiceException>
         </detail>
      </soap:Fault>
   </soap:Body></soap:Envelope>

Now IMHO this is wrong because using any client the exception's QName is
{http://arsenalist.com}fault but the actual QName that's needed to serialize
it is {http://arsenalist.com}WebServiceException.  If I change the generated
client code (try any client: XFire, CXF, Axis2 etc.) to have
WebServiceException as the local part instead of fault, it works.

Any ideas?




Zarar Siddiqi wrote:
> 
> I'm seeing the following behavior.  I have an exception which is annotated
> with:
> 
> @WebFault(name="WebServiceException")
> @XmlType(name="WebServiceException", namespace="http://arsenalist.com")
> public class MyWebServiceException extends Exception {...}
> 
> but the WSDL that is generated is:
> 
> <wsdl:message name="MyWebServiceException">
> <wsdl:part name="fault" type="ns1:WebServiceException"></wsdl:part>
> </wsdl:message>
> 
> IMHO, the name of the part should be "WebServiceException" and not
> "fault".  Is my thinking correct? If not, how do you change the WSDL part
> name?  Are there any Aegis annotations that can be used at the class level
> to change this?
> 
> Thanks,
> Zarar
> 

-- 
View this message in context: http://www.nabble.com/WSDL-part-name-incorrect.-How-do-you-change-it--tf4432101.html#a12655879
Sent from the cxf-user mailing list archive at Nabble.com.