Hi Stuart,
Try doing

Service serviceModel = new ObjectServiceFactory().create(ICollaborationServiceTwo.class, "Name", "namespace", null);

- Dan

Stuart Barlow wrote:
The request is sent using the wrong namespace when I use the client...
Service serviceModel = new ObjectServiceFactory().create(ICollaborationServiceTwo.class); ICollaborationServiceTwo service = (ICollaborationServiceTwo) new XFireProxyFactory().create(serviceModel, url);

Is there a way to set the target namespace?
The correct namespace is used when I use the dynamic client.


Stuart Barlow wrote:
I am trying to call a method on my MTOM enabled service and get the following
error...

org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: There must be a method name element. org.codehaus.xfire.fault.XFireFault: There must be a method name element. at org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBinding.java:31) at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
    at org.codehaus.xfire.client.Client.onReceive(Client.java:448)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:174) at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:66) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
    at org.codehaus.xfire.client.Client.invoke(Client.java:359)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
    at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
    at $Proxy0.logon(Unknown Source)
at com.hummingbird.hc.api.MTOMTest.testGetDocumentData(MTOMTest.java:41)


Spring service configuration...

<bean name="CollaborationServiceTwo" class="org.codehaus.xfire.spring.ServiceBean">
        <property name="serviceBean" ref="collaborationServiceTwo"/>
<property name="serviceClass" value="com.hummingbird.hc.api.ICollaborationServiceTwo"/> <property name="namespace" value="http://hemp.hummingbird.com/v1/hemp"/>

        <property name="properties">
            <map>
                <entry>
                    <key><value>mtom-enabled</value></key>
                    <value>true</value>
                </entry>
            </map>
        </property>

        <property name="inHandlers">
            <list>
                <ref bean="addressingHandler"/>
            </list>
        </property>
    </bean>


The Java interface with 3 methods is...

public interface ICollaborationServiceTwo {

    String logon(String username, String password, String organization,
                 String remoteLocation) throws HCException;

    void logoff(String sessionID) throws HCException;

    DataHandler getDocumentData(String sessionID, String documentID,
                int version, boolean returnData) throws HCException;
}


The error is when I call the logon method.
Should I only call...
client.setProperty("mtom-enabled", "true");
when I want to call a DataHandler or byte[] method?

ta,
Stuart





--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog

Reply via email to