The WSDL reader just reads the stream. There could be some sort of option to have it buffer and log. My idea was to buffer a bit so that we had something to log without paying the cost of a full buffer.
On Fri, Dec 4, 2009 at 10:47 AM, Nathaniel Auvil <[email protected]> wrote: > Is there a way to have the log interceptors show the request/response for > the WSDL? > > > On Fri, Dec 4, 2009 at 10:22 AM, Daniel Kulp <[email protected]> wrote: >> >> On Fri December 4 2009 10:13:52 am Benson Margulies wrote: >> > Dan, I still wonder what is hitting him to begin with. I have an idea: >> > capture the first 256 bytes of the returned WSDL and include it in the >> > error. I'm musing about how to make the unit test for this. >> >> It's probably the "Cannot find operation...." soap fault that would >> normally >> be generated when you do a get on the service address. >> >> Dan >> >> >> >> > On Fri, Dec 4, 2009 at 9:31 AM, Daniel Kulp <[email protected]> wrote: >> > > On Fri December 4 2009 8:43:25 am Nathaniel Auvil wrote: >> > >> ah...when i added a ?wsdl to the URL it worked. Why does CXF need to >> > >> parse the WSDL at runtime? I have already generated my code. >> > > >> > > That's pretty much what the JAX-WS spec requires. There are things >> > > in >> > > the WSDL that are not completely represented in code. The actual >> > > endpoint address is one of them. Things like policies are another. >> > > >> > > In MOST cases, you can pass null for the wsdl location and then do a >> > > service.createPort(...) call to create a port with your service URL >> > > and >> > > it will work fine. For straight soap calls with nothing fancy, the >> > > generated code may be enough in that case. >> > > >> > > Dan >> > > >> > >> On Fri, Dec 4, 2009 at 8:38 AM, Benson Margulies >> > > >> > > <[email protected]>wrote: >> > >> > CXF is trying to dynamically take the WSDL from your service, and >> > >> > something is coming back (perhaps an error page) that is not much >> > >> > like >> > >> > a WSDL. If you manually grab the ?wsdl URL what do you see? >> > >> > >> > >> > On Fri, Dec 4, 2009 at 8:09 AM, Nathaniel Auvil >> > >> > >> > >> > <[email protected]> wrote: >> > >> > > Hi all. I am using Maven to generate a SOAP client from WSDL. I >> > >> > > followed the web site example and some other examples i found on >> > >> > > the >> > >> > > net and my classes seemed to generate fine. As a side note i am >> > >> > > using java version "1.6.0_16" >> > >> > > >> > >> > > <plugin> >> > >> > > <groupId>org.apache.cxf</groupId> >> > >> > > <artifactId>cxf-codegen-plugin</artifactId> >> > >> > > <version>${cxf.version}</version> >> > >> > > <executions> >> > >> > > <execution> >> > >> > > <id>generate-sources</id> >> > >> > > <phase>generate-sources</phase> >> > >> > > <configuration> >> > >> > > <client>true</client> >> > >> > > >> > >> > > <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot> >> > >> > > <wsdlOptions> >> > >> > > <wsdlOption> >> > >> > > >> > >> > > <wsdl>${basedir}/src/main/wsdl/oasApi.wsdl</wsdl> >> > >> > > <extraargs> >> > >> > > >> > >> > > <extraarg>-p</extraarg> >> > >> > > >> > >> > > <extraarg>com.xxx.soap</extraarg> </extraargs> >> > >> > > >> > >> > > </wsdlOption> >> > >> > > >> > >> > > </wsdlOptions> >> > >> > > </configuration> >> > >> > > <goals> >> > >> > > <goal>wsdl2java</goal> >> > >> > > </goals> >> > >> > > </execution> >> > >> > > </executions> >> > >> > > </plugin> >> > >> > > >> > >> > > >> > >> > > >> > >> > > However, when i create a new xxxService Object as in... >> > >> > > >> > >> > > OaxApiService service = new OaxApiService( url, >> > >> > > OaxApiService.SERVICE ); >> > >> > > >> > >> > > >> > >> > > i am getting the following exception.... >> > >> > > >> > >> > > >> > >> > > >> > >> > > org.apache.cxf.service.factory.ServiceConstructionException: >> > >> > > Failed >> > >> > > to create service. >> > >> > > at >> > >> > >> > >> > >> > >> > org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.jav >> > >> >a:9 3) >> > >> > >> > >> > > at >> > >> > > >> > >> > > org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:20 >> > >> > >5) at >> > >> > > org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:148) >> > >> > > at >> > >> > >> > >> > >> > >> > org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderIm >> > >> >pl. java:65) >> > >> > >> > >> > > at javax.xml.ws.Service.<init>(Service.java:56) >> > >> > > at com.xxx.soap.OaxApiService.<init>(OaxApiService.java:48) >> > >> > > at com.xxx.OaxClient.invoke(OaxClient.java:97) >> > >> > > at com.xxx.oas.OaxClient.main(OaxClient.java:32) >> > >> > > Caused by: javax.wsdl.WSDLException: WSDLException: >> > >> > >> > >> > faultCode=PARSER_ERROR: >> > >> > > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected >> > >> > > character >> > >> > > 't' >> > >> > >> > >> > (code >> > >> > >> > >> > > 116) excepted space, or '>' or "/>" >> > >> > > at [row,col,system-id]: >> > >> > > [2,41,"https://server.xxx.com/oasapi/OaxApi"] at >> > >> > >> > >> > >> > >> > org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.j >> > >> >ava >> > >> > >> > >> >:226) >> > >> >: >> > >> > > at >> > >> > >> > >> > >> > >> > org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.ja >> > >> >va: 179) >> > >> > >> > >> > > at >> > >> > >> > >> > >> > >> > org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.jav >> > >> >a:9 1) >> > >> > >> > >> > > ... 7 more >> > >> > > Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: >> > >> > > Unexpected >> > >> > > character 't' (code 116) excepted space, or '>' or "/>" >> > >> > > at [row,col,system-id]: >> > >> > > [2,41,"https://server.xxx.com/oasapi/OaxApi"] at >> > >> > > >> > >> > > com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java >> > >> > >:64 8) at >> > >> > >> > >> > >> > >> > com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java >> > >> >:29 65) >> > >> > >> > >> > > at >> > >> > >> > >> > >> > >> > com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.ja >> > >> >va: 2936) >> > >> > >> > >> > > at >> > >> > >> > >> > >> > >> > com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java: >> > >> >284 8) >> > >> > >> > >> > > at >> > >> > > >> > >> > > com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) >> > >> > > at >> > >> > > >> > >> > > org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:90 >> > >> > >8) at >> > >> > > >> > >> > > org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java:826) >> > >> > > at >> > >> > > >> > >> > > org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:86 >> > >> > >8) at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:755) >> > >> > > at >> > >> > >> > >> > >> > >> > org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.j >> > >> >ava >> > >> > >> > >> >:217) >> > >> >: >> > >> > > ... 9 more >> > > >> > > -- >> > > Daniel Kulp >> > > [email protected] >> > > http://www.dankulp.com/blog >> > >> >> -- >> Daniel Kulp >> [email protected] >> http://www.dankulp.com/blog > >
