You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Kyle.Bober" <ky...@gmail.com> on 2008/02/13 23:06:33 UTC

Issue with WSDL or CXF

I have a Simple WSDL from which I generate the client and server code using
the applicable Maven2 plugins. My WSDL is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions name="UserService" 
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"	 
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"	
	xmlns:user-service="http://ws.user.service.websend.agfa.com"
	xmlns:user-model="http://model.ws.user.service.websend.agfa.com"
	targetNamespace="http://ws.user.service.websend.agfa.com">
  
  <wsdl:types>
    <xsd:schema 
    	targetNamespace="http://model.ws.user.service.websend.agfa.com"
    	xmlns:user-model="http://model.ws.user.service.websend.agfa.com">
        
      <xsd:element name="logonRequest"
type="user-model:UserSO"></xsd:element>
      <xsd:element name="logonResponse"
type="user-model:UserSO"></xsd:element>

      <xsd:complexType name="UserSO">
      	<xsd:sequence>
      		<xsd:element name="username" type="xsd:string"/>
      		<xsd:element name="password" type="xsd:string"/>
      		<xsd:element name="validated" type="xsd:boolean"/>
      	</xsd:sequence>
      </xsd:complexType>
      
    </xsd:schema>
  </wsdl:types>
    
  <wsdl:message name="logonRequest">
  	<wsdl:part element="user-model:logonRequest" name="in"/>
  </wsdl:message>
  <wsdl:message name="logonResponse">
  	<wsdl:part element="user-model:logonResponse" name="out"/>
  </wsdl:message>
  
  <wsdl:portType name="UserServicePortType">    
    <wsdl:operation name="logon">
    	<wsdl:input name="logonRequest" message="user-service:logonRequest"/>
    	<wsdl:output name="logonRespons" message="user-service:logonResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  
  <wsdl:binding name="UserServiceBinding"
type="user-service:UserServicePortType">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
                
    <wsdl:operation name="logon">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
        
  </wsdl:binding>
  
  <wsdl:service name="UserService">
    <wsdl:port name="UserService" binding="user-service:UserServiceBinding">
      <soap:address location="http://localhost:8080/UserService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Whenever I run the generated Client code I receive the following error:

Feb 13, 2008 5:00:29 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {http://ws.user.service.websend.agfa.com}UserService
from WSDL:
http://localhost:8080/com.agfa.websend.server.ws.user/services/UserService?wsdl
Invoking logon...
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Fault
occurred while processing.
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
	at $Proxy25.logon(Unknown Source)
	at
com.agfa.websend.service.user.ws.UserServicePortType_UserService_Client.main(UserServicePortType_UserService_Client.java:44)
Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while
processing.
	at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)
	at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
	at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:56)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
	... 2 more

Is this a bug with CXF or is my WSDL bad??? I also run the validate option
for the wsdl2java command I have included my Maven2 POM as well:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>com.agfa.websend.server.ws</groupId>
	<artifactId>user</artifactId>
	<version>1.0.0</version>
	<packaging>war</packaging>
	
	<repositories>
		<repository>
			<id>apache-snapshots</id>
			<name>Apache SNAPSHOT Repository</name>
			<url>http://people.apache.org/repo/m2-snapshot-repository/</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>apache-incubating</id>
			<name>Apache Incubating Repository</name>
			<url>http://people.apache.org/repo/m2-incubating-repository/</url>
		</repository>
        <!-- for jaxb-impl -->
        <repository>
            <id>java.net</id>
            <url>http://download.java.net/maven/1/</url>
            <layout>legacy</layout>
        </repository>
	</repositories>
	
	<pluginRepositories>
		<pluginRepository>
			<id>apache-plugin-snapshots</id>
			<name>Apache Maven Plugin Snapshots</name>
			<url>http://people.apache.org/repo/m2-snapshot-repository</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
        <pluginRepository>
               <id>apache-plugin-incubating</id>
               <name>Apache Plugin Incubating Repository</name>
              
