Author Topic: [Composer] Blank Response from Web Service  (Read 2145 times)

Offline Sosy

  • Newbie
  • *
  • Posts: 44
  • Karma: 0
[Composer] Blank Response from Web Service
« on: November 05, 2019, 01:07:44 AM »
Hi guys,
we're facing an issue with Web Service calls in Composer...
First I have to say that we're not facing the same problem when we perform the request via SOAP UI. Everything is fine there.
When it comes to Composer, however, we keep getting a blank response.
We're calling the web service via VXML Form Block, configured as follow:

Quote
<block>
<if cond="(AppState.COMPOSER_WSSTUBBING == '1') || (AppState.COMPOSER_WSSTUBBING == 1)" >
            <!-- Web Service is stubbed !! -->
            
            
                   <var name="WebUrl" expr="''"/>
                     <assign name="AppState.esito" expr="''"/>
                     <log> Stubbing: assigned "AppState.esito"="" /> </log>
            <goto next="#Log_Response" />
         </if>
      
            
      <!-- Stubbing is Off - normal processing continues -->
      
      
      <script>
         var requestObj = new Object();
         requestObj['WebUrl']    = 'https://xxx;
         requestObj['MethodName']='xxx';
         requestObj['Protocol']   = 'SOAP';
         requestObj['AuthenAccess']= 'HTTPBasicAuthentication';
         requestObj['UserName']   = 'xxx';
         requestObj['Password']   = 'xxx';
         requestObj['enableProxy']=false;
         requestObj['proxyHost']='';
         requestObj['proxyPort']=80;
         requestObj['proxyUserName']='';
         requestObj['proxyPassword']='';
         requestObj['SOAPActionURI']      ='urn:sap-com:document:sap:rfc:functions:xxx:xxx';
         requestObj['targetNameSpaceUri']='urn:sap-com:document:sap:rfc:functions';
         requestObj['KeyStorePass']='';
         requestObj['KeyStoreFilePath']   ='';
         requestObj['PrivateKeyPass']   ='';
         requestObj['PrivateKeyAlias']   ='';
         requestObj['CertStoreName']      ='';
         requestObj['CertAlias']         ='';
         requestObj['SigAlgorithm']      ='DSA';
         requestObj['NameSpaceMap']      ='{"wsdl"="http://schemas.xmlsoap.org/wsdl/", "soap11"="http://schemas.xmlsoap.org/wsdl/soap/", "soap12"="http://schemas.xmlsoap.org/wsdl/soap12/", "http"="http://schemas.xmlsoap.org/wsdl/http/", "mime"="http://schemas.xmlsoap.org/wsdl/mime/", "wsp"="http://www.w3.org/ns/ws-policy", "wsp200409"="http://schemas.xmlsoap.org/ws/2004/09/policy", "wsp200607"="http://www.w3.org/2006/07/ws-policy", "ns0"="http://xxx.it/", "xsd"="http://www.w3.org/2001/XMLSchema"}';
           requestObj['EnableNSPrefix'] = false;
           requestObj['PrefixForChildTags'] = false;
           requestObj['CustomPrefix'] = '';
           requestObj['AppStateString'] = JSON.stringify(AppState);
           requestObj['VariableScope'] = 'AppState.';
           requestObj['CustomSOAPEnvFileName']='//src//soap//test.xml';   
         var parameters = [];
       
         requestObj['Timeout'] = '60';
         requestObj['Parameters'] = parameters;
      </script>
      <data name="WS_RicercaRitiriResponse" enctype="application/json" gvp:contentexpr="requestObj" method="post" src="../include/getWebServiceData.jsp" />
      
         
            
                     <assign name="AppState.esito" expr="WS_RicercaRitiriResponse"/>
            <if cond="typeof WS_RicercaRitiriResponse.errorMsg == 'undefined'">
            <goto next="#Log_Response" />
         <else/>
              <throw event="error.com.genesyslab.composer.webservice.badFetch" messageexpr="WS_RicercaRitiriResponse.errorMsg" />
           </if>   
</block>

   <catch event="error.badfetch">
            <goto next="#Timeout" />
          </catch>
         <catch event="error.com.genesyslab.composer.webservice.badFetch">
            <goto next="#Timeout" />
    </catch>


The same configuration has been used for another Web Service call that is pretty much the "twin" of the one that is currently not working.
When we call the application, no error is thrown but we get a blank response:

