Tsung load testing not able to send message ejabberd server - xmpp

I am new to this tsung load testing framework, since last one week i have been exploring this tool to load test my ejabberd server till now i am able to register some 200 users at one go that is awesome, i am able to generate report Graphs (right now it is blank all over).
My problem is I am not able to send message from the sendmessage.xml file to my any other user through I am new to this tsung load testing framework, since last one week i have been exploring this tool to load test my ejabberd server till now i am able to register some 200 users at one go that is awesome, i am able to generate report Graphs (right now it is blank all over).
My problem is I am not able to send message from the sendmessage.xml file to my any other user through my ejabberd instance here is my sendmessage.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info" backend="json">
<clients>
<client host="localhost" use_controller_vm="true"/>
</clients>
<servers>
<server host="*.*.*.*" port="5222" type="tcp"/>
</servers>
<load duration="12" unit="minute">
<arrivalphase phase="1" duration="12" unit="minute">
<users maxnumber="100" interarrival="1" unit="second"></users>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="5"></option>
<option type="ts_jabber" name="userid_max" value="200000" />
<option type="ts_jabber" name="domain" value="hostname.com" />
<option type="ts_jabber" name="username" value="andupandu" />
<option type="ts_jabber" name="passwd" value="password" />
</options>
<sessions>
<session probability="100" name="xmpp-connection" type="ts_jabber">
<request> <jabber type="connect" ack="local"></jabber> </request>
<thinktime value="2"></thinktime>
<request><jabber type="starttls" ack="bidi_ack" />
</request>
<thinktime value="5"></thinktime>
<transaction name="authenticate">
<request> <jabber type="auth_sasl_anonymous" ack="local"></jabber> </request>
<request> <jabber type="connect" ack="local"></jabber> </request>
<request> <jabber type="auth_sasl_bind" ack="local" ></jabber></request>
<request> <jabber type="auth_sasl_session" ack="local" ></jabber></request>
<request> <jabber type="presence:initial" ack="no_ack"/> </request>
</transaction>
<thinktime value="5"></thinktime>
<transaction name="online">
<request> <jabber type="chat" ack="no_ack" size="4000" destination="online"/></request>
</transaction>
<transaction name="close">
<request> <jabber type="close" ack="local"></jabber> </request>
</transaction>
</session>
</sessions>
</tsung>
While running this script i was going my ejabberd.log file this is coming
2016-12-19 11:02:43.553 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30840>) Accepted connection 223.30.185.182:46844 -> 122.166.14.59:5222
2016-12-19 11:02:43.772 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30841>) Accepted connection 223.30.185.182:48205 -> 122.166.14.59:5222
2016-12-19 11:02:44.266 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30842>) Accepted connection 223.30.185.182:48358 -> 122.166.14.59:5222
2016-12-19 11:02:45.530 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30843>) Accepted connection 223.30.185.182:46427 -> 122.166.14.59:5222
2016-12-19 11:02:45.689 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30844>) Accepted connection 223.30.185.182:48789 -> 122.166.14.59:5222
2016-12-19 11:02:46.872 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30845>) Accepted connection 223.30.185.182:34836 -> 122.166.14.59:5222
2016-12-19 11:02:48.092 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30846>) Accepted connection 223.30.185.182:33801 -> 122.166.14.59:5222
2016-12-19 11:02:49.144 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30847>) Accepted connection 223.30.185.182:33990 -> 122.166.14.59:5222
2016-12-19 11:02:50.479 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30848>) Accepted connection 223.30.185.182:50522 -> 122.166.14.59:5222
2016-12-19 11:02:51.676 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30849>) Accepted connection 223.30.185.182:40768 -> 122.166.14.59:5222
2016-12-19 11:02:52.925 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30850>) Accepted connection 223.30.185.182:57973 -> 122.166.14.59:5222
2016-12-19 11:02:53.759 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30851>) Accepted connection 223.30.185.182:41619 -> 122.166.14.59:5222
2016-12-19 11:02:54.371 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30852>) Accepted connection 223.30.185.182:42115 -> 122.166.14.59:5222
... and similar
the problem is session is not getting created
and folowing tsung.log i am getting
{
"stats": [
{"timestamp": 1482142630, "samples": []},
{"timestamp": 1482142640, "samples": [ {"name": "users", "value": 3, "max": 3}, {"name": "cpu", "hostname": "neureol", "value": 1, "mean": 5.301845187701585,"stddev": 0,"max": 5.301845187701585,"min": 5.301845187701585 ,"global_mean": 0 ,"global_count": 0}, {"name": "load", "hostname": "neureol", "value": 1, "mean": 0.37109375,"stddev": 0,"max": 0.37109375,"min": 0.37109375 ,"global_mean": 0 ,"global_count": 0}, {"name": "freemem", "hostname": "neureol", "value": 1, "mean": 4278.2265625,"stddev": 0,"max": 4278.2265625,"min": 4278.2265625 ,"global_mean": 0 ,"global_count": 0}, {"name": "users_count", "value": 3, "total": 3}, {"name": "finish_users_count", "value": 0, "total": 0}, {"name": "request", "value": 3, "mean": 264.84033203125,"stddev": 88.15162068742659,"max": 389.04296875,"min": 193.447021484375 ,"global_mean": 0 ,"global_count": 0}, {"name": "connect", "value": 3, "mean": 125.679931640625,"stddev": 42.371197826714514,"max": 185.3427734375,"min": 91.028076171875 ,"global_mean": 0 ,"global_count": 0}, {"name": "page", "value": 3, "mean": 264.84033203125,"stddev": 88.15162068742659,"max": 389.04296875,"min": 193.447021484375 ,"global_mean": 0 ,"global_count": 0}, {"name": "size_rcv", "value": 2024, "total": 2024}, {"name": "size_sent", "value": 501, "total": 501}, {"name": "connected", "value": 3, "max": 3}]},
{"timestamp": 1482142650, "samples": [ {"name": "users", "value": 7, "max": 7}, {"name": "cpu", "hostname": "neureol", "value": 1, "mean": 7.1357035553329995,"stddev": 0.0,"max": 7.1357035553329995,"min": 5.301845187701585 ,"global_mean": 5.301845187701585 ,"global_count": 1}, {"name": "load", "hostname": "neureol", "value": 1, "mean": 0.30859375,"stddev": 0.0,"max": 0.37109375,"min": 0.30859375 ,"global_mean": 0.37109375 ,"global_count": 1}, {"name": "freemem", "hostname": "neureol", "value": 1, "mean": 4275.30078125,"stddev": 0.0,"max": 4278.2265625,"min": 4275.30078125 ,"global_mean": 4278.2265625 ,"global_count": 1}, {"name": "users_count", "value": 4, "total": 7}, {"name": "finish_users_count", "value": 0, "total": 0}, {"name": "request", "value": 4, "mean": 522.1024780273438,"stddev": 425.6234764859712,"max": 1257.77099609375,"min": 193.447021484375 ,"global_mean": 264.84033203125 ,"global_count": 3}, {"name": "connect", "value": 4, "mean": 398.53875732421875,"stddev": 438.4391252124725,"max": 1156.155029296875,"min": 91.028076171875 ,"global_mean": 125.679931640625 ,"global_count": 3}, {"name": "page", "value": 4, "mean": 522.1024780273438,"stddev": 425.6234764859712,"max": 1257.77099609375,"min": 193.447021484375 ,"global_mean": 264.84033203125 ,"global_count": 3}, {"name": "size_rcv", "value": 2784, "total": 4808}, {"name": "size_sent", "value": 753, "total": 1254}, {"name": "connected", "value": 4, "max": 7}]}]}
If you see the tsung.log which is showing similar to {"name": "connected", "value": 3, "max": 3} how it is coming since there is no any log present there on ejbbered side .
After running perl script i am getting totally blank report with graph.
Here is my ijabberd.yml is :-
loglevel: 4
log_rotate_size: 10485760
log_rotate_date: ""
log_rotate_count: 1
log_rate_limit: 100
hosts:
- "something.com"
- "122.166.14.59"
- "demo.something.com"
listen:
-
port: 5222
module: ejabberd_c2s
certfile: "/opt/ejabberd-16.06/conf/server.pem"
starttls: true
## To enforce TLS encryption for client connections,
## use this instead of the "starttls" option:
## starttls_required: true
##
## Custom OpenSSL options
##
protocol_options:
- "no_sslv3"
## - "no_tlsv1"
max_stanza_size: 65536
shaper: c2s_shaper
access: c2s
resend_on_timeout: true
-
port: 5269
module: ejabberd_s2s_in
max_stanza_size: 131072
shaper: s2s_shaper
-
port: 5280
module: ejabberd_http
request_handlers:
"/websocket": ejabberd_http_ws
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
## register: true
captcha: false
auth_method: internal
auth_method: anonymous
anonymous_protocol: both
allow_multiple_connections: true
host_config:
"something.com":
odbc_type: mysql
odbc_server: "localhost"
odbc_database: "chatdb"
odbc_username: "siteuser"
odbc_password: "site!##$"
auth_method: [odbc]
shaper:
##
## The "normal" shaper limits traffic speed to 1000 B/s
##
normal: 1000
##
## The "fast" shaper limits traffic speed to 50000 B/s
##
fast: 500000000
max_fsm_queue: 1000
shaper_rules:
## Maximum number of simultaneous sessions allowed for a single user:
max_user_sessions: 10
## Maximum number of offline messages that users can have:
max_user_offline_messages:
- allow: all
## For C2S connections, all users except admins use the "normal" shaper
c2s_shaper:
- none: admin
- fast
## All S2S connections use the "fast" shaper
s2s_shaper: fast
access_rules:
## This rule allows access only for local users:
local:
- allow: local
## Only non-blocked users can use c2s connections:
c2s:
- deny: blocked
- allow
## Only admins can send announcement messages:
announce:
- allow: admin
## Only admins can use the configuration interface:
configure:
- allow: admin
## Only accounts of the local ejabberd server can create rooms:
muc_create:
- allow: local
## Only accounts on the local ejabberd server can create Pubsub nodes:
pubsub_createnode:
- allow: local
## In-band registration allows registration of any possible username.
## To disable in-band registration, replace 'allow' with 'deny'.
register:
- allow
## Only allow to register from localhost
trusted_network:
- allow: all
registration_timeout: infinity
modules:
mod_adhoc: {}
mod_admin_extra: {}
mod_announce: # recommends mod_adhoc
access: announce
mod_blocking: {} # requires mod_privacy
mod_caps: {}
mod_carboncopy: {}
mod_client_state: {}
mod_configure: {} # requires mod_adhoc
mod_disco: {}
## mod_echo: {}
mod_http_bind: {}
mod_last: {}
mod_muc:
access:
- allow
access_admin:
- allow: admin
access_create: muc_create
access_persistent: muc_create
mod_muc_admin: {}
## mod_muc_log: {}
## mod_multicast: {}
mod_offline:
access_max_user_messages: max_user_offline_messages
mod_ping:
send_pings: true
ping_interval: 60
ping_ack_timout: 32
timeout_action: kill
mod_privacy: {}
mod_private: {}
mod_pubsub:
access_createnode: pubsub_createnode
## reduces resource comsumption, but XEP incompliant
ignore_pep_from_offline: true
## XEP compliant, but increases resource comsumption
## ignore_pep_from_offline: false
last_item_cache: false
plugins:
- "flat"
- "hometree"
- "pep" # pep requires mod_caps
mod_register:
welcome_message:
subject: "Welcome!"
body: |-
Hi.
Welcome to this XMPP server.
access: register
mod_roster: {}
mod_shared_roster: {}
mod_vcard:
search: false
mod_version: {}
allow_contrib_modules: true
After changing the ejabber log to 5 here is the ejabber.logs are :
2016-12-20 12:35:09.694 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123804>) Accepted connection 223.30.185.182:44998 -> *.*.*.*:5222
2016-12-20 12:35:09.696 [debug] <0.8478.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='1' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:09.696 [debug] <0.8479.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='12153081287775773739' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:09.697 [debug] <0.8479.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:10.043 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123801>) Accepted connection 223.30.185.182:36296 -> *.*.*.*:5222
2016-12-20 12:35:10.044 [debug] <0.8480.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='2' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:10.044 [debug] <0.8481.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3424930239190161372' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:10.045 [debug] <0.8481.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:11.173 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123807>) Accepted connection 223.30.185.182:35101 -> *.*.*.*:5222
2016-12-20 12:35:11.175 [debug] <0.8482.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='3' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:11.175 [debug] <0.8483.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='10270498772362791845' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:11.176 [debug] <0.8483.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:11.872 [debug] <0.8478.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:11.872 [debug] <0.8478.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217509697017}, Size=51
M=5.1e-5, I=2175.696
2016-12-20 12:35:11.873 [debug] <0.8478.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:11.873 [debug] <0.8478.1>#shaper:update:120 State: {maxrate,500000000,11.719617122406575,1482217511872856}, Size=0
M=0.0, I=0.328
2016-12-20 12:35:12.157 [debug] <0.8480.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:12.157 [debug] <0.8480.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217510044454}, Size=51
M=5.1e-5, I=2113.04
2016-12-20 12:35:12.157 [debug] <0.8480.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:12.158 [debug] <0.8480.1>#shaper:update:120 State: {maxrate,500000000,12.067047354406341,1482217512157647}, Size=0
M=0.0, I=0.311
2016-12-20 12:35:13.303 [debug] <0.8482.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:13.303 [debug] <0.8482.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217511175417}, Size=51
M=5.1e-5, I=2128.331
2016-12-20 12:35:13.304 [debug] <0.8482.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:13.304 [debug] <0.8482.1>#shaper:update:120 State: {maxrate,500000000,11.980431023020751,1482217513303888}, Size=0
M=0.0, I=0.368
2016-12-20 12:35:15.202 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123812>) Accepted connection 223.30.185.182:49986 -> *.*.*.*:5222
2016-12-20 12:35:15.203 [debug] <0.8484.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='4' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:15.203 [debug] <0.8485.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='6574869083255218624' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:15.204 [debug] <0.8485.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:15.504 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123810>) Accepted connection 223.30.185.182:41718 -> *.*.*.*:5222
2016-12-20 12:35:15.505 [debug] <0.8486.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='5' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:15.506 [debug] <0.8487.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='11910276457718456980' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:15.507 [debug] <0.8487.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:16.979 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123799>) Accepted connection 223.30.185.182:57791 -> *.*.*.*:5222
2016-12-20 12:35:16.980 [debug] <0.8488.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='6' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:16.980 [debug] <0.8489.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='16257359711038503484' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:16.981 [debug] <0.8489.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:17.486 [debug] <0.8484.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:17.487 [debug] <0.8484.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217515203642}, Size=51
M=5.1e-5, I=2283.43
2016-12-20 12:35:17.487 [debug] <0.8484.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:17.487 [debug] <0.8484.1>#shaper:update:120 State: {maxrate,500000000,11.166760014941563,1482217517487205}, Size=0
M=0.0, I=0.271
2016-12-20 12:35:17.756 [debug] <0.8486.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:17.756 [debug] <0.8486.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217515505921}, Size=51
M=5.1e-5, I=2250.965
2016-12-20 12:35:17.757 [debug] <0.8486.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:17.757 [debug] <0.8486.1>#shaper:update:120 State: {maxrate,500000000,11.32786071795537,1482217517757008}, Size=0
M=0.0, I=0.314
2016-12-20 12:35:17.793 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123817>) Accepted connection 223.30.185.182:42577 -> *.*.*.*:5222
2016-12-20 12:35:17.803 [debug] <0.8490.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='7' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:17.803 [debug] <0.8491.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3919444622270218959' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:17.804 [debug] <0.8491.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:18.762 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123818>) Accepted connection 223.30.185.182:37374 -> *.*.*.*:5222
2016-12-20 12:35:18.763 [debug] <0.8492.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='8' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:18.763 [debug] <0.8493.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='11192005229436680642' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:18.764 [debug] <0.8493.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:19.210 [debug] <0.8488.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:19.210 [debug] <0.8488.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217516980265}, Size=51
M=5.1e-5, I=2230.46
2016-12-20 12:35:19.211 [debug] <0.8488.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:19.211 [debug] <0.8488.1>#shaper:update:120 State: {maxrate,500000000,11.43193760582948,1482217519210858}, Size=0
M=0.0, I=0.277

