Issue Details (XML | Word | Printable)

Key: XFIRE-412
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Dan Diephouse
Reporter: eureka
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName

Created: 18/May/06 11:29 AM   Updated: 18/May/06 12:13 PM
Component/s: None
Affects Version/s: 1.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. File TestXFire.rar (9 kB)

Environment: Windows 2003 SP1, JDK 1.5.0_06, Resin 3.0.19


 Description  « Hide
use org.codehaus.xfire.spring.remoting.XFireExporter to expose webservice, use org.codehaus.xfire.spring.remoting.XFireClientFactoryBean as client,
when the service being invoked, the follow exception thrown:

ERROR-[2006-05-19 00:20:31,562] Fault occurred!
java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName
at javax.xml.namespace.QName.<init>(QName.java:170)
at com.bea.xml.stream.MXParser.getName(MXParser.java:1439)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:104)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:61)
at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:278)
at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:144)
at org.codehaus.xfire.spring.remoting.XFireServletControllerAdapter.handleRequest(XFireServletControllerAdapter.java:63)
at org.codehaus.xfire.spring.remoting.XFireExporter.handleRequest(XFireExporter.java:44)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:389)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:507)
at com.caucho.util.ThreadPool.run(ThreadPool.java:433)
at java.lang.Thread.run(Thread.java:595)

The generated wsdl is as below:

<wsdl:definitions targetNamespace="http://my" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://my" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://holders.rpc.xml.javax" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/">
<wsdl:types>
<xsd:schema targetNamespace="http://my" elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="JustInput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in0" type="xsd:string" nillable="true" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in1" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in2" type="xsd:float" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in3" type="xsd:double" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in4" type="xsd:boolean" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="JustInputResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string" nillable="true" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="InputOutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in0" type="ns1:StringHolder" nillable="true" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in1" type="ns1:IntHolder" nillable="true" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in2" type="ns1:FloatHolder" nillable="true" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in3" type="ns1:DoubleHolder" nillable="true" minOccurs="1" maxOccurs="1"/>
<xsd:element name="in4" type="ns1:BooleanHolder" nillable="true" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="InputOutputResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string" nillable="true" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://holders.rpc.xml.javax" elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:complexType name="StringHolder"/>
<xsd:complexType name="IntHolder"/>
<xsd:complexType name="FloatHolder"/>
<xsd:complexType name="DoubleHolder"/>
<xsd:complexType name="BooleanHolder"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="InputOutputRequest">
<wsdl:part name="parameters" element="tns:InputOutput"/>
</wsdl:message>
<wsdl:message name="JustInputResponse">
<wsdl:part name="parameters" element="tns:JustInputResponse"/>
</wsdl:message>
<wsdl:message name="InputOutputResponse">
<wsdl:part name="parameters" element="tns:InputOutputResponse"/>
</wsdl:message>
<wsdl:message name="JustInputRequest">
<wsdl:part name="parameters" element="tns:JustInput"/>
</wsdl:message>
<wsdl:portType name="MyServicePortType">
<wsdl:operation name="JustInput">
<wsdl:input name="JustInputRequest" message="tns:JustInputRequest"/>
<wsdl:output name="JustInputResponse" message="tns:JustInputResponse"/>
</wsdl:operation>
<wsdl:operation name="InputOutput">
<wsdl:input name="InputOutputRequest" message="tns:InputOutputRequest"/>
<wsdl:output name="InputOutputResponse" message="tns:InputOutputResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MyServiceHttpBinding" type="tns:MyServicePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="JustInput">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="JustInputRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="JustInputResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="InputOutput">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="InputOutputRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="InputOutputResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MyService">
<wsdl:port name="MyServiceHttpPort" binding="tns:MyServiceHttpBinding">
<wsdlsoap:address location="http://localhost:8080/TestXFire/service/MyService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Source code are in the attachment.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Diephouse added a comment - 18/May/06 11:43 AM
Hiya,
We'll definitely take a look into this issue. It appears to be due to differences in the stax reference implementation and the woodstox stax implementation we normally use. Please try removing the stax-1.1.x-dev jar from your classpath and adding the woodstox jar from the distribution instead.

eureka added a comment - 18/May/06 12:13 PM
Yes, the problem solved. I change the stax implementation from BEA's jsr173_1.0_ri.jar to wstx-asl-2.9.3.jar, it works.
Thanks a lot.

Another question, I define the interface as below

public interface MyService {
String JustInput(String s, int i, float f, double d, boolean b);

String InputOutput(StringHolder s, IntHolder i, FloatHolder f,
DoubleHolder d, BooleanHolder b);
}

The JustInput method works. But the InputOutput method doesn't work. I use TCP Monitor to inspect the traffic. It shows that the InputOutput message doesn't include the value set in the arguments. I guess the reason is XFire does not support the holder classes or it requires additional works if these classes are used as parameters. Isn't it?

POST /TestXFire/service/MyService HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)
Host: localhost:8081
Expect: 100-continue
Content-Length: 378

<?xml version='1.0' encoding='UTF-8'?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><JustInput xmlns="http://my"><in0 xmlns="http://my">string</in0><in1>1</in1><in2>1.2</in2><in3>1.23</in3><in4>true</in4></JustInput></soap:Body></soap:Envelope>POST /TestXFire/service/MyService HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)
Host: localhost:8081
Expect: 100-continue
Content-Length: 344

<?xml version='1.0' encoding='UTF-8'?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><InputOutput xmlns="http://my"><in0 xmlns="http://my" /><in1 /><in2 /><in3 /><in4 /></InputOutput></soap:Body></soap:Envelope>