Quote
2019-11-04 15:56:07.993 DBUG 007701DC-1000C377 5980 0C000000 VXMLSession.cxx:1348 HandleFetchEvent(): Process state: 2, response code: 200, error: , uri: http://10.207.173.205:8080/Test/include/getWebServiceData.jsp
2019-11-04T15:56:07.993 Trc 20001 INFO 007701DC-1000C377 5980 02B68719 Compile Done|0ms|http://10.207.173.205:8080/Test/include/getWebServiceData.jsp
2019-11-04T15:56:07.993 Trc 20001 INFO 007701DC-1000C377 5980 02B6871A Fetching Done|875ms|data|http://10.207.173.205:8080/Test/include/getWebServiceData.jsp
2019-11-04T15:56:07.993 Int 50043 007701DC-1000C377 5980 fetch_end Done (direct):http://10.207.173.205:8080/Test/include/getWebServiceData.jsp
2019-11-04 15:56:07.993 DBUG 007701DC-1000C377 5980 0C000000 VxmlRuntimeRoot.cxx:213 Execute() Started, event type: 1
2019-11-04 15:56:07.993 DBUG 007701DC-1000C377 5980 0C000000 VxmlRuntimeDoc.cxx:162 Execute() Started, event type: 1
2019-11-04 15:56:07.993 DBUG 007701DC-1000C377 5980 0C000000 BlockRuntime.cxx:195 Execute() Started
2019-11-04 15:56:07.993 DBUG 007701DC-1000C377 5980 0C000000 DataRuntime.cxx:442 Execute() Started, event type: 1
2019-11-04 15:56:07.993 DBUG 007701DC-1000C377 5980 0C000000 Runtime.cxx:425 EvaluateExpression(): Expression [var WS_RicercaRitiriResponse =














{}


;]

What can the problem be here?

VXML Form Block is used here instead of Web Service Block because it fails in parsing the Service URL, saying that there's come file missing.
Same thing happened when we tried to parse the Service URL of the "twin" Web Service but we get no problem when it comes to receiving the response via VXML Form Block.
The only thing that appear to be different is that when we created the SOAP Project on SOAP UI, the WS asked for its .xsd file (that had to be in the same folder of the .wsdl) while the "twin" didn't asked for it.

Thanks everyone in advance

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: [Composer] Blank Response from Web Service
« Reply #1 on: November 05, 2019, 01:57:01 AM »
Hi,

As first step, you should check SOAP message sent by MCP (Tomcat) and received response. You can either do it on remote (server) site if you have access to server's log or enable debug logging on your Composer Tomcat (edit log4j.xml file and set set DEBUG level for getWebService logger).

R.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
  • Karma: 56330
Re: [Composer] Blank Response from Web Service
« Reply #2 on: November 05, 2019, 02:28:19 AM »
As you are using HTTPS you need to declare the certs file location under JRE path. Otherwise won't work
Check documentation about this

Offline Sosy

  • Newbie
  • *
  • Posts: 44
  • Karma: 0
Re: [Composer] Blank Response from Web Service
« Reply #3 on: November 05, 2019, 03:18:58 AM »
Hi Renč, hi cavagnaro,

thanks for your replies:

While managing to understand whats going on, I checked the default_composer.log file and found that the expected response is there but an error seems to occure that says InputStream does not represent a valid SOAP 1.1 Message:

