BaseX 10.0 as a SOAP client

Friday, 12 August 2022 · 9 messages
Y
ykhabins12 Aug 2022 00:10 #
Hello, I need to call SOAP Web Service based on its URL and WSDL. The Web Service is password protected, and returns back XML. WSDL shows all operations, aka methods. Is it possible to make calls to SOAP Web Service from the BaseX 10.0? Regards, Yitzhak Khabinsky
ВВ
Ветошкин Владимир12 Aug 2022 06:55 #
Если нет вариантов составного ключевого поля, то пусть будет id.
Quoted text · ykhabins · 11 lines
11.08.2022, 23:10, "ykhabins at bellsouth.net" <ykhabins at bellsouth.net>: > Hello, > > I need to call SOAP Web Service based on its URL and WSDL. > The Web Service is password protected, and returns back XML. > WSDL shows all operations, aka methods. > > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? > > Regards, > Yitzhak Khabinsky
-- С уважением, Ветошкин Владимир Владимирович
ВВ
Ветошкин Владимир12 Aug 2022 06:59 #
Oh, sorry for wrong reply.
Quoted text · Ветошкин Владимир · 23 lines
12.08.2022, 07:55, "Ветошкин Владимир" <en-trance at yandex.ru>: > Если нет вариантов составного ключевого поля, то пусть будет id. > > > 11.08.2022, 23:10, "ykhabins at bellsouth.net" <ykhabins at bellsouth.net>: > > > Hello, > > > > I need to call SOAP Web Service based on its URL and WSDL. > > The Web Service is password protected, and returns back XML. > > WSDL shows all operations, aka methods. > > > > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? > > > > Regards, > > Yitzhak Khabinsky > > > > > -- > С уважением, > Ветошкин Владимир Владимирович
-- С уважением, Ветошкин Владимир Владимирович
CG
Christian Grünin reply to ykhabins, 12 Aug 2022, 00:1012 Aug 2022 13:40 #
Hi Yitzhak,
Quoted text · ykhabins · 1 line
> Is it possible to make calls to SOAP Web Service from the BaseX 10.0?
That’s no problem; you can use the HTTP Client Module for that [1]. Best, Christian [1] https://docs.basex.org/wiki/HTTP_Client_Module
CG
Christian Grünin reply to ykhabins, 12 Aug 2022, 19:4812 Aug 2022 17:56 #
SOAP calls are nothing else than simple HTTP requests using the POST method and XML payloads. You can have a look at the following example [1]. You'll need to adjust the target URI and the body (the user/password attributes can possibly be dropped if the SOAP server does not require basic or digest authentication). Hope this helps Christian [1] https://docs.basex.org/wiki/HTTP_Client_Module#POST_Request
Quoted text · ykhabins · 46 lines
<ykhabins at bellsouth.net> schrieb am Fr., 12. Aug. 2022, 17:48: > Mr. Grün, > > The documentation is covering just the REST calls. > I need to make SOAP call. > It seems that it is not coverd in the HTTP_Client_Module documentation. > > It is not clear how to specify an operation/method on a SOAP service. > > Here is a sample of the request exposed via SoapUI. > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:miam="http://miamiarrest.ws.ts"> > <soapenv:Header/> > <soapenv:Body> > <miam:getArrestReportsForExport> > <miam:agencyId>000</miam:agencyId> > <miam:passphrase>password</miam:passphrase> > <miam:fromDate>2022-08-02T06:35:01</miam:fromDate> > </miam:getArrestReportsForExport> > </soapenv:Body> > </soapenv:Envelope> > > > > Regards, > Yitzhak Khabinsky > > -----Original Message----- > From: Christian Grün <christian.gruen at gmail.com> > Sent: Friday, August 12, 2022 7:41 AM > To: Yitzhak Khabinsky <ykhabins at bellsouth.net> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client > > Hi Yitzhak, > > > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? > > That’s no problem; you can use the HTTP Client Module for that [1]. > > Best, > Christian > > [1] https://docs.basex.org/wiki/HTTP_Client_Module > >
Y
ykhabinsin reply to Christian Grün, 12 Aug 2022, 13:4012 Aug 2022 19:48 #
Mr. Grün, The documentation is covering just the REST calls. I need to make SOAP call. It seems that it is not coverd in the HTTP_Client_Module documentation. It is not clear how to specify an operation/method on a SOAP service. Here is a sample of the request exposed via SoapUI.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:miam="http://miamiarrest.ws.ts">
   <soapenv:Header/>
   <soapenv:Body>
      <miam:getArrestReportsForExport>
         <miam:agencyId>000</miam:agencyId>
         <miam:passphrase>password</miam:passphrase>
         <miam:fromDate>2022-08-02T06:35:01</miam:fromDate>
      </miam:getArrestReportsForExport>
   </soapenv:Body>
