cinglez
asked on
Consume Oracle 11g Native WebService
Hello.
I have a Test Webservice, with the attached WSDL
SIM-FILIAL-USUARIO-TESTE.wsdl.txt
I have created a java client application, but it keeps returning me:
java.lang.IllegalArgumentE xception: faultCode argument for createFault was passed NULL
at com.sun.xml.internal.messa ging.saaj. soap.ver1_ 1.SOAPFact ory1_1Impl .createFau lt(SOAPFac tory1_1Imp l.java:55)
at com.sun.xml.internal.ws.fa ult.SOAP11 Fault.getP rotocolExc eption(SOA P11Fault.j ava:169)
at com.sun.xml.internal.ws.fa ult.SOAPFa ultBuilder .createExc eption(SOA PFaultBuil der.java:1 11)
at com.sun.xml.internal.ws.cl ient.sei.S yncMethodH andler.inv oke(SyncMe thodHandle r.java:108 )
at com.sun.xml.internal.ws.cl ient.sei.S yncMethodH andler.inv oke(SyncMe thodHandle r.java:78)
at com.sun.xml.internal.ws.cl ient.sei.S EIStub.inv oke(SEIStu b.java:107 )
at $Proxy27.simFILIALUSUARIOT ESTE(Unkno wn Source)
at TesteXDB.testeXDB(TesteXDB .java:41)
at TesteXDB.main(TesteXDB.jav a:50)
Authentication seems to be ok. Where should I start looking?
The java code:
import java.net.Authenticator;
import java.net.PasswordAuthentic ation;
import com.oracle.xmlns.orawsv.bi _demo.sim_ filial_usu ario_teste .SIMFILIAL USUARIOTES TEService;
import com.oracle.xmlns.orawsv.bi _demo.sim_ filial_usu ario_teste .SIMFILIAL USUARIOTES TEPortType ;
import com.oracle.xmlns.orawsv.bi _demo.sim_ filial_usu ario_teste .SNUMBERSI MFILIALUSU ARIOTESTEI nput;
import com.oracle.xmlns.orawsv.bi _demo.sim_ filial_usu ario_teste .SIMFILIAL USUARIOTES TEOutput;
class TesteXDB {
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(use r,password .toCharArr ay());
return auth;
}
}
public void testeXDB(){
try { // Call Web Service Operation
SIMFILIALUSUARIOTESTEServi ce service = new SIMFILIALUSUARIOTESTEServi ce();
SIMFILIALUSUARIOTESTEPortT ype port = service.getSIMFILIALUSUARI OTESTEPort ();
MyAuthenticator myAuth = new MyAuthenticator("BI_DEMO", "bi_demo") ;
Authenticator.setDefault(m yAuth);
SNUMBERSIMFILIALUSUARIOTES TEInput parameters = new SNUMBERSIMFILIALUSUARIOTES TEInput();
parameters.setSACUSUARIO$V ARCHAR2IN( "MSVSIM");
parameters.setSENHA$VARCHA R2IN("msv1 ");
SIMFILIALUSUARIOTESTEOutpu t result = port.simFILIALUSUARIOTESTE (parameter s);
System.out.println("Result = "+result);
} catch (Throwable e1) {e1.printStackTrace();}
}
public static void main(String[] args) throws Exception {
TesteXDB t = new TesteXDB();
t.testeXDB();
System.out.println("Result = ABCDEFG");
}
}
I have a Test Webservice, with the attached WSDL
SIM-FILIAL-USUARIO-TESTE.wsdl.txt
I have created a java client application, but it keeps returning me:
java.lang.IllegalArgumentE
at com.sun.xml.internal.messa
at com.sun.xml.internal.ws.fa
at com.sun.xml.internal.ws.fa
at com.sun.xml.internal.ws.cl
at com.sun.xml.internal.ws.cl
at com.sun.xml.internal.ws.cl
at $Proxy27.simFILIALUSUARIOT
at TesteXDB.testeXDB(TesteXDB
at TesteXDB.main(TesteXDB.jav
Authentication seems to be ok. Where should I start looking?
The java code:
import java.net.Authenticator;
import java.net.PasswordAuthentic
import com.oracle.xmlns.orawsv.bi
import com.oracle.xmlns.orawsv.bi
import com.oracle.xmlns.orawsv.bi
import com.oracle.xmlns.orawsv.bi
class TesteXDB {
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(use
return auth;
}
}
public void testeXDB(){
try { // Call Web Service Operation
SIMFILIALUSUARIOTESTEServi
SIMFILIALUSUARIOTESTEPortT
MyAuthenticator myAuth = new MyAuthenticator("BI_DEMO",
Authenticator.setDefault(m
SNUMBERSIMFILIALUSUARIOTES
parameters.setSACUSUARIO$V
parameters.setSENHA$VARCHA
SIMFILIALUSUARIOTESTEOutpu
System.out.println("Result
} catch (Throwable e1) {e1.printStackTrace();}
}
public static void main(String[] args) throws Exception {
TesteXDB t = new TesteXDB();
t.testeXDB();
System.out.println("Result
}
}
Maybe your issue is as simple as providing the password in the EXACT character case (11g passwords are case sensitive).
Also make sure the user can connect, try login with sqlplus.
Good luck!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Authenticated, but still have other problems
ASKER
I keep getting "org.apache.axis2.AxisFaul
My java code now is:
import java.net.Authenticator;
import java.net.PasswordAuthentic
import com.oracle.xmlns.orawsv.sc
import com.oracle.xmlns.orawsv.sc
import com.oracle.xmlns.orawsv.sc
import com.oracle.xmlns.orawsv.sc
import
class EMPCOUNT_XDB {
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(use
return auth;
}
}
public void empcountXDB(){
try { // Call Web Service Operation
EMPCOUNTService service = new EMPCOUNTService();
EMPCOUNTPortType
port = service.getEMPCOUNTPort();
SNUMBEREMPCOUNTInput parameters = new SNUMBEREMPCOUNTInput();
EMPCOUNTOutput result = port.empcount(parameters);
MyAuthenticator myAuth = new MyAuthenticator("SCOTT","t
Authenticator.setDefault(m
System.out.println("Result
} catch (Throwable e1) {e1.printStackTrace();}
}
public static void main(String[] args) throws Exception {
EMPCOUNT_XDB t = new EMPCOUNT_XDB();
t.empcountXDB();
System.out.println("Result
}
}
Is my authentication wrong?