Oracle Native Web Services and Axis2

Hi.

I've created the Stubs from an Oracle XMLDB native web service (using the auto generated WSDL). For that, I've used wsdl2java (Axis2). Then I created a simple java client:



//import java.net.Authenticator;
//import java.net.PasswordAuthentication;


import com.oracle.xmlns.orawsv.bi_demo.filial_cotacao.FILIAL_COTACAOServiceStub;
import org.apache.axis2.client.Options;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;


//import javax.xml.ws.BindingProvider;

class FILIAL_COTACAO {

//  public class MyAuthenticator extends Authenticator {

//    private String user;
//    private String password;

//    public MyAuthenticator(String user,String password) {
//      this.user = user;
//      this.password = password;
//    }

//    @Override
//    protected PasswordAuthentication getPasswordAuthentication() {
//        PasswordAuthentication auth = new PasswordAuthentication(user,password.toCharArray());
//        return auth;
//    }
//  }

    public void filialCOTACAO(){

//    MyAuthenticator myAuth = new MyAuthenticator("SCOTT","tiger");
//    Authenticator.setDefault(myAuth);

      try { // Call Web Service Operation

        FILIAL_COTACAOServiceStub stub = new FILIAL_COTACAOServiceStub();

        Options options = stub._getServiceClient().getOptions();
        HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
        auth.setPreemptiveAuthentication(true);
        auth.setPassword("bi_demo");
        auth.setUsername("bi_demo");
        options.setProperty(HTTPConstants.AUTHENTICATE,auth);

        FILIAL_COTACAOServiceStub.SVARCHAR2FILIAL_COTACAOInput dados = new FILIAL_COTACAOServiceStub.SVARCHAR2FILIAL_COTACAOInput();
        FILIAL_COTACAOServiceStub.FILIAL_COTACAOOutput resp = new FILIAL_COTACAOServiceStub.FILIAL_COTACAOOutput();
               
        String user = "TESTE";
       
        dados.setUSUARIO$VARCHAR2IN(user);

        resp = stub.fILIAL_COTACAO(dados);

        System.out.println("Resposta " + resp.getRETURN());
        System.out.println("TESTE");

      } catch (Throwable e1) {e1.printStackTrace();}

    }

  public static void main(String[] args) throws Exception {

      FILIAL_COTACAO t = new FILIAL_COTACAO();
      t.filialCOTACAO();
    }



}


When I execute it, it returns  me:


[INFO] Deploying module: metadataExchange-1.5.1 - file:/Users/CInglez/MSV/NetBeansProjects/FILIAL_COTACAO_Axis/dist/lib/mex-1.5.1.jar
org.apache.axiom.soap.SOAPProcessingException: Only Characters are allowed here
      at org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.processText(SOAP11BuilderHelper.java:153)
      at org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.handleEvent(SOAP11BuilderHelper.java:63)
      at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:390)
      at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:227)
      at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:196)
      at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
      at org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:664)
      at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:141)
      at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.findNextElementWithQName(OMChildrenQNameIterator.java:96)
      at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.<init>(OMChildrenQNameIterator.java:53)
      at org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName(OMElementImpl.java:270)
      at org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl.getCode(SOAP11FaultImpl.java:124)
      at org.apache.axis2.AxisFault.initializeValues(AxisFault.java:202)
      at org.apache.axis2.AxisFault.<init>(AxisFault.java:196)
      at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:435)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at com.oracle.xmlns.orawsv.bi_demo.filial_cotacao.FILIAL_COTACAOServiceStub.fILIAL_COTACAO(FILIAL_COTACAOServiceStub.java:181)
      at FILIAL_COTACAO.filialCOTACAO(FILIAL_COTACAO.java:56)
      at FILIAL_COTACAO.main(FILIAL_COTACAO.java:68)


Any ideas?

Thanks
cinglezAsked:
Who is Participating?
 
cinglezConnect With a Mentor Author Commented:
There was a "$" character in one of the Oracle parameters.Removing it solved the problem.
0
 
cinglezAuthor Commented:
Solved doing my own testing
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.