</soapenv:Envelope>
Regards, Yitzhak Khabinsky
Quoted text · Christian Grün · 12 lines
-----Original Message----- From: Christian Grün <christian.gruen at gmail.com> Sent: Friday, August 12, 2022 7:41 AM To: Yitzhak Khabinsky <ykhabins at bellsouth.net> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client Hi Yitzhak, > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? That’s no problem; you can use the HTTP Client Module for that [1]. Best, Christian [1] https://docs.basex.org/wiki/HTTP_Client_Module
CG
Christian Grünin reply to ykhabins, 12 Aug 2022, 23:2412 Aug 2022 21:35 #
I think you have encountered a bug of the initial BaseX 10 release: We have upgraded to the new JDK HTTP Client API, and in some cases, headers were not correctly passed on to the server. The bug has recently been fixed in the latest snapshot. Could you give it a try? [1] BaseX 10.1 will be released later this month. We apologize for the inconvenience, Christian [1] https://files.basex.org/releases/
Quoted text · PM · 169 lines
On Fri, Aug 12, 2022 at 9:24 PM <ykhabins at bellsouth.net> wrote: > > Mr. Grün, > > > > I followed your suggestion. > > Here is my unsuccessful attempt. > > The request is failing on SOAPAction that should be a SOAP operation. > > Our Web Service has multiple operations. > > > > let $uri := 'https://…/” > > > > return http:send-request( > > <http:request method="POST" href="{$uri}" timeout='120'> > > <http:header name="SOAPAction" value="getArrestReportsForExport"/> > > <http:body media-type='application/xml'> > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:miam="http://miamiarrest.ws.ts"> > > <soapenv:Header/> > > <soapenv:Body> > > <miam:getArrestReportsForExport> > > <miam:agencyId>000</miam:agencyId> > > <miam:passphrase> password </miam:passphrase> > > <miam:fromDate>2022-08-12T06:35:01</miam:fromDate> > > </miam:getArrestReportsForExport> > > </soapenv:Body> > > </soapenv:Envelope> > > </http:body> > > </http:request> > > ) > > > > Getting back the following error: > > <faultstring>no SOAPAction header!</faultstring> > > > > Here is full response: > > > > <http:response xmlns:http="http://expath.org/ns/http-client" status="500" message="Internal Server Error"> > <http:header name="connection" value="close"/> > <http:header name="content-language" value="en-US"/> > <http:header name="content-security-policy" value="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * data:"/> > <http:header name="content-type" value="text/xml; charset=utf-8"/> > <http:header name="date" value="Fri, 12 Aug 2022 18:57:02 GMT"/> > <http:header name="set-cookie" value="NSC_bgpsnqse.njbnjebef.hpw_TTM=ffffffff09da352b45525d5f4f58455e445a4a42378b;expires=Fri, 12-Aug-2022 19:13:41 GMT;path=/;secure;httponly"/> > <http:header name="strict-transport-security" value="max-age=31536000; includeSubDomains"/> > <http:header name="transfer-encoding" value="chunked"/> > <http:header name="x-content-type-options" value="nosniff"/> > <http:header name="x-forwarded-for" value="10.5.34.112"/> > <http:header name="x-frame-options" value="SAMEORIGIN"/> > <http:header name="x-powered-by" value="Servlet/3.0"/> > <http:header name="x-xss-protection" value="1; mode=block"/> > <http:body media-type="text/xml"/> > </http:response> > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Body> > <soapenv:Fault> > <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode> > <faultstring>no SOAPAction header!</faultstring> > <detail> > <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">s0144517</ns2:hostname> > </detail> > </soapenv:Fault> > </soapenv:Body> > </soapenv:Envelope> > > > > Regards, > Yitzhak Khabinsky > > > > From: Christian Grün <christian.gruen at gmail.com> > Sent: Friday, August 12, 2022 11:56 AM > To: Yitzhak Khabinsky <ykhabins at bellsouth.net> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client > > > > SOAP calls are nothing else than simple HTTP requests using the POST method and XML payloads. You can have a look at the following example [1]. You'll need to adjust the target URI and the body (the user/password attributes can possibly be dropped if the SOAP server does not require basic or digest authentication). > > > > Hope this helps > > Christian > > > > [1] https://docs.basex.org/wiki/HTTP_Client_Module#POST_Request > > > > > > <ykhabins at bellsouth.net> schrieb am Fr., 12. Aug. 2022, 17:48: > > Mr. Grün, > > The documentation is covering just the REST calls. > I need to make SOAP call. > It seems that it is not coverd in the HTTP_Client_Module documentation. > > It is not clear how to specify an operation/method on a SOAP service. > > Here is a sample of the request exposed via SoapUI. > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:miam="http://miamiarrest.ws.ts"> > <soapenv:Header/> > <soapenv:Body> > <miam:getArrestReportsForExport> > <miam:agencyId>000</miam:agencyId> > <miam:passphrase>password</miam:passphrase> > <miam:fromDate>2022-08-02T06:35:01</miam:fromDate> > </miam:getArrestReportsForExport> > </soapenv:Body> > </soapenv:Envelope> > > > > Regards, > Yitzhak Khabinsky > > -----Original Message----- > From: Christian Grün <christian.gruen at gmail.com> > Sent: Friday, August 12, 2022 7:41 AM > To: Yitzhak Khabinsky <ykhabins at bellsouth.net> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client > > Hi Yitzhak, > > > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? > > That’s no problem; you can use the HTTP Client Module for that [1]. > > Best, > Christian > > [1] https://docs.basex.org/wiki/HTTP_Client_Module
Y
ykhabinsin reply to Christian Grün, 12 Aug 2022, 17:5612 Aug 2022 23:24 #
Mr. Grün, I followed your suggestion. Here is my unsuccessful attempt. The request is failing on SOAPAction that should be a SOAP operation. Our Web Service has multiple operations.
let $uri := 'https://…/”
  <http:request method="POST" href="{$uri}" timeout='120'>

    <http:header name="SOAPAction" value="getArrestReportsForExport"/>

    <http:body media-type='application/xml'>

        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:miam="http://miamiarrest.ws.ts">

         <soapenv:Header/>

         <soapenv:Body>

            <miam:getArrestReportsForExport>

               <miam:agencyId>000</miam:agencyId>

               <miam:passphrase> password </miam:passphrase>

               <miam:fromDate>2022-08-12T06:35:01</miam:fromDate>

            </miam:getArrestReportsForExport>

         </soapenv:Body>

      </soapenv:Envelope>

    </http:body>

  </http:request>
) Getting back the following error:
   <faultstring>no SOAPAction header!</faultstring>
