[ 
https://issues.apache.org/jira/browse/AXIS2-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Waldner updated AXIS2-2748:
---------------------------------

    Attachment: WSTest_wsdl1.xml
                WSTest_wsdl0.xml
                WSTest_wsdl.xml

> wsdl2java problem generating Faults for WCF service
> ---------------------------------------------------
>
>                 Key: AXIS2-2748
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2748
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.2, 1.1.1
>         Environment: Windows XP Professional
>            Reporter: Scott Waldner
>         Attachments: WSTest_wsdl.xml, WSTest_wsdl0.xml, WSTest_wsdl1.xml, 
> WSTest_xsd0.xml, WSTest_xsd1.xml, WSTest_xsd2.xml
>
>
> I am attempting to create a client to communicate with a Web Service written 
> using WCF.  For the most part this is working well.  However, I am seeing a 
> problem with the way wsdl2java is generating Faults.  I have produced a 
> simple example where there are two operations on the web service that look 
> like this (this is the WCF interface):
>     public interface IWSTest
>     {
>         [OperationContract]
>         [FaultContract(typeof(CustomException))]
>         int MyMethod1();
>         [OperationContract]
>         [FaultContract(typeof(CustomException))]
>         int MyMethod2();
>     }
> Note that both methods throw the exception "CustomException".  After running 
> wsdl2java I end up with the following:
>   public  int MyMethod2(myproduct.mycompany.MyMethod2 myMethod233)
>                     throws java.rmi.RemoteException,
>                                  
> com.metafile.eippadminws.WSTest_MyMethod2_CustomExceptionFault_FaultMessageException;
>   public  int MyMethod1(myproduct.mycompany.MyMethod1 myMethod130)
>                     throws java.rmi.RemoteException,
>                                  
> com.metafile.eippadminws.WSTest_MyMethod2_CustomExceptionFault_FaultMessageException;
> In the generated client code, both methods throw the same exception 
> com.metafile.eippadminws.WSTest_MyMethod2_CustomExceptionFault_FaultMessageException
>  (good), but the exception name includes the name of the method "MyMethod2" 
> which I think it should not.  This causes compatibility problems in the 
> following scenario: Suppose a new operation is added to the WCF web service, 
> call it "MyMethod3" (I consider this type of change to be an upward 
> compatible change because no existing web service operations have been 
> changed).  Suppose MyMethod3 also throws CustomException.  In the code 
> generated by wsdl2java, the contract for MyMethod1 and MyMethod2 now changes. 
>  Instead of throwing 
> com.metafile.eippadminws.WSTest_MyMethod2_CustomExceptionFault_FaultMessageException
>  it now throws 
> com.metafile.eippadminws.WSTest_MyMethod3_CustomExceptionFault_FaultMessageException.
>   My application that was catching this exception now has compile errors.
> Some other background information:
> WCF doesn't generate one WSDL file - it generates many WSDL files and schema 
> files.  I also can't figure out how to export these wsdl files from WCF.  
> However, I can open the WSDL in a browser and save the WSDL.  I will attach 
> these.  The following output from wsdl2java shows you the WSDL files that are 
> being read and also shows an message about the Fault not be able to be 
> overwritten:
> ----- Start of output -----
> Using AXIS2_HOME:   C:\downloads\ApacheAxis2\1.2\unzipped\axis2-1.2
> Using JAVA_HOME:    C:\Program Files\Java\jre1.5.0_09
> Retrieving document at 'http://scd9600:6000/WSTest?wsdl=wsdl1', relative to 
> 'http://scd9600:6000/WSTest?wsdl'.
> Retrieving document at 'http://scd9600:6000/WSTest?wsdl=wsdl0', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl1'.
> Retrieving schema at 'http://scd9600:6000/WSTest?xsd=xsd2', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl0'.
> Retrieving schema at 'http://scd9600:6000/WSTest?xsd=xsd0', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl0'.
> Retrieving schema at 'http://scd9600:6000/WSTest?xsd=xsd1', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl0'.
> Retrieving document at 'http://scd9600:6000/WSTest?wsdl=wsdl1', relative to 
> 'http://scd9600:6000/WSTest?wsdl'.
> Retrieving document at 'http://scd9600:6000/WSTest?wsdl=wsdl0', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl1'.
> Retrieving schema at 'http://scd9600:6000/WSTest?xsd=xsd2', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl0'.
> Retrieving schema at 'http://scd9600:6000/WSTest?xsd=xsd0', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl0'.
> Retrieving schema at 'http://scd9600:6000/WSTest?xsd=xsd1', relative to 
> 'http://scd9600:6000/WSTest?wsdl=wsdl0'.
> May 31, 2007 3:23:27 PM org.apache.axis2.wsdl.codegen.writer.ClassWriter 
> createOutFile
> INFO: The 
> 1.2\src\com\metafile\eippadminws\WSTest_MyMethod2_CustomExceptionFault_FaultMessageException.java
>  file cannot
> be overwritten.
> ----- End of output -----

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to