- Previous thread: Wrapping existing service bean
- Next thread: Versioning of Web Services using Interfaces
- Threads sorted by date: cxf-users 201006
Hello,
I’m running into an issue using CXF with a legacy Corba application and am
looking for some advice.
Currently I have a CXF 2.2.9 client up and communicating with a pure corba
server using java 1.6 with sun’s orbd and idlj. In this setup, the wsdl
location is specified using a corbaname address and in the
client I’m instantiating the corba service and port objects directly. This
is based directly upon the corba/hello-world example in the CXF samples
directory. So far so good.
The change I’m trying to make is to remove the corba address from the wsdl
because I don’t want host and port values hard-coded there. My intended
approach is to use a ClientProxyFactoryBean in the client (rather than
instantiating the corba service object directly) and specify the corbaname
address at runtime.
So based upon the original hello-world example, my updated service looks
like:
And my updated client looks like:
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(HelloWorld.class);
factory.setAddress("corbaname::localhost:1050#HelloWorld");
HelloWorld client = (HelloWorld) factory.create();
String result = client.greetMe("Hello There");
Running this, I end up with a NullPointerException:
Exception in thread "main" java.lang.NullPointerException
at
org.apache.cxf.binding.corba.TypeMapCache.get(TypeMapCache.java:40)
at
org.apache.cxf.binding.corba.CorbaConduit.(CorbaConduit.java:84)
at
org.apache.cxf.binding.corba.CorbaBindingFactory.getConduit(CorbaBindingFactory.java:110)
at
org.apache.cxf.binding.corba.CorbaBindingFactory.getConduit(CorbaBindingFactory.java:105)
at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:78)
at
org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:61)
at
org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:743)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:68)
at $Proxy38.greetMe(Unknown Source)
at cxf.client.Client.main(Client.java:47)
I’m seeing that DescriptionInfo never gets included as part of the
ServiceInfo when buildServiceFromClass() is called on
ReflectionServiceFactoryBean; whereas DescriptionInfo does eventually get
set if instead buildServiceFromWSDL(…) is called. It’s the null
DescriptionInfo that eventually trips things up.
So in summary: Can someone help me get this running? Or is there a better
way to go about pulling host and port values out of my wsdl? Or is there
some documentation out there that I’m missing?
Thanks,
Andrew
On Friday 25 June 2010 12:47:01 pm Andrew Lamb wrote:
Way cool. I was actually wondering if someone outside of IONA/Progress's
customers were using the CORBA binding. :-)
I think you need to add the factory.setWsdlLocation(....) call in there to
give it the location of the WSDL that would have the type mapping and such in
it. That alone may solve it. Let me know how it works out.
Dan
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Way cool. I was actually wondering if someone outside of IONA/Progress's
customers were using the CORBA binding. :-)
I think you need to add the factory.setWsdlLocation(....) call in there to
give it the location of the WSDL that would have the type mapping and such in
it. That alone may solve it. Let me know how it works out.
Dan
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Thanks Dan,
For anyone interested this is what I ended up with in my client (the wsdl
didn't require any further changes):
QName SERVICE-NAME = new
QName("http://cxf.apache.org/schemas/cxf/idl/HelloWorld",
"HelloWorldCORBAService");
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass( HelloWorld.class );
factory.setWsdlLocation( "file:resources/HelloWorld-corba.wsdl" );
factory.setAddress( "corbaname::localhost:1050#HelloWorld" );
factory.setServiceName( SERVICE-NAME );
HelloWorld client = (HelloWorld) factory.create();
So in addition to the setWsdlLocation(...) suggestion, I also needed to call
setServiceName(...). And finally I was only able to get this to work using
a JaxWsProxyFactoryBean factory (rather than my earlier choice of
ClientProxyFactoryBean.)
>
Related Threads
- PATCH - USB: gadget: storage_common: comments updated - linux-usb
- Xen-devel - PATCH - : as requested, disable_migrate support for libxl - xen-devel
- project types missing in ubuntu (netbeans) - ubuntu-users
- Installing GoogleEarth - gnu-bug-make
- About python support on Windows - vim-use
- New static analysis tool recommended by Mozilla: sixgill.org - wine-devel
- Portable Ivy - ant-ivy-user
- StorageProxy.mutate - cassandra-user
- platform-dev - howto build run and deploy a netbeans platform application without ide, using Ant - netbeans-platform-dev
Related Lists
- activemq-users
- ant-ivy-user
- ant-user
- axis-c-user
- axis-java-user
- buildr-users
- camel-users
- cayenne-user
- click-user
- cocoon-users
- commons-user
- continuum-users
- cxf-users
- db-derby-user
- directory-users
- felix-users
- geronimo-user
- hadoop-chukwa-user
- hadoop-common-user
- hadoop-general
- hadoop-hbase-user
- hadoop-hive-user
- hadoop-mapreduce-user
- hadoop-pig-user
- hadoop-zookeeper-user
- harmony-dev
- hc-httpclient-users
- httpd-users
- ibatis-user-java
- incubator-general
- jackrabbit-users
- jakarta-jmeter-user
- james-server-user
- logging-log4j-user
- lucene-general
- lucene-java-user
- lucene-lucene-net-user
- lucene-mahout-user
- lucene-nutch-user
- lucene-solr-user
- lucene-tika-user
- maven-users
- mina-ftpserver-users
- mina-users
- myfaces-users
- ode-user
- ofbiz-user
- openejb-users
- openjpa-users
- pdfbox-users
- perl-modperl
- pivot-user
- poi-user
- portals-jetspeed-user
- qpid-users
- servicemix-users
- sling-users
- spamassassin-users
- struts-user
- subversion-users
- synapse-user
- tapestry-users
- tomcat-users
- tuscany-user
- wicket-users
- xerces-c-users
- xmlgraphics-fop-users