C2DM registration results never receive - response

I have used "Android Cloud to Device Messaging (C2DM) - Tutorial" by Lars Vogel.
When i start my applcation, registration response never received.
How It can be solved?
my Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application android:icon="#drawable/appicon" android:label="#string/app_name" android:debuggable="true">
<activity android:name=".activities.MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.DailyTripList" android:screenOrientation="portrait" />
<activity android:name=".ui.TripActivity" android:screenOrientation="portrait" />
<activity android:name=".ui.StationsList" android:screenOrientation="portrait" />
<activity android:name=".ui.StationActivity" android:screenOrientation="portrait" />
<activity android:name=".ui.PassengerList" android:screenOrientation="portrait" />
<activity android:name=".ui.DriverMsgList" android:screenOrientation="portrait" />
<service android:name=".services.SecurityReqestTransmitter" android:exported="false"/>
<service android:name=".services.LocationTransmitter" android:exported="false"/>
<activity android:name=".cardReader.IDTUniMagActivity" android:screenOrientation="portrait" />
<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.em_projects.MyWay.receivers" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.em_projects.MyWay.receivers" />
</intent-filter>
</receiver>
</application>
CatLog
08-15 23:57:41.624: WARN/KeyCharacterMap(959): No keyboard for id 0
08-15 23:57:41.634: WARN/KeyCharacterMap(959): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
08-15 23:57:44.645: DEBUG/dalvikvm(150): GC_EXTERNAL_ALLOC freed 698 objects / 37712 bytes in 273ms
08-15 23:58:01.374: DEBUG/SntpClient(70): request time failed: java.net.SocketException: Address family not supported by protocol
08-15 23:58:17.365: INFO/EventLogService(236): Aggregate from 1313450896472 (log), 1313450896472 (data)
08-15 23:58:22.704: DEBUG/dalvikvm(236): GC_EXPLICIT freed 473 objects / 120056 bytes in 276ms
08-15 23:58:29.744: DEBUG/dalvikvm(150): GC_EXTERNAL_ALLOC freed 611 objects / 29936 bytes in 198ms
08-15 23:58:32.754: DEBUG/MainActivity(959): onClick
08-15 23:58:33.944: INFO/global(959): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
08-15 23:58:33.974: DEBUG/Communicator(959): # parseData <?xml version="1.0" encoding="UTF-8"?><root><row internal_code="644" external_code="1442" ws_string="http://wap.y-it.co.il:8080/wapdb/ws_redirect/http://localhost:8080/fltctrl_11" report_location_period="60" reject_mission="1"/></root>
08-15 23:58:34.124: DEBUG/MainActivity(959): Rows counter = 1
08-15 23:58:34.155: DEBUG/MainActivity(959): handleMessage
08-15 23:58:34.184: INFO/ActivityManager(70): Starting activity: Intent { flg=0x4000000 cmp=com.em_projects.MyWay/.ui.DailyTripList }
08-15 23:58:34.494: DEBUG/DailyTripList(959): onCreate
08-15 23:58:35.444: DEBUG/dalvikvm(959): GC_FOR_MALLOC freed 7436 objects / 493624 bytes in 90ms
08-15 23:58:43.254: ERROR/C2DMRegistrar(236): [C2DMReg] handleRequest caught java.io.IOException: SSL shutdown failed: I/O error during system call, Broken pipe
08-15 23:58:43.534: DEBUG/SecurityReqestTransmitter(959): onCreate
08-15 23:58:43.584: DEBUG/SecurityReqestTransmitter(959): initServiceThread
08-15 23:58:43.624: DEBUG/SecurityReqestTransmitter(959): run
08-15 23:58:43.634: DEBUG/SecurityReqestTransmitter(959): onStartCommand
08-15 23:58:43.875: DEBUG/LocationTransmitter(959): onCreate
08-15 23:58:43.944: DEBUG/LocationTransmitter(959): spd = 0.0
08-15 23:58:44.024: WARN/GpsLocationProvider(70): Duplicate add listener for uid 10040
08-15 23:58:44.224: WARN/ActivityManager(70): Launch timeout has expired, giving up wake lock!
08-15 23:58:44.414: INFO/global(959): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
08-15 23:58:44.454: WARN/ActivityManager(70): Activity idle timeout for HistoryRecord{44ec58c0 com.em_projects.MyWay/.ui.DailyTripList}
08-15 23:58:44.534: DEBUG/Communicator(959): # parseData <?xml version="1.0" encoding="UTF-8"?><root><row line_code="90476" acc_name="אי סי אי" order_start_time="08:00" order_end_time="08:30" line_description="איסוף עובדים איזור הדרום" line_status="-1" t_Pass_QTY="4" Pass_QTY="4" group_name="שם הקבוצה" department_name="שם המחלקה" line_date="2011-08-15" long_remarks="הערות ארוכות...
שורה שניה
שורה שלישית
שורה רביעית
שורה אחרונה !" short_remarks="הערות קצרות של הנסיעה"/><row line_code="90377" acc_name="מפעל תע"ש רכש" order_start_time="12:00" order_end_time="12:45" line_description="מרוחובות+נס ציונה לתע"ש" line_status="-1" t_Pass_QTY="0" Pass_QTY="0" line_date="2011-08-15" long_remarks="" short_remarks=""/><row line_code="90406" acc_name="משתלת ציפורן" order_start_time="15:00" order_end_time="15:40" line_description="הסעות עובדים אמצע שבוע" line_status="5" t_Pass_QTY="0" Pass_QTY="0" department_name="מחלקה 1" line_date="2011-08-15" long_remarks="על הנהג להתקשר לשלמה 050-3344334 בעל המשתלה
כל יום לאחר סיום ההסעה." short_remarks="הערה ליום ב'"/><row line_code="90439" acc_name="טבע כפר סבא" order_start_time="18:00" order_end_time="18:00" line_description="נתב"ג כ"ס" line_status="-1" t_Pass_QTY="0" Pass_QTY="0" line_date="2011-08-15" long_remarks="" short_remarks=""/></root>
08-15 23:58:47.554: INFO/ActivityManager(70): Displayed activity com.em_projects.MyWay/.ui.DailyTripList: 13122 ms (total 13122 ms)

