Hello, Alexander!
I can connect to ftp://speedtest.tele2.net/ via browser.
- Log in to post comments
Hello, Alexander!
I can connect to ftp://speedtest.tele2.net/ via browser.
Hello, Alexander!
I can connect to ftp://speedtest.tele2.net/ via browser.
Thanks a lot Robert!
Thanks a lot Eduard! It's working. But another problem has occured: the response is non readable:
<?xml version="1.0" encoding="UTF-8"?>
<CheckContractResponse><code>-1</code><message>ÐевеÑнÑй Ñип договоÑа</message></CheckContractResp>
compare headers between postman and cache I found the difference in content type.
In postman : Content-Type: text/xml
In cache: Content-Type: text/xml; charset=UTF-8
How I can remove charset=UTF-8 from header in cache ?
Hello Eduard!
Now I'm getting error: 415 Unsupported Media Type. In the code i set:
Set httpRequest.ContentType="text/xml"
HTTP/1.1 415 Unsupported Media Type
ACCESS-CONTROL-ALLOW-CREDENTIALS: false
ACCESS-CONTROL-ALLOW-METHODS: POST
ACCESS-CONTROL-ALLOW-ORIGIN: *
ACCESS-CONTROL-EXPOSE-HEADERS: APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID
CONNECTION: Keep-Alive
CONTENT-ENCODING: gzip
CONTENT-TYPE: text/plain
DATE: Thu, 13 Sep 2018 13:55:03 GMT
TRANSFER-ENCODING: chunked
USER-AGENT: IBM-APIConnect/5.0
X-BACKSIDE-TRANSPORT: OK OK
X-GLOBAL-TRANSACTION-ID: 2956707581
Unsupported Media Type
str=<OBJECT REFERENCE>[19@%Stream.FileCharacterGzip]
+----------------- general information ---------------
| oref value: 19
| class name: %Stream.FileCharacterGzip
| %%OID: $lb("C:\InterSystems\Ensemble2016\mgr\Temp\VqdL7hXdFahzDg.http","%Stream.FileCharacterGzip","")
| reference count: 3
+----------------- attribute values ------------------
| (%Concurrency) = 1
| %Location = "" <Set>
| (%LockRef) = ""
| (%Locked) = 0
| AtEnd = 0
| BOM = ""
| (CurrFile) = ""
| Id = "C:\InterSystems\Ensemble2016\mgr\Temp\VqdL7hXdFahzDg.http" <Set>
| LineTerminator = $c(13,10) <Set>
| (MakePermLoc) = 0
| (Mode) = 1
|(NormalizedDirectory) = "C:\InterSystems\Ensemble2016\mgr\Temp\"
|(OidTranslateTable) = "RAW"
| (ReadMode) = 0
| ReadSize = 48
| RemoveOnClose = 1
| (StoreFile) = "VqdL7hXdFahzDg.http"
| StreamFormatWrite = 1
| (TempFile) = ""
| TranslateTable = "RAW" <Set>
| UseVMSVersion = 0
| (VariableRecord) = 0
sc=1
0
resp=<OBJECT REFERENCE>[138@%Net.HttpResponse]
+----------------- general information ---------------
| oref value: 138
| class name: %Net.HttpResponse
| reference count: 3
+----------------- attribute values ------------------
| ContentBoundary = ""
| ContentInfo = ""
| ContentLength = ""
| ContentType = ""
| Data = "139@%Stream.GlobalBinary"
| HttpVersion = ""
| ReasonPhrase = ""
| StatusCode = ""
| StatusLine = ""
Set sc = httpRequest.Post("/sample/", 1)The output:
set sc=##class(Example.TEST).xmlRequest("891208300335","Ivan","Ivanov","Ivanovich","08.12.1989","ОПВ")
POST /sample/ HTTP/1.1
User-Agent: IBM-APIConnect/5.0
Host: 172.27.139.151
Accept-Encoding: gzip
Accept: text/xml
x-ibm-client-id: adsad-adsadsa-asdsad
x-ibm-client-secret: 13213213asdsadsadsad
Content-Length: 251
Content-Type: text/xml; charset=UTF-8
<CheckContractRequest><IIN>891208300335</IIN><FirstName>Ivan</FirstName>
<LastName>Ivanov</LastName><MiddleName>Ivanovich</MiddleName>
<BirthDate>08.12.1989</BirthDate><ContractType>ОПВ</ContractType></CheckContractRequest>0
Set sc = httpRequest.Post("/sample/", 2)
zw scoutput: sc=1
Hi Eduard!
Thank you for your response. I have change the code, method return output status=0.
I have sent the request using Postman utility and receive the response after 30 seconds.
how i can know that request was sent sussecfully and how to get readable response? Thank you.
Hi Eduard,
I should updgrade cache version ?
it doesn't work.
Forgot to mention that I added ClassMethod %ConvertJSONToObject to %ZEN.Auxiliary.jsonProvider. Is it correct ?
I check the code in cache version2016 .
When set property
the response was successfull :
HTTP/1.1 200 OK
ACCESS-CONTROL-ALLOW-CREDENTIALS: false
ACCESS-CONTROL-ALLOW-METHODS: POST
ACCESS-CONTROL-ALLOW-ORIGIN: *
ACCESS-CONTROL-EXPOSE-HEADERS:
CONNECTION: Keep-Alive
CONTENT-ENCODING: gzip
CONTENT-TYPE: application/json
DATE: Thu, 23 Aug 2018 03:31:32 GMT
TRANSFER-ENCODING: chunked
USER-AGENT: IBM-APIConnect/5.0
X-BACKSIDE-TRANSPORT: OK OK
X-GLOBAL-TRANSACTION-ID: 699524573
{"code":0,"message":"OK"}
httpResponse="{""code"":0,""message"":""OK""}"
httpResponse=""
write $isObject(httpResponse)
the output :
$isObject=0
Hi Eduard!
still didn't parse the response. Here is my code, can you help please?
Set sc = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(httpResponse,,.Object,1)
Thanks a lot Eduard!
Could you say how to parse JSON response in my case?
the response:
{
"code": 0,
"message": "OK"
}
set sc=##class(Example.TEST).Check(901205300353,"Ivan","Ivanov","Ivanovich","05.12.1990","Z")
User-Agent: IBM-APIConnect/5.0
Host: 127.0.0.1
Accept-Encoding: gzip
x-ibm-client-id: test
x-ibm-client-secret: test
Content-Length: 180
Content-Type: application/json; charset=utf-8
{
"birthDate":"05.12.1990",
"contractType":"Z",
"firstName":"Ivan",
"iin":901205300353,
"lastName":"Ivanov",
"middleName":"Ivanovich"
}1POST /test/ HTTP/1.1
remove the line, but still getting error:
httpResponse="Corrupt body: json: cannot unmarshal number into Go struct field CheckContractRequest.iin of type string"
HTTP/1.1 400 Bad Request
ACCESS-CONTROL-ALLOW-CREDENTIALS: false
ACCESS-CONTROL-ALLOW-METHODS: POST
ACCESS-CONTROL-ALLOW-ORIGIN: *
ACCESS-CONTROL-EXPOSE-HEADERS: APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID
CONNECTION: Keep-Alive
CONTENT-ENCODING: gzip
CONTENT-TYPE: text/plain
DATE: Tue, 14 Aug 2018 13:45:21 GMT
TRANSFER-ENCODING: chunked
X-BACKSIDE-TRANSPORT: OK OK
X-GLOBAL-TRANSACTION-ID: 647439117
Thank you Dmitry!
Thank you Fabian! I have change the unicode to UTF-8.
Hello!
I found a bug in the code. Now everything works, thank you.
Hi Alexander!
Sorry, below correct wsdl
Hi Alexander!
Please, below wsdl:
The version is :
Did you use SOAP Client Wizard to generate SOAP client classes from WSDL?
Thank you for your response!
Hi Alexander!
I guess namespace should be xmlns="http://testws/"
Below code:
s response = ws.GetContractsExt(xml)
Thank you for your response!
Alexander, Thanks a lot!