<url>http://people.apache.org/repo/m2-incubating-repository/</url>
      	</pluginRepository>
	</pluginRepositories>
	
	<properties>
		<spring.version>2.5</spring.version>
		<cxf.version>2.0.4-incubator</cxf.version>
	</properties>
	<dependencies>		
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.14</version>
			<scope>compile</scope>
		</dependency>
		
		<!-- Depending on your requirements you may need more or less modules from
cxf -->
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-core</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-simple</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-jaxws</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-databinding-aegis</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-local</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http-jetty</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-jms</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-management</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-common-utilities</artifactId>
			<version>${cxf.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.mortbay.jetty</groupId>
			<artifactId>jetty</artifactId>
			<version>6.1.5</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.4</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	
	<build>
	    <finalName>user</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-codegen-plugin</artifactId>
				<version>2.0.4-incubator</version>
				<executions>
					<execution>
						<id>generate-sources</id>
						<phase>generate-sources</phase>
						<configuration>
							<sourceRoot>${basedir}/src/main/java</sourceRoot>				
							<wsdlOptions>
								<wsdlOption>
									<wsdl>${basedir}/src/main/wsdl/UserService.wsdl</wsdl>
									<extraargs>	
										<extraarg>-validate</extraarg>			
						    			<extraarg>-all</extraarg>			
									</extraargs>
								</wsdlOption>
							</wsdlOptions>
						</configuration>
						<goals>
							<goal>wsdl2java</goal>
						</goals>
					</execution>
				</executions>
			</plugin>			
		
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

Any help here would be much appreciated!!!

Regards,
Kyle



-- 
View this message in context: http://www.nabble.com/Issue-with-WSDL-or-CXF-tp15469111p15469111.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Issue with WSDL or CXF

Posted by Gautam <ga...@sonata-software.com>.
Hello guys,

Even I have got a same issue.  @Kyle, I am sure you are populating data in
the object and sending the same using cxf (a web service call maybe).  

The problem is, either no data will reach the server end or even sometimes
partial data would reach uptil the server end because of which as in above
post, it throws you the null pointer exception.

I was able to solve this by changing the cxf version from 2.1.2 to 2.4.0. 
But there is no guarantee that it will solve. 

If someone knows the solution, please reply to this as there is no one
single solution to this null pointer exception.

Thanks
Gautam

--
View this message in context: http://cxf.547215.n5.nabble.com/Issue-with-WSDL-or-CXF-tp554673p5576675.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Issue with WSDL or CXF

Posted by Gautam <ga...@sonata-software.com>.
Hello guys, 

Even I have got a same issue.  @Kyle, I am sure you are populating data in
the object and sending the same using cxf (a web service call maybe).   

The problem is, either no data would reach the server end or sometimes
partial data would reach uptil the server end because of which as in above
post, it throws you the null pointer exception. I realized this by looking
at the server side logs.  DATA IS NOT REACHING for sure.

Earlier I was able to solve this by changing the cxf version from 2.1.2 to
2.4.0. But today again I am facing the same issue even with cxf-2.4.0 

If someone knows the solution, please reply to as we are stuck with this
'Fault occurred while processing' and 'NullPointerException'

Thanks 
Teddy

--
View this message in context: http://cxf.547215.n5.nabble.com/Issue-with-WSDL-or-CXF-tp554673p5576684.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Issue with WSDL or CXF

Posted by Kyle Bober <ky...@gmail.com>.
The answer to your question:

'Do you litterally mean "I ran wsdl2java, compiled it, than ran the
client"?   If so, that's probably the issue.'

Is Yes

Ahhhh... I did just simply run the client without populating any data. If
this is what the issue is I will feel like a fool. Let me try regenerating
with some default data.

Again Daniel thanks for the prompt response!!!

-Kyle

Re: Issue with WSDL or CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 14 February 2008, Kyle.Bober wrote:
> Okay so I setup the CXF logging interceptor and this is what I now
> see...
> It seems that the soap:body is empty!!! Why is this happening???
> Knowing me I am making a stupid mistake on my WSDL somewhere.
> Although, I used one of the simple examples as my template and just
> changed some of the XSD and WSDL tags to fit my situation. Notice
> anything out of the ordinary? Or maybe I am not setting up a
> configuration parameter somewhere. Again, I am just running the test
> client class that CXF generates for me...
>
> -Kyle
>
> Next step Wireshark setup...

Wireshark will show the same thing.  Don't worry about it since the logs 
worked well.

When you say:
> Again, I am just running the test
> client class that CXF generates for me...

Do you litterally mean "I ran wsdl2java, compiled it, than ran the 
client"?   If so, that's probably the issue.   The client is pretty much 
just a stub.   You probably need to go in and actually create the data 
that would be passed in.   Without doing that, it's probably sending a 
null object to a bare method which probably doesn't work and would 
create that error.

If that IS the case, you COULD try running wsdl2java with 
the  -defaultValues switch.   The client that is then generated (server 
as well) does throw some random data in there.   The random data may not 
match the schema exactly, but it may work if validation is off.   



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Issue with WSDL or CXF

Posted by "Kyle.Bober" <ky...@gmail.com>.
Okay so I setup the CXF logging interceptor and this is what I now see...

Feb 14, 2008 9:48:24 AM org.apache.cxf.interceptor.LoggingInInterceptor
logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {cache-control=[no-cache], content-type=[text/xml; charset=UTF-8],
connection=[keep-alive], host=[localhost:8080], soapaction=[""],
transfer-encoding=[chunked], accept=[*], user-agent=[Java/1.6.0_04],
pragma=[no-cache]}
Messages: 
Message:

Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body></soap:Body></soap:Envelope>
--------------------------------------
Feb 14, 2008 9:48:25 AM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
INFO: Interceptor has thrown exception, unwinding now
java.lang.NullPointerException
	at
org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:96)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:57)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
	at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77)
	at