Quote
2019-11-04 18:05:57,065 getWebService [INFO] - WebServiceSOAPRequest() constructor
2019-11-04 18:05:57,095 getWebService [INFO] - authType is RSA
2019-11-04 18:05:57,095 getWebService [INFO] - cert issuers
2019-11-04 18:05:57,095 getWebService [INFO] -    CN=xxx, OU=xxx,O=xxx,L=RM,ST=RM,C=IT
2019-11-04 18:05:57,095 getWebService [INFO] -    CN=xxx, OU=xxx, O=xxx, L=RM, ST=RM, C=IT
2019-11-04 18:05:57,128 getWebService [WARN] - Warning: URL Host: 10.222.65.49 vs. 10.222.65.49
2019-11-04 18:05:57,128 getWebService [DEBUG] - soapMessage: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap1="http://soap.service.ritiri.sda.it/">   <soap:Header/>   <soap:Body>      <soap1:ricercaRitiri>         <arg0>            <codicePrenotazione>CP195610258</codicePrenotazione>            <canale>NFE</canale>            <numMaxRecord>10</numMaxRecord>            <paginazione>0</paginazione>         </arg0>      </soap1:ricercaRitiri>   </soap:Body></soap:Envelope>
2019-11-04 18:05:57,128 getWebService [INFO] - WebServiceBackendProcessor.formHTTPMessage() out
2019-11-04 18:05:57,128 getWebService [INFO] - WebServiceBackendProcessor.connectToURL() in
2019-11-04 18:05:57,392 getWebService [INFO] - WebServiceBackendProcessor.connectToURL() out
2019-11-04 18:05:57,392 getWebService [INFO] - WebServiceBackendProcessor.readWebServiceresponse() in
2019-11-04 18:05:57,392 getWebService [INFO] - readWebServiceresponse OK
2019-11-04 18:05:57,438 getWebService [DEBUG] - postData: <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns2:ricercaRitiriResponse xmlns:ns2="http://xxx.it/"><return><outcome>OK</outcome><pagina>0</pagina><risposta><code>0</code><description/><result>OK</result></risposta><ritiro><attivo>false</attivo><codiceClientePagante>xxxxx</codiceClientePagante><codicePrenotazione>xxxx</codicePrenotazione><destinatario/><dettaglioRitiro><assicurata/><contrassegno/><dataRichiesta>2018-12-21T11:58:18+01:00</dataRichiesta><dataRitiro>2019-10-25T00:00:00+02:00</dataRitiro><ldv/><tiporitiro><buste><numeroColli>1</numeroColli><peso>1.00</peso></buste><pacchi><numeroColli>0</numeroColli><voluminoso>false</voluminoso></pacchi><servizio>xx</servizio></tiporitiro></dettaglioRitiro><idRitiro>195610258</idRitiro><letteraVettura/><mittente><cap>xxxx</cap><citofono/><codiceCliente>xxxx</codiceCliente><codiceFiscale>xxxx</codiceFiscale><email>xxxx</email><indirizzo>xxxx</indirizzo><interno/><localita>ATESSA</localita><nominativoContatto>xxxxxx</nominativoContatto><palazzina/><partitaIva>xxxx</partitaIva><provincia>xx</provincia><ragioneSociale>xxxx</ragioneSociale><ritiroPressoPortineria>false</ritiroPressoPortineria><scala/><telefono>xxxx</telefono><ufficio/></mittente><statoRitiro><codice>XXX</codice><descrizione>RITIRO PRENOTATO</descrizione></statoRitiro></ritiro></return></ns2:ricercaRitiriResponse></soapenv:Body></soapenv:Envelope>

2019-11-04 18:05:57,438 getWebService [INFO] - WebServiceBackendProcessor.readWebServiceresponse() in
2019-11-04 18:05:57,438 getWebService [INFO] - WebServiceBackendProcessor.processSOAPMessage() in
2019-11-04 18:05:57,438 getWebService [DEBUG] - value: <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns2:ricercaRitiriResponse xmlns:ns2="http://soap.service.ritiri.sda.it/"><return><outcome>OK</outcome><pagina>0</pagina><risposta><code>0</code><description/><result>OK</result></risposta><ritiro><attivo>false</attivo><codiceClientePagante>xxxx</codiceClientePagante><codicePrenotazione>xxxx</codicePrenotazione><destinatario/><dettaglioRitiro><assicurata/><contrassegno/><dataRichiesta>2018-12-21T11:58:18+01:00</dataRichiesta><dataRitiro>2019-10-25T00:00:00+02:00</dataRitiro><ldv/><tiporitiro><buste><numeroColli>1</numeroColli><peso>1.00</peso></buste><pacchi><numeroColli>0</numeroColli><voluminoso>false</voluminoso></pacchi><servizio>xx</servizio></tiporitiro></dettaglioRitiro><idRitiro>xxxx</idRitiro><letteraVettura/><mittente><cap>xxx</cap><citofono/><codiceCliente>xxxx</codiceCliente><codiceFiscale>xxxx</codiceFiscale><email>xxxx</email><indirizzo>xxxx</indirizzo><interno/><localita>xx</localita><nominativoContatto>xxxx</nominativoContatto><palazzina/><partitaIva>xxxx</partitaIva><provincia>xx</provincia><ragioneSociale>xx</ragioneSociale><ritiroPressoPortineria>false</ritiroPressoPortineria><scala/><telefono>xxx</telefono><ufficio/></mittente><statoRitiro><codice>XXX</codice><descrizione>RITIRO PRENOTATO</descrizione></statoRitiro></ritiro></return></ns2:ricercaRitiriResponse></soapenv:Body></soapenv:Envelope>

