[ 
https://issues.apache.org/jira/browse/AXIS2-6033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17523867#comment-17523867
 ] 

Raj K commented on AXIS2-6033:
------------------------------

My suggestion is to adjust the imports on parent definition. The method - 
{color:#ff8b00}changeImportAndIncludeLocations {color}is already taking care of 
adjusting imports on all child/referenced xsd, wsdl files . So we can call this 
method with parent definition

In axis2-kernel-1.8.0 - AxisService.java . Highlighted added code in orange

public void printUserWSDL(OutputStream out, String wsdlName, String ip)
throws AxisFault {
Definition definition = null;
// first find the correct wsdl definition
Parameter wsdlParameter = getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
if (wsdlParameter != null) {
definition = (Definition) wsdlParameter.getValue(); {color:#c1c7d0}// This is 
parent definition{color}
}

{color:#ff8b00} if (!wsdlImportLocationAdjusted) {{color}
{color:#ff8b00} changeImportAndIncludeLocations(definition); 
{color:#c1c7d0}//Adjust imports on parent definition and all included xsd, wsdl 
files in parent definition{color}{color}
{color:#ff8b00} wsdlImportLocationAdjusted = true;{color}
{color:#ff8b00} }{color}

if (definition != null) {
try {
printDefinitionObject(getWSDLDefinition(definition, wsdlName),
out, ip); {color:#c1c7d0}// Currently we are adjusting imports on child 
definition if child wsdl file is accessed first{color}
} catch (WSDLException e) {
throw AxisFault.makeFault(e);
}
} else {
printWSDLError(out);
}
}

 

I need to verify scenarios and run some more tests. But please review above and 
let me know if you see any concerns

> wsdl import locations are not getting updated correctly if wsdl is we are 
> importing .wsdl file in wsdl file
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-6033
>                 URL: https://issues.apache.org/jira/browse/AXIS2-6033
>             Project: Axis2
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.7.9, 1.8.0
>            Reporter: Raj K
>            Priority: Major
>
> In org.apache.axis2.description.AxisService#changeImportAndIncludeLocations
> we are updating import locations in wsdl file and any files being imported in 
> the wsdl and marking the service as  wsdlImportLocationAdjusted=true when the 
> service/wsdl is first loaded.  This is having issue if we are importing a 
> .wsdl file in parent wsdl file.
> We have below structure of wsdl
> Main wsdl file - imports 2 files - bindings.wsdl and types.xsd 
> If main wsdl is accessed first then the import locations are getting adjusted 
> in all files and marking the axisservice as  wsdlImportLocationAdjusted=true
> But if bindings.wsdl is accessed first then the import locations in parent 
> are not updated. Only import location in bindings.wsdl and any imported files 
> in this wsdl are getting adjusted. And still the service is getting marked as 
> wsdlImportLocationAdjusted=true. So the parent is never processed for 
> location adjustments as wsdlImportLocationAdjusted is set to true
>  
> Refer below from AxisService
> private synchronized void printDefinitionObject(Definition definition, 
> OutputStream out, String requestIP) throws AxisFault, WSDLException {
> if (this.isModifyUserWSDLPortAddress()) {
> this.setPortAddress(definition, requestIP);
> }
> *if (!this.wsdlImportLocationAdjusted) {*
> this.changeImportAndIncludeLocations(definition);
> this.wsdlImportLocationAdjusted = true;
> }
> WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
> writer.writeWSDL(definition, out);
> }
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to