WSO2 ESB Using AuthenticationAdmin - wsdl

I have a NetBeans Project and tried to creat an Web Service client with the following WSDL from WSO2 ESB 4.6.0 like in this example:
https://localhost:9443/services/AuthenticationAdmin?wsdl
But when NetBeans tries to create the client I get an error:
Why is this happening? I created other Web Service Clients, they are working, but this isn't working and I don't know why...
If I try it with eclipse I also get an error:
IWAB0399E Error in generating Java from WSDL: java.io.IOException: ERROR: Missing <soap:fault> element inFault "AuthenticationAdminAuthenticationException" in operation "AuthenticationAdminAuthenticationException", in binding logout
java.io.IOException: ERROR: Missing <soap:fault> element inFault "AuthenticationAdminAuthenticationException" in operation "AuthenticationAdminAuthenticationException", in binding logout
at org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2858)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:722)
Maybe the WSDL has an error?

The AuthenticationAdmin WSDL file is correct.
The logout operation is defined as a "One-way" operation. If you look at AuthenticationAdmin.java implementation, you can see logout method has following signature.
public void logout() throws AuthenticationException
Note that the return type is "void", which means there is no output.
WSO2 uses Apache Axis2 and there are no problems generating the client with Axis2.
I just tried creating a client with Eclipse & Apache Axis2. I could successfully create the stub.
WSO2 also uses the Service Stub created using AuthenticationAdmin WSDL. See pom.xml for more information about generating the client.
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<arg line="-uri src/main/resources/AuthenticationAdmin.wsdl
-u -uw -o target/generated-code
-ns2p http://common.core.carbon.wso2.org/xsd=org.wso2.carbon.authenticator.stub.authentication,http://authentication.services.core.carbon.wso2.org=org.wso2.carbon.authenticator.stub,http://authentication.services.core.carbon.wso2.org/xsd=org.wso2.carbon.authenticator.stub"/>
<classpath refid="wsdl2java.classpath"/>
</java>
I'm getting the same error as you have shown, when I try to generate the client using Apache Axis. Therefore please make sure to use Apache Axis2 as the web service runtime. Also make sure you point Axis2 directory in Eclipse Preferences -> Web Services -> Axis2 Preferences.
I also see NetBeans try to use wsimport utility. May be it doesn't support one-way operations properly.
I recommend you to use Apache Axis2 to generate the client.

Related

wsdl schema namespace prefix is changing in different environments - AXIS2

I deployed a component having SOAP webservices in an Open Nebula recently. After deployment, we noticed the WSDL responses to be having a different namespace prefix
Problem: AlertBot was expecting to see
<ax25:response>TEST</ax25:response>
but, it started seeing
<ax21:response>TEST</ax21:response> instead. We compared the build between the new and old host, and saw no differences in config files, or the java package.
We need to figure out why the ax25 part namespace prefix got changed to ax21 on the new host
NOTE: We use AXIS2 library for generating WSDLs

Chrome and Spring security: Refused to execute script from 'http://<server url>/assets/app.js' because its MIME type ('') is not executable

I'm using the Chrome and the Spring security and I got the following error message:
Refused to execute script from 'http://<server url>/assets/app.js' because its MIME type ('') is not executable
in the Chrome browser. The application is working with the IE and the Firefox browsers, because they don't care the missing MIME type. How the change the configuration and fix the problem?
I have an other project and its source code. When I run the other project and the app.js is returned from the server there are in the response headers the content type "application/javascript". But when I search for the source code I don't find the string "application/javascript". So how this is configured? The string "application/javascript" is not configured in the application server, because all the Jetty configuration are in the source files.
One solution is to add to the web.xml
<mime-mapping>
<extension>js</extension>
<mime-type>application/javascript</mime-type>
</mime-mapping>

Keycloak Unknown authentication mechanism

