Rest->Soap->Rest Api Proxy autogenerated policies incompleted

Not applicable

Hello,

I'm trying to generate the automatic rest -> soap conversion API Proxy using this wsdl.

The validation step pass succesfully.

The autogenerated policies are incompleted, endpoint flow are correctly created but the policies for extract variables or assign message to build the soap envelop are empty with this comment:
<!-- THERE WAS A PROBLEM GENERATING THE TEMPLATE. PLEASE CREATE THE REQUEST MANUALLY -->

Could someone tell me what is wrong with this wsdl and how could this behaviour be corrected?

Thanks a lot

Regards, Fabio

0 4 972
4 REPLIES 4

sidd-harth
Participant V

Hi @Fabio Sgrò, I have used the same WSDL and created a Rest - Soap - Rest proxy.

Everything is working as expected. All the Extract/Assign policies are generated automatically. I am not seeing any error.

So nothing is wrong with your WSDL.

Try creating a new proxy.

Please let us know which Apigee Account you are using?

Hi @Siddharth Barahalikar,
I'm using the account fabio.sgro@noovle.it, with noovledemo organization.The new proxy is called ECommerceCreditGateway.

Look at policies about SendProposal flow, expecially SendProposal-build-soap; this is the one we need the most and probably the only one incompleted.

I also insert a screenshot to help you find the problem that I'm seeing.

7033-schermata-2018-06-20-alle-085620europe-rome.png

Also the extractParam one seems wrong...

7034-schermata-2018-06-20-alle-085640europe-rome.png

thanks very much for your help.

Regards, Fabio

Hi @Fabio Sgrò, AFAIK the Rest > Soap > Rest service in Apigee tries to guess & generate all the resources, policies based on the WSDL file. Maybe, in this case, it is not able to guess the header/body elements for WSDL file. So we have to manually construct the Assign Message Policy.

++ @Dino-at-Google @Anil Sagar for more insights.

ylesyuk
Participant V

I've got similar wsdl that generated same problem.


The git project https://github.com/apigee/wsdl2apigee has the code equivalent to the one that +PROXY wizard runs for wsld import.

Looking at the https://github.com/apigee/wsdl2apigee/blob/3a655b957129651007742eb89d12be370503880c/src/main/java/co...

lines 1067-1077 contains condition that tiggers the message (at least in my case:)

		if (xmlUtils.isValidXML(apiMap.getSoapBody()) && apiMap.getSoapBody().getBytes().length < 4096) {			// JIRA-EDGEUI-672			operationPayload = xmlUtils.getXMLFromString(replaceReservedVariables(apiMap.getSoapBody()));		} else {			LOGGER.warning("Operation " + operationName + " soap template could not be generated");			if (soapVersion.equalsIgnoreCase(SOAP_11)) {				operationPayload = xmlUtils.getXMLFromString(emptySoap11);			} else {				operationPayload = xmlUtils.getXMLFromString(emptySoap12);			}		}

The .length < 4096

I am not sure why the limit is here because is is pretty low limit. As my message was about 8k, I changed it to 40960 and recompiled and re-run the project and the proxy was generated successfully.

After you git clone the project;

Change the 4096 value;

execute: mvn install command

run

java -jar wsdl2apigee-1.0.0-jar-with-dependencies.jar -wsdl=<wsdl URL or Path>

that will generate .zip file with a proxy bundle;

import it as a proxy bundle.

UPDATE,

As my colleague @Prakash Jeya Prakash pointed, 4096 is the maximum length for GET request url.

So, another (less dramatic) way to correct the problem is to change GET to POST request and this will remove the check.

Yet this way we change semantics of operation, so the better idea seems to be to generate the error as a WARNING and let a developer to make the decision appropriately.