w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
IOS PKIOperation signature certificate's generic CN in mdm enrollment scep step
I may be wrong in some details, because I touched this about two years ago. However, as I remember it's part of a protocol If you take a look at SCEP draft: http://tools.ietf.org/html/draft-nourse-scep-23#page-30 you will see this: When building a pkiMessage, clients MUST have a certificate to sign the PKCS#7 [RFC2315] signed-data (because PKCS#7 [RFC2315] requires it). Clients MUST either use an existing certificate, or create a self-signed certificate (see Section 2.3). - If the requester does not have an appropriate existing certificate, then a locally generated self-signed certificate MUST be used instead. The self-signed certificate MUST use the same subject name as in the PKCS#10 request. However, I was under impression that iOS device uses certificate/private keys whic

Categories : IOS

What is the purpose of a CRC on a payload when the payload is broken across multiple packets?
A packet can travel multiple (lower-layer ) hops when going from source to destination. Validating checksum at the destination ensures that we did not run into any bit-errors at any of the intermediate hops. Thus, even when we have a packet fragmented into multiple smaller packets, it is the source that does the fragmentation and it is the destination that reassembles the fragmentation. That is why, from checksum point of view, it makes senese to treat each fragment as a separate packet. In fact, this is exactly how fragmentation and checksum is done in IP networks as well. If the packet to send is larger than the MTU, then the sender fragements the packet into multiple smaller packets and calculates checksum for each of them individually. Once the destination receives these fragments, it

Categories : Misc

iOS Mobile Device Management - The SCEP server returned an invalid response
Some thoughts (not a real answer) 1) The "The SCEP server returned an invalid response" could be returned for a huge amount of different reasons. Generally speaking, if SCEP returns anything what can't be parsed by MDM client, it will show this error. 2) Take a look at jSCEP (https://code.google.com/p/jscep/). It's java implementation of SCEP server. And I am pretty sure that it works with iOS (I used it). You can both check how they are handling it (as I remember, they are using Bouncy Castle too) Also, I would rather include jSCEP in your open source imlpementation than reinvent a bycycle. SCEP RFC has quite a lot of pieces, jSCEP is pretty good with following it.

Categories : IOS

Retrieving certificate stored via Safari during enrollment
I think you can't access it. As you correctly mentioned, it's stored in keychain. And I believe in this case, it will be stored in keychain of Safari or mdmd. And you don't have access to either of those on your device (except, if it's jailbroken). However, if Certificate authority in your control, potentially you can write server side code which will allow query certificate (not a private key) for your device. Your application will talk to your server and it will go to Certificate authority and get a certificate associated with your device.

Categories : IOS

REST method calling D2l For an enrollment but returns status 303
Notice that the rights to enroll are granted based on a matrix of permissions (RoleType,OrgUnitType). That is, your calling user may be able to create a user record and enroll that user as a Student Role in the Organization org unit type, and not have the permissions to enroll that user in a Department, Semester, Course Offering, or other org unit type. The 303 you're getting is most likely a redirect to an error page as a result of your POST failing for some reason. If you're able to make other calls fine, then the most likely errors are that your calling user context is not permitted to make the enrollment action you're trying, you're not identifying the user, user role, or org unit properly in the CreateEnrollmentData block you're passing, or the block is malformed in some way. It may

Categories : Rest

Expected JSON payload not returning proper JSON payload
To protect the consumer, if it's literally returning the word 'null' in the json string {"0":null,"1":" 0"}, just do a string replace and replace the pattern null with ''. $payload = file_get_contents('php://input'); $payload = str_replace(' null ', '""', $payload); return json_decode($payload, true); To fix send_response() so it never includes 'null' as a result you can iterrate through the array before encoding it to either: change any null into an empty string. delete any index pointing to a null I like number 1: function send_response($data) { foreach($data as $key=>$value){ $data[$key] = is_null($value) ? '' : $value; } $response = json_encode($data, JSON_FORCE_OBJECT); header('Content-Type: application/json'); header('Content-Length: ' .

Categories : PHP

rails way - how to add enrollment to course - course controller or roll controller?
I would link that button to RollsController#create. The other option you might be considering is CoursesController#update, but you're not really changing anything about the course itself, like its name, number of credits, or anything intrinsic to the course. You're creating a new instance of an enrollment: a student in a course. RollsController#create.