I need help with using keycloak in an Errai app. I am getting an error about "unknown authentication method" for "KEYCLOAK" ? I have the keycloak-appliance running (on a different port though), and the Errai app has a with KEYCLOAK in the web.xml file inside WEB-INF
When I run the Errai app with mvn gwt:run, I get : RuntimeException caused by "Unknown authentication mechanism KEYCLOAK". I have no idea how to go around this issue .
Just wanted to add a little more detail to #cfsnyder's answer. In order for your application server to recognize a definition in the web.xml that looks like this:
<login-config>
<auth-method>KEYCLOAK</auth-method>
<realm-name>internal</realm-name>
</login-config>
you'll need to tell jboss (in this instance) how to interpret that particular auth method. At the time of my answer, this is in section 8.2 of the Keycloak docs.
First, download the keycloak adapter (remember, this is not the same as the Keycloak Server). Next, unzip the download in the wildfly home directory. With your application server running, just use the following command to install the Keycloak configuration into the appropriate files:
jboss-cli.sh -c --file=adapter-install.cli
When this script completes, your configuration file will have the new entry added to accommodate the KEYCLOAK entry in your web.xml. The script will add something like this to either a domain.xml or standalone.xml:
<security-domain name="keycloak">
<authentication>
<login-module code="org.keycloak.adapters.jboss.KeycloakLoginModule" flag="required"/>
</authentication>
</security-domain>
Once you have the Keycloak module files provided by the adapter + the security domain configuration to link the KEYCLOAK method to the appropriate LoginModule, you should be all set.
You will need to install and configure the Wildfly adapter in order for your Errai app to recognize the "KEYCLOAK" authentication method. See section 7.2 of the Keycloak documentation.
To add to #josh-cain's answer, you might also need following additions in your domain.xml or standalone.xml:
To <extensions></extensions>, add:
<extension module="org.keycloak.keycloak-adapter-subsystem"/>
To <profile></profile>, add:
<subsystem xmlns="urn:jboss:domain:keycloak:1.1"/>
The adapter installation cli scripts can fail for various reasons so you might need to add these entries manually.

Unable to deploy a osgi bundle containing a camel route defined via aries blueprint in Websphere 8.5

I created an .eba file (enterprise bundle archive) that contains one osgi bundle having a apache camel route (Java DSL). The camel context definition is done via a blueprint xml file. When I tried to deploy the .eba file in Websphere Application Server 8.5, I got the following exception:
org.apache.aries.application.modelling.ModellerException: CWSAL0126E: An exception occurred while modelling bundle ib-base_0.0.1.SNAPSHOT: org.apache.aries.application.modelling.ModellerException: org.osgi.service.blueprint.container.ComponentDefinitionException: Unsupported node namespace: http://camel.apache.org/schema/blueprint.
My blueprint xml file is as follows:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-
blueprint.xsd">
<camel:camelContext id="cbrContext" trace="false">
<camel:packageScan>
<camel:package>a.b.c.d</camel:package>
</camel:packageScan>
</camel:camelContext>
</blueprint>
I am not too sure why this fails in Websphere. The same .eba file gets successfully deployed in Karaf 3.0.0-SNAPSHOT. (This version of Karaf uses Aries Blueprint version 1.0.0).
I guess the same is used or a forked version of the Aries Blueprint 1.0.0 is used in Websphere 8.5.
As per the OSGi specs, any blueprint extension handlers for custom namespaces like camel: are retrieved from the OSGi Service Registry under the key (osgi.service.blueprint.namespace). The value element tells the actual namespace uri .
eg:
<service interface="org.apache.aries.blueprint.NamespaceHandler">
<service-properties>
<entry key="osgi.service.blueprint.namespace" value="http://camel.apache.org/schema/blueprint"/>
<entry key="osgi.service.blueprint.namespace" value="http://camel.apache.org/schema/blueprint/cxf"/>
</service-properties>
<bean class="org.apache.camel.blueprint.handler.CamelNamespaceHandler">
</bean>
</service>
I am not too sure why IBM does not honor this spec.
Another interesting point to ponder over is the fact that when I tried to create a blueprint .xml file using Websphere Application Developer Tool, it shows only 4 extensions as shown below:
IBM Blueprint Extension
JPA Blueprint Support
Blueprint Transaction Support
Blueprint Resource Reference support
I ensured that both the camel-core and camel-blueprint bundles are deployed in the internal repository in websphere.
I tried to deploy the .eba file as an asset.
Not too sure, if I have missed something. I would be glad if someone can point me in the right direction.
best regards,
Sriraman.
WebSphere does not support custom namespace extension (other than the one provided by IBM). The main reason being it runs on Aries (Blueprint container) isolated runtime. There are two options
Use camel api instead of blueprint tags
Use other container (for e.g. Karaf) which supports custom namespace extension
Karaf is a friendly container for camel.

Axapta Error :The Configuration "xxxx" could not be found

When ever i try to launch the application through citrix. i get the error "The Configuration "xxxx" could not be found.
Use the Navision Axapta Configuration Utility to verify the configuration.Please restart the Axapta Business Connector before Logging on.
The Application runs on Axapta and i have im[orted the .xpo files in the Axapta Connector Utility 3.0.
Kindly suggest how to fix the error.
Thanks!!!
You have to import the XPO on the Citrix server and for each user.
The easy way to is incorporate it in the Citrix shortcut it self:
"C:\Program Files\Navision\Axapta Client\Bin\ax32.exe" "-regimport=\\File01\Appl\Config\Test.xpo" -regconfig=Test
The -regimport has the path to the configuration file and -regconfig tells Axapta to use that configuration (hopefully the one in the file).

Resources