org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:264)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
	at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170)
	at
org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
Feb 14, 2008 9:48:25 AM
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
Encoding: UTF-8
Headers: {}
Messages: 
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Fault
occurred while
processing.</faultstring></soap:Fault></soap:Body></soap:Envelope>
--------------------------------------

It seems that the soap:body is empty!!! Why is this happening??? Knowing me
I am making a stupid mistake on my WSDL somewhere. Although, I used one of
the simple examples as my template and just changed some of the XSD and WSDL
tags to fit my situation. Notice anything out of the ordinary? Or maybe I am
not setting up a configuration parameter somewhere. Again, I am just running
the test client class that CXF generates for me...

-Kyle

Next step Wireshark setup...
-- 
View this message in context: http://www.nabble.com/Issue-with-WSDL-or-CXF-tp15469111p15480901.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Issue with WSDL or CXF

Posted by "Kyle.Bober" <ky...@gmail.com>.
Daniel,
   I noticed I am receiving this exceprtion on the server side. I am running
Tomcat 6.0.14.

Feb 14, 2008 9:35:32 AM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
INFO: Interceptor has thrown exception, unwinding now
java.lang.NullPointerException
	at
org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:96)
	at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:57)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
	at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
	at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77)
	at
org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)
	at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:264)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
	at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170)
	at
org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)

I am now in the process of setting up logging with CXF and Wireshark. Not
sure if the above exception explains anything that may stand out an be
obvious.

-Kyle
-- 
View this message in context: http://www.nabble.com/Issue-with-WSDL-or-CXF-tp15469111p15480789.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Issue with WSDL or CXF

Posted by Daniel Kulp <dk...@apache.org>.
Kyle,

From the stack trace, it's getting a fault back from the server.   Thus, 
the question is: why is the server sending back a fault?

Two things that would help figure that out:

1) If you can use wireshark or tcpdump or something to get the wirelevel 
messages, that can sometimes help.   Alternatively, look at:
http://cwiki.apache.org/CXF20DOC/debugging.html
to turn on various logging things.

