1

I am having problems consuming a SOAP WebService with security that uses a certificate to encrypt the data. I am using GeneXus 17 (but I did this same test with GeneXus X Evolution 2 and 3) generating Java. I did all the necessary steps to generate the certificate and the keystore, then I added everything in the KB and in the object as specified there but it gives me the following error when executing it:

"C:\Program Files\Java\jdk1.8.0_241\bin\java.exe" com.rendiciongastos17.aobtnerrendicionespendientessoap
Exception in thread "main" java.lang.RuntimeException: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.(-5)
at com.rendiciongastos17.SdtClients.getrendicionespendientesintegracion(SdtClients.java:386)
at com.rendiciongastos17.aobtnerpendingrendicionessoap.privateExecute(aobtnerpendingrendicionessoap.java:61)
at com.renditionexpenses17.aobtnerpendingrenditionssoap.execute_int(aobtnerpendingrenditionssoap.java:46)
at com.renditionexpenses17.aobtnerrenditionspendingsoap.execute(aobtnerrenditionspendingsoap.java:38)
at com.surrenderpending17.aobtnerrenderpendingsoap.executeCmdLine(aobtnerrenderpendingsoap.java:22)
at com.renditionexpenses17.aobtnerrenditionspendingsoap.main(aobtnerrenditionspendingsoap.java:15)
Failed: Execution

Now if I import the WSDL into SOAPUI and run it, it does fine.

The only code I have is:

java System.setProperty("javax.net.ssl.trustStore", "d:\\caolix");
java System.setProperty("javax.net.ssl.trustStorePassword", "Riogas1710");

&location = GetLocation('Clients')
&location.Authentication = 1
&location.AuthenticationMethod = 0
&location.AuthenticationRealm = "UnRealm"
&location.AuthenticationUser = "riogas"
&location.AuthenticationPassword = "xcrtdymx"

&RendicionesPendientesDeIntegracion = &wsClients.GetRendicionesPendientesIntegracion()

The location of the keystoke is correct and I can't see what it can be.

Kensy
  • 112
  • 8

1 Answers1

0

This error could be related with the SAC numbers #48044, #49588 or #51075, take a look at them before do anything. If it's not, then the error comes because the endpoint is not returning an XML, or something broke in between. You're talking about "a certificate to encrypt the data", but there is no code where you "encrypt the data" itself, setting the property to a trustStore is not enought, you have to use the Security API to encrypt the data. And last but not least, I do see that the web service provider uses realm-based authentication, check if the parameters are ok. It's very rare to see endpoints with realm-based authentication but, who knows...