Here is an example of my tsung xml file which working well with starttls:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/home/ubuntu/tsung-1.7.0/tsung-1.0.dtd" []>
<tsung loglevel="warning" dumptraffic="false" version="1.0">
<clients>
<client host="localhost" use_controller_vm="false" cpu="8" maxusers="100000">
</client>
</clients>
<servers>
<server host="xmpp.example.com" port="5222" type="tcp"/>
</servers>
<load duration="30" unit="minute">
<!--user session="jabber-login" start_time="2" unit="second"></user-->
<!-- to make 24k online users -->
<arrivalphase phase="1" duration="30" unit="minute">
<users arrivalrate="20" unit="second"></users>
<session_setup name="jabber-login" probability="100"/>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="500"/>
<option type="ts_jabber" name="userid_max" value="1000000"/>
<option type="ts_jabber" name="domain" value="mylowdown.com"/>
<option type="ts_jabber" name="username" value="tsung_"/>
<option type="ts_jabber" name="passwd" value="tsung_pwd"/>
</options>
<sessions>
<session probability="0" name="jabber-login" type="ts_jabber" bidi="true">
<transaction name="connect">
<request> <jabber type="connect" ack="local" /> </request>
<thinktime value="5"></thinktime>
<request> <jabber type="starttls" ack="bidi_ack" /> </request>
<request> <jabber type="connect" ack="local" /> </request>
</transaction>
<thinktime value="5"></thinktime>
<transaction name="authenticate">
<request> <jabber type="auth_sasl" ack="local"/> </request>
<request> <jabber type="connect" ack="local"/> </request>
<request> <jabber type="auth_sasl_bind" ack="local"/> </request>
<request> <jabber type="auth_sasl_session" ack="local"/> </request>
</transaction>
<transaction name="online">
<request> <jabber type="presence:initial" ack="no_ack"/> </request>
</transaction>
<thinktime value="5"></thinktime>
<for var="counter" from="1" to="21" incr="1">
<transaction name="online_msg">
<request>
<jabber type="chat" ack="no_ack" size="40" stamped="true" destination="online"/>
</request>
</transaction>
<thinktime value="15"/>
<transaction name="offline_msg">
<request>
<jabber type="chat" ack="no_ack" size="10" stamped="true" destination="offline"/>
</request>
</transaction>
<thinktime value="15"/>
</for>
<transaction name="close">
<request> <jabber type="close" ack="local"> </jabber></request>
</transaction>
</session>
</sessions>
</tsung>

