1

Estou tendo problemas em um Data Service no WSO2 DSS 3.0.0. Se executar a query diretamente no banco de dados nenhum erro acontece. O banco de dados é um Sybase 12. Alguém poderia ajudar?

DBS

<data name="DSProgram" serviceNamespace="http://myschema.org.br">
<config id="ProgramDS">
  <property name="carbon_datasource_name">ProgramDS</property>
</config>
<query id="updateProgram" useConfig="ProgramDS">
  <sql>update aca..program set name = :name, endingdate = (case when :endingdate = '' then null else :endingdate) where course = :course</sql>
  <param name="name" sqlType="STRING"/>
  <param name="endingdate" sqlType="STRING"/>
  <param name="course" sqlType="INTEGER"/>
</query>
<operation name="updateProgram">
  <call-query href="updateProgram">
     <with-param name="name" query-param="name"/>
     <with-param name="endingdate" query-param="endingdate"/>
     <with-param name="course" query-param="course"/>
  </call-query>
</operation>
</data>

SOAP Envelope

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://myschema.org.br">
<soapenv:Header/>
<soapenv:Body>
  <int:updateProgram>
     <int:name>Course name</int:name>
     <int:endingdate></int:endingdate>
     <int:course>999</int:course>
  </int:updateProgram>
</soapenv:Body>
</soapenv:Envelope>

SOAP Fault

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <soapenv:Fault xmlns:axis2ns1820="http://ws.wso2.org/dataservice">
     <faultcode>axis2ns1820:DATABASE_ERROR</faultcode>
     <faultstring>DS Fault Message: Error in DS non result invoke.
DS Code: DATABASE_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: DSProgram
Location: /DSProgram.dbs
Description: N/A
Default Namespace: http://myschema.org.br
Current Request Name: updateProgram
Current Params: {endingdate=, course=999, name=Course name}
Nested Exception:-
java.lang.NullPointerException</faultstring>
     <detail>
        <axis2ns1819:DataServiceFault xmlns:axis2ns1819="http://ws.wso2.org/dataservice">DS Fault Message: Error in DS non result invoke.
DS Code: DATABASE_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: DSProgram
Location: /DSProgram.dbs
Description: N/A
Default Namespace: http://myschema.org.br
Current Request Name: updateProgram
Current Params: {endingdate=, course=999, name=Course name}
Nested Exception:-
java.lang.NullPointerException</axis2ns1819:DataServiceFault>
     </detail>
  </soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

* Alterei os dados do Web Service por confidencialidade

2
  • este é o StackOverflow em Português, favor traduzir sua pergunta. Commented 12/05/2015 às 17:20
  • 1
    Achei que estava no Stack americano. Agora sim, traduzido. Commented 12/05/2015 às 17:34

1 Resposta 1

0

Eu já utilizei essa query da seguinte maneira:

   <query id="UPDATE_DEMONSTRATION" useConfig="C_CONFIG">
      <sql>call PR_UPDATE_STATUS(?,?,?,?)</sql>
      <param name="messageid"   ordinal="1"  sqlType="INTEGER"/>
      <param name="status"      ordinal="2"  sqlType="STRING"/>
      <param name="errorCode"   ordinal="3"  sqlType="STRING" type="OUT"/>
      <param name="errorMessage"   ordinal="4"  sqlType="STRING" type="OUT"/>
      <result element="UPDATE_DEMONSTRATIONResponse" rowName="">
         <element column="v_ERRORCOD" name="errorCode" xsdType="string"/>
         <element column="v_ERRORMSG" name="errorMsg"  xsdType="string"/>
     </result>
   </query>  

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .