Well, it seems that the
Code:
javax.xml.rpc.ServiceException: Error processing WSDL document:
javax.xml.rpc.ServiceException: Cannot find service: xxx
thing is a common one. I got that error too trying to invoke a simple Axis web service.
After trying almost all combinations of namespaceUri, endpintAddress, serviceName and portName values; I succedded with a configuration (adapted to your's) similar to:
WSDL:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<definitions targetNamespace="urn" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="HelloOperation" />
<message name="HelloOperationResponse">
<part name="return" type="xsd:string" />
</message>
<portType name="HelloWorldService">
<operation name="HelloOperation">
<documentation parameterOrder="">Hello World Method</documentation>
<input message="tns:HelloOperation" />
<output message="tns:HelloOperationResponse" />
</operation>
</portType>
<binding name="HelloWorldService" type="tns:HelloWorldService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http/" />
<operation name="HelloOperation" selector="hello">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="urn" />
</input>
<output>
<soap:body use="literal" namespace="urn" />
</output>
</operation>
</binding>
<service name="HelloWorldService">
<port name="HelloWorldService" binding="tns:HelloWorldService">
<soap:address location="http://maa5.rmb.co.za:8819/HelloWorldService" />
</port>
</service>
<schemaBindings />
</definitions>
applicationContext.xml:
Code:
<beans>
<bean id="HelloWorldService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean">
<property name="serviceFactoryClass"><value>org.apache.axis.client.ServiceFactory</value></property>
<property name="wsdlDocumentUrl"><value>http://maa5.rmb.co.za:8008/HelloWorldServiceMike250.wsdl</value></property>
<property name="namespaceUri"><value>urn</value></property>
<property name="portName"><value>HelloWorldService</value></property>
<property name="serviceName"><value>HelloWorldService</value></property>
<property name="serviceInterface"><value>jaxrpc.HelloWorldService</value></property>
<property name="portInterface"><value>jaxrpc.RemoteHelloWorldService</value></property>
</bean>
</beans>
For the shake of clarity here are listed from where in the WSDL is taken each bean property:
Code:
serviceFactoryClass = always org.apache.axis.client.ServiceFactory
wsdlDocumentUrl = the complete URL where the WSLD is located
namespaceUri = /definitions[@targetnamespace]
portName = /definitions/service/port[@name]
serviceName = /definitions/service[@name]
serviceInterface = if you reached this point it shouldn't bee too hard
portInterface = idem
In respect to the endpointAddress attribute I didn't needed it even I had a /definitions/service/port/soap:address[@location] like:
Code:
http://maa5.rmb.co.za:8819/mycontext/HelloWorldService
i.e. for an WSDD like:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="adminPassword" value="admin"/>
<parameter name="sendXsiTypes" value="true"/>
<parameter name="sendMultiRefs" value="true"/>
<parameter name="sendXMLDeclaration" value="true"/>
<parameter name="axis.sendMinimizedElements" value="true"/>
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="session"/>
</handler>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="request"/>
<parameter name="extension" value=".jwr"/>
</handler>
</requestFlow>
</globalConfiguration>
<handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
<handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/>
<handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
<service name="AdminService" provider="java:MSG">
<parameter name="allowedMethods" value="AdminService"/>
<parameter name="enableRemoteAdmin" value="false"/>
<parameter name="className" value="org.apache.axis.utils.Admin"/>
<namespace>http://xml.apache.org/axis/wsdd/</namespace>
</service>
<service name="Version" provider="java:RPC">
<parameter name="allowedMethods" value="getVersion"/>
<parameter name="className" value="org.apache.axis.Version"/>
</service>
<transport name="http">
<requestFlow>
<handler type="URLMapper"/>
<handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
</requestFlow>
</transport>
<transport name="local">
<responseFlow>
<handler type="LocalResponder"/>
</responseFlow>
</transport>
</deployment>
Axis generated the following WSDL:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://localhost:8080/test-spring-jaxrpc/services/Version">
<wsdl:message name="getVersionRequest"></wsdl:message>
<wsdl:message name="getVersionResponse">
<wsdl:part name="getVersionReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Version">
<wsdl:operation name="getVersion">
<wsdl:input message="impl:getVersionRequest" name="getVersionRequest"/>
<wsdl:output message="impl:getVersionResponse" name="getVersionResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="VersionSoapBinding" type="impl:Version">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getVersion">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getVersionRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org" use="encoded"/>
</wsdl:input>
<wsdl:output name="getVersionResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/test-spring-jaxrpc/services/Version" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="VersionService">
<wsdl:port binding="impl:VersionSoapBinding" name="Version">
<wsdlsoap:address location="http://localhost:8080/test-spring-jaxrpc/services/Version"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And the bean definition on the applicationContext.xml configuration file I used was:
Code:
<bean id="version" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean">
<property name="serviceFactoryClass"><value>org.apache.axis.client.ServiceFactory</value></property>
<property name="wsdlDocumentUrl"><value>http://localhost:8080/test-spring-jaxrpc/services/Version?wsdl</value></property>
<property name="namespaceUri"><value>http://localhost:8080/test-spring-jaxrpc/services/Version</value></property>
<property name="serviceName"><value>VersionService</value></property>
<property name="portName"><value>Version</value></property>
<property name="serviceInterface"><value>foo.bar.tests.springjaxrpc.server.WebService</value></property>
<property name="portInterface"><value>foo.bar.tests.springjaxrpc.springjaxrpc.server.RemoteWebService</value></property>
</bean>
Hope it helps, I got mad with this one.
Regards.
Ignacio.