Hi,

See this resources http://xfire.codehaus.org/Message+Binding.

How do you check that the message reached the server? Do you use any
http tunnel to monitor http connection?
(see www.nettool.org)

My services.xml is here:
<beans xmlns="http://xfire.codehaus.org/config/1.0";>

    <bean id="WfstService" class="test.SoapServiceImpl"/>

        <service >
                <name>WfstService</name>
                <namespace>http://service.namespace.org</namespace>
                <serviceBean>#WfstService</serviceBean>
                <serviceFactory>#my.messageServiceFactory</serviceFactory>
<!--    <wsdlURL>/META-INF/wsdl/WFST.wsdl</wsdlURL> -->
                <style>message</style>
                <use>literal</use>
        </service>
        
        <bean id="my.messageServiceFactory"
    class="org.codehaus.xfire.service.binding.ObjectServiceFactory">
    <constructor-arg index="0" ref="xfire.transportManager" />
    <constructor-arg index="1" ref="xfire.messageBindingProvider" />
    <property name="style" value="message" />
    <property name="use" value="literal" />
  </bean>
</beans>

Regards,
Zdenek


On Nov 16, 2007 9:54 PM, Nayan Hajratwala <[EMAIL PROTECTED]> wrote:
> Good afternoon!
>
> I'm in the process of setting up a webservice using Spring/XFire. I am
> able to get it working fine with a simple String input parameter, but
> when I try to use the XMLStreamReader for Message Binding, my tests
> seem to fail.
>
> First, here is my test:
>
> ===============
>         public void testLiveServerXml() throws Exception {
>
>                 XMLInputFactory factory = XMLInputFactory.newInstance();
>                 XMLStreamReader reader = factory.createXMLStreamReader(
>                                 new FileReader("C:\\testMessage.xml"));
>
>                 ObjectServiceFactory serviceFactory = new 
> ObjectServiceFactory();
>                 serviceFactory.setStyle("message");
>                 Service serviceModel = 
> serviceFactory.create(AggregatorService.class);
>
>                 AggregatorService service = (AggregatorService)new
> XFireProxyFactory().create(
>                                 serviceModel,
> "http://localhost:8888/caps2/services/AggregatorService?wsdl";);
>
>                 XMLStreamReader result = service.invoke(reader);
>                 assertNotNull(result);
>                 assertEquals("OK", result.getText());
>         }
> ===============
>
> The service.invoke method executes, however, debugging shows that the
> service method on the server is never called (maybe it's failing
> somewhere in the proxy?).  The end result is that the test fails
> because the "result" is null.
>
> Here then, is my Service
> =====================
> public class AggregatorServiceImpl implements AggregatorService {
>
>         private Log logger = LogFactory.getLog(AggregatorServiceImpl.class);
>
>         public XMLStreamReader invoke(XMLStreamReader reader) {
>
>                 XMLStreamReader result = null;
>
>                 try {
>                         logger.info("in XMLStreamReader invoke");
>                         logger.info("reader data: [" + reader.getText() + 
> "]");
>
>                         XMLInputFactory factory = 
> XMLInputFactory.newInstance();
>                         result = factory.createXMLStreamReader(new 
> StringReader("OK"));
>                 }
>                 catch (Exception e) {
>                         logger.error("Exception!", e);
>                 }
>
>                 return result;
>         }
> }
> =====================
>
> The service has an associated interface, which i won't include here.
>
> Finally, my spring configuration:
>
> ======================
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>         xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
>
>         <!-- Include the XFire goodness -->
>         <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
>
>         <bean name="aggregator-webservice"
>                 class="org.codehaus.xfire.spring.ServiceBean">
>                 <property name="serviceBean" ref="aggregatorService" />
>                 <property name="serviceClass"
> value="com.me.caps.aggregator.service.AggregatorService" />
>
>         <bean id="aggregatorService"
> class="com.me.caps.aggregator.service.impl.AggregatorServiceImpl" />
>
> </beans>
> ========================
>
> Does anyone have any tips on what might be happening?
>
> Thanks!
> ---
> Nayan Hajratwala
> http://www.chikli.com  Chikli Consulting LLC
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to