Changing cell content on google spreadsheets via api 3.0 - c++

I need to change the contents of a cell on google spreadsheets.
I have successfully gotten the data via google docs api (all required authorization and options tag are set).
But I can't change the cell content. I have generated the following url and data:
req url: https://spreadsheets.google.com/feeds/cells/0AnT0uFQJWw_edENkYndfQWxCWlVmeG9oNW5kWjhYVUE/tCdbw_AlBZUfxoh5ndZ8XUA/private/full/R2C1
req data: <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gs='http://schemas.google.com/spreadsheets/2006'><id>https://spreadsheets.google.com/feeds/cells/0AnT0uFQJWw_edENkYndfQWxCWlVmeG9oNW5kWjhYVUE/tCdbw_AlBZUfxoh5ndZ8XUA/private/full/R2C1</id><link rel='edit' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/cells/0AnT0uFQJWw_edENkYndfQWxCWlVmeG9oNW5kWjhYVUE/tCdbw_AlBZUfxoh5ndZ8XUA/private/full/R2C1'/><gs:cell row='2' col='1' inputValue='*match found*
имя: вася
фамилия: тра та та
номер телефона дом: +7123456789
номер телефона моб: +7098765432
город: москва'/></entry>
repl data: Response contains no content type
And sometimes I recieve "bad request" in reply.
i following this document when writing code, and create this:
1. i getting cellsfeed url
NETLIBHTTPREQUEST nlhr = {0};
nlhr.cbSize = sizeof(NETLIBHTTPREQUEST);
nlhr.headersCount = 2;
nlhr.headers = (NETLIBHTTPHEADER*)malloc(sizeof(NETLIBHTTPHEADER) * (nlhr.headersCount));
nlhr.headers[0].szName = "Authorization";
if(AuthTag.empty())
{
string str;
str += "GoogleLogin auth=";
str += Auth;
AuthTag = str;
nlhr.headers[0].szValue = _strdup(str.c_str());
}
else
nlhr.headers[0].szValue = _strdup(AuthTag.c_str());
nlhr.headers[1].szName = "GData-Version";
nlhr.headers[1].szValue = "3.0";
nlhr.cbSize = sizeof(NETLIBHTTPREQUEST);
nlhr.flags = NLHRF_SSL;
{
string str = "https://spreadsheets.google.com/feeds/worksheets/";
str += toUTF8(Params.vtszDocuments[0]);
str += "/private/full";
nlhr.szUrl = _strdup(str.c_str());
}
nlhr.requestType = REQUEST_GET;
nlhr2 = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&nlhr);
if(!nlhr2)
{
boost::this_thread::sleep(boost::posix_time::minutes(Params.Interval));
continue;
}
using namespace rapidxml;
xml_document<> xml;
xml.parse<0>(nlhr2->pData);
Netlib_CloseHandle(nlhr2);
for(xml_node<> *node = xml.first_node()->first_node("entry"); node; node = node->next_sibling("entry"))
{
if(strcmp(node->first_node("title")->value(), toUTF8(Params.tszListName).c_str()))
continue;
bool found = false;
xml_node<> *id = node->first_node("id");
string spreadshit_id = id->value();
if(spreadshit_id.find(toUTF8(Params.vtszDocuments[0])) == string::npos)
continue;
for(xml_node<> *link = node->first_node("link"); link; link = link->next_sibling("link"))
{
if(strcmp(link->first_attribute("rel")->value(), "http://schemas.google.com/spreadsheets/2006#cellsfeed"))
continue;
cellsfeed = link->first_attribute("href")->value();
found = true;
if(found)
break;
}
if(found)
break;
}
2. i getting cellsfeed to buffer for parsing on need
base_document_xml.clear();
if(base_document_xml_buffer)
free(base_document_xml_buffer);
NETLIBHTTPREQUEST nlhr = {0};
nlhr.cbSize = sizeof(NETLIBHTTPREQUEST);
nlhr.headersCount = 2;
nlhr.headers = (NETLIBHTTPHEADER*)malloc(sizeof(NETLIBHTTPHEADER) * (nlhr.headersCount));
nlhr.headers[0].szName = "Authorization";
if(AuthTag.empty())
{
string str;
str += "GoogleLogin auth=";
str += Auth;
AuthTag = str;
nlhr.headers[0].szValue = _strdup(str.c_str());
}
else
nlhr.headers[0].szValue = _strdup(AuthTag.c_str());
nlhr.headers[1].szName = "GData-Version";
nlhr.headers[1].szValue = "3.0";
nlhr.cbSize = sizeof(NETLIBHTTPREQUEST);
nlhr.flags = NLHRF_SSL;
nlhr.szUrl = _strdup(cellsfeed.c_str());
nlhr.requestType = REQUEST_GET;
nlhr2 = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUser, (LPARAM)&nlhr);
if(!nlhr2)
{
boost::this_thread::sleep(boost::posix_time::minutes(Params.Interval));
continue;
}
using namespace rapidxml;
base_document_xml_buffer = _strdup(nlhr2->pData);
base_document_xml.parse<0>(base_document_xml_buffer); //memory leak ?
Netlib_CloseHandle(nlhr2);
3. i getting etag and edit url for needed cell
string edit_link, etag;
using namespace rapidxml;
for(xml_node<> *node = base_document_xml.first_node()->first_node("entry"); node; node = node->next_sibling("entry"))
{
xml_node<> *cell_id = node->first_node("gs:cell");
char buf[4];
_itoa(i->row +1 ,buf, 10);
if(strcmp(cell_id->first_attribute("row")->value(), buf))
continue;
_itoa(i->column +1 ,buf, 10);
if(strcmp(cell_id->first_attribute("col")->value(), buf))
continue;
for(xml_node<> *link = node->first_node("link"); link; link = link->next_sibling("link"))
{
if(strcmp(link->first_attribute("rel")->value() , "edit"))
continue;
edit_link = link->first_attribute("href")->value();
etag = node->first_attribute("gd:etag")->value();
}
}
i using Miranda IM core network library in this code, and i think all right with network part, something wrong with request url or data content in request
UPD:
i have missed content type header in first code, now i fixed this, but have another problem, google returning "premature end of file"..., code updated.
UPD2:
i have solve this problem, it caused by wrong parameters passed by netowrk library, now i have following Invalid query parameter value for grid-id., and does not understand what it means...
UPD3:
looks like i have misunderstand api, i need to rewrite some code, i will post result here...
UPD4:
i have tried to obtain edit url via different api function, but have same result ...
UPD5:
i have solved this problem, not optimal and i thnk slow way, but at least working, i implement few more api calls and addition xml parsing steps to get correct link for edit each cell, code updated if someone need this, rapidxml parsing library and miranda im core net library used here.

