If you could create a small test case and attach to a JIRA, that would be a big help. Not really sure what is going on with it.
Dan On Jan 10, 2013, at 2:35 AM, [email protected] wrote: > Hi, > > I am trying to call an endpint with @WebParam(mode = WebParam.Mode.IN, > header = true,..). The header=true setting gives me various jaxb errors with > this dependency > > <dependency> > <groupId>org.apache.cxf</groupId> > <artifactId>cxf-bundle</artifactId> > <version>2.7.1</version> > </dependency> > > > @WebResult(targetNamespace = "http://test2.test1/", name = > "returnedValFromTestSOAP") > public String testSOAP(@WebParam(mode = WebParam.Mode.IN, header = true, > name = "credentials") Credentials credentials, > @WebParam(name="par1") WrappedList<String> par1, > @WebParam(name="par2") WrappedList<String> par2); > > > The server is created with: > > JaxWsServerFactoryBean svrBean = new JaxWsServerFactoryBean(); > svrBean.setAddress(getSimpleServerAddress()); > svrBean.setServiceClass(HelloService.class); > svrBean.setServiceBean(new HelloServiceImpl()); > svrBean.setBus(CXFBusFactory.getDefaultBus()); > server = svrBean.create(); > > server.getEndpoint().getInInterceptors() > .add(new LoggingInInterceptor()); > server.getEndpoint().getOutInterceptors() > .add(new LoggingOutInterceptor()); > > and the client with: > > JaxWsDynamicClientFactory dcf = > JaxWsDynamicClientFactory.newInstance(); > Client client = > dcf.createClient("http://localhost:1101/App/test?wsdl"); > > Object[] res = client.invoke("testSOAP", par1, par2); > > There is a problem: the soap header gets scrambled with info from par2 and > both parameters (par1 and 2) are not correctly written by the soap > mechanism. > > I can put the binary sources if required. > > The results are: > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials xmlns:ns2="http://test2.test1/"/> > <ns2:credentials > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:ns2="http://test2.test1/" xsi:type="wrappedList"> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">s1</innerList> > </ns2:credentials> > </soap:Header> > <soap:Body> > <ns2:testSOAP xmlns:ns2="http://test2.test1/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:type="wrappedList"> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > </ns2:testSOAP> > </soap:Body> > </soap:Envelope> > > Unmarshalling Error: unexpected element (uri:"", local:"innerList"). > Expected elements are <{}par2>,<{}par1> > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials xmlns:ns2="http://test2.test1/"/> > <ns2:credentials > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:ns2="http://test2.test1/" xsi:type="wrappedList"><innerList > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">s1</innerList></ns2:credentials> > </soap:Header> > <soap:Body> > <ns2:testSOAP xmlns:ns2="http://test2.test1/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:type="wrappedList"> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > </ns2:testSOAP> > </soap:Body> > </soap:Envelope> > > complex params > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials xmlns:ns2="http://test2.test1/"/> > </soap:Header> > <soap:Body> > <ns2:complexParameters xmlns:ns2="http://test2.test1/"> > <par1> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > </par1> > <par2> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">s1</innerList> > </par2> > </ns2:complexParameters> > </soap:Body> > </soap:Envelope> > > more values > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials xmlns:ns2="http://test2.test1/"/> > </soap:Header> > <soap:Body> > <ns2:complexParameters xmlns:ns2="http://test2.test1/"> > <par1> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t11</innerList> > </par1> > <par2> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">s1</innerList> > </par2> > </ns2:complexParameters> > </soap:Body> > </soap:Envelope> > > > one credential > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials xmlns:ns2="http://test2.test1/"> > <domain>domain</domain> > <password>password</password> > <username>uname</username> > </ns2:credentials> > </soap:Header> > <soap:Body> > <ns2:complexParameters xmlns:ns2="http://test2.test1/"> > <par1> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t11</innerList> > </par1> > <par2> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">s1</innerList> > </par2> > </ns2:complexParameters> > </soap:Body> > </soap:Envelope> > > server response (soap with header) > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:ns2="http://test2.test1/" xsi:type="wrappedList"> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t11</innerList> > </ns2:credentials> > </soap:Header> > <soap:Body> > <ns2:testSOAP xmlns:ns2="http://test2.test1/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:type="credentials"> > <domain>domain</domain> > <username>username</username> > </ns2:testSOAP> > </soap:Body> > </soap:Envelope> > > parameter inversion Object[] res = client.invoke("testSOAP", par1, > credentials); > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <ns2:credentials xmlns:ns2="http://test2.test1/"> > <domain>domain</domain> > <username>username</username> > </ns2:credentials> > </soap:Header> > <soap:Body> > <ns2:testSOAP xmlns:ns2="http://test2.test1/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:type="wrappedList"> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > <innerList xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t11</innerList> > </ns2:testSOAP> > </soap:Body> > </soap:Envelope> > > > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Body> > <ns2:complexParameters xmlns:ns2="http://test2.test1/"> > <par1> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t1</innerList> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">t11</innerList> > </par1> > <par2> > <innerList > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xsi:type="xs:string">s1</innerList> > </par2> > </ns2:complexParameters> > </soap:Body> > </soap:Envelope> > > If somebody can help (with an example), I will appreciate, > > Thank you! > > > Best regards, > Bogdan > > > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/jaxb-errors-when-calling-with-WebParam-and-header-true-tp5721357.html > Sent from the cxf-user mailing list archive at Nabble.com. -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