Here is full response:
<http:response xmlns:http="http://expath.org/ns/http-client" status="500" message="Internal Server Error">
  <http:header name="connection" value="close"/>
  <http:header name="content-language" value="en-US"/>
  <http:header name="content-security-policy" value="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * data:"/>
  <http:header name="content-type" value="text/xml; charset=utf-8"/>
  <http:header name="date" value="Fri, 12 Aug 2022 18:57:02 GMT"/>
  <http:header name="set-cookie" value="NSC_bgpsnqse.njbnjebef.hpw_TTM=ffffffff09da352b45525d5f4f58455e445a4a42378b;expires=Fri, 12-Aug-2022 19:13:41 GMT;path=/;secure;httponly"/>
  <http:header name="strict-transport-security" value="max-age=31536000; includeSubDomains"/>
  <http:header name="transfer-encoding" value="chunked"/>
  <http:header name="x-content-type-options" value="nosniff"/>
  <http:header name="x-forwarded-for" value="10.5.34.112"/>
  <http:header name="x-frame-options" value="SAMEORIGIN"/>
  <http:header name="x-powered-by" value="Servlet/3.0"/>
  <http:header name="x-xss-protection" value="1; mode=block"/>
  <http:body media-type="text/xml"/>
</http:response>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
   <faultstring>no SOAPAction header!</faultstring>
   <detail>
    <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">s0144517</ns2:hostname>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
Regards, Yitzhak Khabinsky
Quoted text · Christian Grün · 40 lines
From: Christian Grün <christian.gruen at gmail.com> Sent: Friday, August 12, 2022 11:56 AM To: Yitzhak Khabinsky <ykhabins at bellsouth.net> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client SOAP calls are nothing else than simple HTTP requests using the POST method and XML payloads. You can have a look at the following example [1]. You'll need to adjust the target URI and the body (the user/password attributes can possibly be dropped if the SOAP server does not require basic or digest authentication). Hope this helps Christian [1] https://docs.basex.org/wiki/HTTP_Client_Module#POST_Request <ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> > schrieb am Fr., 12. Aug. 2022, 17:48: Mr. Grün, The documentation is covering just the REST calls. I need to make SOAP call. It seems that it is not coverd in the HTTP_Client_Module documentation. It is not clear how to specify an operation/method on a SOAP service. Here is a sample of the request exposed via SoapUI. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:miam="http://miamiarrest.ws.ts"> <soapenv:Header/> <soapenv:Body> <miam:getArrestReportsForExport> <miam:agencyId>000</miam:agencyId> <miam:passphrase>password</miam:passphrase> <miam:fromDate>2022-08-02T06:35:01</miam:fromDate> </miam:getArrestReportsForExport> </soapenv:Body> </soapenv:Envelope> Regards, Yitzhak Khabinsky -----Original Message----- From: Christian Grün <christian.gruen at gmail.com <mailto:christian.gruen at gmail.com> > Sent: Friday, August 12, 2022 7:41 AM To: Yitzhak Khabinsky <ykhabins at bellsouth.net <mailto:ykhabins at bellsouth.net> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de <mailto:basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client Hi Yitzhak, > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? That’s no problem; you can use the HTTP Client Module for that [1]. Best, Christian [1] https://docs.basex.org/wiki/HTTP_Client_Module
Y
ykhabinsin reply to Christian Grün, 12 Aug 2022, 21:3512 Aug 2022 23:53 #
Mr. Grün, That was it. The latest snapshot: BaseX101-20220812.202804 resolved the issue. Much appreciated for taking care with such speed! P.S. Please update the HTTP_Client_Module documentation with the explicit SOAP call. Regards, Yitzhak Khabinsky
Quoted text · Christian Grün · 184 lines
-----Original Message----- From: Christian Grün <christian.gruen at gmail.com> Sent: Friday, August 12, 2022 3:35 PM To: Yitzhak Khabinsky <ykhabins at bellsouth.net> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client I think you have encountered a bug of the initial BaseX 10 release: We have upgraded to the new JDK HTTP Client API, and in some cases, headers were not correctly passed on to the server. The bug has recently been fixed in the latest snapshot. Could you give it a try? [1] BaseX 10.1 will be released later this month. We apologize for the inconvenience, Christian [1] https://files.basex.org/releases/ On Fri, Aug 12, 2022 at 9:24 PM <ykhabins at bellsouth.net> wrote: > > Mr. Grün, > > > > I followed your suggestion. > > Here is my unsuccessful attempt. > > The request is failing on SOAPAction that should be a SOAP operation. > > Our Web Service has multiple operations. > > > > let $uri := 'https://…/” > > > > return http:send-request( > > <http:request method="POST" href="{$uri}" timeout='120'> > > <http:header name="SOAPAction" value="getArrestReportsForExport"/> > > <http:body media-type='application/xml'> > > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:miam="http://miamiarrest.ws.ts"> > > <soapenv:Header/> > > <soapenv:Body> > > <miam:getArrestReportsForExport> > > <miam:agencyId>000</miam:agencyId> > > <miam:passphrase> password </miam:passphrase> > > <miam:fromDate>2022-08-12T06:35:01</miam:fromDate> > > </miam:getArrestReportsForExport> > > </soapenv:Body> > > </soapenv:Envelope> > > </http:body> > > </http:request> > > ) > > > > Getting back the following error: > > <faultstring>no SOAPAction header!</faultstring> > > > > Here is full response: > > > > <http:response xmlns:http="http://expath.org/ns/http-client" status="500" message="Internal Server Error"> > <http:header name="connection" value="close"/> > <http:header name="content-language" value="en-US"/> > <http:header name="content-security-policy" value="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; media-src *; img-src * data:"/> > <http:header name="content-type" value="text/xml; charset=utf-8"/> > <http:header name="date" value="Fri, 12 Aug 2022 18:57:02 GMT"/> > <http:header name="set-cookie" value="NSC_bgpsnqse.njbnjebef.hpw_TTM=ffffffff09da352b45525d5f4f58455e445a4a42378b;expires=Fri, 12-Aug-2022 19:13:41 GMT;path=/;secure;httponly"/> > <http:header name="strict-transport-security" value="max-age=31536000; includeSubDomains"/> > <http:header name="transfer-encoding" value="chunked"/> > <http:header name="x-content-type-options" value="nosniff"/> > <http:header name="x-forwarded-for" value="10.5.34.112"/> > <http:header name="x-frame-options" value="SAMEORIGIN"/> > <http:header name="x-powered-by" value="Servlet/3.0"/> > <http:header name="x-xss-protection" value="1; mode=block"/> > <http:body media-type="text/xml"/> > </http:response> > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Body> > <soapenv:Fault> > <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode> > <faultstring>no SOAPAction header!</faultstring> > <detail> > <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">s0144517</ns2:hostname> > </detail> > </soapenv:Fault> > </soapenv:Body> > </soapenv:Envelope> > > > > Regards, > Yitzhak Khabinsky > > > > From: Christian Grün <christian.gruen at gmail.com> > Sent: Friday, August 12, 2022 11:56 AM > To: Yitzhak Khabinsky <ykhabins at bellsouth.net> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client > > > > SOAP calls are nothing else than simple HTTP requests using the POST method and XML payloads. You can have a look at the following example [1]. You'll need to adjust the target URI and the body (the user/password attributes can possibly be dropped if the SOAP server does not require basic or digest authentication). > > > > Hope this helps > > Christian > > > > [1] https://docs.basex.org/wiki/HTTP_Client_Module#POST_Request > > > > > > <ykhabins at bellsouth.net> schrieb am Fr., 12. Aug. 2022, 17:48: > > Mr. Grün, > > The documentation is covering just the REST calls. > I need to make SOAP call. > It seems that it is not coverd in the HTTP_Client_Module documentation. > > It is not clear how to specify an operation/method on a SOAP service. > > Here is a sample of the request exposed via SoapUI. > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:miam="http://miamiarrest.ws.ts"> > <soapenv:Header/> > <soapenv:Body> > <miam:getArrestReportsForExport> > <miam:agencyId>000</miam:agencyId> > <miam:passphrase>password</miam:passphrase> > <miam:fromDate>2022-08-02T06:35:01</miam:fromDate> > </miam:getArrestReportsForExport> > </soapenv:Body> > </soapenv:Envelope> > > > > Regards, > Yitzhak Khabinsky > > -----Original Message----- > From: Christian Grün <christian.gruen at gmail.com> > Sent: Friday, August 12, 2022 7:41 AM > To: Yitzhak Khabinsky <ykhabins at bellsouth.net> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] BaseX 10.0 as a SOAP client > > Hi Yitzhak, > > > Is it possible to make calls to SOAP Web Service from the BaseX 10.0? > > That’s no problem; you can use the HTTP Client Module for that [1]. > > Best, > Christian > > [1] https://docs.basex.org/wiki/HTTP_Client_Module

⚡Generated with XQuery