Categories : Ruby On Rails

Bad payload for some tokens
According to what you describe, the 2f9c2239c85e4705171e379691ace8fd0e68ad984912de530a1f969ebb655fd7 token is invalid. Perhaps it's a sandbox token and you are using it to push to the production environment or vice versa. When you send a push notification with an invalid device token to the APNS server, Apple return an error response (if you are using the newer binary format) and closes the socket. Therefore, any messages that were sent through the same socket after the one with the invalid token will be discarded, and need to be resent through a new socket. That's why you encounter different results depending on the order of the messages. Read some more about error handling of Apple Push Notifications here.

Categories : PHP

Android NDEF NFC Payload
What's your strategy for converting from a byte array to a String? There's more data returned in getPayload() than simply the text you want to read. This link has a breakdown of the protocol, plus there's another link or two on SO like this one that explains how to handle it.

Categories : Android

MDM payload to wipe an OS X device
In order to lock an OS X device a 6 digit PIN must be provided in the payload. <?xml version=""1.0"" encoding=""UTF-8""?> <!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd""> <plist version=""1.0""> <dict> <key>Command</key> <dict> <key>RequestType</key> <string>EraseDevice</string> <key>PIN</key> <string>123456</string> </dict> <key>CommandUUID</key> <string>2349d04b-d0ba-404b-afae-4863f85cbba6</string> </dict> </plist>

Categories : IOS

How can I POST a Zip file as it's payload
You basically need to send the file contents as part of the POST body. You may also want to send some metadata about the file. In that case, you should use either Multipart/Form or Multipart/Mixed content types. Basically it allows you to have different kind of data in your POST body. Here is a very good and simple tutorial to help you learn how to upload a file to a RESTful service: http://www.mkyong.com/webservices/jax-rs/file-upload-example-in-jersey/

Categories : Java

Incrementing pattern as payload
If you want your payloads to contain the ASCII strings "1", "2", ... "19", "20", then try this: pkt=(Ether(dst='00:01:02:03:04:05', src='00:06:07:08:09:0a')/ IP(src='192.168.0.1', dst='192.168.0.2', tos=0)/ TCP(sport=(123), dport=123)/ Raw((1,20))) If you want your payloads to contain one byte each, with values 1, 2, ... 20, try this: pkt=(Ether(dst='00:01:02:03:04:05', src='00:06:07:08:09:0a')/ IP(src='192.168.0.1', dst='192.168.0.2', tos=0)/ TCP(sport=(123), dport=123)/ Raw(list(chr(x) for x in range(1,21)))) In either case, you can confirm what you've got via: wireshark(pkt)

Categories : Misc

Payload not found in Cache
If you want a payload to be laid out in a subfolder, specify that in Payload/@Name. <Payload Name="Adobe Reader XIadberdr11000_en_us.msi" SourceFile="$(var.SetupPrereqs.TargetDir)Adobe Reader XIadberdr11000_en_us.msi" />

Categories : Wix

Filter on GRE packets payload ip /dst
I found a way to do this. Using pcap filter expresions we can filter by an offset and length. By using wireshark we inspected the .pcap capture and determined that the src address on the payload ip packet (the one inside GRE) has a byte offset of 54 from the header of the outer ip packet. The dst address of the payload ip packet has a byte offset of 58. So we included this expression as a filter (ip[54:4] = 0X0ac004ef) or (ip[58:4] = 0X0ac004ef) where the hex number represents the concatenated octets converted to hex. of the ip we want to filter by.

Categories : Java

Spring Integration - how to keep the orginal payload and use it later?
Since your original message is just text you could copy it to a header field. This should work as long as you don't do anything special in between when you store and afterwards retrieve it. So what I would try is: <int:header-enricher input-channel="authenticated-channel" output-channel="pre-routing-channel"> <int:header name="original-payload" expression="payload.toString()" /> </int:header-enricher> <!-- changed input channel of router --> <int-xml:xpath-router id="servicetype-router" input-channel="pre-routing-channel" evaluate-as-string="true"> If this is not working for you (maybe because you have to do something more special in between or the payload is too big), you still have the option to use a ClaimCheck. Which is actually exactly what you ar

Categories : Spring

