Hello
we have a project that calls an external REST service to pass XML data to produce documents.
We have noticed that in v12.1 this worked correctly. In 12.3 it seems to exclude the attachment (part of the message body). It seems to be one of these files that differs in the BF versions:
hwweb.jar
sxforms.jar
xengine.jar
xplatform.jar
Can you please look into his ASAP, as this is impacting on delivery to a large client.
Thanks
we have a project that calls an external REST service to pass XML data to produce documents.
We have noticed that in v12.1 this worked correctly. In 12.3 it seems to exclude the attachment (part of the message body). It seems to be one of these files that differs in the BF versions:
hwweb.jar
sxforms.jar
xengine.jar
xplatform.jar
Can you please look into his ASAP, as this is impacting on delivery to a large client.
Thanks
RE: REST Service call in BizFlow12.3
I'm afraid we will need a lot more details to be able to track down the issue here.
Are you able to provide a project export, and the full logs for the working and broken scenarios?
What do you mean by 'it seems to exclude the attachment'? Is this a fragment of XML data?
Should this be in the request message sent, or the response received?
Is the rest of the message correct?
Are you getting any errors reported?
How is this message being constructed?
How is the remote service configured in WebMaker?
Hopefully with some more details we can track down what is going on.
Regards,
Gerard
RE: REST Service call in BizFlow12.3
sorry, I was typing quickly before i had to leave - i realise that i didn't give you much to go on!
We've switched in old versions of the four jars I mentioned in the original post. It successfully generated the document. I then copied in the current versions one by one. It continued to work with hwweb.jar, sxforms.jar and xengine.jar until I copied in xplatform.jar as well. It then failed. Re-replacing xplatform.jar then again successfully generated the document.
I've sent logs for the working and broken scenarios to your support@hyfinity.com account - this has both a failed attempt, and a successful attempt in it.
By 'it seems to exclude the attachment' we mean that it makes the call to the service but does not seem to include the attachement - yes this is a fragment of XML data.
It should be in the request message sent and we then receive a guid back.
The rest of the message appears to be correct.
We get an error from the REST service but can't see one from the BF/WM side.
I've also sent you an export of the project so you can hopefully see how the message being constructed and the remote service is configured in WebMaker.
Thanks for all your help.
RE: REST Service call in BizFlow12.3
Thanks for the additional information.
Can you clarify where in the logs I can see the working and broken calls?
Am I correct in assuming it is the call from AdHocDoer that we are looking at?
If so, I can see a call with timestamp 29-07-2016 at 09:02:12.169 which seems to be successful, but I am not sure when the failed one is made.
Thanks,
Gerard
RE: REST Service call in BizFlow12.3
Yep, it is the Ad Hoc Doer call. I think that the reset of TomCat i performed may have reset the log. Apologies - i have sent you the correct log now.
RE: REST Service call in BizFlow12.3
Thanks for the additional log file.
From comparing both there only seems to be minor differences between the two requests. Can you explain exactly what is wrong with the second one to cause it to fail? I'm not sure what section is the 'attachment' information that you mentioned previously.
Also, are the two scenarios talking to the same REST server, as I've noticed that the list of documents returned in the Prepare controller seems to be different, which I think causes some of the changes in the later requests.
Thanks,
Gerard
RE: REST Service call in BizFlow12.3
we don't know what is wrong with the second request to cause it to fail, other than that the xml does not appear to be being submitted. The 'attachment' is the xml document that we are trying to send via the service.
Both scenarios are talking to the same REST server. I did a find and replace to remove the client name on the original file, but forgot to do that on the second file. Could this account for the differences you are seeing?
[hr][/hr]
Also, although the logs suggest that data is being submitted, we have had Wireshark on the target server shows the XML is not included in the body text of the REST Service Post call.
RE: REST Service call in BizFlow12.3
Thanks, that definitely helps to explain things.
I will do some more investigation into what might have changed in the call handling to explain why the content might not be sent even though the logs say it has been.
To help with this, can you confirm the exact two WebMaker versions (working and broken) that you have? I believe BizFlow 12.1 was WM 5 and 12.3 was WM 7, but to confirm the exact patch version etc, can you check the Implementation Version strings from within the manifest file inside each JAR?
As you seem to have narrowed it down to just a change in the xplatform.jar, then this is the one to check.
It would probably also be worth setting the platform log level to debug and rerunning the failed scenario to see if this gives any useful output.
Thanks,
Gerard
RE: REST Service call in BizFlow12.3
I have looked into this a bit, and I think I can see a possible reason for the behaviour you are seeing.
If you have not installed WebMaker patch 5.0.0.0002 in your BizFlow 12.1 installation (which I think was released as part of BizFlow 12.1.0.0005.00), then I believe some changes introduced in this patch (and included in future releases) around calling REST services could be the cause.
This added additional checking of the 'Content-Type' attribute (if present) to decide how to handle the request. If this indicates a non XML type of content, then the content of the root element in the message is assumed to contain the request to send, rather than sending the XML itself. If this is the case, you should see some additional information logs indicating that it is sending non XML content.
In your case you have specified a custom Content-Type that will not be treated as XML. Do you know if you are able to change this from 'application/com.streamserve.sssp-1.0+octet-stream' to 'application/com.streamserve.sssp-1.0+xml' and still successfully call the service? If so, this would probably be your best option.
If not, then another option might be to create a wrapper element around your existing request, and then use the XML String action to convert the existing request XML to a string.
If you then add the xg:HttpHeader configuration section to this new wrapper, and send the wrapper element to the service proxy node I think it should work ok.
If this is the cause of your problems, then hopefully these pointers will help you get it working ok.
If not, or you have any further issues, please let me know and we can investigate further.
Regards,
Gerard
RE: REST Service call in BizFlow12.3
thanks for this.
We tried tried changing the content type to xml from octet-stream to xml - we got a "HTTP call failed. Status: HTTP/1.1 415 Unsupported Media Type</
" error back.
With regard to creating the wrapper, we're not sure what you mean. Would it be possible to give us a few more pointers?
thanks for all your help
RE: REST Service call in BizFlow12.3
That's a shame that changing the content type didn't work.
I've sent you an email with an updated rules file to hopefully illustrate what I meant with the second option.
Please let me know how you get on with this.
Regards,
Gerard
RE: REST Service call in BizFlow12.3
that updated rules file worked a treat! It appears that the wrapper round the content has fixed the issue. Thanks for your help. A true WebMaker guru!!!! ;-)