Related

MuleSoft REST API invoking SOAP Service

I invoke a SOAP Service that calls data from a DB using a REST Service, when I call the GET function it returns all null values and the Anypoint Studio Console returns this answer:
INFO 2020-11-19 08:51:40,897 [[MuleRuntime].uber.03: [userstory12_soap].getCustomerByLastName.BLOCKING #393df87f] [processor: ; event: bb2e3fd0-2a76-11eb-9a6c-86c5a63076bd] org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean: Creating Service {http://client.internal.soap.mule.org/}ProxyService from class org.mule.soap.internal.client.CxfClientFactory$ProxyService
I do not know why is it not working, since I compared my flows with those of a colleague and they are exactly the same (except for some minor variations in variable names). Any input in solving this would be great! Find below screenshot of my flows and XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mule xmlns:wsc="http://www.mulesoft.org/schema/mule/wsc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit-soap="http://www.mulesoft.org/schema/mule/apikit-soap" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/apikit-soap http://www.mulesoft.org/schema/mule/apikit-soap/current/mule-apikit-soap.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/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd">
<http:listener-config name="api-httpListenerConfig">
<http:listener-connection host="0.0.0.0" port="8087"/>
</http:listener-config>
<apikit-soap:config httpStatusVarName="httpStatus" name="soapkit-config" port="us12SOAP" service="us12" wsdlLocation="SOAPUS12.wsdl"/>
<db:config name="Database_Config" doc:name="Database Config" doc:id="176ab101-fa7d-4ee9-aca3-5c0bf9fe8c77" >
<db:mssql-connection host="localhost" port="1433" user="sa" password="Gecegu0722#" databaseName="EAIS_Training" />
</db:config>
<wsc:config name="Web_Service_Consumer_Config" doc:name="Web Service Consumer Config" doc:id="0665000a-d19d-4801-a118-2315417e9290" >
<wsc:connection wsdlLocation="api\SOAPUS12.wsdl" service="us12" port="us12SOAP" address="http://localhost:8087/us12/us12SOAP/" >
<wsc:web-service-security actor="http://schemas.xmlsoap.org/soap/actor/next" />
</wsc:connection>
</wsc:config>
<flow name="api-main">
<http:listener config-ref="api-httpListenerConfig" path="/us12/us12SOAP">
<http:response statusCode="#[attributes.protocolHeaders.httpStatus default 200]">
<http:body>#[payload]</http:body>
<http:headers>#[attributes.protocolHeaders default {}]</http:headers>
</http:response>
<http:error-response statusCode="#[attributes.protocolHeaders.httpStatus default 500]">
<http:body>#[payload]</http:body>
<http:headers>#[attributes.protocolHeaders default {}]</http:headers>
</http:error-response>
</http:listener>
<apikit-soap:router config-ref="soapkit-config">
<apikit-soap:attributes><![CDATA[#[%dw 2.0
output application/java
---
{
headers: attributes.headers,
method: attributes.method,
queryString: attributes.queryString
}]]]></apikit-soap:attributes>
</apikit-soap:router>
</flow>
<flow name="getCustomerDB:\soapkit-config">
<db:select doc:name="Select" doc:id="75cdc0ea-04b6-429f-a022-9152c14d1dd9" config-ref="Database_Config">
<db:sql ><![CDATA[SELECT * FROM customer_aux WHERE last_name = :last_name]]></db:sql>
<db:input-parameters ><![CDATA[#[output application/java
ns ns0 http://www.example.org/us12/
---
{
last_name: payload.body.ns0#getCustomerDB.last_name
}]]]></db:input-parameters>
</db:select>
<ee:transform>
<ee:message>
<ee:set-payload><![CDATA[output application/java
ns ns0 http://www.example.org/us12/
---
{
body: {
ns0#getCustomerDBResponse: {
id: payload.id,
first_name: payload.first_name,
last_name: payload.last_name,
birth_date: payload.age,
street: payload.street,
city: payload.city,
country: payload.country,
phone: payload.phone
}
} write "application/xml"
}
]]></ee:set-payload>
</ee:message>
</ee:transform>
</flow>
<flow name="getCustomerByLastName" doc:id="0b351b65-af46-414b-9ac6-ccf02812e2d2" >
<http:listener doc:name="Listener" doc:id="72239ecd-26b9-4a81-90a0-6a486e396eb8" config-ref="api-httpListenerConfig" path="/getCustomerByLastName"/>
<wsc:consume operation="getCustomerDB" doc:name="Consume" doc:id="d29f381b-d054-4a03-8255-f953ce6996ed" config-ref="Web_Service_Consumer_Config">
<wsc:message >
<wsc:body ><![CDATA[#[output application/xml
ns ns0 http://www.example.org/us12
---
{
ns0#getCustomerDB: {
last_name: attributes.queryParams.last_name
}
}]]]></wsc:body>
</wsc:message>
</wsc:consume>
<ee:transform doc:name="Transform Message" doc:id="8a2b6eb1-d798-4f73-a25b-a74f54eeb8ce" >
<ee:message >
<ee:set-payload ><![CDATA[output application/json
ns ns0 http://www.example.org/us12/
import * from dw::core::Strings
---
{
id: payload.body.ns0#getCustomerDBResponse.id default 0,
firstName: capitalize(payload.body.ns0#getCustomerDBResponse.first_name) default "",
lastName: capitalize(payload.body.ns0#getCustomerDBResponse.last_name) default "",
age: payload.body.ns0#getCustomerDBResponse.birth_date default "",
street: capitalize(payload.body.ns0#getCustomerDBResponse.street) default "",
city: capitalize(payload.body.ns0#getCustomerDBResponse.city) default "",
country: capitalize(payload.body.ns0#getCustomerDBResponse.country) default "",
phone: payload.body.ns0#getCustomerDBResponse.phone default 0
}
]]></ee:set-payload>
</ee:message>
</ee:transform>
</flow>
</mule>

Mulesoft Insertion into Mongo DB database

I am using a Mongo DB connector to insert data into Mongo Instance located in mLab.
I am sure I am using the correct credentials since these credentials are working when I am using them through a Java code.
But here using the Mongo DB connector constantly throws me an error as can be seen below.
org.mule.api.ConnectionException: Couldn't connect with the given
credentials org.mule.api.ConnectionException: Couldn't connect with
the given credentials at
org.mule.module.mongo.MongoCloudConnector.getDatabase(MongoCloudConnector.java:1304)
at
org.mule.module.mongo.MongoCloudConnector.connect(MongoCloudConnector.java:1173)
at
org.mule.module.mongo.connectivity.MongoCloudConnectorConnectionFactory.makeObject(MongoCloudConnectorConnectionFactory.java:56)
at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at
org.mule.module.mongo.connectivity.MongoCloudConnectorConnectionManager.acquireConnection(MongoCloudConnectorConnectionManager.java:361)
at
org.mule.module.mongo.connectivity.MongoCloudConnectorConnectionManager.test(MongoCloudConnectorConnectionManager.java:444)
at
org.mule.tooling.metadata.api.utils.ConnectionTester.internalTestConnection(ConnectionTester.java:88)
at
org.mule.tooling.metadata.api.utils.ConnectionTester.testConnectionFor(ConnectionTester.java:113)
at
Is there something that I am missing here?
Below is the XML :
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:mongo="http://www.mulesoft.org/schema/mule/mongo" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="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/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/mongo http://www.mulesoft.org/schema/mule/mongo/current/mule-mongo.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="developers.zomato.com" port="80" doc:name="HTTP Request Configuration"/>
<http:request-config name="HTTP_Request_Configuration1" host="api.mlab.com" port="80" doc:name="HTTP Request Configuration"/>
<mongo:config name="Mongo_DB" password="XXXXX" database="restaurant_data" host="ds241039.mlab.com" port="41039" doc:name="Mongo DB" username="XxXx"/>
<flow name="rest-webservice-applicationFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/rest" allowedMethods="GET" doc:name="HTTP"/>
<http:request config-ref="HTTP_Request_Configuration" path="api/v2.1/search" method="GET" doc:name="HTTP">
<http:request-builder>
<http:query-param paramName="entity_id" value="1"/>
<http:query-param paramName="entity_type" value="city"/>
<http:header headerName="user-key" value="XXXXXXXXX"/>
</http:request-builder>
</http:request>
<dw:transform-message doc:name="Transform Message" metadata:id="13f7b603-ac1e-45b4-9950-32c39a20ee36">
<dw:input-payload mimeType="application/json"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/json
---
{
results_found: payload.results_found,
results_start: payload.results_start,
results_shown: payload.results_shown,
restaurants: payload.restaurants map ((restaurant , indexOfRestaurant) -> {
restaurant: {
R: restaurant.restaurant.R,
id: restaurant.restaurant.id,
name: restaurant.restaurant.name,
url: restaurant.restaurant.url,
location: restaurant.restaurant.location,
switch_to_order_menu: restaurant.restaurant.switch_to_order_menu,
cuisines: restaurant.restaurant.cuisines,
average_cost_for_two: restaurant.restaurant.average_cost_for_two,
price_range: restaurant.restaurant.price_range,
currency: restaurant.restaurant.currency,
offers: restaurant.restaurant.offers map ((offer , indexOfOffer) -> offer),
thumb: restaurant.restaurant.thumb,
user_rating: restaurant.restaurant.user_rating,
photos_url: restaurant.restaurant.photos_url,
menu_url: restaurant.restaurant.menu_url,
featured_image: restaurant.restaurant.featured_image,
has_online_delivery: restaurant.restaurant.has_online_delivery,
is_delivering_now: restaurant.restaurant.is_delivering_now,
deeplink: restaurant.restaurant.deeplink,
has_table_booking: restaurant.restaurant.has_table_booking,
events_url: restaurant.restaurant.events_url
}
})
}]]></dw:set-payload>
</dw:transform-message>
<mongo:json-to-dbobject doc:name="Mongo DB"/>
<mongo:insert-object config-ref="Mongo_DB" doc:name="Mongo DB" collection="restaurant"/>
</flow>
</mule>
The MongoDB connector uses the deprecated MONGODB-CR authentication mechanism, MLab is expecting the SCRAM-SHA-1 mechanism.
The SCRAM-SHA-1 mechanism is available in the enterprise version of Mulesoft ESB.
The connection URI configuration is available on version 4.2.0 and above. This is how you configure it:
Add the connector to pom.xml:
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-mongo-connector</artifactId>
<version>4.2.0</version>
</dependency>
Configure a connection in your flow:
<mongo:config-connection-string name="MongoDB_Config"
connectionString="mongodb://jdoe:myPass#localhost:27017?authMechanism=SCRAM-SHA-1"/>

Error consuming SOAP 1.1 operation send attachment using MTOM optimization

I'm trying to consume a SOAP service that receives a message with an attachment. With SoapUI I made the call the service with success, but using WSO2 Integrator I receive the follow response error from server:
OSB-382000: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]</faultstring><detail><con:stack-trace xmlns:con="http://www.bea.com/wli/sb/context">com.bea.wli.sb.service.handlerchain.HandlerException: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.bea.wli.sb.service.disi.handlerchain.handlers.InboundDISIHandler.dispatch(InboundDISIHandler.java:148)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.disi.handlerchain.handlers.InboundWssPhase1DISIHandler.dispatch(InboundWssPhase1DISIHandler.java:100)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.InboundMessageContentHandler.dispatch(InboundMessageContentHandler.java:169)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.CheckAccessControl.dispatch(CheckAccessControl.java:65)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.UpdateInboundTransportStatistics.dispatch(UpdateInboundTransportStatistics.java:64)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.InboundMessageTracing.dispatch(InboundMessageTracing.java:80)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.DefaultInboundErrorHandler.dispatch(DefaultInboundErrorHandler.java:44)
at com.bea.wli.sb.service.handlerchain.InboundHandlerChain.dispatch(InboundHandlerChain.java:134)
at com.bea.wli.sb.transports.TransportDispatcherClient.dispatch(TransportDispatcherClient.java:91)
at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:352)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase.invokePipeline(RequestHelperBase.java:200)
at com.bea.wli.sb.transports.http.wls.HttpTransportServlet$RequestHelperWLS.invokePipeline(HttpTransportServlet.java:228)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:175)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:173)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at com.bea.wli.sb.util.security.SecurityUtils.executeAs(SecurityUtils.java:102)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase.securedInvoke(RequestHelperBase.java:172)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase.service(RequestHelperBase.java:124)
at com.bea.wli.sb.transports.http.wls.HttpTransportServlet.service(HttpTransportServlet.java:129)
at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
I suspect that the error is due the HTTP headers, but I can't find any other reference to change those headers to look like the SoapUI ones. Some headers are equals, others not. I tried to set some header to make these same as in SoapUI, no success.
Following are the resource that I'm using (removed all logs to fit here). Payload is resumed due sensitive data, but assume that SOAP envelope generated by WSO2 Integrator is ok, since the same envelope submitted from SoapUI is received without any error from server:
Endpoint:
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="envio_informacao_res_dados_clinicos">
<address uri="http://xpto.com.br/service?WSDL" format="soap11" optimize="mtom">
<enableSec policy="wssSecurityRES"/>
</address>
</endpoint>
Sequence (to set the attachment to payload):
<sequence xmlns="http://ws.apache.org/ns/synapse" name="attachment">
<property name="attachmentContent" expression="get-property('ATTACHMENT_CONTENT')"/>
<property name="attachmentContentID" expression="get-property('ATTACHMENT_CONTENT_ID')"/>
<class name="br.com.modoagil.MTOMAttachmentFilesMediator"/>
</sequence>
Proxy service (for test only):
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="AttachmentFileProxyService" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="ATTACHMENT_CONTENT" expression="$body/*" />
<property name="ATTACHMENT_CONTENT_ID" value="AnexoLaboratorio.xml" />
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://xpto.com.br/schemas/servico/envio/informacao/res/v1.00" xmlns:v17="http://xpto.com.br/schemas/comum/tipos/complexos/anexos/v1.00" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soapenv:Header />
<soapenv:Body>
<v1:requisicaoEnvioInformacaoRES>
<v1:cabecalhoRequisicao>
<!-- omitted -->
</v1:cabecalhoRequisicao>
<v1:corpoRequisicao>
<v1:beneficiario>
<!-- omitted -->
</v1:beneficiario>
<v1:profissional>
<!-- omitted -->
</v1:profissional>
<v1:informacaoClinica>
<v17:anexoComposicao xm:contentType="application/xml" xm:expectedContentTypes="application/xml" />
<!-- omitted -->
</v1:informacaoClinica>
</v1:corpoRequisicao>
</v1:requisicaoEnvioInformacaoRES>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args />
</payloadFactory>
<sequence key="attachment" />
<header name="Action" action="remove" />
<property name="SOAPAction" action="remove" />
<property name="FORCE_HTTP_1.0" value="true" scope="axis2" />
<property name="SOAPAction" value="envio_informacao_res" scope="transport" />
<property name="Proxy-Authorization" scope="transport" expression="fn:concat('Basic ', base64Encode('ZZZZ:YYYY'))" />
<send>
<endpoint key="envio_informacao_res_dados_clinicos" />
</send>
</inSequence>
<outSequence>
<property name="enableMTOM" value="true" scope="axis2" />
<send />
</outSequence>
</target>
</proxy>
Custom Mediator:
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.xml.namespace.QName;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMText;
import org.apache.axiom.soap.SOAPBody;
import org.apache.synapse.MessageContext;
import org.apache.synapse.SynapseException;
import org.apache.synapse.mediators.AbstractMediator;
public class MTOMAttachmentFilesMediator extends AbstractMediator {
#Override
public boolean mediate(final MessageContext context) {
this.addAttachmentToRequest(context);
return true;
}
private void addAttachmentToRequest(final MessageContext context) {
final String attachmentContent = (String) context.getProperty("attachmentContent");
final String attachmentContentID = (String) context.getProperty("attachmentContentID");
Path tempContentFile = null;
try {
tempContentFile = Files.createTempFile(attachmentContentID + "-" + System.currentTimeMillis(), ".bin");
Files.write(tempContentFile, attachmentContent.getBytes(Charset.defaultCharset()));
} catch (final IOException e) {
super.handleException("Error while creating attachment file: " + e.getMessage(), e, context);
}
if (tempContentFile == null) {
throw new SynapseException("Temporary attachment file must not be null here");
}
final SOAPBody body = context.getEnvelope().getBody();
final OMElement requisicaoEnvioInformacaoRES = body.getFirstElement();
final OMElement corpoRequisicao = (OMElement) requisicaoEnvioInformacaoRES.getChildrenWithName(new QName("corpoRequisicao")).next();
final OMElement informacaoClinica = (OMElement) corpoRequisicao.getChildrenWithName(new QName("informacaoClinica")).next();
final OMFactory factory = informacaoClinica.getOMFactory();
final OMElement anexoComposicao = (OMElement) informacaoClinica.getChildrenWithName(new QName("anexoComposicao")).next();
final FileDataSource fileDataSource = new FileDataSource(tempContentFile.toFile());
final DataHandler dataHandler = new DataHandler(fileDataSource);
final OMText bynaryNode = factory.createOMText(dataHandler, true);
bynaryNode.setContentID(attachmentContentID);
anexoComposicao.addChild(bynaryNode);
}
}
SoapUI "full request/response":
POST /service?WSDL HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml"; start="<rootpart#soapui.org>"; start-info="text/xml"; boundary="----=_Part_10_1408830521.1496694507193"
SOAPAction: "envio_informacao_res"
Authorization: Basic omitted
MIME-Version: 1.0
Content-Length: 33427
Host: xpto.com.br.br:7300
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
------=_Part_10_1408830521.1496694507193
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart#soapui.org>
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://xpto.com.br/schemas/servico/envio/informacao/res/v1.00" xmlns:v17="http://xpto.com.br/schemas/comum/tipos/complexos/anexos/v1.00" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-CAD2037163FCADC4A5149669450719220">
<wsse:Username>omitted</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">omitted</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">omitted==</wsse:Nonce>
<wsu:Created>2017-06-05T20:28:27.192Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<v1:requisicaoEnvioInformacaoRES>
<v1:cabecalhoRequisicao>
<!-- omitted -->
</v1:cabecalhoRequisicao>
<v1:corpoRequisicao>
<v1:beneficiario>
<!-- omitted -->
</v1:beneficiario>
<v1:profissional>
<!-- omitted -->
</v1:profissional>
<v1:informacaoClinica>
<v17:anexoComposicao xm:contentType="application/xml" xm:expectedContentTypes="application/xml">
<inc:Include xmlns:inc="http://www.w3.org/2004/08/xop/include" href="cid:AnexoLaboratorio.xml" />
</v17:anexoComposicao>
<!-- omitted -->
</v1:informacaoClinica>
</v1:corpoRequisicao>
</v1:requisicaoEnvioInformacaoRES>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_10_1408830521.1496694507193
Content-Type: text/xml; charset=us-ascii; name=AnexoLaboratorio.xml
Content-Transfer-Encoding: 7bit
Content-ID: <AnexoLaboratorio.xml>
Content-Disposition: attachment; name="AnexoLaboratorio.xml"; filename="AnexoLaboratorio.xml"
<?xml version="1.0" encoding="UTF-8"?>
<Clinical_Summary_Events xmlns:oe="http://schemas.openehr.org/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.oceanehr.com/templates" archetype_node_id="openEHR-EHR-COMPOSITION.encounter.v1" template_id="clinical-summary-events" type="COMPOSITION" xsi:schemaLocation="http://schemas.oceanehr.com/templates templates/clinical-summary-events.xsd">
<!-- omitted -->
</Clinical_Summary_Events>
------=_Part_10_1408830521.1496694507193--
##### RESPONSE #####
HTTP/1.1 200 OK
Server: Oracle-Traffic-Director/11.1.1.9
Date: Mon, 05 Jun 2017 20:28:30 GMT
Content-length: 3463
Content-type: text/xml; charset=UTF-8
X-oracle-dms-ecid: XeMsH1O_000000000
Via: 1.1 net-QA
Proxy-agent: Oracle-Traffic-Director/11.1.1.9
<soapenv:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soap-env:Body xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><ptucsseir:respostaEnvioInformacaoRES xmlns:ptucsseir="http://xpto.com.br/schemas/servico/envio/informacao/res/v1.00"> <!-- omitted --></ptucsseir:respostaEnvioInformacaoRES></soap-env:Body></soapenv:Envelope>"
WSO2 EI "full request/response":
POST /service?WSDL HTTP/1.0
SOAPAction: envio_informacao_res
Accept-Encoding: gzip,deflate
Proxy-Authorization: Basic omitted
Content-Type: text/xml; charset=UTF-8
Content-Length: 41934
Host: xpto.com.br:7300
Connection: Keep-Alive
User-Agent: Synapse-PT-HttpComponents-NIO
--MIMEBoundary_20282c2967f861ead2423a50af020431e31644c6c1d1eeb6
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.30282c2967f861ead2423a50af020431e31644c6c1d1eeb6#apache.org>
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://xpto.com.br/schemas/servico/envio/informacao/res/v1.00" xmlns:v17="http://xpto.com.br/schemas/comum/tipos/complexos/anexos/v1.00" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1">
<wsse:Username>omitted</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">omitted</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">omitted</wsse:Nonce>
<wsu:Created>2017-06-06T15:01:38.098Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<v1:requisicaoEnvioInformacaoRES>
<v1:cabecalhoRequisicao>
<!-- omitted -->
</v1:cabecalhoRequisicao>
<v1:corpoRequisicao>
<v1:beneficiario>
<!-- omitted -->
</v1:beneficiario>
<v1:profissional>
<!-- omitted -->
</v1:profissional>
<v1:informacaoClinica>
<v17:anexoComposicao xm:contentType="application/xml" xm:expectedContentTypes="application/xml">
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:AnexoLaboratorio.xml" />
</v17:anexoComposicao>
<!-- omitted -->
</v1:informacaoClinica>
</v1:corpoRequisicao>
</v1:requisicaoEnvioInformacaoRES>
</soapenv:Body>
</soapenv:Envelope>
--MIMEBoundary_20282c2967f861ead2423a50af020431e31644c6c1d1eeb6
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <AnexoLaboratorio.xml>
<Clinical_Summary_Events xmlns="http://schemas.oceanehr.com/templates" xmlns:oe="http://schemas.openehr.org/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" archetype_node_id="openEHR-EHR-COMPOSITION.encounter.v1" template_id="clinical-summary-events" type="COMPOSITION" xsi:schemaLocation="http://schemas.oceanehr.com/templates templates/clinical-summary-events.xsd">
<!-- omitted -->
</Clinical_Summary_Events>
--MIMEBoundary_20282c2967f861ead2423a50af020431e31644c6c1d1eeb6--
##### RESPONSE #####
--MIMEBoundary_00282c2967f861ea3c123a50af020431f31644c6c1d1eeb6
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.10282c2967f861ea3c123a50af020431f31644c6c1d1eeb6#apache.org>
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>OSB-382000: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]</faultstring><detail><con:stack-trace xmlns:con="http://www.bea.com/wli/sb/context">com.bea.wli.sb.service.handlerchain.HandlerException: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.bea.wli.sb.service.disi.handlerchain.handlers.InboundDISIHandler.dispatch(InboundDISIHandler.java:148)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.disi.handlerchain.handlers.InboundWssPhase1DISIHandler.dispatch(InboundWssPhase1DISIHandler.java:100)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.InboundMessageContentHandler.dispatch(InboundMessageContentHandler.java:169)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.CheckAccessControl.dispatch(CheckAccessControl.java:65)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.UpdateInboundTransportStatistics.dispatch(UpdateInboundTransportStatistics.java:64)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.InboundMessageTracing.dispatch(InboundMessageTracing.java:80)
at com.bea.wli.sb.service.handlerchain.handlers.AbstractHandler.dispatch(AbstractHandler.java:131)
at com.bea.wli.sb.service.handlerchain.handlers.DefaultInboundErrorHandler.dispatch(DefaultInboundErrorHandler.java:44)
at com.bea.wli.sb.service.handlerchain.InboundHandlerChain.dispatch(InboundHandlerChain.java:134)
at com.bea.wli.sb.transports.TransportDispatcherClient.dispatch(TransportDispatcherClient.java:91)
at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:352)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase.invokePipeline(RequestHelperBase.java:200)
at com.bea.wli.sb.transports.http.wls.HttpTransportServlet$RequestHelperWLS.invokePipeline(HttpTransportServlet.java:228)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:175)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:173)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at com.bea.wli.sb.util.security.SecurityUtils.executeAs(SecurityUtils.java:102)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase.securedInvoke(RequestHelperBase.java:172)
at com.bea.wli.sb.transports.http.generic.RequestHelperBase.service(RequestHelperBase.java:124)
at com.bea.wli.sb.transports.http.wls.HttpTransportServlet.service(HttpTransportServlet.java:129)
at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Caused by: com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:319)
at com.sun.xml.ws.api.message.MessageContextFactory.createContext(MessageContextFactory.java:130)
at com.oracle.webservices.impl.disi.context.DISIMessageContextFactory.createContext(DISIMessageContextFactory.java:114)
at com.oracle.webservices.impl.disi.service.DISIAdapter$2.createContext(DISIAdapter.java:227)
at com.bea.wli.sb.service.disi.handlerchain.handlers.InboundDISIHandler.dispatch(InboundDISIHandler.java:88)
... 47 more
Caused by: com.sun.xml.ws.streaming.XMLStreamReaderException: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:326)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:99)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextContent(XMLStreamReaderUtil.java:169)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextElementContent(XMLStreamReaderUtil.java:104)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:215)
at com.oracle.webservices.impl.encoding.StreamDecoderImpl.decode(StreamDecoderImpl.java:64)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:249)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:166)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:314)
... 51 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:639)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2052)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134)
at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:96)
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:80)
... 58 more
</con:stack-trace></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
--MIMEBoundary_00282c2967f861ea3c123a50af020431f31644c6c1d1eeb6--
So, does anyone have a similar problem to do SOAP/MTOM request with WSO2 EI/WSO2 ESB?
EDIT:
WSO2 Integration version: 6.1.1
WSO2 EI is running with default configuration, no configuration was changed, not even properties to enable MTOM in axis2.xml configuration file.
Found a solution. I just add this property to the proxy:
<property name="messageType" value="multipart/related" scope="axis2"/>
Maybe this is not the best solution, since headers are the same as before and SoapUI apparently generate a more clean request, but now the service receive correctly the message sent by WSO2 EI.
I don't know why, but instead of send attachment in a separated "section", with a XOP inclusion - like before, as logs at question -, now WSO2 EI sends attachment inline on SOAP Envelope - looks like base 64 encoded.
For now it's OK, if this solution cause problem I create other question.