Decoding Websocket payload length in C
You are missing the conversion of your values from network byte order to host byte order. 64000 is 11111010 00000000 in binary. You need to use the byte order conversion routines. payloadLength = ntohs(payloadLength16b); payloadLength = (size_t)ntohll(payloadLength64b); If your system lacks a definition for ntohll, you can follow the suggested answers to this question. But, a possible implementation might be: uint64_t ntohll (uint64_t x) { const unsigned t = 1; if (*(const unsigned char *)&t) { x = ((uint64_t)ntohl(x & 0xffffffffU) << 32) | ntohl((uint32_t)(x >> 32)); } return x; }

Categories : C

Web service with a generic payload XML type "Any"
Please don't do this. I've worked with these sort of "generic" web services before and they are the equivalent of having a java API where every method has the signature public Object methodName(Object o); Yes, it's all very generic, but it conveys no information on how to use it (A well designed interface conveys how it should be used, the same way the handle of a tea pot suggests that the tea pot should be picked up by the handle). When someone wants to develop an application that consumes your service, how do they figure out what to send and what they'll get back? If it's in some other document, then you've basically created your own bespoke web service description language, which won't integrate with any tooling (like Spring or Axis-2) and will require a lot of extra manual code to b

Categories : Spring

Inspect WCF SOAP message payload
One option is to use Fiddler. Another option is WCF logging (as you said), make sure you mark to log at both transport and message level. Here's what works for me: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.diagnostics> <sources> <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelMessageLoggingListener"> <filter type="" /> </add> </listeners>

Categories : Wcf

Determine TCP payload activity/statistics
Perhaps the statistics in /proc/net/dev can help. I am not familiar with counting payload versus full packets including headers, so that makes the question harder to answer. As for statistics on individual file descriptors, I am not aware of any standard means to get that information. If it's possible to control startup of the programs for which the statistics are needed, it is possible to use an "interceptor" library which implements its own read(), write(), sendto(), and recvfrom() calls, passthrough the calls to the standard C library (or directly to system call), keep counters of the activity, and find a way to publish those values.

Categories : Linux

XML validate against recursive and oversized payload
Validation against recursive payloads: The XMLs can be nested, infinit times. An XML with deeply nested tags can be still well-formed, so a parser will accept it. If your parser is a DOM parser (which is pretty likely) it will try to build up the whole tree in memory. If the XML your web service receives is deeply nested, your server will eat up all its memory and crash before it could realize that the xml message is invalid -> DoS is successful. The solution here is to try to validate the MXL message before it is transferred to the web service server. You can achieve this with an application layer gateway which validates the XML messages to an XSD schema. That schema should only allow the depth of nesting which is needed. You need to do this validation without building up a DOM tree, oth

Categories : Xml

tshark: extract rtp payload of the codec G.723
to solve this problem you have just to disable the protocol g723 in wireshark in the item Enabled Protocols from the Analyze menu then the field "payload" will appear in the protocol rtp and the command tshark -nr stream.pcap -i wlan1 -R 'rtp && ip.dst==192.168.1.64' -T fields -e rtp.payload will succeed!

Categories : Unix

