Hello IBMi Community,
We must exchange SOAP requests with a partner who imposes the structure of the request and the response, we have chosen to use the integrated IWS server because the business application is designed in RPGLe, the exposure is simple with this process.
But ... As much as we manage to read the request by playing with the customization of the wsdl, on the other hand the answer is more complicated because precise namespaces are expected in return I do not see how to manage them. We answer but the structure is not "readable" by the partner because namespaces are missing.
On the RPG side, procedure with input and output parameter, nesting of DS nothing more normal :
The interface :
The SOAP request Content-Type text/xml :
Our answer :
Expected answer :
The difference is in the added element prefixes and namespaces. Do you know if it is possible to manage this with the IBMi IWS server ? I searched without success.
If someone has already experienced this situation, what was the choice of technical solution ?
API Gateway?
CGI DIY (never practiced), if yes, can we do SOAP ?
IWS REST POST XML, quid Content-type compatibility ?
Thanks in advance to the whole IBMi community, it's a real call for help.
Jérémie.
We must exchange SOAP requests with a partner who imposes the structure of the request and the response, we have chosen to use the integrated IWS server because the business application is designed in RPGLe, the exposure is simple with this process.
But ... As much as we manage to read the request by playing with the customization of the wsdl, on the other hand the answer is more complicated because precise namespaces are expected in return I do not see how to manage them. We answer but the structure is not "readable" by the partner because namespaces are missing.
On the RPG side, procedure with input and output parameter, nesting of DS nothing more normal :
The interface :
Code:
dcl-proc DdeValoPecracAudRequest export; dcl-pi *n extproc(*dclcase); Pecrac_Aller likeds(ds_VIAMEDIS_Flux_Audioprothese_Aller) const; Pecrac_Aud_Retour likeds(ds_VIAMEDIS_Flux_Audioprothese_Retour); end-pi;
HTML Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns16:DdeValoPecracAudRequest xmlns="vm:pecrac:audioprothese:entete_v1.xsd" xmlns:ns2="vm:pecrac:audioprothese:ps_v1.xsd" xmlns:ns16="http://interface.pecracAudioprothese.webservice.capsante.net/"> <ns8:Pecrac_Aller xmlns="vm:pecrac:audioprothese:entete_v1.xsd" xmlns:ns2="vm:pecrac:audioprothese:ps_v1.xsd" xmlns:ns3="vm:pecrac:audioprothese:assure_v1.xsd" xmlns:ns4="vm:pecrac:audioprothese:beneficiaire_v1.xsd" xmlns:ns5="vm:pecrac:audioprothese:dossier_v1.xsd" xmlns:ns6="vm:pecrac:audioprothese:actes_v1.xsd" xmlns:ns7="vm:pecrac:audioprothese:infosfiltre_v1.xsd" xmlns:ns8="vm:pecrac:audioprothese:pecrac_flux_aller_v1.xsd"> <Entete_Aud> <DateEmission>2023-05-15</DateEmission> <HeureEmission>15:05:57</HeureEmission> <Origine>XXXXX</Origine> <IDUnique>1684155957780</IDUnique> <TypeMessage>XXXX</TypeMessage> <NatureMessage>TEST</NatureMessage> <TypeDemande>XXXXX</TypeDemande> </Entete_Aud> <ns2:PS_Aud> <ns2:Finess>912607223</ns2:Finess> <ns2:RaisonSociale>PDS</ns2:RaisonSociale> <ns2:NomPs>UUUUUUU</ns2:NomPs> <ns2:PrenomPs>JULIEXXX</ns2:PrenomPs> <ns2:Adresse1>11 GRANDE RUE</ns2:Adresse1> <ns2:Adresse3></ns2:Adresse3> <ns2:Adresse4></ns2:Adresse4> <ns2:CodePostal>91800</ns2:CodePostal> <ns2:Ville>BRUNOY</ns2:Ville> </ns2:PS_Aud> </ns8:Pecrac_Aller> </ns16:DdeValoPecracAudRequest> </soap:Body> </soap:Envelope>
HTML Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <DdeValoPecracAudResponse xmlns="http://interface.pecracAudioprothese.webservice.capsante.net/"> <Pecrac_Aud_Retour> <Entete_Aud> <DateEmission>2023-05-15</DateEmission> <HeureEmission>15:05:57</HeureEmission> <Origine>XXXXX</Origine> <IDUnique>1684155957780</IDUnique> <TypeMessage>REPONSE_XXXXX</TypeMessage> <NatureMessage>TEST</NatureMessage> <TypeDemande>XXXXX_RESEAU</TypeDemande> </Entete_Aud> <Dossier_Aud> <Numero>229635482</Numero> <NumeroExterne></NumeroExterne> <CodeActe>PAZ</CodeActe> <DateCreation>2023-05-15</DateCreation> <HeureCreation>15:05:56</HeureCreation> <DatePrescription>2023-05-11</DatePrescription> </Dossier_Aud> </Pecrac_Aud_Retour> </DdeValoPecracAudResponse> </soap:Body> </soap:Envelope>
Expected answer :
HTML Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <DdeValoPecracAudResponse xmlns="http://interface.pecracAudioprothese.webservice.capsante.net/"> <ns5:Pecrac_Aud_Retour xmlns:ns5="vm:pecrac:audioprothese:pecrac_flux_retour_v1.xsd" xmlns="vm:pecrac:audioprothese:entete_v1.xsd" xmlns:ns2="vm:pecrac:audioprothese:dossier_v1.xsd"> <Entete_Aud> <DateEmission>2023-03-08</DateEmission> <HeureEmission>12:39:09</HeureEmission> <Origine>XXXXX</Origine> <IDUnique>1678275549017</IDUnique> <TypeMessage>REPONSE_XXXXXXX</TypeMessage> <NatureMessage>TEST</NatureMessage> <TypeDemande>XXXXXXX</TypeDemande> </Entete_Aud> <ns2:Dossier_Aud> <ns2:Numero>228635758</ns2:Numero> <ns2:NumeroExterne/> <ns2:CodeActe>PAU</ns2:CodeActe> <ns2:DateCreation>2023-03-08</ns2:DateCreation> <ns2:HeureCreation>12:39:08</ns2:HeureCreation> <ns2:DatePrescription>2023-03-08</ns2:DatePrescription> </ns2:Dossier_Aud> </ns5:Pecrac_Aud_Retour> </DdeValoPecracAudResponse> </soap:Body> </soap:Envelope>
If someone has already experienced this situation, what was the choice of technical solution ?
API Gateway?
CGI DIY (never practiced), if yes, can we do SOAP ?
IWS REST POST XML, quid Content-type compatibility ?
Thanks in advance to the whole IBMi community, it's a real call for help.
Jérémie.
Comment