Using WSO2 FHIR Connector

I'm trying the FHIR Connector with WSO2 EI 6.1.0
I'm following this documentation
The request for the create operation is:
{
"body": {
"base": "https://sqlonfhir-stu3.azurewebsites.net",
"type": "Patient",
"format": "json"
}
}
My proxy is:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="fhirTest"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property expression="json-eval($.body.base)"
name="base"
scope="default"
type="STRING"/>
<property expression="json-eval($.body.type)"
name="type"
scope="default"
type="STRING"/>
<property expression="json-eval($.body.format)"
name="format"
scope="default"
type="STRING"/>
<fhir.init>
<base>{$ctx:base}</base>
</fhir.init>
<fhir.create>
<type>{$ctx:type}</type>
<format>{$ctx:format}</format>
</fhir.create>
<send/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="ApplicationXMLBuilder.allowDTD">true</parameter>
<description/>
</proxy>
After the request the response is (the body is void):
HTTP/1.1 202 Accepted
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Date: Fri, 05 May 2017 14:09:01 GMT
Server: WSO2 Carbon Server
but I get the following exception: DOCTYPE is not allowed
log:
[2017-05-05 16:09:01,192] [] INFO - LogMediator To: /services/fhirTest,From: 192.168.81.118,Direction: request,base1 = https://sqlonfhir-stu3.azurewebsites.net
,type1 = Patient,format1 = json,Payload: {
"body": {
"base": "https://sqlonfhir-stu3.azurewebsites.net",
"type": "Patient",
"format": "json"
}
}
[2017-05-05 16:09:01,704] [] ERROR - RelayUtils Error while building Passthrough stream
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:160)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:136)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:99)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.buildMessage(Axis2SynapseEnvironment.java:817)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:546)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:281)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:775)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:262)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:36)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 21 more
[2017-05-05 16:09:01,709] [] ERROR - Axis2SynapseEnvironment Error while building message
org.apache.axis2.AxisFault: Error while building Passthrough stream
at org.apache.synapse.transport.passthru.util.RelayUtils.handleException(RelayUtils.java:283)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:142)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:99)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.buildMessage(Axis2SynapseEnvironment.java:817)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:546)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:281)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:775)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:262)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at ...
[2017-05-05 16:11:03,952] [] WARN - SynapseCallbackReceiver Synapse received a response for the request with message Id : urn:uuid:c14afbec-7e12-4c9a-be5e-0746
53fed0e6 But a callback is not registered (anymore) to process this response
My questions are:
Has anyone been able to take the correct tests by following the guide?
How do I pass the other data to create the resource fhir (further base, type and format) as described here?
Thanks in advance
UPDATE: After I have enabled messageBuilder and messageFormatter (as suggested by Hariprasath) the previus error is resolved
but now I have an other error:
[2017-05-10 16:42:20,891] [] DEBUG - RelayUtils Content Type is application/fhir+json; charset=utf-8
[2017-05-10 16:42:20,893] [] ERROR - Axis2Sender Unexpected error during sending message out
java.lang.NullPointerException
at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer.java:211
This is because of the response is an HTML page(with the content-type is in text/html format). Usually, we need to enable the following formatter and builder to avoid this error and supports text/html format. Please add following message builders and formatters to the sections in /repository/conf/axis2/axis2.xml.
<messageBuilder contentType="text/html"
class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
<messageFormatter contentType="text/html"
class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
Make sure that you add/enable builders and formatter for "text/html" in /repository/conf/axis2/axis2.xml file.
<messageFormatter contentType="text/html"
class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
[1] https://github.com/wso2-extensions/esb-connector-fhir/blob/master/src/test/INTEGRATION-TEST.txt