Is your app package name com.em_projects.MyWay.receivers?
If no, try to use only your package name instead of com.em_projects.MyWay.receivers in categories
<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="***your_app_package_name***" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="***your_app_package_name***" />
</intent-filter>
</receiver>

Related

Problem using Firebase Facebook and Google login on Android

I can't use the firebase login with facebook or google in my Flutter application. It works fine on ios
It doesn't receive confirmation from the provider and doesn't throw success or error. It doesn't work on simulator or real device. The login by email works perfect
My login code:
final _auth = FirebaseAuth.instance;
_auth.onAuthStateChanged.listen((user) {
if (user != null) {
//get useer data
} else {
//go to login page
}
});
Future<Null> _loginByFacebook(Completer completer) async {
FacebookLogin facebookLogin = new FacebookLogin();
FacebookLoginResult result = await facebookLogin.logInWithReadPermissions(['email', 'public_profile']);
switch (result.status) {
case FacebookLoginStatus.loggedIn:
AuthCredential credential = FacebookAuthProvider.getCredential(accessToken: result.accessToken.token);
FirebaseAuth.instance.signInWithCredential(credential);
completer.complete();
break;
case FacebookLoginStatus.cancelledByUser:
break;
case FacebookLoginStatus.error:
completer.completeError(result.errorMessage);
}
}
Future<Null> _loginByGoogle( Completer completer) async {
try {
await GoogleSignIn().signIn();
completer.complete();
} catch (error) {
completer.completeError(error);
print(error);
}
}
My AndroidManifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="app"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!--facebook login configuration>-->
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!--end facebook configuration-->
</application>
</manifest>
Debug informatino when I try to usee the facebook login:
D/ (19022): HostConnection::get() New Host Connection established 0x8fe3ca80, tid 19059
D/EGL_emulation(19022): eglMakeCurrent: 0x9cba4460: ver 2 0 (tinfo 0xa1283790)
I/flutter (19022): user not logged :`(
W/System (19022): ClassLoader referenced unknown path: /system/app/Chrome/lib/x86
I/WebViewFactory(19022): Loading com.android.chrome version 51.0.2704.90 (code 275509012)
I/cr_LibraryLoader(19022): Time to load native libraries: 1 ms (timestamps 9943-9944)
I/cr_LibraryLoader(19022): Expected native library version number "51.0.2704.90", actual native library version number "51.0.2704.90"
V/WebViewChromiumFactoryProvider(19022): Binding Chromium to main looper Looper (main, tid 1) {2441051}
I/cr_LibraryLoader(19022): Expected native library version number "51.0.2704.90", actual native library version number "51.0.2704.90"
I/chromium(19022): [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup(19022): Initializing chromium process, singleProcess=true
E/ApkAssets(19022): Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
E/ApkAssets(19022): Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin
D/EGL_emulation(19022): eglCreateContext: 0x86b79440: maj 2 min 0 rcv 2
D/EGL_emulation(19022): eglMakeCurrent: 0x86b79440: ver 2 0 (tinfo 0x8b5c1ef0)
W/cr_media(19022): Requires BLUETOOTH permission
D/cr_Ime (19022): [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents(19022): onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime (19022): [InputMethodManagerWrapper.java:59] isActive: false
I/cr_Ime (19022): ImeThread is not enabled.
E/libEGL (19022): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/VideoCapabilities(19022): Unsupported profile 4 for video/mp4v-es
D/ (19022): HostConnection::get() New Host Connection established 0x821595c0, tid 19100
D/EGL_emulation(19022): eglCreateContext: 0x82103120: maj 2 min 0 rcv 2
D/EGL_emulation(19022): eglMakeCurrent: 0x82103120: ver 2 0 (tinfo 0x827c98b0)
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
W/cr_BindingManager(19022): Cannot call determinedVisibility() - never saw a connection for the pid: 19022
D/cr_Ime (19022): [InputMethodManagerWrapper.java:59] isActive: false
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
W/art (19022): Attempt to remove non-JNI local reference, dumping thread
D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
When I try the google login only appears: D/EGL_emulation(19022): eglMakeCurrent: 0xa1285cc0: ver 2 0 (tinfo 0xa1283840)
Any guess where may be the problem? :)
UPDATE: I could make it work with Google Sign in updating the code to:
Future<Null> _loginByGoogle( Completer completer) async {
try {
final GoogleSignIn _googleSignIn = GoogleSignIn();
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
await _auth.signInWithCredential(credential);
completer.complete();
} catch (error) {
completer.completeError(error.message);
print(error);
}
}
But, the Facebook login problem keeps the same. When it requests the login it doesn't get result (success or failure)

PhoneGap Build 6.3.0 geolocation getCurrentPosition slow on IOS

I am new in developing on PhoneGap Build. While testing some basic app functionalities I experience a timeout problem when doing a simple geolocation request on my Iphone 6 / IOS 10 / PhoneGap Build 6.3.0.
After re-installing the app I start it and initiate the geolocation by onclick -> geolocation().
Only when I turn the app to the background, I receive the IOS request to allow the location request (should come when I first do the onclick -> geolocation while having the app in the foreground).
Sometimes I get a geolocation result after a long time, sometimes not. I've tried all possible combinations on the three PositionOptions.
When I ask the Google Maps app it shows me the location immediately.
Any idea what I am doing wrong?
Thank you, Kim
function do_geolocation(){
alert('do geoloc');
navigator.geolocation.getCurrentPosition(geo_onSuccess, geo_onError, {maximumAge:120000, enableHighAccuracy:false} );
}
onclick=do_geolocation();
function geo_onSuccess(position){
alert('Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Altitude: ' + position.coords.altitude + '\n' +
'Accuracy: ' + position.coords.accuracy + '\n' +
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' +
'Heading: ' + position.coords.heading + '\n' +
'Speed: ' + position.coords.speed + '\n' +
'Timestamp: ' + position.timestamp + '\n');
var arr = new Array();
arr['lat'] = position.coords.latitude;
arr['lng'] = position.coords.longitude;
var x = new Date();var cb = x.getTime();
}
function geo_onError(position){
alert('code: '+error.code+'\nmessage: '+error.message+'\n');
return false;
}
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "de.vvvvvv.secapp"
versionCode = "10"
version = "1.0.0" >
<!-- versionCode is optional and Android only -->
<name>vvvvvvv</name>
<description>
vvvvvvvvvvvv
</description>
<author href="http://vvvvvvv.de" email="info#vvvvvv.de">
Kim
</author>
<plugin name="cordova-plugin-geolocation" spec="2.4.1" />
<plugin name="cordova-plugin-whitelist" spec="1.3.1" />
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<preference name="orientation" value="portrait" />
<!-- https://makeappicon.com/ios10icon -->
<icon src="res/icons/ios/Icon-App-20x20#2x.png" platform="ios" width="20" height="20" />
<icon src="res/icons/ios/Icon-App-20x20#3x.png" platform="ios" width="40" height="40" />
...
Only when I turn the app to the background, I receive the IOS request to allow the location request (should come when I first do the onclick -> geolocation while having the app in the foreground).
The activation only on backgrounding the app sounds sympomatic of a Content-Security-Policy issue (here's another example).
To resolve, ensure that your Content-Security-Policy meta tag contains gap://ready and file: entries for default-src. For example:
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src * 'unsafe-inline' 'unsafe-eval'">
Sometimes I get a geolocation result after a long time, sometimes not. I've tried all possible combinations on the three PositionOptions.
Setting maximumAge to 120000 means a position up to 2 minutes old (cached by the OS) can be used. To force a fresh position, set it to zero:
{
enableHighAccuracy: false
maximumAge: 0,
timeout: 2000
}
If setting enableHighAccuracy to true, this engages GPS hardware to get a lock, so set a sufficient timeout to allow it to lock enough satellites:
{
enableHighAccuracy: true
maximumAge: 0,
timeout: 30000
}
For a full explanation of PositionOptions, see the Mozilla docs

Android - write to a file . Can't find the file

I'm new to android, so this might be prety basic.
I'm trying to write data into a file, yet I can not find the file in the device.
I'm trying to get the file in the following directory:
"Computer\Nexus 5\Internal storage\Android\data\application name"
I have tried different method but none of them has worked:
FileOutputStream stream;
try {
stream = openFileOutput(filename,Context.MODE_APPEND | Context.MODE_WORLD_READABLE);
stream.write(string.getBytes());
stream.close();
}catch(IOException e){
}}
and
String path = Environment.getExternalStorageDirectory().getAbsolutePath()+"/Android/data/" + packageName + "/files/";
try {
boolean exists = (new File(path )).exists();
if (!exists) {
new File(path ).mkdirs();
}
// Open output stream
FileOutputStream fOut = new FileOutputStream(path + filename,true);
// write integers as separated ascii's
fOut.write((Integer.valueOf(content).toString() + " ").getBytes());
// Close output stream
fOut.flush();
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
I have added the permission in the manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.proLeague"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/>
<group gid="sdcard_rw" />
<group gid="media_rw" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:debuggable= "true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I thought maybe the file is logged properly but I need to pull it out from the ADB, is that possible?
I had manage to solve my issues on my own :
Evantually the code was fine, the problem was that on my nexus 5 phone I need to reboot the phone before I search for new files in the flash storage.
I saw in some blogs it is pretty common.

How to use Spring Security http pattern on Mule?

Im using spring security, but some parts without been secure and some with so i implemented http pattern for my paths, but it doesnt appear to be working or even going through that part of the code...
Code done so far:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:ssl="http://www.mulesoft.org/schema/mule/ssl" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:https="http://www.mulesoft.org/schema/mule/https"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/servlet http://www.mulesoft.org/schema/mule/servlet/current/mule-servlet.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/current/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.4/mule-http.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.4/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.4/mule-spring-security.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.mulesoft.org/schema/mule/ssl http://www.mulesoft.org/schema/mule/ssl/current/mule-ssl.xsd" version="EE-3.4.0">
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="jdbc-provider" delegate-ref="authenticationManager"></mule-ss:delegate-security-provider>
</mule-ss:security-manager>
<spring:beans>
<spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" id="loggingInInterceptor" />
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" id="loggingOutInterceptor"/>
<spring:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<spring:property name="driverClassName" value="${database.driver}"/>
<spring:property name="url" value="${database.url}"/>
<spring:property name="username" value="${database.user}"/>
<spring:property name="password" value="${database.pass}"/>
</spring:bean>
<ss:http auto-config="true" use-expressions="true" request-matcher="regex">
<ss:intercept-url pattern="^/services/.*\.WSDL$" access="permitAll"/>
<ss:intercept-url pattern="^/services/${webservice.idp.in.pessoas.path}" access="hasRole('ROLE_IDP')" />
<ss:intercept-url pattern="^/services/${webservice.idp.in.setor.path}" access="hasRole('ROLE_IDP')" >
</ss:http>
<ss:authentication-manager alias="authenticationManager" >
<ss:authentication-provider>
<ss:jdbc-user-service data-source-ref="dataSource"
users-by-username-query="
select username, password, enabled
from users where username=?"
authorities-by-username-query="
select u.username, ur.authority from users u, authorities ur
where u.id = ur.user_id and u.username =? "/>
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>
<https:connector name="httpsConnector" doc:name="HTTP\HTTPS">
<https:tls-key-store path="${mule.home}/conf/keystore.jks" keyPassword="ciasc.123" storePassword="ciasc.123"></https:tls-key-store>
</https:connector>
<scripting:transformer name="noopLoggingTransformer">
<scripting:script engine="groovy">
def props = [:]
props['User-Agent'] = message.getProperty('User-Agent', org.mule.api.transport.PropertyScope.INBOUND)
props['MULE_REMOTE_CLIENT_ADDRESS'] = message.getProperty('MULE_REMOTE_CLIENT_ADDRESS', org.mule.api.transport.PropertyScope.INBOUND)
props['http.request'] = message.getProperty('http.request', org.mule.api.transport.PropertyScope.INBOUND)
muleContext.client.dispatch('vm://log-request.in', payload, props)
message
</scripting:script>
</scripting:transformer>
<pattern:web-service-proxy name="Logradouros2" transformer-refs="noopLoggingTransformer" wsdlFile="AutenticacaoServico.wsdl">
<http:inbound-endpoint address="${serverName}/services/Logradouros/AutenticacaoServico" exchange-pattern="request-response">
<http:basic-security-filter realm="mule-realm"/>
</http:inbound-endpoint>
<http:outbound-endpoint address="${targetServer}/servicos/v2/AutenticacaoServico.svc" exchange-pattern="request-response" />
</pattern:web-service-proxy>
<jdbc-ee:postgresql-data-source name="WSA" user="${database.user}" password="${database.pass}" url="${database.url}" transactionIsolation="UNSPECIFIED" doc:name="PostgreSQL Data Source">
</jdbc-ee:postgresql-data-source>
<jdbc-ee:connector name="jdbcConnector" dataSource-ref="WSA" validateConnections="false" transactionPerMessage="true" queryTimeout="10" pollingFrequency="10000" doc:name="JDBC">
<jdbc-ee:query key="wsadb" value="insert into inbound_messages (payload, timestamp, agent, ip_from, endpoint, soap_operation) values ('', now(), #[groovy: return message.getInboundProperty('user-agent').toString()], #[groovy: return message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').toString()], #[groovy: return message.getInboundProperty('http.request').toString()], '');"></jdbc-ee:query>
</jdbc-ee:connector>
<flow name="log-request" doc:name="log-request">
<vm:inbound-endpoint path="log-request.in" />
<logger message="#[groovy: return message.getInboundProperty('user-agent').toString()], #[groovy: return message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').toString()], #[groovy: return message.getInboundProperty('http.request').toString()]" level="INFO" doc:name="Logger"/>
<jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="wsadb" responseTimeout="10000" queryTimeout="-1" connector-ref="jdbcConnector" doc:name="Persist raw message" />
</flow>
</mule>
What is required to do to access that?
What i intend to do with that is access the wsdl file without login requirements, and the methods with...
Since you are using Mule's inbound HTTP endpoint, most of the Spring Security you have in place is useless. For example the intercept-url are not doing anything.
I suggest your look at the source code of org.mule.transport.http.filters.HttpBasicAuthenticationFilter and extend it with your own code that will waive security for WSDL requests.
Then replace <http:basic-security-filter realm="mule-realm"/> with your own version.

Unknown property error within item renderer's data property

I'm using an item renderer, but keep getting this actionscript error:
Error: Unknown Property: 'skillName'. at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:870]
at mx.binding::PropertyWatcher/updateProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:338]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.binding::Watcher/wrapUpdate()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Watcher.as:192]
at mx.binding::PropertyWatcher/updateParent()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:239]
at mx.binding::Watcher/updateChildren()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Watcher.as:138]
at mx.binding::PropertyWatcher/updateProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:347]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.binding::Watcher/wrapUpdate()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Watcher.as:192]
at mx.binding::PropertyWatcher/eventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\PropertyWatcher.as:375]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at spark.components::DataRenderer/set data()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataRenderer.as:123]
at spark.components::SkinnableDataContainer/updateRenderer()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableDataContainer.as:606]
at spark.components.supportClasses::ListBase/updateRenderer()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\ListBase.as:1106]
at spark.components::DataGroup/setUpItemRenderer()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:1157]
at spark.components::DataGroup/initializeTypicalItem()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:327]
at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:384]
at spark.components::DataGroup/measure()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\DataGroup.as:1467]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8430]
at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:665]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:816]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
The weird thing is that it worked fine, until at a certain point I kept getting this error, out of the blue. I've been searching for it on Google and Stackoverflow and struck upon a few websites, but none of the answers could help me get any further. It seems this error is also mostly thrown in mobile AIR projects, but mine is a Flash Player project...
This is how the itemrenderer looks:
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:components="components.*"
width="100%" height="100%" autoDrawBackground="true"
creationComplete="creationCompleteHandler(event)"
height.login_edit_state="80"
color.login_edit_state="#000000"
height.login_preview_state="80">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.utils.ArrayUtil;
public var loggedin:Boolean = true;
[Bindable]private var ac_projects:ArrayCollection;
protected function creationCompleteHandler(event:FlexEvent):void
{
currentState = "login_preview_state";
img_foldout_preview.addEventListener(MouseEvent.CLICK, changeState);
img_edit_preview.addEventListener(MouseEvent.CLICK, changeState);
http_projects.addEventListener(ResultEvent.RESULT, http_projects_resultEvent);
http_projects.addEventListener(FaultEvent.FAULT, http_projects_faultEvent);
http_projects.url = "http://localhost/sourcefoliocom.adobe.flexbuilder.project.flexbuilder/bindebug/php/getAllProjectsByUserSkill.php?id=" + data.userId + "&skill=" + data.skillId ;
trace("http://localhost/sourcefoliocom.adobe.flexbuilder.project.flexbuilder/bindebug/php/getAllProjectsByUserSkill.php?id="+ data.userId + "&skill=" + data.skillId);
http_projects.send();
}
protected function http_projects_resultEvent(event:ResultEvent):void
{
ac_projects = new ArrayCollection(ArrayUtil.toArray(event.result.projects.project));
rpt_projects.dataProvider = ac_projects;
}
protected function http_projects_faultEvent(event:FaultEvent):void
{
trace("Kon projecten niet laden");
}
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService id="http_projects"
method="GET" />
</fx:Declarations>
<s:states>
<s:State name="login_preview_state"/>
<s:State name="login_opened_state"/>
<s:State name="login_edit_state"/>
</s:states>
<s:layout.login_opened_state>
<s:VerticalLayout horizontalAlign="right"/>
</s:layout.login_opened_state>
<!-- login_opened_state -->
<s:SkinnableContainer includeIn="login_opened_state" width="100%" height="80">
<s:layout>
<s:HorizontalLayout gap="20" paddingBottom="20" paddingLeft="20" paddingRight="20" paddingTop="20" verticalAlign="middle"/>
</s:layout>
<s:Label fontSize="20" fontWeight="bold" text="{data.skillName}"/>
<s:Label fontSize="20" text="junior"/>
<s:Spacer width="100%" height="10"/>
<s:Image id="img_edit_open" width="20" height="20" source="images/edit.png" buttonMode="true" useHandCursor="true"/>
<s:Image id="img_foldin_open" width="20" height="20" buttonMode="true" source="images/foldin.png" useHandCursor="true"/>
</s:SkinnableContainer>
<s:VGroup id="vg_opened"
visible="false"
width="900" height="1000" gap="0"
horizontalAlign="right">
<mx:VBox>
<mx:Repeater id="rpt_projects" width="100%">
<components:Project currentItem= {rpt_projects.currentItem}" loggedin="true"/>
</mx:Repeater>
<components:AddProject />
</mx:VBox>
<s:Image x="824" width="76" height="51" source="images/edit_flag.png" useHandCursor="true"/>
</s:VGroup>
</s:ItemRenderer>
The error is thrown at this line:
<s:Label fontSize="20" fontWeight="bold" text="{data.skillName}"/>
The ArrayCollection filling up this renderer is an xml file my own webservice returns. I've tested the file and the use of skillName should be correct in this case.
Do you need to see more code or some more info? Let me know!
I found out I'm dealing with a two dimensional ArrayCollection. I'm not correctly referring to the items in this ArrayCollection, so that's why the properties are not recognized.

Resources