Related

Authentication Error (Authentication Failed) Using Sabre Soap Message

I am using soap service to authenticate request by sabre as in the document https://developer.sabre.com/docs/read/soap_basics/Authentication.
I generate the proxy classes using wsdl. i put authentication credential in the code. This is my Code for test purpose:
using ConsoleApplication1.SessionReference1;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
[STAThread]
static void Main(string[] args)
{
try
{
// Set user information, including security credentials and the IPCC.
string username = "my-username";
string password = "my-password";
string ipcc = "not-understand";
string domain = "EXT";
string temp = Environment.GetEnvironmentVariable("tmp"); // Get temp directory
string PropsFileName = temp + "/session.properties"; // Define dir and file name
DateTime dt = DateTime.UtcNow;
string tstamp = dt.ToString("s") + "Z";
//Create the message header and provide the conversation ID.
MessageHeader msgHeader = new MessageHeader();
msgHeader.ConversationId = "TestSession"; // Set the ConversationId
From from = new From();
PartyId fromPartyId = new PartyId();
PartyId[] fromPartyIdArr = new PartyId[1];
fromPartyId.Value = "WebServiceClient";
fromPartyIdArr[0] = fromPartyId;
from.PartyId = fromPartyIdArr;
msgHeader.From = from;
To to = new To();
PartyId toPartyId = new PartyId();
PartyId[] toPartyIdArr = new PartyId[1];
toPartyId.Value = "WebServiceSupplier";
toPartyIdArr[0] = toPartyId;
to.PartyId = toPartyIdArr;
msgHeader.To = to;
//Add the value for eb:CPAId, which is the IPCC.
//Add the value for the action code of this Web service, SessionCreateRQ.
msgHeader.CPAId = ipcc;
msgHeader.Action = "SessionCreateRQ";
Service service = new Service();
service.Value = "SessionCreate";
msgHeader.Service = service;
MessageData msgData = new MessageData();
msgData.MessageId = "mid:20001209-133003-2333#clientofsabre.com1";
msgData.Timestamp = tstamp;
msgHeader.MessageData = msgData;
Security security = new Security();
SecurityUsernameToken securityUserToken = new SecurityUsernameToken();
securityUserToken.Username = username;
securityUserToken.Password = password;
securityUserToken.Organization = ipcc;
securityUserToken.Domain = domain;
security.UsernameToken = securityUserToken;
SessionCreateRQ req = new SessionCreateRQ();
SessionCreateRQPOS pos = new SessionCreateRQPOS();
SessionCreateRQPOSSource source = new SessionCreateRQPOSSource();
source.PseudoCityCode = ipcc;
pos.Source = source;
req.POS = pos;
SessionCreatePortTypeClient s = new SessionCreatePortTypeClient();
SessionCreateRS resp = s.SessionCreateRQ(ref msgHeader, ref security, req);
//SessionCreateRQService serviceObj = new SessionCreateRQService();
//serviceObj.MessageHeaderValue = msgHeader;
//serviceObj.SecurityValue = security;
//SessionCreateRS rs = new SessionCreateRS();
//SessionCreateRS = serviceObj.SessionCreateRQ(req); // Send the request
if (resp.Errors != null && resp.Errors.Error != null)
{
Console.WriteLine("Error : " + resp.Errors.Error.ErrorInfo.Message);
}
else
{
// msgHeader = serviceObj.MessageHeaderValue;
// security = serviceObj.SecurityValue;
Console.WriteLine("**********************************************");
Console.WriteLine("Response of SessionCreateRQ service");
Console.WriteLine("BinarySecurityToken returned : " + security.BinarySecurityToken);
Console.WriteLine("**********************************************");
string ConvIdLine = "convid=" + msgHeader.ConversationId; // ConversationId to a string
string TokenLine = "securitytoken=" + security.BinarySecurityToken; // BinarySecurityToken to a string
string ipccLine = "ipcc=" + ipcc; // IPCC to a string
// File.Delete(PropsFileName); // Clean up
// TextWriter tw = new StreamWriter(PropsFileName); // Create & open the file
// tw.WriteLine(DateTime.Now); // Write the date for reference
// tw.WriteLine(TokenLine); // Write the BinarySecurityToken
// tw.WriteLine(ConvIdLine); // Write the ConversationId
// tw.WriteLine(ipccLine); // Write the IPCC
// tw.Close();
//Console.Read();
}
}
catch (Exception e)
{
Console.WriteLine("Exception Message : " + e.Message);
Console.WriteLine("Exception Stack Trace : " + e.StackTrace);
Console.Read();
}
}
}
}
Please Help me
I didn't check the sequence of the code in detail, but checking the values you set for organization and domain:
string ipcc = "not-understand";
string domain = "EXT";
Unless you did it intentionally to mask the values, you should have received your ipcc value from Sabre after getting a SOAP webservices account.
The value for SOAP APIs domain is normally "DEFAULT".
Registering on dev studio only gives you REST test credentials (not SOAP), so you can use this form to request SOAP test credentials:
https://developer.sabre.com/contact
Finally, I don't quite see the environment/target url you're using to test the SessionCreate service...CERT one is: https://sws3-crt.cert.sabre.com/

