We're having trouble with playback for our SMAPI implementation. When try to play a track the transport immediately returns to pause, as if the track was 0 seconds long. Accessing the URI of the track with cURL at our CDN returns 200 OK and the body.
:~$ curl -v -s -o /dev/null https://tracks.cdn.247e.com/thr/assets/mp4-320kbps/00/11/2E/5D56A973F81DF472E050040A2018AE3E.mp4?wxOllzkODJfur46u1oKXw1_cpUJ4534zUZFsSmBkNmQB5P18qAaiXY35793Mct
HEE_e0sTvctyB6sT4JkeA9xI5icthHfKIyZSF2p-tpn_ov8zulVWUVKWa588tHPUNlRVq5lv5uGbyyLdGz9s8-9ckwaWcl-bmEv1Dgsl-WMNYKdytTJGxWYPho-dERduu-uf6hw60kKKI&t=184451257&u=91399964&p=1739&c=247-web&s=PcEscMiBD7kj1_cz4
76yy5eVSA3KSEqfAU70cm43cIo&sid=2946359606&d=2
> GET /thr/assets/mp4-320kbps/00/11/2E/5D56A973F81DF472E050040A2018AE3E.mp4?wxOllzkODJfur46u1oKXw1_cpUJ4534zUZFsSmBkNmQB5P18qAaiXY35793MctHEE_e0sTvctyB6sT4JkeA9xI5icthHfKIyZSF2p-tpn_ov8zulVWUVKWa588tHPUNlRVq5lv5uGbyyLdGz9s8-9ckwaWcl-bmEv1Dgsl-WMNYKdytTJGxWYPho-dERduu-uf6hw60kKKI HTTP/1.1
> Host: tracks.cdn.247e.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: s-maxage=172800
< Content-Type: audio/mp4
< Date: Thu, 16 Nov 2017 10:14:54 GMT
< Last-Modified: Mon, 06 Nov 2017 20:43:56 GMT
< Server: ECAcc (lha/8D51)
< X-Cache: HIT
< Content-Length: 12341273
Here is the /status/opt/log/anacapa.trace log:
[1970-01-01 11:38:52.440] <chsrc,3> handling req while stopped: 2
[1970-01-01 11:38:52.441] <chsrc,3> recording state as 1 STOPPED (0.000000) w/ itemId = n/a [0]
[1970-01-01 11:38:52.466] <chsrc,3> handling req while stopped: 8
[1970-01-01 11:38:52.467] <chsrc,3> recording state as 1 STOPPED (0.000000) w/ itemId = n/a [0]
[1970-01-01 11:38:52.507] <chsrc,2> starting to execute the queue
[1970-01-01 11:38:52.507] <chsrc,4> resetSegmentFetchErrors
[1970-01-01 11:38:52.507] <chsrc,3> getTrackURIAndFramer() rslt 0x75a6fbc8 [f:0|u:1|m:0((null))] cld:0 [x-sonos-http:ExternalTrack%3a184451257.mp3?sid=255&flags=8224&sn=8]
[1970-01-01 11:38:52.507] <chsrc,4> resetSegmentFetchErrors
[1970-01-01 11:38:52.508] <chsrc,3> Streaming enqueued x-sonos-http:ExternalTrack%3a184451257.mp3?sid=255&flags=8224&sn=8
[1970-01-01 11:38:52.508] <chsrc,2> Start streaming mp3 track (2/2) x-sonos-http:ExternalTrack%3a184451257.mp3?sid=255&flags=8224&sn=8; origin is 41926.927777 (0 samples since)
[1970-01-01 11:38:52.508] <chsrc,3> recording state as 6 TRANSITIONING (-1.000000) w/ itemId = n/a [9]
[1970-01-01 11:38:52.508] <chsrc,2> starting at location 0 s 0 us, offset 0 (00:)
[1970-01-01 11:38:52.508] <chsrc,3> FC: allowing caching
[1970-01-01 11:38:52.989] <sonoscp,3> dereferenced to: https://tracks.cdn.247e.com/thr/assets/mp4-320kbps/00/11/2E/5D56A973F81DF472E050040A2018AE3E.mp4?wxOllzkODJfur46u1oKXw1_cpUJ4534zUZFsSmBkNmQB5P18qAaiXY35793MctHEE_e0sTvctyB6sT4JkeA9xI5icthHfKIyZSF2p-tpn_ov8zulVWUVKWa588tHPUNlRVq5lv5uGbyyLdGz9s8-9ckwaWcl-bmEv1Dgsl-WMNYKdytTJGxWYPho-dERduu-uf6hw60kKKI&t=184451257&u=91399964&p=1739&c=247-web&s=PcEscMiBD7kj1_cz476yy5eVSA3KSEqfAU70cm43cIo&sid=2946359606&d=2
[1970-01-01 11:38:52.989] <chsrc,3> oob metadata cache reset
[1970-01-01 11:38:52.989] <chsrc,3> oob metadata disabled
[1970-01-01 11:38:52.989] <chsrc,2> Downloading https://tracks.cdn.247e.com/thr/assets/mp4-320kbps/00/11/2E/5D56A973F81DF472E050040A2018AE3E.mp4?wxOllzkODJfur46u1oKXw1_cpUJ4534zUZFsSmBkNmQB5P18qAaiXY35793MctHEE_e0sTvctyB6sT4JkeA9xI5icthHfKIyZSF2p-tpn_ov8zulVWUVKWa588tHPUNlRVq5lv5uGbyyLdGz9s8-9ckwaWcl-bmEv1Dgsl-WMNYKdytTJGxWYPho-dERduu-uf6hw60kKKI&t=184451257&u=91399964&p=1739&c=247-web&s=PcEscMiBD7kj1_cz476yy5eVSA3KSEqfAU70cm43cIo&sid=2946359606&d=2
[1970-01-01 11:38:53.692] <chsrc,3> mp3: time to first byte 704
[1970-01-01 11:38:53.693] <chsrc,3> recording state as 5 PLAYING (0.000000) w/ itemId = n/a [9]
[1970-01-01 11:38:53.832] <chsrc,2> Stopped playing x-sonos-http:ExternalTrack%3a184451257.mp3?sid=255&flags=8224&sn=8
[1970-01-01 11:38:53.834] <chsrc,2> running queueCompletionRoutine
[1970-01-01 11:38:54.136] <chsrc,3> recording state as 1 STOPPED (0.000000) w/ itemId = n/a [0]
[1970-01-01 11:38:54.136] <chsrc,2> running stopRoutine
Here's the getMediaMetadata request and response as requested:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<credentials xmlns="http://www.sonos.com/Services/1.1">
<deviceId>94-9F-3E-8A-B8-2A:1</deviceId>
<deviceProvider>Sonos</deviceProvider>
<sessionId>ifEX22xaa8lUFYB0QigH7g</sessionId>
</credentials>
</s:Header>
<s:Body>
<getMediaMetadata xmlns="http://www.sonos.com/Services/1.1">
<id>ExternalTrack:181562676</id>
</getMediaMetadata>
</s:Body>
</s:Envelope>
Response:
<soap:Envelope xmlns="http://www.sonos.com/Services/1.1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getMediaMetadataResponse xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.sonos.com/Services/1.1">
<getMediaMetadataResult>
<id>ExternalTrack:181562676</id>
<itemType>track</itemType>
<title>Havana (feat. Young Thug)</title>
<mimeType>audio/mp3</mimeType>
<trackMetadata>
<albumId>ExternalAlbum:181562675</albumId>
<album>Havana (feat. Young Thug)</album>
<albumArtistId>ExternalArtist:31559059</albumArtistId>
<artist>Camila Cabello</artist>
<albumArtURI>http://artwork.cdn.247e.com/covers/181562675/64x64</albumArtURI>
<canPlay>true</canPlay>
<canSkip>true</canSkip>
<canAddToFavorites>true</canAddToFavorites>
</trackMetadata>
</getMediaMetadataResult>
</getMediaMetadataResponse>
</soap:Body>
</soap:Envelope>
Related
I have camera that supports Onvif. Calling OnVif SOAP GetDeviceInformation
<s:Envelope
xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDeviceInformation
xmlns="http://www.onvif.org/ver10/device/wsdl"/>
</s:Body>
</s:Envelope>
I get an answer when using SoapUI. I created simple WCF console app to call the same method - no answer from camera.
I checked with wireshart the messages sent:
SoapUI:
Frame 8858: 680 bytes on wire (5440 bits), 680 bytes captured (5440 bits) on interface 0
Ethernet II, Src: IntelCor_fc:da:96 (b4:b6:76:fc:da:96), Dst: Shenzhen_a4:9f:e8 (e8:ab:fa:a4:9f:e8)
Internet Protocol Version 4, Src: 10.0.0.8, Dst: 10.0.0.102
Transmission Control Protocol, Src Port: 61385, Dst Port: 888, Seq: 1, Ack: 1, Len: 626
Hypertext Transfer Protocol
POST /onvif/device_service HTTP/1.1\r\n
Accept-Encoding: gzip,deflate\r\n
Content-Type: application/soap+xml;charset=UTF-8;action="http://www.onvif.org/ver10/device/wsdl/GetDeviceInformation"\r\n
Content-Length: 322\r\n
[Content length: 322]
Host: 10.0.0.102:888\r\n
Connection: Keep-Alive\r\n
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)\r\n
\r\n
[Full request URI: http://10.0.0.102:888/onvif/device_service]
[HTTP request 1/1]
[Response in frame: 8891]
File Data: 322 bytes
eXtensible Markup Language
<s:Envelope
xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDeviceInformation
xmlns="http://www.onvif.org/ver10/device/wsdl"/>
</s:Body>
</s:Envelope>
WCF Client:
Frame 11631: 315 bytes on wire (2520 bits), 315 bytes captured (2520 bits) on interface 0
Ethernet II, Src: IntelCor_fc:da:96 (b4:b6:76:fc:da:96), Dst: Shenzhen_a4:9f:e8 (e8:ab:fa:a4:9f:e8)
Internet Protocol Version 4, Src: 10.0.0.8, Dst: 10.0.0.102
Transmission Control Protocol, Src Port: 61420, Dst Port: 888, Seq: 282, Ack: 1, Len: 261
[2 Reassembled TCP Segments (542 bytes): #11629(281), #11631(261)]
Hypertext Transfer Protocol
POST /onvif/device_service HTTP/1.1\r\n
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetDeviceInformation"\r\n
Host: 10.0.0.102:888\r\n
Content-Length: 261\r\n
[Content length: 261]
Expect: 100-continue\r\n
Accept-Encoding: gzip, deflate\r\n
Connection: Keep-Alive\r\n
\r\n
[Full request URI: http://10.0.0.102:888/onvif/device_service]
[HTTP request 1/1]
File Data: 261 bytes
eXtensible Markup Language
<s:Envelope
xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDeviceInformation
xmlns="http://www.onvif.org/ver10/device/wsdl"/>
</s:Body>
</s:Envelope>
Bellow WCF code after WSDL Onvif WSDL reference was added to project:
namespace OnVifInfo
{
class Program
{
static void Main(string[] args)
{
GetDeviceInfo(new Uri("http://10.0.0.102:888/onvif/device_service"));
}
private static void GetDeviceInfo(Uri uri)
{
string address = uri.AbsoluteUri.ToString();
var messageElement = new TextMessageEncodingBindingElement()
{
MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None)
};
HttpTransportBindingElement httpBinding = new HttpTransportBindingElement()
{
AuthenticationScheme = System.Net.AuthenticationSchemes.Negotiate
};
CustomBinding binding = new CustomBinding(messageElement, httpBinding);
OnVifWebService.DeviceClient service = new OnVifWebService.DeviceClient(binding, new EndpointAddress(address));
string model;
string firmwareVersion;
string serialNumber;
string hardwareId;
var response = service.GetDeviceInformation(out model, out firmwareVersion, out serialNumber, out hardwareId);
}
}
}
Any ideas why camera is not answering to WCF client?
Why there is reassemble line:
[2 Reassembled TCP Segments (542 bytes): #11629(281), #11631(261)]
in WCF client request, but not in SoapUI call
Problem was the Expect HTML header
Expect: 100-continue\r\n
When I added this to WCF code
System.Net.ServicePoint servicePoint = System.Net.ServicePointManager.FindServicePoint(service.Endpoint.Address.Uri);
servicePoint.Expect100Continue = false;
It removed the Expect header and I got the answer from the camera.
WHen using NginX for ssl offloading things work fine, however when trying to do this for serialized stream over a socket it seems to work incorrectly, and the documentation over using streams http://nginx.org/en/docs/stream/ngx_stream_upstream_module.html makes no sense,
can anyone help me with a working foo bar example of how to ssl offload for a streaming input(made of serialized logging event objects in this case) with nginx
Edit:
we are trying to forward and strip SSL off of log4j socketappender output but cannot even get the forwarding working when the SSL is not enabled.
here is the config file without the ssl offloading portion(when retrieving non https the forwarding still does not work correctly)
events {
worker_connections 1024;
}
http {
server {
listen 4560 ;
server_name logstash.corelims.com;
location / {
proxy_pass_request_headers on;
proxy_pass http://localhost:4561/;
proxy_redirect http://localhost:4561/ http://logstash.corelims.com:4560/;
}
error_log C:/ELK/nginx-1.9.4/logs/debug.log debug;
}
}
which leads us to these debug logs:
2015/08/27 00:54:59 [info] 5052#3716: *45 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading client request line, client: IP.ADDRESS.HIDDENFOR.POST, server: foo.bar.com, request: "’ "
2015/08/27 00:54:59 [debug] 5052#3716: *45 lingering read: -1
2015/08/27 00:54:59 [debug] 5052#3716: *45 http request count:1 blk:0
2015/08/27 00:54:59 [debug] 5052#3716: *45 http close request
2015/08/27 00:54:59 [debug] 5052#3716: *45 http log handler
2015/08/27 00:54:59 [debug] 5052#3716: *45 free: 008DE8E8, unused: 1991
2015/08/27 00:54:59 [debug] 5052#3716: *45 close http connection: 300
2015/08/27 00:54:59 [debug] 5052#3716: *45 event timer del: 300: 1822859279
2015/08/27 00:54:59 [debug] 5052#3716: *45 select del event fd:300 ev:0
2015/08/27 00:54:59 [debug] 5052#3716: *45 reusable connection: 0
2015/08/27 00:54:59 [debug] 5052#3716: *45 free: 023BCED0
2015/08/27 00:54:59 [debug] 5052#3716: *45 free: 023BEEA8, unused: 24
2015/08/27 12:27:45 [debug] 5052#3716: select del event fd:316 ev:0
I wrote a helper using Jersey to delete a dialog on QuickBlox. For some reason, the same delete request generated by curl returns without any errors but with Jersey (a java restful client library) returns a 403. Here are the packet traces (taken on wireshark) of the requests and responses:
Jersey Request:
DELETE /chat/Dialog/55c5fab8535c12a211000d0f.json HTTP/1.1\r\n
Accept: */*\r\n
QB-Token: 32a7acd55d3b21dad79afba3b834a0b62c9a4946\r\n
User-Agent: Jersey/2.19 (HttpUrlConnection 1.8.0_20)\r\n
Host: api.quickblox.com\r\n
Connection: keep-alive\r\n
\r\n
Jersey Response:
Hypertext Transfer Protocol
HTTP/1.1 403 Access Denied\r\n
Date: Sat, 08 Aug 2015 12:49:14 GMT\r\n
Connection: keep-alive\r\n
Cache-Control: no-store\r\n
Content-Type: text/html\r\n
Content-Language: en\r\n
Content-Length: 249\r\n
\r\n
[HTTP response 2/2]
[Time since request: 0.009155000 seconds]
[Prev request in frame: 24303]
[Prev response in frame: 24324]
[Request in frame: 24328]
Line-based text data: text/html
<HTML>\n
<HEAD>\n
<TITLE>Access Denied</TITLE>\n
</HEAD>\n
\n
<BODY BGCOLOR="white" FGCOLOR="black">\n
<H1>Access Denied</H1>\n
<HR>\n
\n
<FONT FACE="Helvetica,Arial"><B>\n
Description: You are not allowed to access the document you requested.\n
</B></FONT>\n
<HR>\n
</BODY>\n
Curl Request:
Hypertext Transfer Protocol
DELETE /chat/Dialog/55c5fab8535c12a211000d0f.json HTTP/1.1\r\n
User-Agent: curl/7.37.1\r\n
Host: api.quickblox.com\r\n
Accept: */*\r\n
QB-Token: 32a7acd55d3b21dad79afba3b834a0b62c9a4946\r\n
\r\n
[Full request URI: http://api.quickblox.com/chat/Dialog/55c5fab8535c12a211000d0f.json]
[HTTP request 1/1]
[Response in frame: 35345]
Curl Response:
Hypertext Transfer Protocol
HTTP/1.1 200 OK\r\n
Access-Control-Allow-Origin: *\r\n
Cache-Control: max-age=0, private, must-revalidate\r\n
Content-Type: application/json; charset=utf-8\r\n
Date: Sat, 08 Aug 2015 12:54:34 GMT\r\n
ETag: "7215ee9c7d9dc229d2921a40e899ec5f"\r\n
QB-Token-ExpirationDate: 2015-08-08 14:49:14 UTC\r\n
QuickBlox-REST-API-Version: 0.1.1\r\n
Server: nginx/1.0.15\r\n
Status: 200 OK\r\n
X-Rack-Cache: invalidate, pass\r\n
X-Request-Id: 129dfcd4199bcae1f61cbd55a435885d\r\n
X-Runtime: 0.036879\r\n
X-UA-Compatible: IE=Edge,chrome=1\r\n
Content-Length: 1\r\n
Connection: keep-alive\r\n
\r\n
[HTTP response 1/1]
[Time since request: 0.475311000 seconds]
[Request in frame: 35287]
JavaScript Object Notation: application/json
Line-based text data: application/json
Does anyone have any idea what's happening here?
I need know how to invoke the adapter from the development server in the cloud. In the local environment we have the option in eclipse but in the development server in the cloud, I can´t see the option for invoking.
I use MobileFirst 7.0
Update - The notification based in tags does not arrive to my device.
The problem is that in the console the notification is success, but these never arrive to my device. This is the message in my log.
[4/1/15 19:39:03:451 CDT] 00000081 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"nacion"},"target":{"tagNames":["nacion"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"nacion"}}}} [project ElUniversal]
[4/1/15 19:41:14:328 CDT] 0000013f ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"nacion"},"target":{"tagNames":["nacion"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"nacion.com"}}}} [project ElUniversal]
[4/1/15 19:42:26:417 CDT] 000000cb ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:42:36:649 CDT] 00000118 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:44:15:229 CDT] 000000d1 com.worklight.common.util.jmx.LibertyRuntimeMBeanHandler I Establishing REST connection to service:jmx:rest://localhost:9443/IBMJMXConnectorREST
[4/1/15 19:45:03:448 CDT] 000001d7 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:45:23:708 CDT] 00000036 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"metropolitest"},"target":{"tagNames":["metropoli"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"metropoliurl"}}}} [project ElUniversal]
[4/1/15 19:46:29:882 CDT] 000001e8 ht.integration.js.JavaScriptIntegrationLibraryImplementation I Notificacion enviada exitosamente {"message":{"alert":"deportestest"},"target":{"tagNames":["deportes"]},"settings":{"apns":{"sound":"57_dog-barking.mp3","payload":{"url":"deportesurl"}}}} [project ElUniversal]
In my nativeApp the connection to the server is correct and this is a part of the Output:
2015-04-01 19:09:34.041 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:220 :: Sending request (http://198.11.212.196:9080/ElUniversal/apps/services/loguploader) with headers:
{
"Accept-Language" = es;
"Content-Encoding" = gzip;
"Content-Type" = "application/json";
"User-Agent" = "El_Universal_Demo/1 (iPhone; iOS 8.1.2; Scale/2.00)/WLNativeAPI/7.0.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-clientlog-appname" = "El_Universal_Demo";
"x-wl-clientlog-appversion" = "1.0";
"x-wl-clientlog-deviceId" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-clientlog-env" = iOSnative;
"x-wl-clientlog-model" = "iPhone6,1";
"x-wl-clientlog-osversion" = "8.1.2";
"x-wl-compressed" = true;
"x-wl-device-id" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-platform-version" = "7.0.0.0";
}
You can see the request body in the Analytics platform logs.
2015-04-01 19:09:34.081 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:297 :: Starting the request with URL http://198.11.212.196:9080/ElUniversal/apps/services/loguploader
2015-04-01 19:09:34.085 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:230 :: waiting for response... (Thread=<NSThread: 0x170260f40>{number = 1, name = main})
2015-04-01 19:09:34.187 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:310 :: Request Success
2015-04-01 19:09:34.193 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:311 :: Response Status Code : 201
2015-04-01 19:09:34.199 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:312 :: Response Content :
2015-04-01 19:09:34.210 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:361 :: Response Header: {
"Content-Language" = "en-US";
"Content-Length" = 0;
Date = "Thu, 02 Apr 2015 01:10:30 GMT";
P3P = "policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"";
"X-Powered-By" = "Servlet/3.0";
}
Response Data:
Status code=201
2015-04-01 19:09:34.214 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:404 :: NSS object is null
2015-04-01 19:09:34.217 El_Universal_Demo[211:9844] [DEBUG] [OCLogger] Client Logs successfully sent to server.
2015-04-01 19:09:34.269 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:310 :: Request Success
2015-04-01 19:09:34.274 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:311 :: Response Status Code : 201
2015-04-01 19:09:34.279 El_Universal_Demo[211:9844] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:312 :: Response Content :
2015-04-01 19:09:34.290 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:361 :: Response Header: {
"Content-Language" = "en-US";
"Content-Length" = 0;
Date = "Thu, 02 Apr 2015 01:10:30 GMT";
P3P = "policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"";
"X-Powered-By" = "Servlet/3.0";
}
Response Data:
Status code=201
2015-04-01 19:09:34.298 El_Universal_Demo[211:9844] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:404 :: NSS object is null
2015-04-01 19:09:34.304 El_Universal_Demo[211:9844] [DEBUG] [OCLogger] Analytics data successfully sent to server.
When I suscribe to specific tag, this is the log in my console of Xcode.
2015-04-01 19:25:36.579 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] +[WLAFHTTPClientWrapper requestWithURL:] in WLAFHTTPClientWrapper.m:46 :: Request url is http://198.11.212.196:9080/ElUniversal/apps/services/api/El_Universal_Demo/iOSnative/notifications
2015-04-01 19:25:36.586 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:141 :: Request timeout is 10.000000
2015-04-01 19:25:36.589 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:220 :: Sending request (http://198.11.212.196:9080/ElUniversal/apps/services/api/El_Universal_Demo/iOSnative/notifications) with headers:
{
"Accept-Language" = es;
"User-Agent" = "El_Universal_Demo/1 (iPhone; iOS 8.1.2; Scale/2.00)/WLNativeAPI/7.0.0.0";
"X-Requested-With" = XMLHttpRequest;
"x-wl-app-version" = "1.0";
"x-wl-device-id" = "A6042553-8580-4365-A69C-6731388D6A56";
"x-wl-platform-version" = "7.0.0.0";
}
You can see the request body in the Analytics platform logs.
2015-04-01 19:25:36.596 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:297 :: Starting the request with URL http://198.11.212.196:9080/ElUniversal/apps/services/api/El_Universal_Demo/iOSnative/notifications
2015-04-01 19:25:36.601 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:230 :: waiting for response... (Thread=<NSThread: 0x170064f00>{number = 1, name = main})
2015-04-01 19:25:36.876 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:310 :: Request Success
2015-04-01 19:25:36.881 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:311 :: Response Status Code : 200
2015-04-01 19:25:36.886 El_Universal_Demo[242:14249] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:312 :: Response Content : /*-secure-
{"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
2015-04-01 19:25:36.893 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:361 :: Response Header: {
"Cache-Control" = "no-cache, no-store, must-revalidate";
"Content-Length" = 70;
"Content-Type" = "application/json; charset=UTF-8";
Date = "Thu, 02 Apr 2015 01:26:33 GMT";
Expires = "Thu, 01 Jan 1970 00:00:00 GMT";
P3P = "policyref=\"/w3c/p3p.xml\", CP=\"CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE\"";
Pragma = "no-cache";
"X-Powered-By" = "Servlet/3.0";
}
Response Data: /*-secure-
{"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
Status code=200
2015-04-01 19:25:36.897 El_Universal_Demo[242:14249] [DEBUG] [WL_REQUEST] -[WLRequest requestFinished:] in WLRequest.m:404 :: NSS object is null
2015-04-01 19:25:36.899 El_Universal_Demo[242:14249] [DEBUG] [WL_PUSH] -[TagSubscribeRequestDelegate onSuccessWithResponse:userInfo:] in WLPush.m:132 :: Successfully subscribed to tag tucartera
2015-04-01 19:25:36.904 El_Universal_Demo[242:14249] on Success Status: 0
InvocationResult: (null)
InvocationContext: (null)
Response text: /*-secure-
{"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
To invoke the adapter through their endpoint simply make a request to the following url:
http(s)://<server>:<port>/<project-name>/adapters/<adapter-name>/<procedure-name>
For example:
http://localhost:10080/MyProject/adapters/MyHttpAdapter/myRssFeed
In the previous example, my MobileFirst server is running on localhost at port 10080, I have a project called MyProject and adapter MyHttpAdapter with a function myRssFeed
In IBM MobileFirst Platform V7.0 security is based on the OAuth model so you are going to need an authorization token to invoke adapters if they are protected.
For DEVELOPMENT ENVIRONMENT ONLY you can get a test authorization token at:
http(s)://<server>:<port>/<project-name>/authorization/v1/testtoken
To learn more about invoking adapters visit:
http://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight.dev.doc/devref/c_adapters_endpoint.html?lang=en
To learn more about the OAuth test token visit:
http://www-01.ibm.com/support/knowledgecenter/SSHSCD_7.0.0/com.ibm.worklight.dev.doc/devref/c_oauth_test_token_endpoint.html?lang=en
I found the problem, finally!
I had that change the JDK 6 to 7 in the server because in the log of server appeared a Error Message when I invoked my adapter http://###.##.###.###:9080/ElUniversal/adapters/DemoAdapter/sendNotification?params=[%27nacion%27,%27testNacion%27,%27nacion%27]
javax.net.ssl.SSLHandshakeException:
com.ibm.jsse2.util.j: End user tried to act as a CA
And this is the link for replace here!
Regards
Need your help with this issue. I'm trying to deploy war file at localhost:8080 through eclipse using tomcat7.maven plugin version 2.1 scripts but always getting 401 unauthorized error. My PC OS is windows 7 64 bit.
Here is my POM:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>localhost</server>
<username>tomcat</username>
<password>tomcat</password>
<path>/${project.build.finalName}</path>
<warDirectory>${project.build.directory}/exploded/${project.build.finalName}.war</warDirectory>
<update>true</update>
</configuration>
<version>2.1</version>
</plugin>
Here is my tomcat-users.xml :
<tomcat-users>
<user name="admin" password="admin" roles="admin-gui,manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager"/>
<role rolename="tomcat"/>
<user username="tomcat" password="tomcat" roles="manager-script"/>
</tomcat-users>
Here is my settings.xml in /.M2 directory.
<settings>
<servers>
<server>
<id>localhost</id>
<username>tomcat</username>
<password>tomcat</password>
</server>
</servers>
</settings>
Here is my log file output:
[DEBUG] Configuring mojo org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy from plugin realm ClassRealm[plugin>org.apache.tomcat.maven:tomcat7-maven-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader#5d4177f3]
[DEBUG] Configuring mojo 'org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy' with basic configurator -->
[DEBUG] (f) charset = ISO-8859-1
[DEBUG] (f) contextFile = C:\java\Spring3HibernateMaven\target\Spring3HibernateMaven-0.0.1-SNAPSHOT\META-INF\context.xml
[DEBUG] (f) ignorePackaging = false
[DEBUG] (f) mode = war
[DEBUG] (f) packaging = war
[DEBUG] (f) password = tomcat
[DEBUG] (f) path = /Spring3HibernateMaven-0.0.1-SNAPSHOT
[DEBUG] (f) server = localhost
[DEBUG] (f) update = true
[DEBUG] (f) url = http://localhost:8080/manager/text
[DEBUG] (f) username = tomcat
[DEBUG] (f) version = 2.1
[DEBUG] (f) warFile = C:\java\Spring3HibernateMaven\target\Spring3HibernateMaven-0.0.1-SNAPSHOT.war
[DEBUG] -- end configuration --
[INFO] Deploying war to http://localhost:8080/Spring3HibernateMaven-0.0.1-SNAPSHOT
[DEBUG] Connection request: [route: {}->http://localhost:8080][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 5]
[DEBUG] Connection leased: [id: 0][route: {}->http://localhost:8080][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 5]
[DEBUG] Connecting to localhost:8080
[DEBUG] CookieSpec selected: best-match
[DEBUG] Re-using cached 'basic' auth scheme for http://localhost:8080
[DEBUG] Target auth state: SUCCESS
[DEBUG] Proxy auth state: UNCHALLENGED
[DEBUG] Attempt 1 to execute request
[DEBUG] Sending request: PUT /manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true HTTP/1.1
[DEBUG] >> "PUT /manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true HTTP/1.1[\r][\n]"
[DEBUG] >> "User-Agent: Apache Tomcat Maven Plugin/2.1[\r][\n]"
[DEBUG] >> "Content-Length: 11860176[\r][\n]"
[DEBUG] >> "Host: localhost:8080[\r][\n]"
[DEBUG] >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] >> "Authorization: Basic dG9tY2F0OnRvbWNhdA==[\r][\n]"
[DEBUG] >> "[\r][\n]"
[DEBUG] >> PUT /manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true HTTP/1.1
[DEBUG] >> User-Agent: Apache Tomcat Maven Plugin/2.1
[DEBUG] >> Content-Length: 11860176
[DEBUG] >> Host: localhost:8080
[DEBUG] >> Connection: Keep-Alive
[DEBUG] >> Authorization: Basic dG9tY2F0OnRvbWNhdA==
Uploading: http://localhost:8080/manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true
Uploaded: http://localhost:8080/manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true (11583 KB at 1833.5 KB/sec)
[DEBUG] << "HTTP/1.1 401 Unauthorized[\r][\n]"
[DEBUG] << "Server: Apache-Coyote/1.1[\r][\n]"
[DEBUG] << "Cache-Control: private[\r][\n]"
[DEBUG] << "Expires: Wed, 31 Dec 1969 18:00:00 CST[\r][\n]"
[DEBUG] << "WWW-Authenticate: Basic realm="Tomcat Manager Application"[\r][\n]"
[DEBUG] << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
[DEBUG] << "Transfer-Encoding: chunked[\r][\n]"
[DEBUG] << "Date: Fri, 20 Sep 2013 05:24:35 GMT[\r][\n]"
[DEBUG] << "[\r][\n]"
[DEBUG] Receiving response: HTTP/1.1 401 Unauthorized
[DEBUG] << HTTP/1.1 401 Unauthorized
[DEBUG] << Server: Apache-Coyote/1.1
[DEBUG] << Cache-Control: private
[DEBUG] << Expires: Wed, 31 Dec 1969 18:00:00 CST
[DEBUG] << WWW-Authenticate: Basic realm="Tomcat Manager Application"
[DEBUG] << Content-Type: text/html;charset=ISO-8859-1
[DEBUG] << Transfer-Encoding: chunked
[DEBUG] << Date: Fri, 20 Sep 2013 05:24:35 GMT
[DEBUG] Connection can be kept alive indefinitely
[DEBUG] localhost:8080 requested authentication
[DEBUG] Authorization challenge processed
[DEBUG] Authentication failed
[DEBUG] Removing from cache 'basic' auth scheme for http://localhost:8080
[DEBUG] << "9ea[\r][\n]"
[DEBUG] << "[\r][\n]"
[DEBUG] << "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">[\r][\n]"
[DEBUG] << "<html>[\r][\n]"
[DEBUG] << " <head>[\r][\n]"
[DEBUG] << " <title>401 Unauthorized</title>[\r][\n]"
[DEBUG] << " <style type="text/css">[\r][\n]"
[DEBUG] << " <!--[\r][\n]"
[DEBUG] << " BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}[\r][\n]"
[DEBUG] << " H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}[\r][\n]"
[DEBUG] << " PRE, TT {border: 1px dotted #525D76}[\r][\n]"
[DEBUG] << " A {color : black;}A.name {color : black;}[\r][\n]"
[DEBUG] << " -->[\r][\n]"
[DEBUG] << " </style>[\r][\n]"
[DEBUG] << " </head>[\r][\n]"
[DEBUG] << " <body>[\r][\n]"
[DEBUG] << " <h1>401 Unauthorized</h1>[\r][\n]"
[DEBUG] << " <p>[\r][\n]"
[DEBUG] << " You are not authorized to view this page. If you have not changed[\r][\n]"
[DEBUG] << " any configuration files, please examine the file[\r][\n]"
[DEBUG] << " <tt>conf/tomcat-users.xml</tt> in your installation. That[\r][\n]"
[DEBUG] << " file must contain the credentials to let you use this webapp.[\r][\n]"
My Run Configuration in Eclipse:
Maven Runtime: 3.1.0 ( External )
Goal: -X -e tomcat7:deploy