ejabberd BOSH takes too many minutes in HTTP pre-bind

The context:
I'm trying to generate a session from my back-end to attach to it from my front-end. In the process, I'm sending the request to ejabberd, to the mod_http_bind module listening on the port 5280, as is explained in metajack.im post.
Session id requests are sent using this script.
I'm using external authentication and is working well, in a normal time, when connecting directly through XMPP or WebAdmin.
The problem:
It's generating the session id right BUT it's taking around 1-3 minutes. After this time my Bosh chat client through a timeout. Beside this, it's too much time for a simple session id.
Any suggestion??
Extra info:
Here is my ejabberd logs:
ejabberd-log
2015-12-14 15:52:34.655 [info] <0.490.0>#ejabberd_listener:accept:299 (#Port<0.3971>) Accepted connection 127.0.0.1:49840 -> 127.0.0.1:5280
2015-12-14 15:52:34.655 [info] <0.713.0>#ejabberd_http:init:157 started: {gen_tcp,#Port<0.3971>}
2015-12-14 15:53:43.187 [info] <0.490.0>#ejabberd_listener:accept:299 (#Port<0.3972>) Accepted connection 127.0.0.1:49855 -> 127.0.0.1:5280
2015-12-14 15:53:43.187 [info] <0.715.0>#ejabberd_http:init:157 started: {gen_tcp,#Port<0.3972>}
error.log
--empty--
crash.log
--empty--
Ejabberd version:
15.11
ejabberd.log with log_level at debug
2015-12-14 16:20:19.170 [info] <0.1240.0>#ejabberd_listener:accept:299 (#Port<0.7839>) Accepted connection 127.0.0.1:50027 -> 127.0.0.1:5280
2015-12-14 16:20:19.170 [debug] <0.1241.0>#ejabberd_http:init:153 S: [{[<<"register">>],mod_register_web},{[<<"admin">>],ejabberd_web_admin},{[<<"http-bind">>],mod_http_bind}]
2015-12-14 16:20:19.170 [info] <0.1241.0>#ejabberd_http:init:157 started: {gen_tcp,#Port<0.7839>}
2015-12-14 16:20:19.170 [debug] <0.1241.0>#ejabberd_http:process_header:280 (#Port<0.7839>) http query: 'POST' <<"/http-bind">>
2015-12-14 16:20:19.170 [debug] <0.1241.0>#ejabberd_http:extract_path_query:392 client data: <<"<body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' to='chatdomain' window='5' xml:lang='en' rid='1598394' hold='1' wait='70'/>">>
2015-12-14 16:20:19.170 [debug] <0.1241.0>#ejabberd_http:process:350 [<<"http-bind">>] matches [<<"http-bind">>]
2015-12-14 16:20:19.170 [debug] <0.1241.0>#mod_http_bind:process:68 Incoming data: <body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' to='chatdomain' window='5' xml:lang='en' rid='1598394' hold='1' wait='70'/>
2015-12-14 16:20:19.171 [debug] <0.1241.0>#ejabberd_http_bind:parse_request:1114 --- incoming data ---
<body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' to='chatdomain' window='5' xml:lang='en' rid='1598394' hold='1' wait='70'/>
--- END ---
2015-12-14 16:20:19.171 [debug] <0.1241.0>#ejabberd_http_bind:start:154 Starting session
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:init:339 started: {<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>,<<>>,{{127,0,0,1},50027}}
2015-12-14 16:20:19.176 [debug] <0.1241.0>#ejabberd_http_bind:handle_session_start:282 got pid: <0.1242.0>
2015-12-14 16:20:19.176 [debug] <0.1241.0>#ejabberd_http_bind:handle_session_start:321 Create session: <<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>
2015-12-14 16:20:19.176 [debug] <0.1241.0>#ejabberd_http_bind:http_put:775 Looking for session: <<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:handle_sync_event:442 New request: {http_put,1598394,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"to">>,<<"chatdomain">>},{<<"window">>,<<"5">>},{<<"xml:lang">>,<<"en">>},{<<"rid">>,<<"1598394">>},{<<"hold">>,<<"1">>},{<<"wait">>,<<"70">>}],[],155,1,{<<"chatdomain">>,<<>>},{{127,0,0,1},50027}}
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:handle_http_put_event:558 New request: {http_put,1598394,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"to">>,<<"chatdomain">>},{<<"window">>,<<"5">>},{<<"xml:lang">>,<<"en">>},{<<"rid">>,<<"1598394">>},{<<"hold">>,<<"1">>},{<<"wait">>,<<"70">>}],[],155,1,{<<"chatdomain">>,<<>>},{{127,0,0,1},50027}}
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:591 Actually processing request: {http_put,1598394,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"to">>,<<"chatdomain">>},{<<"window">>,<<"5">>},{<<"xml:lang">>,<<"en">>},{<<"rid">>,<<"1598394">>},{<<"hold">>,<<"1">>},{<<"wait">>,<<"70">>}],[],155,1,{<<"chatdomain">>,<<>>},{{127,0,0,1},50027}}
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:642 -- SaveKey:
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:654 reqlist: [{hbr,1598394,<<>>,[]}]
2015-12-14 16:20:19.176 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:700 really sending now: []
2015-12-14 16:20:19.278 [debug] <0.1241.0>#ejabberd_http_bind:prepare_response:900 OutPacket: [{xmlstreamstart,<<"stream:stream">>,[{<<"xml:lang">>,<<"en">>},{<<"xmlns">>,<<"jabber:client">>},{<<"xmlns:stream">>,<<"http://etherx.jabber.org/streams">>},{<<"id">>,<<"108440446">>},{<<"from">>,<<"chatdomain">>}]}]
2015-12-14 16:20:19.279 [info] <0.1240.0>#ejabberd_listener:accept:299 (#Port<0.7846>) Accepted connection 127.0.0.1:50028 -> 127.0.0.1:5280
2015-12-14 16:20:19.279 [debug] <0.1244.0>#ejabberd_http:init:153 S: [{[<<"register">>],mod_register_web},{[<<"admin">>],ejabberd_web_admin},{[<<"http-bind">>],mod_http_bind}]
2015-12-14 16:20:19.279 [info] <0.1244.0>#ejabberd_http:init:157 started: {gen_tcp,#Port<0.7846>}
2015-12-14 16:20:19.279 [debug] <0.1244.0>#ejabberd_http:process_header:280 (#Port<0.7846>) http query: 'POST' <<"/http-bind">>
2015-12-14 16:20:19.279 [debug] <0.1244.0>#ejabberd_http:extract_path_query:392 client data: <<"<body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' rid='1598395' xml:lang='en' sid='92c4475848d8b8f10b4dbe1a66980c385f46ac00'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFkbWluADEyMzQ=\n</auth></body>">>
2015-12-14 16:20:19.279 [debug] <0.1244.0>#ejabberd_http:process:350 [<<"http-bind">>] matches [<<"http-bind">>]
2015-12-14 16:20:19.279 [debug] <0.1244.0>#mod_http_bind:process:68 Incoming data: <body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' rid='1598395' xml:lang='en' sid='92c4475848d8b8f10b4dbe1a66980c385f46ac00'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFkbWluADEyMzQ=
</auth></body>
2015-12-14 16:20:19.279 [debug] <0.1244.0>#ejabberd_http_bind:parse_request:1114 --- incoming data ---
<body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' rid='1598395' xml:lang='en' sid='92c4475848d8b8f10b4dbe1a66980c385f46ac00'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFkbWluADEyMzQ=
</auth></body>
--- END ---
2015-12-14 16:20:19.279 [debug] <0.1244.0>#ejabberd_http_bind:http_put:775 Looking for session: <<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>
2015-12-14 16:20:19.279 [debug] <0.1242.0>#ejabberd_http_bind:handle_sync_event:442 New request: {http_put,1598395,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"rid">>,<<"1598395">>},{<<"xml:lang">>,<<"en">>},{<<"sid">>,<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>}],[{xmlel,<<"auth">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>},{<<"mechanism">>,<<"PLAIN">>}],[{xmlcdata,<<"AGFkbWluADEyMzQ=\n">>}]}],255,1,<<>>,{{127,0,0,1},50028}}
2015-12-14 16:20:19.280 [debug] <0.1242.0>#ejabberd_http_bind:handle_http_put_event:558 New request: {http_put,1598395,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"rid">>,<<"1598395">>},{<<"xml:lang">>,<<"en">>},{<<"sid">>,<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>}],[{xmlel,<<"auth">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>},{<<"mechanism">>,<<"PLAIN">>}],[{xmlcdata,<<"AGFkbWluADEyMzQ=\n">>}]}],255,1,<<>>,{{127,0,0,1},50028}}
2015-12-14 16:20:19.280 [debug] <0.1242.0>#ejabberd_http_bind:rid_allow:852 Previous rid / New rid: 1598394/1598395
2015-12-14 16:20:19.280 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:591 Actually processing request: {http_put,1598395,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"rid">>,<<"1598395">>},{<<"xml:lang">>,<<"en">>},{<<"sid">>,<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>}],[{xmlel,<<"auth">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>},{<<"mechanism">>,<<"PLAIN">>}],[{xmlcdata,<<"AGFkbWluADEyMzQ=\n">>}]}],255,1,<<>>,{{127,0,0,1},50028}}
2015-12-14 16:20:19.280 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:642 -- SaveKey:
2015-12-14 16:20:19.280 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:654 reqlist: [{hbr,1598395,<<>>,[]},{hbr,1598394,<<>>,[{xmlstreamstart,<<"stream:stream">>,[{<<"xml:lang">>,<<"en">>},{<<"xmlns">>,<<"jabber:client">>},{<<"xmlns:stream">>,<<"http://etherx.jabber.org/streams">>},{<<"id">>,<<"108440446">>},{<<"from">>,<<"chatdomain">>}]}]}]
2015-12-14 16:20:19.280 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:700 really sending now: [{xmlel,<<"auth">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>},{<<"mechanism">>,<<"PLAIN">>}],[{xmlcdata,<<"AGFkbWluADEyMzQ=\n">>}]}]
^[OF2015-12-14 16:21:29.387 [info] <0.1240.0>#ejabberd_listener:accept:299 (#Port<0.7847>) Accepted connection 127.0.0.1:50030 -> 127.0.0.1:5280
2015-12-14 16:21:29.388 [debug] <0.1245.0>#ejabberd_http:init:153 S: [{[<<"register">>],mod_register_web},{[<<"admin">>],ejabberd_web_admin},{[<<"http-bind">>],mod_http_bind}]
2015-12-14 16:21:29.388 [info] <0.1245.0>#ejabberd_http:init:157 started: {gen_tcp,#Port<0.7847>}
2015-12-14 16:21:29.388 [debug] <0.1245.0>#ejabberd_http:process_header:280 (#Port<0.7847>) http query: 'POST' <<"/http-bind">>
2015-12-14 16:21:29.388 [debug] <0.1245.0>#ejabberd_http:extract_path_query:392 client data: <<"<body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' rid='1598396' xml:lang='en' sid='92c4475848d8b8f10b4dbe1a66980c385f46ac00'/>">>
2015-12-14 16:21:29.388 [debug] <0.1245.0>#ejabberd_http:process:350 [<<"http-bind">>] matches [<<"http-bind">>]
2015-12-14 16:21:29.388 [debug] <0.1245.0>#mod_http_bind:process:68 Incoming data: <body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' rid='1598396' xml:lang='en' sid='92c4475848d8b8f10b4dbe1a66980c385f46ac00'/>
2015-12-14 16:21:29.388 [debug] <0.1245.0>#ejabberd_http_bind:parse_request:1114 --- incoming data ---
<body xmlns='http://jabber.org/protocol/httpbind' content='text/xml; charset=utf-8' rid='1598396' xml:lang='en' sid='92c4475848d8b8f10b4dbe1a66980c385f46ac00'/>
--- END ---
2015-12-14 16:21:29.388 [debug] <0.1245.0>#ejabberd_http_bind:http_put:775 Looking for session: <<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:handle_sync_event:442 New request: {http_put,1598396,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"rid">>,<<"1598396">>},{<<"xml:lang">>,<<"en">>},{<<"sid">>,<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>}],[],160,1,<<>>,{{127,0,0,1},50030}}
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:handle_http_put_event:558 New request: {http_put,1598396,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"rid">>,<<"1598396">>},{<<"xml:lang">>,<<"en">>},{<<"sid">>,<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>}],[],160,1,<<>>,{{127,0,0,1},50030}}
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:rid_allow:852 Previous rid / New rid: 1598395/1598396
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:591 Actually processing request: {http_put,1598396,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"content">>,<<"text/xml; charset=utf-8">>},{<<"rid">>,<<"1598396">>},{<<"xml:lang">>,<<"en">>},{<<"sid">>,<<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>}],[],160,1,<<>>,{{127,0,0,1},50030}}
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:642 -- SaveKey:
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:654 reqlist: [{hbr,1598396,<<>>,[]},{hbr,1598395,<<>>,[]}]
2015-12-14 16:21:29.389 [debug] <0.1242.0>#ejabberd_http_bind:process_http_put:700 really sending now: []
2015-12-14 16:23:09.492 [info] <0.1242.0>#ejabberd_http_bind:handle_info:507 Session timeout. Closing the HTTP bind session: <<"92c4475848d8b8f10b4dbe1a66980c385f46ac00">>
2015-12-14 16:23:09.492 [debug] <0.1242.0>#ejabberd_http_bind:terminate:538 terminate: Deleting session 92c4475848d8b8f10b4dbe1a66980c385f46ac00
I was making a mistake in the BoshClient script.
There, in the "startSessionAndAuth" method, you can set the "wait" value, that I don't know in what stages you may want to wait but... it was set to 70 seconds by default. I set it to 0 and now is responding instantly with a new session id.
In the protocol definition its said:
Note: Clients that only support Polling Sessions MAY prevent the
connection manager from waiting by setting 'wait' or 'hold' to "0".
However, polling is NOT RECOMMENDED since the associated increase in
bandwidth consumption and the decrease in responsiveness are both
typically one or two orders of magnitude!
and it's exactly my case.