[ 
https://issues.apache.org/jira/browse/CXF-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13545589#comment-13545589
 ] 

Freeman Fang commented on CXF-4676:
-----------------------------------

Hi,

Please ensure you grasp the latest code(svn update) on trunk, that's what I get 
with your patch

{code}
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.cxf.sdo.HelloWorldDynamicTest
Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 1.395 sec <<< 
FAILURE!
testBasicInvoke(org.apache.cxf.sdo.HelloWorldDynamicTest)  Time elapsed: 1.25 
sec  <<< FAILURE!
junit.framework.AssertionFailedError: Failed to select any nodes for expression:
/s:Envelope/s:Body/ns1:greetMeResponse from document:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>argument type mismatch while invoking public java.lang.String 
org.apache.cxf.sdo.HelloWorldDynamicTest$Server.greetMe(java.lang.String) with 
params [[org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@1bd7b222 (mixed: 
[xml.type:text=World], anyAttribute: null)]].</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>

        at org.apache.cxf.test.XPathAssert.assertValid(XPathAssert.java:65)
        at org.apache.cxf.test.TestUtilities.assertValid(TestUtilities.java:146)
        at 
org.apache.cxf.test.AbstractCXFTest.assertValid(AbstractCXFTest.java:111)
        at 
org.apache.cxf.sdo.AbstractHelloWorldTest.testBasicInvoke(AbstractHelloWorldTest.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at 
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
testWSDL(org.apache.cxf.sdo.HelloWorldDynamicTest)  Time elapsed: 0.047 sec  
<<< FAILURE!
java.lang.AssertionError: Did not find schemas
        at org.junit.Assert.fail(Assert.java:88)
        at 
org.apache.cxf.sdo.AbstractHelloWorldTest.testWSDL(AbstractHelloWorldTest.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at 
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
testStructure(org.apache.cxf.sdo.HelloWorldDynamicTest)  Time elapsed: 0.033 
sec  <<< FAILURE!
junit.framework.AssertionFailedError: Failed to select any nodes for expression:
/s:Envelope/s:Body/ns1:echoStructResponse from document:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>argument type mismatch while invoking public 
commonj.sdo.DataObject 
org.apache.cxf.sdo.HelloWorldDynamicTest$Server.echoStruct(commonj.sdo.DataObject)
 with params [[org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@71257687 
(mixed: [xml.type:text=
                , 
types:text=org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@5288d319 (mixed: 
[xml.type:text=Hello], anyAttribute: null), xml.type:text=
                , 
types:int=org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@14db38a4 (mixed: 
[xml.type:text=24], anyAttribute: null), xml.type:text=
                , 
types:dbl=org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@4463a1ae (mixed: 
[xml.type:text=3.14159], anyAttribute: null), xml.type:text=
                , 
types:texts=org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@690bc995 (mixed: 
[xml.type:text=Hello], anyAttribute: null), xml.type:text=
                , 
types:texts=org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl@4df8b14 (mixed: 
[xml.type:text=World], anyAttribute: null), xml.type:text=
        ], anyAttribute: null)]].</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>

        at org.apache.cxf.test.XPathAssert.assertValid(XPathAssert.java:65)
        at org.apache.cxf.test.TestUtilities.assertValid(TestUtilities.java:146)
        at 
org.apache.cxf.test.AbstractCXFTest.assertValid(AbstractCXFTest.java:111)
        at 
org.apache.cxf.sdo.AbstractHelloWorldTest.testStructure(AbstractHelloWorldTest.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at 
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Running org.apache.cxf.sdo.HelloWorldStaticTest
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.146 sec <<< 
FAILURE!
testWSDL(org.apache.cxf.sdo.HelloWorldStaticTest)  Time elapsed: 0.036 sec  <<< 
FAILURE!
java.lang.AssertionError: Did not find schemas
        at org.junit.Assert.fail(Assert.java:88)
        at 
org.apache.cxf.sdo.AbstractHelloWorldTest.testWSDL(AbstractHelloWorldTest.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at 
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:113)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Results :

Failed tests:   testBasicInvoke(org.apache.cxf.sdo.HelloWorldDynamicTest): 
Failed to select any nodes for expression:(..)
  testWSDL(org.apache.cxf.sdo.HelloWorldDynamicTest): Did not find schemas
  testStructure(org.apache.cxf.sdo.HelloWorldDynamicTest): Failed to select any 
nodes for expression:(..)
  testWSDL(org.apache.cxf.sdo.HelloWorldStaticTest): Did not find schemas

Tests run: 6, Failures: 4, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] -----------------------------------------------------------------------
{code}

It works without your patch

Freeman



                
> Partial WSDL support in CXF 
> ----------------------------
>
>                 Key: CXF-4676
>                 URL: https://issues.apache.org/jira/browse/CXF-4676
>             Project: CXF
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 2.6.2
>            Reporter: iris ding
>            Assignee: Freeman Fang
>         Attachments: cxf-4676.patch
>
>
> I have one SEI defined as below:
> @WebService(wsdlLocation="WEB-INF/wsdl/AddNumbersImplPartial1Service.wsdl")
> public class AddNumbersImplPartial1 {
>        
>         public int addTwoNumbers(int number1, int number2) throws 
> AddNegativeNumbersException {
>                 if (number1 < 0 || number2 < 0) {
>                         throw new AddNegativeNumbersException("Negative 
> number submitted !! ", "Numbers: " +
>                                                               number1 + ", " 
> + number2);
>                 }
>                 return number1 + number2;
>         }
> }
> The WEB-INF/wsdl/AddNumbersImplPartial1Service.wsdl is not complete, it only 
> contains to the porttype part:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <definitions
> targetNamespace="http://serverpartial1.partialwsdl.annotations/"; 
> name="AddNumbersImplPartial1Service"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns:tns="http://serverpartial1.partialwsdl.annotations/";
> xmlns="http://schemas.xmlsoap.org/wsdl/";>
>   <types>
>     <xsd:schema>
>       <xsd:import namespace="http://serverpartial1.partialwsdl.annotations/"; 
> schemaLocation="AddNumbersImplPartial1Service_schema1.xsd"/>
>     </xsd:schema>
>   </types>
>   <message name="addTwoNumbers">
>     <part name="parameters" element="tns:addTwoNumbers"/>
>   </message>
>   <message name="addTwoNumbersResponse">
>     <part name="parameters" element="tns:addTwoNumbersResponse"/>
>   </message>
>   <message name="AddNegativeNumbersException">
>     <part name="fault" element="tns:AddNegativeNumbersException"/>
>   </message>
>   <portType name="AddNumbersImplPartial1">
>     <operation name="addTwoNumbers">
>       <input message="tns:addTwoNumbers"/>
>       <output message="tns:addTwoNumbersResponse"/>
>       <fault name="AddNegativeNumbersException" 
> message="tns:AddNegativeNumbersException"/>
>     </operation>
>   </portType>
>  
> </definitions>
> Now if I put the war file into tomcat and let it use CXF, the service can not 
> be deployed successfully. In CXF, when it calls WSDLServiceFactory.create, it 
> will simply get the service name from wsdl file and in our case, since it is 
> empty, it will throw exception and service deployment failed. you can 
> reference below part:
> javax.wsdl.Service wsdlService = definition.getService(serviceName);
>             if (wsdlService == null) {
>                 throw new ServiceConstructionException(new 
> Message("NO_SUCH_SERVICE_EXC", LOG, serviceName));
>             }
> But per jaxws 2.2 spec, in chapter 5.2.5.5:
> 5.2.5.5 Application-specified PortType
> No metadata document contains a definition for the sought-after service S, 
> but a metadata document, say
> D, contains a definition for the WSDL portType whose qualified name, say P, 
> matches that specified by the
> endpoint being published. In this case, a JAX-WS implementation MUST create a 
> new description for S,
> including an appropriate WSDL binding element referencing portType P. The 
> metadata document D MUST
> be imported/included so that the published contract uses the definition of P 
> provided by D. No schema generation
> occurs,as P is assumed to embed or import schema definitions for all the 
> types/elements it requires.
> Like in the previous case, the implementation MUST override any location and 
> schemaLocation attributes.
> It is an error if more than one metadata document contains a definition for 
> the sought-after portType
> P.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to