cig
Sep 22nd, 2004, 06:41 AM
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
<beans>
<bean id="HelloWorldService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean">
<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>
I have tried changing the namespaceUri and serviceName to every possible configuration I can think of but I always get the following exception:
INFO: Creating shared instance of singleton bean 'HelloWorldService'
2004/09/22 12:29:33 org.springframework.beans.factory.support.Abstract BeanFactory destroySingletons
INFO: Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [HelloWorldService]; Root of BeanFactory hierarchy}
Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: 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.createServic e(ServiceFactory.java:232)
at org.springframework.remoting.jaxrpc.LocalJaxRpcSer viceFactory.createJaxRpcService(LocalJaxRpcService Factory.java:152)
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.afterPropertiesSet(JaxRpcPortClientI nterceptor.java:226)
at org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean.afterPropertiesSet(JaxRpcPortProxyFac toryBean.java:52)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:801)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:249)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:177)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:159)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:177)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:268)
at org.springframework.context.support.FileSystemXmlA pplicationContext.<init>(FileSystemXmlApplicationContext.java:60)
at jaxrpc.ServiceLauncher.bind(ServiceLauncher.java:2 7)
at jaxrpc.ServiceLauncher.main(ServiceLauncher.java:3 1)
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:
1. url
2. namespaceUri
3. portName
4. serviceName
Below is the wsdl file I am using:
<?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>
Please help!!! Also read the relevant sections from Rod's book "J2EE Development Without EJB" but I'm still not winning
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
<beans>
<bean id="HelloWorldService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean">
<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>
I have tried changing the namespaceUri and serviceName to every possible configuration I can think of but I always get the following exception:
INFO: Creating shared instance of singleton bean 'HelloWorldService'
2004/09/22 12:29:33 org.springframework.beans.factory.support.Abstract BeanFactory destroySingletons
INFO: Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [HelloWorldService]; Root of BeanFactory hierarchy}
Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: 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.createServic e(ServiceFactory.java:232)
at org.springframework.remoting.jaxrpc.LocalJaxRpcSer viceFactory.createJaxRpcService(LocalJaxRpcService Factory.java:152)
at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.afterPropertiesSet(JaxRpcPortClientI nterceptor.java:226)
at org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean.afterPropertiesSet(JaxRpcPortProxyFac toryBean.java:52)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:801)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:249)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:177)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:159)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:177)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:268)
at org.springframework.context.support.FileSystemXmlA pplicationContext.<init>(FileSystemXmlApplicationContext.java:60)
at jaxrpc.ServiceLauncher.bind(ServiceLauncher.java:2 7)
at jaxrpc.ServiceLauncher.main(ServiceLauncher.java:3 1)
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:
1. url
2. namespaceUri
3. portName
4. serviceName
Below is the wsdl file I am using:
<?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>
Please help!!! Also read the relevant sections from Rod's book "J2EE Development Without EJB" but I'm still not winning