Does anyone have a serviceProperties.xml file that I can use as an example to create a MQ service using API?
What are you setting for the 'Content-Type' HTTP header? That error looks like a basic HTTP header verification issue, probably unrelated to whether you're using a supported transport protocol for your VS.
To answer your original question: You can create a VS with the *old* 'IBM MQ Series' transport protocol through the portal. It requires to to first generate your VS once using Workstation and save the .vrs recording session file at the end of that process. Then you can use that .vrs file to generate more VSs with the same parameters through the portal.
I haven't tried doing that with the API, but it should work the same way.
We basically don't yet support this with the newer 'IBM MQ Native' protocol, as its .vrs is not self-contained.
Is it possible to create a MQ service by Req/Resp files using the API?
The product documentation for the relevant API (here) has this section
When creating a virtual service from request/response pairs, the following assumptions are made:
So, officially no.
You can obtain more control if you use a VRS file, however. The same area of the document contains
In addition to the serviceProperties.xml configuration, a Virtual Recording Session (VRS) file can be included to configure the protocol handler to use when importing request/response pairs. This file must have a .vrs extension.
You can create a VRS file from the service recorder in Workstation.
If you still have trouble getting the API to do what you want, there is also the ServiceImageManager command line utility in the "bin" folder of your installation. Here you can set transport protocols:
-t protocol, --transport=protocol Specifies the transport protocol to use during an import operation. Valid protocols are: TCP CICS LINK (DPL), DTP (MRO, LU6.1, LU6.2) HTTP/S Opaque Data Processing IBM MQ Native IBM MQ Series (Deprecated) JMS Standard JMS (Deprecated) RabbitMQ Java JDBC (Driver based) CICS Transaction Gateway (ECI) DRDA IMS Connect SAP RFC via JCo JCo IDoc Protocol
This may be a way to achieve what you need
I tryed by command line:
ServiceImageManager.exe -t "IBM MQ Native" -r "SWIFT Data Protocol" -R "SWIFT Data Protocol" -s mq1.vsi -m mq1.vsm -v "c:\francis\mq_example.vrs" -i "C:\francis\MT202.TXT" -C "C:\francis\project.config"
The error presents:
2018-02-02 19:12:57,471Z (17:12) [main] ERROR System.err - An error occurred processing the command.2018-02-02 19:12:57,472Z (17:12) [main] ERROR System.err - java.lang.RuntimeException: An error occurred trying to perform the import operation.2018-02-02 19:12:57,472Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.ServiceImageManager.doImport(ServiceImageManager.java:432)2018-02-02 19:12:57,473Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.ServiceImageManager.main(ServiceImageManager.java:151)2018-02-02 19:12:57,473Z (17:12) [main] ERROR System.err - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)2018-02-02 19:12:57,474Z (17:12) [main] ERROR System.err - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)2018-02-02 19:12:57,474Z (17:12) [main] ERROR System.err - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)2018-02-02 19:12:57,475Z (17:12) [main] ERROR System.err - at java.lang.reflect.Method.invoke(Method.java:498)2018-02-02 19:12:57,475Z (17:12) [main] ERROR System.err - at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)2018-02-02 19:12:57,476Z (17:12) [main] ERROR System.err - at com.exe4j.runtime.WinLauncher.main(Unknown Source)2018-02-02 19:12:57,477Z (17:12) [main] ERROR System.err - at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)2018-02-02 19:12:57,477Z (17:12) [main] ERROR System.err - Caused by: java.lang.RuntimeException: An error occurred trying to perform the import operation.2018-02-02 19:12:57,477Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.ServiceImageManager.doImport(ServiceImageManager.java:505)2018-02-02 19:12:57,478Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.ServiceImageManager.doImport(ServiceImageManager.java:429)2018-02-02 19:12:57,479Z (17:12) [main] ERROR System.err - ... 8 more2018-02-02 19:12:57,479Z (17:12) [main] ERROR System.err - Caused by: java.lang.IllegalArgumentException: Unsupported import tag, <null>, specified.2018-02-02 19:12:57,479Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.recorder.DefaultRecordingSession.importTransactions(DefaultRecordingSession.java:579)2018-02-02 19:12:57,480Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.recorder.RecordingSession.importTransactions(RecordingSession.java:424)2018-02-02 19:12:57,480Z (17:12) [main] ERROR System.err - at com.itko.lisa.vse.stateful.ServiceImageManager.doImport(ServiceImageManager.java:495)2018-02-02 19:12:57,481Z (17:12) [main] ERROR System.err - ... 9 more
Sending attached the files that I used and my svcimgmgr.log file.
Do you have any idea for this error?
As per Kevin's response, the newer MQ steps aren't supported when using a vrs. The older steps will be, but are deprecated - so there would be very limited support available should you encounter difficulties.
I tried MQ RR pairs with a serviceProperties.xml file which I created and it didn't work for me. I got the below error in Postman when I tried the POST URL as http://localhost:1505/api/Dcm/VSEs/VSE/actions/createService
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 Error.xsd" type="application/vnd.ca.lisaInvoke.error+xml" xmlns="http://www.ca.com/lisa/invoke/v2.0"><Id>1009</Id><Message>Unsupported Media Type (Please, check Content-Type header.)</Message></Error>
As far as I know in Invoke API V2, don't think we support MQ protocol as Portal doesn't support it. I am not sure is there a way, we can do it.
I am attaching the sample zip file I tested.
Prema and Kevin,
Thanks for the answer. I will try by command line using the vrs. I let you know the results.
I tried using VRS and the service was generated. I will verify if the OLD MQ is sufficient for the customer.
The service is been created in VSE, but present some errors after that:
Asset not found config://queue-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I think those errors occurred because I need to send the assets inside the zip file. Is it possible to send the project.config and the assets inside the zip file when generating the service by API?
Like I said, it's not really supported for the new 'IBM MQ Native' protocol, for exactly the reason you have discovered.
You need to be using the old 'IBM MQ Series' protocol, which does not depend on extra config being present.
Retrieving data ...