2019-11-04 18:05:57,438 getWebService [INFO] - WebServiceSOAPRequest.processSOAPMessage()
2019-11-04 18:05:57,438 getWebService [INFO] - message: <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns2:ricercaRitiriResponse xmlns:ns2="http://xxx.it/"><return><outcome>OK</outcome><pagina>0</pagina><risposta><code>0</code><description/><result>OK</result></risposta><ritiro><attivo>false</attivo><codiceClientePagante>xxxxx</codiceClientePagante><codicePrenotazione>xxxx</codicePrenotazione><destinatario/><dettaglioRitiro><assicurata/><contrassegno/><dataRichiesta>2018-12-21T11:58:18+01:00</dataRichiesta><dataRitiro>2019-10-25T00:00:00+02:00</dataRitiro><ldv/><tiporitiro><buste><numeroColli>1</numeroColli><peso>1.00</peso></buste><pacchi><numeroColli>0</numeroColli><voluminoso>false</voluminoso></pacchi><servizio>xx</servizio></tiporitiro></dettaglioRitiro><idRitiro>195610258</idRitiro><letteraVettura/><mittente><cap>xxxx</cap><citofono/><codiceCliente>xxxx</codiceCliente><codiceFiscale>xxxx</codiceFiscale><email>xxxx</email><indirizzo>xxxx</indirizzo><interno/><localita>xxxx</localita><nominativoContatto>xxxxxx</nominativoContatto><palazzina/><partitaIva>xxxx</partitaIva><provincia>xx</provincia><ragioneSociale>xxxx</ragioneSociale><ritiroPressoPortineria>false</ritiroPressoPortineria><scala/><telefono>xxxx</telefono><ufficio/></mittente><statoRitiro><codice>XXX</codice><descrizione>RITIRO PRENOTATO</descrizione></statoRitiro></ritiro></return></ns2:ricercaRitiriResponse></soapenv:Body></soapenv:Envelope>

2019-11-04 18:05:57,438 getWebService [INFO] - Entered getSoapMessage()
2019-11-04 18:05:57,442 getWebService [DEBUG] - data: InputStream does not represent a valid SOAP 1.1 Message
2019-11-04 18:05:57,442 getWebService [INFO] - WebServiceBackendProcessor.processSOAPMessage() out
2019-11-04 18:05:57,442 getWebService [INFO] - result:{}
2019-11-04 18:05:57,442 getWebService [INFO] - value:{}

2019-11-04 18:05:57,442 getWebService [INFO] - WebServiceBackendProcessor.isSOAPFault(): false
2019-11-04 18:05:57,442 getWebService [INFO] - WebServiceBackendProcessor.disconnectConnection() in
2019-11-04 18:05:57,442 getWebService [INFO] - WebServiceBackendProcessor.disconnectConnection() out
2019-11-04 18:05:57,442 getWebService [INFO] - value:{}
2019-11-04 18:05:57,442 getWebService [INFO] - getWebServiceData:End

As of what @cavagnaro suggested, the twin Web Service use HTTPS as well and it still works as expected even without declaring certs file location, so I dont think the problem lies there, but I will surely check for that!

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
  • Karma: 56330
Re: [Composer] Blank Response from Web Service
« Reply #4 on: November 05, 2019, 03:26:58 AM »
SoapUI doesn't use Java, that is the difference

Enviado de meu SM-G9650 usando o Tapatalk


Offline Sosy

  • Newbie
  • *
  • Posts: 44
  • Karma: 0
Re: [Composer] Blank Response from Web Service
« Reply #5 on: November 05, 2019, 08:19:47 PM »
Hi,
the second web service works fine even on Composer (https without certs path), that's why it seemed odd to me.
For what I can understand the problem here is that the service we're trying to call uses SOAP 1.2 (while the other WS uses SOAP 1.1) thats not supported by Composer...
Here a comparison of the wsdl of the two services:

Quote
Not Working Service WSDL:
<wsdl:operation name="ricercaRitiri">
<soap12:operation style="document" soapActionRequired="false" soapAction=""/>
<wsdl:input name="ricercaRitiriRequest">
<wsdl:output name="ricercaRitiriResponse">
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="xxxxx">
<soap12:fault name="xxxxx" use="literal"/>
</wsdl:fault>
</wsdl:operation>

Working Service WSDL:
<wsdl:operation name="doIt">
<soap11:operation style="document" soapAction=""/>
<wsdl:input name="doItRequest">
<soap11:body use="literal"/>
</wsdl:input>
<wsdl:output name="doItResponse">
<soap11:body use="literal"/>
</wsdl:output>
<wsdl:fault name="xxxxx">
<soap11:fault name="xxxxx" use="literal"/>
</wsdl:fault>
<wsdl:fault name="SOAPException">
<soap11:fault name="SOAPException" use="literal"/>
</wsdl:fault>
</wsdl:operation>

From the tomcat logs we can see the response received in the right way but Composer is probably not capable of understanding the message because of the soap version.

Is there anything we can do to make Composer understand it? ???

Thanks!

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
  • Karma: 56330
Re: [Composer] Blank Response from Web Service
« Reply #6 on: November 05, 2019, 08:22:08 PM »
Ok, got it. No, as it is not supported. What you can do is create your own backend and use it to process that WS maybe.


Enviado de meu SM-G9650 usando o Tapatalk