...
O erro TransactionRolledbackLocalException
ocorre porque o GlassFish reverteu a transação devido a uma ArrayIndexOutOfBoundsException
, que acontece quando o código tenta acessar um índice inválido de um array ou lista vazia. Isso pode estar relacionado a dados ausentes ou inválidos (como login e senha no XML). Para resolver, valide os dados de entrada, trate exceções adequadamente no EJB, e revise os logs para entender melhor a origem do problema.
...
DICA:
Após entender quais campos são necessários para enviar a requisição você pode montar um POST utilizando o comando Curl:
Atente-se aos campos obrigatórios como Rateplan e Profile.
Code Block |
---|
curl -X POST http://45.229.107.102:8080/SipPulse/SubscriberWS \
-H "Content-Type: text/xml; charset=utf-8" \
-d '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.sippulse.voffice.com.br/">
<soapenv:Header/>
<soapenv:Body>
<ser:insertSubscriber>
<subscriber>
<accountCode>4933473498-API</accountCode>
<activeIncomingCalls>1</activeIncomingCalls>
<activeOutgoingCalls>1</activeOutgoingCalls>
<addServiceHeader>1</addServiceHeader>
<address>12312312</address>
<areaCode>48</areaCode>
<blockAnonymousCalls>0</blockAnonymousCalls>
<blockCollectCalls>0</blockCollectCalls>
<blockEntry0303>1</blockEntry0303>
<callFwd></callFwd>
<callLimit>0</callLimit>
<callsOnlyByIp>1</callsOnlyByIp>
<city>Teste</city>
<cityCode>2892</cityCode>
<complement></complement>
<contractNumber></contractNumber>
<copyPassertedRpid>0</copyPassertedRpid>
<countryCode>55</countryCode>
<document></document>
<domain>sip.atplus.com.br</domain>
<emailAddress>testeapi@teste.com</emailAddress>
<firstName>teste</firstName>
<fwdBusy>0</fwdBusy>
<id></id>
<lastName></lastName>
<localArea>48</localArea>
<lowCreditLimit>0</lowCreditLimit>
<lowCreditNotification>0</lowCreditNotification>
<mobile></mobile>
<noAnswer></noAnswer>
<number></number>
<password>12345</password>
<passwordPortal>12345</passwordPortal>
<phone></phone>
<profile>DIDS_OUTROS</profile>
<quarter></quarter>
<ratePlanId>5</ratePlanId>
<resellerBillingType></resellerBillingType>
<resellerId></resellerId>
<resellerMarkup>0</resellerMarkup>
<resellerRatePlanId></resellerRatePlanId>
<rings>30</rings>
<rpid></rpid>
<softphoneAllowed>1</softphoneAllowed>
<state></state>
<username>4933473498-API</username>
<validateSource0303>0</validateSource0303>
<voiceMailPassword>12345</voiceMailPassword>
<voicemail>0</voicemail>
<zip></zip>
</subscriber>
<principal>
<login>USUARIO</login>
<password>#qiourtyeuiwp#AAAAAAAAAAAA</password>
</principal>
</ser:insertSubscriber>
</soapenv:Body>
</soapenv:Envelope>' |