java - How to create SOAP Client with shared objects -


I am trying to create a Java client to consume SAP services that are created by another team.

Services use a series of related items

  • com.company.WSException
  • com.company.Customer
  • Com.company.Employee

Then I have related WSDL files:

  • service.company.com/Customer.srv?wsdl
  • service.company.com/ employee-rv? Wsdl

When I use wsdl2java on the customer, the service works great The only thing for the employee is to create both WSDL files WSException files. I have verified with a diff tool that the generated files are similar. However, when I run wsdl2java against both wsdl2java, my test program throws a long chain of exceptions.

To test, I am generating a stub code from the command line:

  wsdl2java -key main-warbose-d src \ main \ Java service.company.com /Customer.srv?wsdl wsdl2java-client-impl-verbose-d src \ main \ Java service.company.com/Employee.srv?wsdl  

I have separate binding files for each service Before making it it has taken it around and bound it in a different package. Although it is generating ALAT of unnecessary code and using the library is very cumbersome. Is there any more effective way to work with related services like this?

There is a sample of the exceptions I get when using two services for clarity:

  Exception threads "main" javax.xml.ws.WebServiceException: org.apache.cxf.jaxws.ServiceImpl.getPort (ServiceImpl.java:334) on javax.xml.ws.Service .ServiceImpl.getPort on OrgkapachekcxfkservicekfactorykServiceConstructionException Orgkapachekcxfkjaxws K At getPort (ServiceImpl.java319) (Service.java:119) org.tempuri.People.getBasicHttpBindingIPeople at com.gallup.oms (People.java:79). Because of TestDriver.main (TestDriver.java:38): On org.apache.cxf.jaxb.JAXBDataBinding.initialize (JAXBDataBinding.java:332) on org.apache.cxf.service.factory.ServiceConstructionException org.apache.cxf . Service.factory.AbstractServiceFactoryBean.initializeDataBindings (AbstractServiceFactoryBean.java:86) org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL (mirrored) rviceFactoryBean.java:434) org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel (ReflectionServiceFactoryBean.java:538) .apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create (org.apache.cxf on) organization org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create (ReflectionServiceFactoryBean.java:252. Org.apple.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint (AboveWSDLBsAndPointFactorJavaAdvertiser) at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create (org.applebusiness.java205) on org.apache at frontend.clientfactoryBean.create) (JaxWsProxyFactoryBean.create : 156) on org.apache.c At xf.frontend.ClientProxyFactoryBean.create (ClientProxyFactoryBean.java:156) (ClientFactoryBean.java:90). Cxf.jaxws.ServiceImpl.createPort (ServiceImpl.java:465) on org.apache.cxf.jaxws.ServiceImpl.getPort (ServiceImpl.java:332) ... 4 and its reason: com.sun.xml.bind.v2 .Retim.Legal Annotation Exception: 72 Counts of Ill: For example, there is no ObjectFactory with @ XmlElementDecl for the Annotation Exception element {http://schemas.company.com/oms/2010/10/}request this problem is the following location related: protect javax.xml.bind.JAXBElement com.company.schemas.oms._2010._10.AddPrivilege.request   < H2> Edit  

I simplified the situation for brevity Land in reality I am working with a dozen related services and Dblyuesdiel files, for example using various shared objects such WSEESS object.

Edit 2

Based on this ticket, and the name of the additional name collision I have just figured out that I am closing it because these services are not worth the effort to automate With the current implementation of I have to come up with a solution to deal with the messy code. At least until the CXF Dev team comes up with updates to handle overlapping services in such a way.

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -