XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> - Problem with http-post not bei... (3)
-> ->Problem with http-post no...
-> ->Problem with http-post no...
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Bruce CantorSubject: Problem with http-post not being accepted,
Author: Bruce Cantor
Date: 25 Apr 2023 01:15 PM
Originally Posted: 25 Apr 2023 01:13 PM
Hi,

We use the built-in ddtek:http-post method to send documents to a partner on a daily basis.
Unfortunately, the receiving server is often busy or closes our connection, causing an error such as this:

(host:172.16.0.74) Apr 25, 2023 2:22:08 PM com.ivitechnologies.pipeline.server.OperationXQuery runInternal
SEVERE: [I9][XQuery]java.net.SocketException: Connection reset
xquery uri file:/c:/xps/pipelines/xxx/xquery/Deliver2WS.xquery
input URL file:///E:/Nav-PipelineServer-DataExchange/FilesFromNavision/xxx/FR_5695448_20230425T142200.xml
operation properties:
annotation=false
rotate=270
Name=Deliver2WS.xquery
h=100
Operation=XQUERY
ID=25
y=143
.xquery file=..\xyx\xxx\Deliver2WS.xquery
x=882
w=140
XQPreparedExpression com.ivitechnologies.pipeline.concurrent.ObjectWithLock@4b3b7375
isClosed false
javax.xml.xquery.XQException: [I9][XQuery]java.net.SocketException: Connection reset

I tried to make this more error tolerant by adding these options to the request, but I am not finding that it makes a difference:

<header name="retries" value="5"/>
<header name="connection-timeout" value="12000"/>

Is there another way to handle this, can one make code that tries to resend?

As by now I need to resend from our ERP system, since the input file has been deleted at this point.

Kind regards



Postnext
Ivan PedruzziSubject: Problem with http-post not being accepted,
Author: Ivan Pedruzzi
Date: 25 Apr 2023 05:48 PM
I do not think you are passing the options correctly, "retries", "socket-timeout" are attributes of element "request".

The headers are HTTP header inserted in the message that are sent to the server.

For the full list of options see chapter "Settings for Connections and Sockets" at

<Stylus Studio Install>
-\Components
--\DataDirect XQuery
---\books
----\ddxquery
-----\ddxqug
------\ddxqug.pdf



See example below

declare variable $options :=

<request
username="..."
password="..."
retries="3"
socket-timeout="30000">
<request-header>
<header name="Content-Type" value="text/xml"/>
</request-header>
</request>;

declare variable $url := "...";
declare variable $payload := "...";

ddtek:http-post($url, $payload, $options)

Ivan Pedruzzi
Stylus Studio Team

Posttop
Bruce CantorSubject: Problem with http-post not being accepted,
Author: Bruce Cantor
Date: 26 Apr 2023 08:58 AM
I have now added the attributes 'retries' and 'connection-timeout' to the request element.

Before that, I had tried to make it work by adding the values as header name value pairs.

Hopefully that makes the difference, thank you for helping me out here.

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.