What should be the developer payload in android in-app billing v3 api?
Please check below answer, it may solved your problem: if you are using consumable item(managed item) then you can use random generated string step 1: before on create method declare this: private static final char[] symbols = new char[36]; static { for (int idx = 0; idx < 10; ++idx) symbols[idx] = (char) ('0' + idx); for (int idx = 10; idx < 36; ++idx) symbols[idx] = (char) ('a' + idx - 10); } step 2: set RandomString and SessionIdentifierGenerator class in your activity public class RandomString { /* * static { for (int idx = 0; idx < 10; ++idx) symbols[idx] = (char) * ('0' + idx); for (int idx = 10; idx <

Categories : Android

Unable to Unmarshal a payload with spaces in values
even in xml " 1 " this is a string and not a int, the parser cant parse this string to an int. so 0 is just the default int value, if you change your code to : err:= xml.Unmarshal([]byte(payload), &mt) if err != nil { fmt.Println(err) } you will see that there was an error during parsing if your xml could have " 1 " as value, i recommend to use a string in your struct. or if there is a chance, tell the creator of the xml to only use int and not strings, where int are expected

Categories : Go

Why am I not getting the changed payload after consuming JMS queue in Mule?
You don't specify the exchange-pattern on the jms:outbound-endpoint and jms:inbound-endpoint. Therefore Mule uses the default, which is one-way. So it's impossible that the payload change made in fmsAdapterConsumerFlow1 get replied to jmsFlow1. Set exchange-pattern="request-response" on both JMS endpoints and also set disableTemporaryReplyToDestinations="false" on the connector otherwise you'll never receive any response.

Categories : Java

How pass payload via JSON file for curl?
curl sends POST requests with the default content type of application/x-www-form-urlencoded. If you want to send a json request, you will have to specify the correct content type header: $ curl -vX POST http://server/api/v1/places.json -d @testplace.json --header "Content-Type: application/json" But that will only work if the server accepts json input. The .json at the end of the url may only indicate that the output is json, it doesn't necessarily mean that it also will handle json input. The API documentation should give you a hint wheather it does or not. The reason why you get a 401 and not some other error is probably because the server can't extract the auth_token from your request.

Categories : Json

how to work out payload size from html5 websocket
There are three ways how the payload length of a websocket frame can be encoded, which depend on the length of the payload: 125 or less 126-65535 65536 + Which way is used can be told by looking at the value of the 7 last bits of the 2nd byte (the first bit of the 2nd byte is the masking flag). When it's below 126, it's the payload length. When it's 126, the payload length is in the following two bytes. When it's 127, the payload length is in the following 8 bytes. So the algorithm you have to follow to interpret a websocket frame is: read the 1st byte ("byte0") to get the fin flag and the opcode read the 2nd byte ("byte1") when byte1 is greater than 127, subtract 127 from byte1 and set masked to true when byte1 is now 126, read the next two bytes and convert it to a short. This is

Categories : Java

AMQP Content header payload structure
I realize that this is an old post, but since I recently came upon some enlightement on this topic, I'll post my observations here in case others have a need to understand this detail. I just recently fought this battle while trying to implement the AMQP API for Perl in order to talk to a RabbitMQ server. I also did not find any official documentation regarding this detail. However, the rabbitmq docs have among them the source code for a JAVA API. http://www.rabbitmq.com/java-client.html Buried in all of that source code is a python utility that generates the low level frame construction code. So, some background - The properties are attributes that may be attached to messages that wind up in queues. These are not arbitrary attributes, but rather have specific definitions. In particu

Categories : Misc

Why would the same payload have a slightly different looking IEEE 802.15.4 frame three days later?
Try to get a hex dump of those payloads. I would guess that some of the * characters are unprintable ASCII and vary as well. The payload probably has different header fields, possibly including an incrementing transaction ID. Does the target device's 64-bit IEEE address appear in those bytes? How about it's 16-bit network address? Maybe sender address? You'll need to figure out the packet format, and my guess is that it contains more variable data than just the character you're sending.

Categories : C

tcpdump PCAP file format payload bytes
In fact it generates lines that mention "tsft 1.0 Mb/s 2452 MHz 11g -78dB signal -91dB noise antenna 0 Beacon". What's wrong with that? It's dissecting radiotap headers in exactly the fashion it should. You captured with the -I flag, meaning you captured in monitor mode. By default, on OS X (and, in most cases on Linux and *BSD), that captures with radiotap headers, giving radio-layer meta-data. A pcap file has a "linktype" value in the file header; a pcap-ng file has a "linktype" value in each Interface Description Block for each network interface on which traffic was captured. Those values are described on the link-layer header types page of the tcpdump.org Web site. Your capture probably has a link-layer header type value of 127, which is LINKTYPE_IEEE802_11_RADIOTAP, and the

Categories : Osx

Soap UI Post Payload Groovy variable substitution
You can achieve that in two ways: Provided you have the Groovy Script test step invoked before the REST Call. Follow the below modifications to the Groovy Script. //Instead of setting the property to context //context.setProperty("readingDate", readingDate) //Approach 1: //Set it as a global property for SoapUI com.eviware.soapui.SoapUI.globalProperties.setPropertyValue('readingDate', readingDate) //Approach 2: //Or if you do not want to set it globally and ruin other tests //Set it as a project (SoapUI Project) property. //testRunner.testCase.testSuite.project.setPropertyValue('readingDate', readingDate) In the former case the xml would look like <readingDate>${readingDate}</readingDate> In the later case, the property should be a Project property, so <readingDate&g

Categories : Groovy

xmllint : validate an XML file against two XSD schemas (envelope / payload)
I quit on xmllint and used Xerces instead. I downloaded Xerces tarball and after exploding it to some local folder I created the following validate script (based on this suggestion): #!/bin/bash XERCES_HOME=~/software-downloads/xerces-2_11_0/ echo $XERCES_HOME java -classpath $XERCES_HOME/xercesImpl.jar:$XERCES_HOME/xml-apis.jar:$XERCES_HOME/xercesSamples.jar sax.Counter $* The ab.xml file is then validated, against both schemas, with the following command: validate -v -n -np -s -f ab.xml Xerces is reading the schema locations from the xsi:schemaLocation element in ab.xml so they don't need to be provided in the command line invocation.

Categories : Xml

Parameterize Post Request payload using Rest Assured
In body we need to give the exact string like : "{"id":" + id + ","email":" + email + "}" This should work. But this is not the best approach. You should consider creating a class with 2 fields( id and email ), and as body to the request you should add the json-serialised body of the object. LoginRequest loginRequest = new LoginRequest(id, email); String loginAsString = Util.toJson(loginRequest); given().contentType(JSON).with() .body(loginAsString)... Try this way. Hope it helps.

Categories : Java

Issue in Get argument property inside the Payload Factory
If you want to send the message to the DSS server and do not a response back, you can specify the "OUT_ONLY" property to "true" as mentioned below. <property action="set" name="OUT_ONLY" value="true"/> If you want to get a response back to your client, you can include mediator as the last element of your configuration or within the out sequence. <send/>

Categories : Java

Tile notification for windows phone - invalid XML payload -
Your tile format should be like string tileMessage = "<?xml version="1.0" encoding="utf-8"?>" + "<wp:Notification xmlns:wp="WPNotification">" + "<wp:Tile>" + "<wp:BackgroundImage>" + TextBoxBackgroundImage.Text + "</wp:BackgroundImage>" + "<wp:Count>" + TextBoxCount.Text + "</wp:Count>" + "<wp:Title>" + TextBoxTitle.Text + "</wp:Title>" + "<wp:BackBackgroundImage>" + TextBoxBackBackgroundImage.Text + "</wp:BackBackgroundImage>" + "<wp:BackTitle>" + TextBoxBackTitle.Text + "</wp:BackTitle>" + "<wp:BackContent>" + TextBoxBackContent.Text + "&

Categories : Windows

Android GCM - Send different payload to each user in registration_ids array
Make it a map like this: { regn: [{ regn_id: id_1, data: abc }, { regn_id: id_2, data: defg }, ..] } Call it in a JSONArray object.

Categories : Android

When posting Json using jQuery posted data is different than payload?
Look closely at this part: TradeOffers":"[{"OfferedProductId That quotation mark just after the colon tells me that TradeOffers' value is actually a string, which happens to contain a JSON array. Chrome is just making sure that it will come out the other side as a string, complete with any quotation marks in it. You'll just need to find where TradeOffers is set, and if there's something wrong with it. Funny enough, this sort of issue seems to be common lately...

Categories : Javascript

Posting incorrect json payload with Ajax/jquery
You don't want to use serialize, but the serializeArray method. If you need it in an object, you then still can make the name-value pairs properties of an object: var res = {}, arr = $('#addItemForm').serializeArray(); for (var i=0; i<arr.length; i++) res[arr[i].name] = arr[i].value;

Categories : Javascript

RestKit: how to handle case where children are delivered in a different JSON payload?
RestKit will not lazy load automatically. You would usually trigger the download when the post details are required (like when the detail view was shown in a master-detail setup). You will probably need a request descriptor so that when you POST the post RestKit will send the comment ids. Then the response would be a post object (or at least a container) and a list of comments.

Categories : IOS

Firefox addon sdk Request module POST method with payload
I guess the server script expects a JSON string representation of the contentObject. But this is not how objects are treated by the request module, they are turned to key/value pairs. So change content: contentObject to content: JSON.stringify(contentObject)

Categories : Javascript

Unit test laravel 4 controller passing JSON payload
Why are you using file_get_contents("php://input") ? Laravel allow you to use the Input:get() method wich is an easy way to retrieve input data from form or json. I bet it will be more testable. Your controller should be like that : class SecurityController extends Controller { public function login() { $input = array( 'mail' => Input::get('mail'), 'password' => Input::get('password'), ); if (Auth::attempt($input)) { } } }

Categories : Laravel



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.