how to pass cookies in winnovative

first of all I would like to wish everyone a happy 2015 and be prosperous for all of you.
I would like to help me with a problem I have with a cookie and Winnovative, the problem is that I correctly the data in a cookie but when the process for the dll and reaches the window that gets data to the cookie comes in white with no data. not then I'm doing wrong. Annex code to Confinued:
string apo = String.Empty;
apo = Request.Cookies["dApoderados"].Value;
HttpCookie datosApoderados = new HttpCookie("datosApoderados");
string cadenaPDF = String.Empty;
string ruta = String.Empty;
ruta = ObtenerDireccionInformeSalida();
ruta = ruta.Replace("../", "");
GenerarQueryString();
Response.Cookies["datosApoderados"].Value = apo;
ruta = "http://localhost:10458/" + ruta;
byte[] bytes = ObtenerPdfBytes(ruta);
That's when I want to process, then passes through an intermediate product which is:
public byte[] ObtenerPdfBytes(string ruta)
{
string datosClientes = Request.Cookies["datosCliente"].Value;
string datosApoderados = Request.Cookies["datosApoderados"].Value;
datosClientes = "?DATOS=" + datosClientes;
ruta = ruta + datosClientes;
PdfConverter pdfConverter = new PdfConverter();
HttpCookie prueba = new HttpCookie("prueba");
Response.Cookies["prueba"].Value = datosApoderados;
if (Context.Request.Cookies[FormsAuthentication.FormsCookieName] != null)
{
pdfConverter.HttpRequestHeaders = String.Format("prueba : {0}={1}",
FormsAuthentication.FormsCookieName, Request.Cookies[FormsAuthentication.FormsCookieName].Value);
}
pdfConverter.LicenseKey = ClaveGeneradorPdf;
pdfConverter.PdfDocumentOptions.ShowFooter = true;
pdfConverter.PdfFooterOptions.PageNumberText = TextoPagina;
pdfConverter.PdfFooterOptions.PageNumberTextFontType = PdfFontType.HelveticaBold;
pdfConverter.PdfFooterOptions.PageNumberTextFontSize = 8;
pdfConverter.PdfFooterOptions.ShowPageNumber = true;
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.Legal;
pdfConverter.PdfFooterOptions.FooterHeight = AltoPie;
pdfConverter.PdfDocumentOptions.LeftMargin = MargenIzquierdo;
pdfConverter.PdfDocumentOptions.RightMargin = MargenDerecho;
pdfConverter.PdfDocumentOptions.TopMargin = MargenSuperior;
pdfConverter.PdfDocumentOptions.BottomMargin = MargenInferior;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
pdfConverter.PdfFooterOptions.FooterText = "texto";
pdfConverter.PdfFooterOptions.FooterTextFontType = PdfFontType.HelveticaBold;
pdfConverter.PdfFooterOptions.FooterTextFontSize = 8;
pdfConverter.PdfDocumentOptions.ShowHeader = false;
byte[] pdfBytes = pdfConverter.GetPdfBytesFromUrl(ruta);
return pdfBytes;
}
when I get to the next line is where the cookie is lost:
byte [] pdfBytes = pdfConverter.GetPdfBytesFromUrl (path);
public override void Pagina_PrimeraCarga(object sender, EventArgs e)
{
string prueba = Request.Cookies["prueba"].Value;
string datosRequest = Request.QueryString["DATOS"];
char delimitadores = ';';
string[] datos = datosRequest.Split(delimitadores);
imgBanco.Attributes.Add("ImageUrl", "~/App_Themes/Imagenes/Logo.gif");
DateTime fechaHoy = DateTime.Now;
lblDia.Text = Convert.ToString(fechaHoy.Day);
lblMes.Text = Convert.ToString(fechaHoy.Month);
lblAno.Text = Convert.ToString(fechaHoy.Year);
loading data from the cookie in the latter code:
string test = Request.Cookies ["test"] Value.;
This goes empty and no data
The converter has a HttpRequestCookies collection you can use. There is a complete example for cookies in Winnovative website. Here is the relevant code copied from there:
// Create a HTML to PDF converter object with default settings
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
// Set license key received after purchase to use the converter in licensed mode
// Leave it not set to use the converter in demo mode
htmlToPdfConverter.LicenseKey = "fvDh8eDx4fHg4P/h8eLg/+Dj/+jo6Og=";
// Add custom HTTP cookies
if (cookie1NameTextBox.Text.Length > 0 && cookie1ValueTextBox.Text.Length > 0)
htmlToPdfConverter.HttpRequestCookies.Add(cookie1NameTextBox.Text, cookie1ValueTextBox.Text);
if (cookie2NameTextBox.Text.Length > 0 && cookie2ValueTextBox.Text.Length > 0)
htmlToPdfConverter.HttpRequestCookies.Add(cookie2NameTextBox.Text, cookie2ValueTextBox.Text);
if (cookie3NameTextBox.Text.Length > 0 && cookie3ValueTextBox.Text.Length > 0)
htmlToPdfConverter.HttpRequestCookies.Add(cookie3NameTextBox.Text, cookie3ValueTextBox.Text);
if (cookie4NameTextBox.Text.Length > 0 && cookie4ValueTextBox.Text.Length > 0)
htmlToPdfConverter.HttpRequestCookies.Add(cookie4NameTextBox.Text, cookie4ValueTextBox.Text);
if (cookie5NameTextBox.Text.Length > 0 && cookie5ValueTextBox.Text.Length > 0)
htmlToPdfConverter.HttpRequestCookies.Add(cookie5NameTextBox.Text, cookie5ValueTextBox.Text);
// Convert the HTML page to a PDF document in a memory buffer
byte[] outPdfBuffer = htmlToPdfConverter.ConvertUrl(urlTextBox.Text);
// Send the PDF as response to browser
// Set response content type
Response.AddHeader("Content-Type", "application/pdf");
// Instruct the browser to open the PDF file as an attachment or inline
Response.AddHeader("Content-Disposition", String.Format("attachment; filename=HTTP_Cookies.pdf; size={0}", outPdfBuffer.Length.ToString()));
// Write the PDF document buffer to HTTP response
Response.BinaryWrite(outPdfBuffer);
// End the HTTP response and stop the current page processing
Response.End();

Blackberry Push notification using C# as server side

I am trying to send push notification in blackberry by using C# Web
service but i am facing problem is it return exception "The remote
server returned an error: (404) Not Found.". all info is correct as
per RIM Standard so please Help me ASAP.
[WebMethod]
public bool push(string notification)
{
bool success = true;
byte[] bytes = Encoding.ASCII.GetBytes("Hello");
Stream requestStream = null;
HttpWebResponse HttpWRes = null;
HttpWebRequest HttpWReq = null;
String BESName = "cp****.pushapi.eval.blackberry.com";
try
{
//http://<BESName>:<BESPort>/push?DESTINATTION=<PIN/EMAIL>&PORT=<PushPort>&REQUESTURI=/
// Build the URL to define our connection to the BES.
string httpURL = "https://" + BESName + "/push?DESTINATION=2B838E45&PORT=32721&REQUESTURI=/";
//make the connection
HttpWReq = (HttpWebRequest)WebRequest.Create(httpURL);
HttpWReq.Method = ("POST");
//add the headers nessecary for the push
HttpWReq.ContentType = "text/plain";
HttpWReq.ContentLength = bytes.Length;
// ******* Test this *******
HttpWReq.Headers.Add("X-Rim-Push-Id", "2B838E45" + "~" + DateTime.Now); //"~" +pushedMessage +
HttpWReq.Headers.Add("X-Rim-Push-Reliability", "application-preferred");
HttpWReq.Headers.Add("X-Rim-Push-NotifyURL", ("http://" + BESName + "2B838E45~Hello~" + DateTime.Now).Replace(" ", ""));
// *************************
HttpWReq.Credentials = new NetworkCredential("Username", "Password");
requestStream = HttpWReq.GetRequestStream();
//Write the data from the source
requestStream.Write(bytes, 0, bytes.Length);
//get the response
HttpWRes = (HttpWebResponse)HttpWReq.GetResponse();
var pushStatus = HttpWRes.Headers["X-RIM-Push-Status"];
//if the MDS received the push parameters correctly it will either respond with okay or accepted
if (HttpWRes.StatusCode == HttpStatusCode.OK || HttpWRes.StatusCode == HttpStatusCode.Accepted)
{
success = true;
}
else
{
success = false;
}
//Close the streams
HttpWRes.Close();
requestStream.Close();
}
catch (System.Exception)
{
success = false;
}
return success;
}
I got the same error when I tried your code above. Replace
String BESName = "cp****.pushapi.eval.blackberry.com";
With
String BESName = "cpxxx.pushapi.eval.blackberry.com/mss/PD_pushRequest";
and make sure you provide the right username and password here:
HttpWReq.Credentials = new NetworkCredential("username", "password");
I got success = true;
However, even though the above code executed successfully, I still do not see the push message on the BlackBerry device.

trying to upload video using graph api

I have been trying to implement a video upload facebook feature for my mobile app for a while now but never really succeeded with rest. I learnt yesterday that the graph alternative was available.
After getting a few errors to do with access key mainly i have gotten to the point where output stream succesfully writes the movie file and the input stream just receives an empty json array once i have written the 3gp file.
Anyone any idea why I would get an empty json array and no video gets published when i get all my code to run, i get 200 response code and the server sends me a non error response?
Any help greatly appreciated.
Here is the class that gets the blank json array (send method). I have appended the token to the url and in the table to be sure. I am sorry if the code is untidy buts it just been a day of trial and error.
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import net.rim.device.api.io.http.HttpProtocolConstants;
public class HttpMultipartRequest2
{
static final String BOUNDARY = "----------V2ymHFg03ehbqgZCaKO6jy";
byte[] postBytes = null;
String url = null;
Hashtable paramsTable;
public HttpMultipartRequest2(String url, Hashtable params,
String fileField, String fileName, String fileType, byte[] fileBytes) throws Exception
{
this.url = url;
String boundary = getBoundaryString();
paramsTable = params;
String boundaryMessage = getBoundaryMessage(boundary, params, fileField, fileName, fileType);
String endBoundary = "\r\n--" + boundary + "--\r\n";
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bos.write(boundaryMessage.getBytes());
bos.write(fileBytes);
bos.write(endBoundary.getBytes());
this.postBytes = bos.toByteArray();
bos.close();
}
String getBoundaryString() {
return BOUNDARY;
}
String getBoundaryMessage(String boundary, Hashtable params, String fileField, String fileName, String fileType)
{
StringBuffer res = new StringBuffer("--").append(boundary).append("\r\n");
Enumeration keys = params.keys();
while(keys.hasMoreElements())
{
String key = (String)keys.nextElement();
String value = (String)params.get(key);
res.append("Content-Disposition: form-data; name=\"").append(key).append("\"\r\n")
.append("\r\n").append(value).append("\r\n")
.append("--").append(boundary).append("\r\n");
}
res.append("Content-Disposition: form-data; name=\"").append(fileField)
.append("\"; filename=\"").append(fileName).append("\"\r\n")
.append("Content-Type: ").append(fileType).append("\r\n\r\n");
Log.info(("res "+res.toString()));
return res.toString();
}
public String send() throws Exception
{
StringBuffer sb = new StringBuffer();
HttpConnection hc = null;
InputStream is = null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] res = null;
try
{
Log.info("before hc open"+ url);
hc = (HttpConnection) Connector.open(url);
hc.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + getBoundaryString());
hc.setRequestProperty("access_token", (String)paramsTable.get("access_token"));
hc.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(postBytes.length));
hc.setRequestProperty( "x-rim-transcode-content", "none" );
ByteArrayOutputStream out = new ByteArrayOutputStream();
OutputStream dos = hc.openOutputStream();
is = hc.openInputStream();
Log.info("before dos write responsecode");// + hc.getResponseCode());
out.write(postBytes, 0, postBytes.length);
//Log.info("flushing"+ hc.getResponseCode());
Log.info("after doswrite responsecode");
dos.write(out.toByteArray());
dos.flush();
Log.info("after flush");
if(dos!=null)
dos.close();
int ch;
Log.info("before openinput ");
Log.info("after openinput ");
while ((ch = is.read()) != -1)
{
bos.write(ch);
sb.append((char)ch);
Log.info("char"+(char)ch);
}
res = bos.toByteArray();
Log.info("Response recieved from Server is : " + sb.toString() );
}
catch(Exception e)
{
Log.info(hc.getResponseCode() + "sexce"+e);
}
catch(OutOfMemoryError error)
{
Log.info("outofmemory " + error);
System.gc();
}
finally
{
try
{
if(bos != null)
bos.close();
if(is != null)
is.close();
if(hc != null)
hc.close();
}
catch(Exception e2)
{
Log.info("finally exception"+ e2);
}
}
return sb.toString();
}
}
Are you trying to upload to a user's feed or to a page? There is an Open Bug regarding posting to pages.
Also, could you post some code?
Assuming that you've read the documentation:
Facebook Graph API->Video
And that you are using graph-video.facebook.com, not graph.facebook.com.

