Page 1 of 1

LANSA Integrator & 3rd Party SOAP Services

Posted: Wed Feb 22, 2017 3:38 am
by trossiter
I am trying to create a solution to validate addresses with a third party SOAP service. The host and service URLs use a secure connection (https://), but when I try to define a connection to the server, LANSA Integrator automatically defaults to an unsecure connection (http://). Is there a way to change this? I've tried entering my service's URL without the 's', and I get a connection timeout. Using the 's', I was able to retrieve the correct .wsdl file for the service I want to use, but I keep getting the following error:

'Compiler runtime error.
Cannot run program "javac.exe" (in directory "C:\Program Files (x86)\LANSAV14\Integrator\Studio\workspace\ValidateAddress\solutions\AddressAgent\compile-agent"): CreateProcess error=2, The system cannot find the file specified.'

This is my first time using Integrator, so I'm not exactly sure what I'm doing here. I'm trying to follow along with example INT009 in the LANSA Documentation, but I think that example is creating a user-defined service to use in the agent solution.

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Thu Feb 23, 2017 1:51 am
by trossiter
Update on my situation. I was able to fix the compiler runtime error by setting the Java Runtime and Compiler settings from the defaults to the executables on my C drive. I must have missed that part in the tutorial. I can now get to where I can map outbound parameters and inbound return values, but now I have a new problem. When I right click on a parameter or return value, the only option available to me is Ignore. So now I cannot map the fields I need to use for the SOAP service.

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Thu Feb 23, 2017 7:34 pm
by HMJust
That sounds strange. I have gotten a couple of SOAP clients up and running with Lansa Integrator and I can't recognize that situation.

So, you have created a solution with the SOAP Agent Wizard tool, right? And picked the WSDL for the service?

In the wizard, the operations are listed in the left hand window and if you select one of these the parameters and return fields are listed on the right?

In that case, it *might* be an issue with the webservice. I am just guessing here, but could this be a situation where the fields in the webservice are so complex that Lansa Integrator simply can't understand them?

Is the webservice API public in any way, because if it is you can link the WSDL here and I can take a look.

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Fri Feb 24, 2017 12:13 am
by trossiter
I changed the outbound parameter and inbound response to fragments, and I can now map my repository fields to the corresponding parts. I was able to get the jar and properties files published to my JSM server and use the generated code. I placed the RDML into a function and the RDMLX in a click routine on a button on a form. Now I have runtime errors on both; the function fails when trying to load the service, and the form fails when trying to open a JSM session. I'm not sure, but I think I might be using an incorrect address somewhere. It's just going to need some more tinkering, I guess.

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Fri Feb 24, 2017 8:50 am
by trossiter
I was using the wrong port for my JSM server on my Use Builtin(JSMX_OPEN) call. I can now get to where it starts to prepare the outbound parameter fragments. The way they are set up, there is one parameter fragment I named REQUEST that is made up of two more fragments named INPUT and OPTIONS. The JSM command that sets the REQUEST fragment goes through just fine (JSMXSTS is returned as OK). The next command tries to set the INPUT fragment, which contains my mapped repository fields, within a loop. However, this is where my program fails now. JSMXSTS is returned as ERROR and JSMXMSG reads "SOAPAgentParameter: parameter has no prepared fragment <insert actual name of REQUEST fragment>".

I am currently just using the generated RDMLX code after building the service solution in the SOAP Wizard with the exception of defining the server to use in the JSMX_OPEN call. I was thinking about changing the order the fragments are set, but I don't know if that will only give me more problems. Is there anything else I could be missing?

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Fri Feb 24, 2017 6:13 pm
by HMJust
My initial thinking (based on your description and not seeing your code) is that changing the order of the fragments could only be relevant in your code, not in the setup in Integrator.

Have you tried the sample RDML(X) that Integrator generates? I usually use that as a starting point and "just" fill in the real logic where indicated.

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Sat Feb 25, 2017 12:21 am
by trossiter
That's what I'm using. The first SET FRAGMENT command for the overall fragment goes through OK, but the next SET FRAGMENT command for the first subfragment is where it fails. It is inside a loop (I'm guessing to get all mapped fields). I did add a leave statement before the CHECK subroutine to leave the loop if it fails because it was getting stuck in the loop when it failed and an If condition at the end of each command block to end the routine if the JSM status was not OK.

Code: Select all

* Set parameter - VALIDATEADDRESSREQUEST
Change Field(#JSMXCMD) To('SET PARAMETER(VALIDATEADDRESSREQUEST)')
Use Builtin(JSMX_COMMAND) With_Args(#JSMXHDLE1 #JSMXCMD) To_Get(#JSMXSTS #JSMXMSG)
Execute Subroutine(CHECK) With_Parms(#JSMXSTS #JSMXMSG)
If Cond('#JSMXSTS *EQ ERROR')
Goto Label(END)
Endif

* Set fragment - REQUEST
Change Field(#JSMXCMD) To('SET FRAGMENT(REQUEST) SERVICE_EXCHANGE(*FIELD)')
Use Builtin(JSMX_COMMAND) With_Args(#JSMXHDLE1 #JSMXCMD) To_Get(#JSMXSTS #JSMXMSG)
Execute Subroutine(CHECK) With_Parms(#JSMXSTS #JSMXMSG)
If Cond('#JSMXSTS *EQ ERROR')
Goto Label(END)
Endif

* <<< Enter the fragment loop logic for INPUT >>>

Begin_Loop /* INPUT */
* Set fragment loop - INPUT
Change Field(#JSMXCMD) To('SET FRAGMENT(REQUEST) SERVICE_EXCHANGE(*FIELD)')
Use Builtin(JSMX_COMMAND) With_Args(#JSMXHDLE1 #JSMXCMD) To_Get(#JSMXSTS #JSMXMSG)
Leave If('(#JSMXSTS *EQ NOFRAGMENT) *OR (#JSMXSTS *EQ ERROR)')
Execute Subroutine(CHECK) With_Parms(#JSMXSTS #JSMXMSG)
If Cond('#JSMXSTS *EQ ERROR')
Goto Label(END)
Endif
End_Loop /* INPUT */
If there is something I need to write in place of the comment with <<< >>>, I don't know what that is. Would I use Exchange Fields() with the fields I need to map?

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Sat Feb 25, 2017 12:38 am
by HMJust
Are you sure that's right? I think you are setting the same fragment (REQUEST) twice.

Code: Select all

Change Field(#JSMXCMD) To('SET FRAGMENT(REQUEST) SERVICE_EXCHANGE(*FIELD)')
The second one should probably be

Code: Select all

Change Field(#JSMXCMD) To('SET FRAGMENT(INPUT) SERVICE_EXCHANGE(*FIELD)')

Re: LANSA Integrator & 3rd Party SOAP Services

Posted: Sat Feb 25, 2017 12:53 am
by trossiter
It is, that was a typo on my part.

Reading up on the SOAP service tutorial some more, I saw in the example form they use that the names of the fields being used is not just the field name in the repository, i.e. the DEPTMENT field is called in_dept, and DEPTMENT is set to this value before that particular parameter is set.

I was hoping that if I just use the fields' given names that they would automatically be mapped to the service since those are the names I used for the fields to be mapped.