History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-754
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Tomasz Sztelak
Reporter: Matthew
Votes: 0
Watchers: 0
Operations

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

Not converting header element into function argument

Created: 13/Nov/06 06:24 PM   Updated: 05/Mar/07 05:17 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.5

Time Tracking:
Not Specified

File Attachments: 1. XML File TestService.wsdl (3 kb)

Environment: XFire 1.2.2, Tomcat 5.5, XP Pro


 Description  « Hide
I created a service implementation class from the attached wsdl and used that to build a web service:
<wsgen outputDirectory="${build.src}"
wsdl="../${admin.etc}/TestService.wsdl"
package="test.ws"
overwrite="true"/>
(On a side note, the wsdl attribute doesn't take into account the "basedir" attribute)

I initialized the service in the servlet init method:

public class MyServlet extends XFireServlet {
public void init() throws ServletException
{
super.init();
ObjectServiceFactory factory = new ObjectServiceFactory(xfire.getTransportManager());

URL url = null;
try { url = new URL("file://\\WebService\\etc\\TestService.wsdl"); } catch (Exception e) { e.printStackTrace(); }
QName qn = new QName("http://ws.test", "TestServiceService");

Properties props = new Properties();
props.put(ObjectServiceFactory.PORT_TYPE, new QName("http://ws.test", "TestService"));
Service service = factory.create(TestService.class, qn, url, props);
service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, TestServiceServiceImpl.class);
getController().getServiceRegistry().register(service);

}
}

I then called the release method using the following soap message which is valid according to the wsdl:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns3="http://xml.test.com/ws/session" xmlns:tns1="http://TestService.ws.test.com">
<soap:Header>
<tns3:sessionID>0</tns3:sessionID>
</soap:Header>
<soap:Body>
<tns1:release>
</tns1:release>
</soap:Body>
</soap:Envelope>

I get the error below...
Looking at the fillInHolders method at the top of the stack trace below. It appears that it is counting the operation's soap body and header elements and then comparing that to just the the actual soap message's body only. There's also a part in the list for releaseRequest when there is no such part. I would think that it should be creating a holder for the header element sessionId since it is in both the input and output of the operation but the generated skeleton method has only an in parameter.

INFO: Fault occurred!
org.codehaus.xfire.fault.XFireFault: Not enough message parts were received for the operation.
at org.codehaus.xfire.service.binding.ServiceInvocationHandler.fillInHolders(ServiceInvocationHandler.java:226)
at org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:71)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:301)
at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:130)
at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tomasz Sztelak - 05/Mar/07 05:17 AM
Fixed in svn