Description
Issue with Steps to re-produce:
Say, I have 3 (could be 'n') operations in my wsdl. All 3 take the same param type (say CustomParamterType) but internally have different business logic.
Step1- I take the wsdl and run the Axis 2 code gen as follows:
Step 2- There would be '3' different public accessor methods generated in the stub (which is good and expected) take in the same parameter type, then the respective toOM() method generated. Say:
public com.ebay.trinity.identityservice.pres.wsdl.LinkIdentitiesResponseType CreateLinkedIdentities(com.ebay.trinity.identityservice.pres.wsdl.LinkIdentitiesType linkIdentities150) throws java.rmi.RemoteException
public com.ebay.trinity.identityservice.pres.wsdl.ModifyLinkResponseType ModifyLink
(com.ebay.trinity.identityservice.pres.wsdl.LinkIdentitiesType modifyLink140) throws java.rmi.RemoteException
public com.ebay.trinity.identityservice.pres.wsdl.RemoveLinkResponseType RemoveLink
(com.ebay.trinity.identityservice.pres.wsdl.LinkIdentitiesType removeLink132) throws java.rmi.RemoteException
All the above take LinkIdentitiesType param.
In side each of the method, an envolope is formed as follows (auto gen code further)
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), linkIdentities150,optimizeContent(new javax.xml.namespace.QName("", "CreateLinkedIdentities")))
private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.ebay.trinity.identityservice.pres.wsdl.LinkIdentitiesType param, boolean optimizeContent) throws org.apache.axis2.AxisFault {
org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
envelope.getBody().addChild(toOM(param, optimizeContent));
return envelope;
}
private org.apache.axiom.om.OMElement toOM(com.ebay.trinity.identityservice.pres.wsdl.LinkIdentitiesType param, boolean optimizeContent)
throws org.apache.axis2.AxisFault {
try
catch (javax.xml.bind.JAXBException bex)
{ throw org.apache.axis2.AxisFault.makeFault(bex); }}
The above mehods are called by the following calls:
So whenever we make any af the above *Link call, it used to form the envelope as follows:
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><axis2ns1:version
xmlns:axis2ns1="">1.2</axis2ns1:version></soapenv:Header><soapenv:Body><removeLink /////////////////////////////////////////////// CULPRIT //////////////////////////////////////////////////
So all calls finally landing to the Server were being processed for removeLink.
For now, I can fix the aut-generated code for the above methods which takes a extra parameter called apiName which can be passed around without stuff like removeLink & createIdentity being hardcoded. The DISADVANTGE IS THAT we need to have a static stub version which is checked in our code base which can be used in our build time. This is AVOID us from integrating codeGen within our ANT script.
As a dev persion, the problem seems to be:
Lets consider *Link calls..All these above 3 calls take LinkIdentities param. So Axis generates common toEnvelope method which takes LinkIdentities param. Now it should create 4 different "toOM" methods for the following
CreateLinkedIdentities
ModifyLiink
ModifyLiinkReturnGuid
RemoveLink
But some how it creates just one method and inside this, the RemoveLink is always hardcoded.
Attachments
Attachments
Issue Links
- is duplicated by
-
AXIS2-2902 jaxbri databinding cannot handle multiple XML elements of the same type
- Resolved