On Tue October 27 2009 1:17:40 pm Suneet Shah wrote:
> Hi Dan:
> ASM is on the classpth.. Does this have an impact?
It can for cases where the SEI and stuff was not generated from wsdl. If asm
isn't there, that can be a problem. If ASM is there, then you should be all
set.
> Dumb question - how do I use the wsdl at runtime?
> Do you mean that I should use the wsdl in my service definition? ie.
> jaxws:endpoint id="userDataService"
> implementor="#userManager"
> wsdlLocation="WEB-INF/wsdl/UserDataService.wsdl"
> address="/UserDataService"/>
Yes, no the server side.
On the client side,
factory.setWsdlLocation(....)
type thing to make sure the client is created with the appropriate wsdl.
Dan
>
>
> thanks
> Suneet
>
> Daniel Kulp wrote:
> > Couple thoughts:
> >
> > 1) Is ASM on the classpath?
> >
> > 2) What does the soap message look like if validation is turned off?
> > Does it actually match the schema?
> >
> > 3) I notice you aren't using the WSDL at runtime. Thus, it ends up
> > using a "generated" schema and not the "real" schema from the wsdl. You
> > might want to actually point it at the correct wsdl.
> >
> > Dan
> >
> > On Tue October 27 2009 1:18:27 am Suneet Shah wrote:
> >> Hello:
> >>
> >> I get the exception below when I call the add() operation on my service
> >> with schema validation turned on. Its goes through fine, if the schema
> >> validation is set to false. I suspect that something is wrong in my wsdl
> >> that is causing this error to come up. However, I am at a loss as to
> >> where the problem may be. I have attached the wsdl and my client code.
> >>
> >> Thanks for your help.
> >>
> >> ClientProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> >> factory.setServiceClass(ConnectorService.class);
> >>
> >>
> >> factory.setAddress("http://localhost:8080/idm-connector-ws/ExampleConnec
> >>tor Service"); javax.xml.namespace.QName qname =
> >> javax.xml.namespace.QName.valueOf("http://www.openiam.org/service/connec
> >>tor "); factory.setEndpointName(qname);
> >> ConnectorService client = (ConnectorService) factory.create();
> >>
> >>
> >> AddRequestType addReqType = new AddRequestType();
> >> PSOIdentifierType idType = new
> >> PSOIdentifierType("test.user",null, "target");
> >> addReqType.setPsoID(idType);
> >> addReqType.setRequestID("R4589");
> >> addReqType.setTargetID("100");
> >>
> >> ExtensibleUser extUser = new ExtensibleUser();
> >> extUser.setName("Test User");
> >> extUser.getAttributes().add(new ExtensibleAttribute("cn","Test
> >> User"));
> >> extUser.getAttributes().add(new
> >> ExtensibleAttribute("givenname","Test"));
> >> extUser.getAttributes().add(new
> >> ExtensibleAttribute("sn","User")); extUser.getAttributes().add(new
> >> ExtensibleAttribute("description","Test User"));
> >> extUser.getAttributes().add(new
> >> ExtensibleAttribute("mail","[email protected]"));
> >>
> >>
> >> addReqType.getData().getAny().add(extUser);
> >>
> >> client.add(addReqType);
> >>
> >> ResponseType resp = client.add(addReqType);
> >>
> >>
> >> javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: cvc-elt.1:
> >> Cannot find the declaration of element 'arg0'.
> >> at
> >> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:141)
> >> at $Proxy56.add(Unknown Source)
> >> at org.openiam.srvc.UserMgrTest.testAdd(UserMgrTest.java:70)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >> at java.lang.reflect.Method.invoke(Unknown Source)
> >> at junit.framework.TestCase.runTest(TestCase.java:164)
> >> at junit.framework.TestCase.runBare(TestCase.java:130)
> >> at
> >> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase
> >>.ja va:76) at junit.framework.TestResult$1.protect(TestResult.java:110)
> >> at junit.framework.TestResult.runProtected(TestResult.java:128) at
> >> junit.framework.TestResult.run(TestResult.java:113)
> >> at junit.framework.TestCase.run(TestCase.java:120)
> >> at junit.framework.TestSuite.runTest(TestSuite.java:228)
> >> at junit.framework.TestSuite.run(TestSuite.java:223)
> >> at
> >> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.jav
> >>a:3 5) at
> >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes
> >>tRe ference.java:45) at
> >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
> >>va: 38) at
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
> >>stR unner.java:460) at
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
> >>stR unner.java:673) at
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
> >>ner .java:386) at
> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
> >>nne r.java:196) Caused by: org.apache.cxf.binding.soap.SoapFault:
> >> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element
> >> 'arg0'. at
> >> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarsh
> >>alF ault(Soap11FaultInInterceptor.java:75) at
> >> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleM
> >>ess age(Soap11FaultInInterceptor.java:46) at
> >> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleM
> >>ess age(Soap11FaultInInterceptor.java:35) at
> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> >>hai n.java:236) at
> >> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage
> >>(Ab stractFaultChainInitiatorObserver.java:96) at
> >> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMess
> >>age (CheckFaultInterceptor.java:69) at
> >> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMess
> >>age (CheckFaultInterceptor.java:34) at
> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> >>hai n.java:236) at
> >> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:641) at
> >> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp
> >>ons eInternal(HTTPConduit.java:2134) at
> >> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp
> >>ons e(HTTPConduit.java:2013) at
> >> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTP
> >>Con duit.java:1938) at
> >> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> >> at
> >> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:626)
> >> at
> >> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI
> >>nte rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> >>hai n.java:236) at
> >> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:469) at
> >> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299) at
> >> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251) at
> >> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> >> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:120)
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog