on 07-15-2020 9:23 PM
Hi,
My data type was incorrect.
Before
0..1
After
Request XML
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ExportaColaboradores_Req xmlns:ns0="...:ExportaColaboradores">
<employees>
<properties>
<code>EMPLOYEE_ID</code>
<value>1010</value>
</properties>
<properties>
<code>STATE</code>
<value>SP</value>
</properties>
<properties>
<code>EMAIL</code>
<value>fulano@teste.com.br</value>
</properties>
<properties>
<code>COUNTRY</code>
<value>BR</value>
</properties>
<properties>
<code>HIRE_DATE</code>
<value>09/07/2007</value>
</properties>
<properties>
<code>BIRTH_DATE</code>
<value>12/10/1985</value>
</properties>
<properties>
<code>GENDER</code>
<value>M</value>
</properties>
<properties>
<code>JOB_TITLE</code>
<value>TECNICO DE PROCESSOS JR</value>
</properties>
<properties>
<code>MANAGER_ID</code>
<value>1020</value>
</properties>
<properties>
<code>NAME</code>
<value>FULANO DA SILVA</value>
</properties>
<properties>
<code>CITY</code>
<value>São Paulo</value>
</properties>
<properties>
<code>AREA</code>
<value>Processos</value>
</properties>
</employees>
<employees>
<properties>
<code>EMPLOYEE_ID</code>
<value>1020</value>
</properties>
<properties>
<code>STATE</code>
<value>SP</value>
</properties>
<properties>
<code>EMAIL</code>
<value>beltrano@teste.com.br</value>
</properties>
<properties>
<code>COUNTRY</code>
<value>BR</value>
</properties>
<properties>
<code>HIRE_DATE</code>
<value>09/07/2007</value>
</properties>
<properties>
<code>BIRTH_DATE</code>
<value>12/10/1985</value>
</properties>
<properties>
<code>GENDER</code>
<value>M</value>
</properties>
<properties>
<code>JOB_TITLE</code>
<value>REPRESENTANTE DE VENDAS </value>
</properties>
<properties>
<code>MANAGER_ID</code>
<value></value>
</properties>
<properties>
<code>NAME</code>
<value>BELTRANO DA SILVA</value>
</properties>
<properties>
<code>CITY</code>
<value>São Paulo</value>
</properties>
<properties>
<code>AREA</code>
<value>Vendas</value>
</properties>
</employees>
</ns0:MT_ExportaColaboradores_Req>
How was the requisition in JSON with error (before adjustment) 1 tag properties.
{
"employees": [
{
"properties": [
{
"code": "EMPLOYEE_ID",
"value": 1010
},
{
"code": "STATE",
"value": "SP"
},
{
"code": "EMAIL",
"value": "fulano@teste.com.br"
},
{
"code": "COUNTRY",
"value": "BR"
},
{
"code": "HIRE_DATE",
"value": "09\/07\/2007"
},
{
"code": "BIRTH_DATE",
"value": "12\/10\/1985"
},
{
"code": "GENDER",
"value": "M"
},
{
"code": "JOB_TITLE",
"value": "TECNICO DE PROCESSOS JR"
},
{
"code": "MANAGER_ID",
"value": 1020
},
{
"code": "NAME",
"value": "FULANO DA SILVA"
},
{
"code": "CITY",
"value": "São Paulo"
},
{
"code": "AREA",
"value": "Processos"
}
]
}
]
}
How the server expected the request in JSON (after adjustment) 2 tags properties.
{
"employees": [
{
"properties": [
{
"code": "EMPLOYEE_ID",
"value": 1010
},
{
"code": "STATE",
"value": "SP"
},
{
"code": "EMAIL",
"value": "fulano@teste.com.br"
},
{
"code": "COUNTRY",
"value": "BR"
},
{
"code": "HIRE_DATE",
"value": "09\/07\/2007"
},
{
"code": "BIRTH_DATE",
"value": "12\/10\/1985"
},
{
"code": "GENDER",
"value": "M"
},
{
"code": "JOB_TITLE",
"value": "TECNICO DE PROCESSOS JR"
},
{
"code": "MANAGER_ID",
"value": 1020
},
{
"code": "NAME",
"value": "FULANO DA SILVA"
},
{
"code": "CITY",
"value": "São Paulo"
},
{
"code": "AREA",
"value": "Processos"
}
]
},
{
"properties": [
{
"code": "EMPLOYEE_ID",
"value": 1020
},
{
"code": "STATE",
"value": "SP"
},
{
"code": "EMAIL",
"value": "beltrano@teste.com.br"
},
{
"code": "COUNTRY",
"value": "BR"
},
{
"code": "HIRE_DATE",
"value": "09\/07\/2007"
},
{
"code": "BIRTH_DATE",
"value": "12\/10\/1985"
},
{
"code": "GENDER",
"value": "M"
},
{
"code": "JOB_TITLE",
"value": "REPRESENTANTE DE VENDAS "
},
{
"code": "MANAGER_ID",
"value": ""
},
{
"code": "NAME",
"value": "BELTRANO DA SILVA"
},
{
"code": "CITY",
"value": "São Paulo"
},
{
"code": "AREA",
"value": "Vendas"
}
]
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Actually, it doesn't work. You receive the same HTTP 400 error in Postman too. The difference is that PI treats the response as error (not HTTP 200 or 201) and raises exception. You can proceed with REST adapter's error handling functionality or better send the valid request.
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I would suggest try calling the service using an external tool (like Postman, soapui) with the same payload. This will validate if the message is good or not. Then you can check the configuration.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.