2) Check the server side logs to see if there is anything like a stack 
trace or similar there.   That could potentially be the biggest help.

Dan



On Wednesday 13 February 2008, Kyle.Bober wrote:
> I have a Simple WSDL from which I generate the client and server code
> using the applicable Maven2 plugins. My WSDL is as follows:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <wsdl:definitions name="UserService"
> 	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	xmlns:user-service="http://ws.user.service.websend.agfa.com"
> 	xmlns:user-model="http://model.ws.user.service.websend.agfa.com"
> 	targetNamespace="http://ws.user.service.websend.agfa.com">
>
>   <wsdl:types>
>     <xsd:schema
>     	targetNamespace="http://model.ws.user.service.websend.agfa.com"
>     	xmlns:user-model="http://model.ws.user.service.websend.agfa.com">
>
>       <xsd:element name="logonRequest"
> type="user-model:UserSO"></xsd:element>
>       <xsd:element name="logonResponse"
> type="user-model:UserSO"></xsd:element>
>
>       <xsd:complexType name="UserSO">
>       	<xsd:sequence>
>       		<xsd:element name="username" type="xsd:string"/>
>       		<xsd:element name="password" type="xsd:string"/>
>       		<xsd:element name="validated" type="xsd:boolean"/>
>       	</xsd:sequence>
>       </xsd:complexType>
>
>     </xsd:schema>
>   </wsdl:types>
>
>   <wsdl:message name="logonRequest">
>   	<wsdl:part element="user-model:logonRequest" name="in"/>
>   </wsdl:message>
>   <wsdl:message name="logonResponse">
>   	<wsdl:part element="user-model:logonResponse" name="out"/>
>   </wsdl:message>
>
>   <wsdl:portType name="UserServicePortType">
>     <wsdl:operation name="logon">
>     	<wsdl:input name="logonRequest"
> message="user-service:logonRequest"/> <wsdl:output name="logonRespons"
> message="user-service:logonResponse"/> </wsdl:operation>
>   </wsdl:portType>
>
>   <wsdl:binding name="UserServiceBinding"
> type="user-service:UserServicePortType">
>     <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
>     <wsdl:operation name="logon">
>       <soap:operation soapAction="" style="document"/>
>       <wsdl:input>
>         <soap:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>
>   </wsdl:binding>
>
>   <wsdl:service name="UserService">
>     <wsdl:port name="UserService"
> binding="user-service:UserServiceBinding"> <soap:address
> location="http://localhost:8080/UserService"/> </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
>
> Whenever I run the generated Client code I receive the following
> error:
>
> Feb 13, 2008 5:00:29 PM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service
> {http://ws.user.service.websend.agfa.com}UserService from WSDL:
> http://localhost:8080/com.agfa.websend.server.ws.user/services/UserSer
>vice?wsdl Invoking logon...
> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Fault
> occurred while processing.
> 	at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175
>) at $Proxy25.logon(Unknown Source)
> 	at
> com.agfa.websend.service.user.ws.UserServicePortType_UserService_Clien
>t.main(UserServicePortType_UserService_Client.java:44) Caused by:
> org.apache.cxf.binding.soap.SoapFault: Fault occurred while
> processing.
> 	at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handl
>eMessage(Soap11FaultInInterceptor.java:70) at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handl
>eMessage(Soap11FaultInInterceptor.java:35) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>rChain.java:208) at
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessa
>ge(AbstractFaultChainInitiatorObserver.java:96) at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
>essage(ReadHeadersInterceptor.java:183) at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
>essage(ReadHeadersInterceptor.java:56) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>rChain.java:208) at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRe
>sponse(HTTPConduit.java:1955) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HT
>TPConduit.java:1791) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66
>) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin
>gInterceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>rChain.java:208) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222) at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135
>) ... 2 more
>
> Is this a bug with CXF or is my WSDL bad??? I also run the validate
> option for the wsdl2java command I have included my Maven2 POM as
> well:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>com.agfa.websend.server.ws</groupId>
> 	<artifactId>user</artifactId>
> 	<version>1.0.0</version>
> 	<packaging>war</packaging>
>
> 	<repositories>
> 		<repository>
> 			<id>apache-snapshots</id>
> 			<name>Apache SNAPSHOT Repository</name>
> 			<url>http://people.apache.org/repo/m2-snapshot-repository/</url>
> 			<snapshots>
> 				<enabled>true</enabled>
> 			</snapshots>
> 		</repository>
> 		<repository>
> 			<id>apache-incubating</id>
> 			<name>Apache Incubating Repository</name>
> 			<url>http://people.apache.org/repo/m2-incubating-repository/</url>
> 		</repository>
>         <!-- for jaxb-impl -->
>         <repository>
>             <id>java.net</id>
>             <url>http://download.java.net/maven/1/</url>
>             <layout>legacy</layout>
>         </repository>
> 	</repositories>
>
> 	<pluginRepositories>
> 		<pluginRepository>
> 			<id>apache-plugin-snapshots</id>
> 			<name>Apache Maven Plugin Snapshots</name>
> 			<url>http://people.apache.org/repo/m2-snapshot-repository</url>
> 			<releases>
> 				<enabled>false</enabled>
> 			</releases>
> 			<snapshots>
> 				<enabled>true</enabled>
> 			</snapshots>
> 		</pluginRepository>
>         <pluginRepository>
>                <id>apache-plugin-incubating</id>
>                <name>Apache Plugin Incubating Repository</name>
>
> <url>http://people.apache.org/repo/m2-incubating-repository/</url>
>       	</pluginRepository>
> 	</pluginRepositories>
>
> 	<properties>
> 		<spring.version>2.5</spring.version>
> 		<cxf.version>2.0.4-incubator</cxf.version>
> 	</properties>
> 	<dependencies>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>spring-core</artifactId>
> 			<version>${spring.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>spring-beans</artifactId>
> 			<version>${spring.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>spring-context</artifactId>
> 			<version>${spring.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.springframework</groupId>
> 			<artifactId>spring-web</artifactId>
> 			<version>${spring.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>log4j</groupId>
> 			<artifactId>log4j</artifactId>
> 			<version>1.2.14</version>
> 			<scope>compile</scope>
> 		</dependency>
>
> 		<!-- Depending on your requirements you may need more or less
> modules from cxf -->
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-core</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-frontend-simple</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-frontend-jaxws</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-databinding-aegis</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-transports-local</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-transports-http</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-transports-http-jetty</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-transports-jms</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-rt-management</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.cxf</groupId>
> 			<artifactId>cxf-common-utilities</artifactId>
> 			<version>${cxf.version}</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.mortbay.jetty</groupId>
> 			<artifactId>jetty</artifactId>
> 			<version>6.1.5</version>
> 			<scope>compile</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>4.4</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
>
> 	<build>
> 	    <finalName>user</finalName>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.cxf</groupId>
> 				<artifactId>cxf-codegen-plugin</artifactId>
> 				<version>2.0.4-incubator</version>
> 				<executions>
> 					<execution>
> 						<id>generate-sources</id>
> 						<phase>generate-sources</phase>
> 						<configuration>
> 							<sourceRoot>${basedir}/src/main/java</sourceRoot>
> 							<wsdlOptions>
> 								<wsdlOption>
> 									<wsdl>${basedir}/src/main/wsdl/UserService.wsdl</wsdl>
> 									<extraargs>
> 										<extraarg>-validate</extraarg>
> 						    			<extraarg>-all</extraarg>
> 									</extraargs>
> 								</wsdlOption>
> 							</wsdlOptions>
> 						</configuration>
> 						<goals>
> 							<goal>wsdl2java</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
>
> 			<plugin>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.6</source>
> 					<target>1.6</target>
> 				</configuration>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
>
> Any help here would be much appreciated!!!
>
> Regards,
> Kyle



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog