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
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext 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.

 
Go to previous topicPrev TopicGo to next topicNext Topic
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.