• No replies
6184 Posts

Pinned topic Using HTTP adapter to retrieve XML from a Webservice

‏2012-11-15T15:11:52Z |

We are currently implementing an interface that is expected to pass parameter to a webservice and receive a XML in return. This is something we haven't done before, so need some pointers.

We were able to use the HTTP adapter and execute a simple call to a webservice that returns a text

GET("HTTP", "-METHOD GET -TV -URL http://XXXX/XXXX/getxxxx?mrn=12345")

When we use the same method to retrieve an XML it errors out.

GET("HTTP", "-METHOD GET -TV -URL http://XXXXX/XXXXX/getSummary?xxxx=5042149&xxxxDate=2012-10-19&xxxxTime=13:00:00")

More details below.

Appreciate your help.


WTX Version: 8.1 on Windows
Above GET command returns the text "Error reported: 415"
Here is the trace

Using http: protocol.
Using HTTP/1.1.
WSAStart: Entering
WSAStart: bWSStarted = 0, nWSClients = 0
WSAStart: Attempting WinSock initialization.
WSAStart: WinSock initialized successfully.
Windows Sockets Version 1.1 will be used.
Windows Sockets Version 2.2 is supported.
Windows Socket Description is 'WinSock 2.0'.
Windows Socket System Status is 'Running'.
Windows Socket supports up to 32767 socket(s).
Windows Socket supports UDP datagram of up to 65467 bytes.
Windows Socket has no additional vendor-specific information.
Sockets Client ID 1 enabled.
WSAStart: Exiting (rc = 1)
Server host is 'dwb1web'.
Hostname: 'xxxx.xxxx.ORG'.
Address #1: XX.XX.X.XX.
Using port '80' for the connection.
Connecting to 'XXXXXX'.
Checking user port 80.
Service: 'http'.
Alias #1: 'www'.
Alias #2: 'www-http'.
Port: 80.
Protocol: 'tcp'.
Socket Opened.
<GET /PatientSummaryWeb/rest/heal17/getSummary?caseNum=5042149&visitDate=2012-10-19&visitTime=13:00:00 HTTP/1.1
Host: xxxxx
User-Agent: HTTP-Adapter/8.1(22)
Content-Type: application/octet-stream
Content-Length: 0
X-Abandon-After: 2147483647

Sending 0 bytes of message data.
>HTTP/1.1 415 Unsupported Media Type (F)
>Server: IBM_HTTP_Server
>Transfer-Encoding: chunked
>Content-Type: text/html;charset=ISO-8859-1
>Content-Language: en-US
Using Transfer-Encoding: chunked to delimit message.
>1f (S)
Getting chunk #1 for 31+2 bytes...
>45 72 72 6f 72 20 34 31 35 3a 20 45 72 72 6f 72 20 72 65 70 6f 72 74 65 64 3a 20 34 31 35 0a 0d 0a
Error 415: Error reported: 415...
>0 (S)
Found last chunk (0 bytes).
Getting trailer (2 bytes).
>0d 0a ..
31 bytes of chunked data received.
Server type is 'IBM_HTTP_Server'.
Socket Closed.
Connection closed.
WSATerm: Entering
WSATerm: bWSStarted = 1, nWSClients = 1
Sockets Client ID 1 disabled.
WSATerm: nWSClients remaining = 0
WSATerm: Attempting WinSock shutdown.
WSATerm: Exiting
Run Terminated