subsonic 3.0 active record update

I am able to retrieve database values and insert database values, but I can't figure out what the Update() syntax should be with a where statement.
Environment -> ASP.Net, C#
Settings.ttinclude
const string Namespace = "subsonic_db.Data";
const string ConnectionStringName = "subsonic_dbConnectionString";
//This is the name of your database and is used in naming
//the repository. By default we set it to the connection string name
const string DatabaseName = "subsonic_db";
Retreive example
var product = equipment.SingleOrDefault(x => x.id == 1);
Insert Example
equipment my_equipment = new equipment();
try
{
// insert
my_equipment.parent_id = 0;
my_equipment.primary_id = 0;
my_equipment.product_code = product_code.Text;
my_equipment.product_description = product_description.Text;
my_equipment.product_type_id = Convert.ToInt32(product_type_id.SelectedItem.Value);
my_equipment.created_date = DateTime.Now;
my_equipment.serial_number = serial_number.Text;
my_equipment.Save();
}
catch (Exception err)
{
lblError.Text = err.Message;
}
Edit: Think that I was just too tired last night, it is pretty easy to update. Just use the retrieve function and use the Update() on that.
var equip = Equipment.SingleOrDefault(x => x.id == 1);
lblGeneral.Text = equip.product_description;
equip.product_description = "Test";
equip.Update();
Resolved. View answer above.