Hi I am using XFireClientFactoryBean to create a client that invokes an
existing WSDL.
Scenario:
In the WSDL I have:
<wsdl:operation name="search">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="searchRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://corpwsdl.myhost" use="encoded"/>
</wsdl:input>
<wsdl:output name="searchResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://corpwsdl.myhost" use="encoded"/>
</wsdl:output>
<wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
name="CFCInvocationException" namespace="http://corpwsdl.myhost"
use="encoded"/>
</wsdl:fault>
</wsdl:operation>
...
<wsdl:message name="searchRequest">
<wsdl:part name="xml" type="xsd:string"/>
</wsdl:message>
In applicationContext.xml I have:
<bean id="proveIdServiceFactory"
class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
<property name="serviceClass"
value="com.idna.wsconsumer.xfire.factory.ProveIdService" />
<property name="wsdlDocumentUrl"
value="http://myhost/ProveID.cfc?wsdl" />
<!-- property name="namespaceUri"
value="http://www.w3.org/2001/XMLSchema"
/-->
<property name="serviceName" value="ProveIDWebService" />
<property name="username" value="basil.eltom" />
<property name="password" value="letmein" />
</bean>
<bean id="proveIdService"
class="com.idna.wsconsumer.xfire.factory.ProveIdServiceImpl">
<property name="proveIdService" ref="proveIdServiceFactory"/>
</bean>
where proveIdService is the interface describing the operation 'search' as
defined in the wsdl.
@WebService
public interface ProveIdService
{
@WebMethod (operationName="search" )
public String search(String xml);
}
In my JUnit test case, I firstly load the bean definition and cast it to a
ProvedIdService object:
proveIdService =
(ProveIdServiceImpl)super.getContext().getBean("proveIdService");
Then I invoke the 'search' operation by calling proveIdService.search("some
input"). The problem is, no matter what arguments taken by the 'search'
method, it did not get passed to the Web Service side at all, as seen in the
log4j output below (Nothing appears within <soap:Body> tag):
DEBUG [org.apache.commons.httpclient.HttpConnection] - enter
HttpConnection.getRequestOutputStream()
DEBUG [httpclient.wire.content] - >>
"<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><ns1:search
xmlns:ns1="http://factory.xfire.wsconsumer.xxx.com">
<ns1:in0 xsi:nil="true" />
</ns1:search>
</soap:Body>
</soap:Envelope>"
DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] -
Request body sent
...
DEBUG [httpclient.wire.content] - << "<?xml version="1.0"
encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">[\n]"
DEBUG [httpclient.wire.content] - << " <soapenv:Body>[\n]"
DEBUG [httpclient.wire.content] - << " <soapenv:Fault>[\n]"
DEBUG [httpclient.wire.content] - << "
<faultcode>soapenv:Server.userException</faultcode>[\n]"
DEBUG [httpclient.wire.content] - << "
<faultstring>coldfusion.xml.rpc.CFCInvocationException:
[coldfusion.runtime.MissingArgumentException : The XML parameter to the
search function is required but was not passed in.]</faultstring>[\n]"
DEBUG [httpclient.wire.content] - << " <detail>[\n]"
DEBUG [httpclient.wire.content] - << " <ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">TOPAMAX</ns1:hostname>[\n]"
DEBUG [httpclient.wire.content] - << " </detail>[\n]"
DEBUG [httpclient.wire.content] - << " </soapenv:Fault>[\n]"
DEBUG [httpclient.wire.content] - << " </soapenv:Body>[\n]"
DEBUG [httpclient.wire.content] - << "</soapenv:Envelope>
Could anyone please give me any clue about why this happen?
Many thanks!
--
View this message in context:
http://www.nabble.com/XFireClientFactoryBean-cannot-pass-operation-arguments-to-WebServices-tp18166994p18166994.html
Sent from the XFire - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email