Hi
I am trying to use JaxRpc to consume a web service. I have configured my bean the same way that the jpetstore sample shows, ie: as follows
I have tried changing the namespaceUri and serviceName to every possible configuration I can think of but I always get the following exception: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>http://maa5.rmb.co.za:8008/HelloWorldServiceMike250</value></property> <property name="portName"><value>HelloWorldService</value></property> <property name="serviceName"><value>urn:HelloWorldService</value></property> <property name="serviceInterface"><value>jaxrpc.HelloWorldService</value></property> </bean> </beans>
When I use Axis with the wsdl2java ant task, with the same url it works fine, can anybody tell me what I should be entering for the following:Code:INFO: Creating shared instance of singleton bean 'HelloWorldService' 2004/09/22 12:29:33 org.springframework.beans.factory.support.AbstractBeanFactory destroySingletons INFO: Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [HelloWorldService]; Root of BeanFactory hierarchy} Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HelloWorldService' defined in file [C:\dev\workspace\spring\applicationContext.xml]: Initialization of bean failed; nested exception is javax.xml.rpc.ServiceException: Error processing WSDL document: javax.xml.rpc.ServiceException: Error processing WSDL document: javax.xml.rpc.ServiceException: Cannot find service: {http://maa5.rmb.co.za:8008/HelloWorldServiceMike250}urn:HelloWorldService javax.xml.rpc.ServiceException: Error processing WSDL document: javax.xml.rpc.ServiceException: Error processing WSDL document: javax.xml.rpc.ServiceException: Cannot find service: {http://maa5.rmb.co.za:8008/HelloWorldServiceMike250}urn:HelloWorldService at org.apache.axis.client.Service.initService(Service.java:278) at org.apache.axis.client.Service.<init>(Service.java:193) at org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:232) at org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory.createJaxRpcService(LocalJaxRpcServiceFactory.java:152) at org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.afterPropertiesSet(JaxRpcPortClientInterceptor.java:226) at org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean.afterPropertiesSet(JaxRpcPortProxyFactoryBean.java:52) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:801) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:249) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:177) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:177) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:268) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:60) at jaxrpc.ServiceLauncher.bind(ServiceLauncher.java:27) at jaxrpc.ServiceLauncher.main(ServiceLauncher.java:31)
1. url
2. namespaceUri
3. portName
4. serviceName
Below is the wsdl file I am using:
Please help!!! Also read the relevant sections from Rod's book "J2EE Development Without EJB" but I'm still not winningCode:<?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>


Reply With Quote