C# Ebay API ReviseFixedPriceItemCall Description Not Updating - c#

So we all know the eBay active content change is coming up here soon. I'm trying to update my listing descriptions to remove the active content. My calls are not failing, but they do not seem to be updating the description. I've tried ReviseFixedPriceItemCall and ReviseItemCall with no success. I've tried changing the options of the DescriptionReviseMode with no success. Any help would be appreciated. This is what I currently have that is going through without any errors, but does not update the description. Thanks in advance.
var reviseFp = new ReviseFixedPriceItemCall(oContext2);
//var reviseFp = new ReviseItemCall(oContext2);
var item = new ItemType { ItemID = myId, Description = newDescription };
item.DescriptionReviseModeSpecified = true;
item.DescriptionReviseMode = DescriptionReviseModeCodeType.Replace;
reviseFp.Item = item;
try
{
reviseFp.Execute();
}
catch (Exception ex)
{
Console.WriteLine(myId + " : " + ex.ToString());
}

So it turns out that this code works perfectly fine. I was trying to have the javascript removed for the active content changed, but it was never being removed. Well just manually going and editing the listing from eBay itself would not remove the javascript either. So it wasn't the code at all it was the listing. I got on the horn with eBay support and they couldn't remove it either.

Related

How to update a test run in HP ALM via c#?

I can get connected to HP ALM via c# OTA no problem. It's what is supposed to happen next that isn't clear. I have looked all over HPs documentation for OTA but not much there in regards to updating a test run.
I can make a connection to ALM no problem. I then create a TestSetFactory and RunFactory. I don't know what to do from here. I'm trying to add a run for a particular test set in ALM. I want to add a run and set it to either Pass or Fail and add a comment.
TestSetFactory tsFactory = (TestSetFactory)qcConn.TestSetFactory;
RunFactory runFactory = (RunFactory)qcConn.RunFactory();
Does anyone know how to do this? Is there a previous post that I can't find? Please give me the link and I will happily go there.
If anyone else has figured this out can you please post your code?
Okay, after much trial and error I figured it out. I'm sure there are easier ways to do it but I haven't figured them out yet.
To create a run and update it's status and that of it's steps here's what you need to run:
//This assumes you are already connected to ALM and your project.
string testFolder = #"Root\whatever your folder name is";
TestSetFactory tstFactory = (TestSetFactory)qcConn.TestSetFactory;
TestSetTreeManager tsTreeMgr = (TestSetTreeManager)qcConn.TestSetTreeManager;
TestSetFolder tsFolder = (TestSetFolder)tsTreeMgr.get_NodeByPath(testFolder);
List tsList = tsFolder.FindTestSets("MyTestSet", false, null);
foreach (TestSet ts in tsList)
{
TestSetFolder tstFolder = (TestSetFolder)ts.TestSetFolder;
TSTestFactory tsTestFactory = (TSTestFactory)ts.TSTestFactory;
List mylist = tsTestFactory.NewList("");
foreach (TSTest tsTest in mylist)
{
RunFactory runFactory = (RunFactory)tsTest.RunFactory;
Run run = (Run)runFactory.AddItem("Name of your run here");
run.CopyDesignSteps();
run.Status = "Passed";
run.Post();
StepFactory stepFactory = (StepFactory)run.StepFactory;
dynamic stepList = stepFactory.NewList("");
var rstepList = (TDAPIOLELib.List)stepList;
foreach (dynamic rstep in rstepList)
{
rstep.Status = "Passed";
rstep.Post();
}
}
}

Adding items to a SharePoint list using UpdateList

I've come across a SharePoint problem that I hope someone can help with. Basically, when I am trying to add a column called "MigratedChemist" to a list called "WorkCards" (pListName in the method parameters). No matter what I try I am getting a FaultException error raised when calling UpdateList. I am connecting using the SharePoint web service. I have confirmed the following:
The column doesn't already exist and I do have permissions to create it in SharePoint
The connection to SharePoint is established corectly to /_vti_bin/lists.asmx
The list name is correct as I have another method which returns items from the list and that works perfectly.
The xVersion and xId values are set correctly when the program runs and passed as parameters - as far as I am concerned I should just be able to pass the list name, as opposed to the GUID, but neither method works.
My code is as follows:
public static bool AddColumnToList(string pUri, string pListName, string pViewName, string pMaxRecords)
{
string version = string.Empty;
XAttribute xId = null;
XAttribute xVersion = null;
try
{
XElement listDetails = client.GetList(pListName);
xVersion = listDetails.Attribute("Version");
xId = listDetails.Attribute("ID");
}
catch { throw; }
XElement ndNewFields = new XElement ("Fields", "");
string newXml = "<Method ID='1' Cmd='New'><Field Name='MigratedChemist' Type='Text' DisplayName='MigratedChemist' /></Method></Fields>";
ndNewFields.Add(newXml);
XElement result;
try
{
result = client.UpdateList(xId.Value, null, ndNewFields, null, null, xVersion.Value);
}
catch (FaultException fe)
{
}
return true;
}
In addition to this does anyone know how to get any decent information from FaultRequest? At the moment I get the following error message, which is of no use and there appears to be no extra detail. I have tried, as some have suggested removing the error handling and letting the program halt, but that doesn't give me any extra information either.
{"Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown."}
For future reference I have solved both the problem of the SharePoint update failing AND the FaultException problem, so am including it here for posterity:
Problem 1 - Problem with UpdateList
This problem was caused because my XML was malformed. When I called ndNewFields.Add(newXml) then XML that was being returned was replacing < and > than with control characters, as shown below (I have added an extra space because this editor converts them automatically.
<Method ID="1" Cmd="New"&gt ;&lt ;Field Name="MigratedChemist"&gt ;&lt ;/Field&gt ;&lt ;/Method&gt ;
Now, I did notice this pretty early on but wasn't sure whether it would cause a problem or not. However using the XElement.Parse command I was able to remove these characters and this resolved the problem:
ndNewFields.Add(XElement.Parse (newXml));
Problem 2 - Problem with the SharePoint error coming back as FaultException
This has been bugging for me ages so I am glad I have finally solved it. I can't take credit for it, as I took it from another page, but the following code was how I got the details.
catch (FaultException fe)
{
MessageFault msgFault = fe.CreateMessageFault();
XmlElement elm = msgFault.GetDetail<XmlElement>();
}
Hopefully this will save someone some frustration in the future!
Andrew

JScript runtime error in Sharepoint Webpart

I'm trying to design a webpart that looks at a list of news items, and initially prints all the rows in order by date. If the user selects a type of news item, then only those news items will be displayed (again, in order by date). The problem is that my webpart keeps throwing up this error when I try to debug it:
Microsoft JScript runtime error: Unknown runtime error
And this mess pops up behind it:
RTE.RteUtility.$1n = function($p0, $p1) {
if (RTE.RteUtility.isInternetExplorer() && $p0.tagName === 'TABLE') {
var $v_0 = document.createElement('DIV');
$v_0.innerHTML = '<table>' + $p1 + '</table>';
while ($p0.childNodes.length > 0) {
$p0.removeChild($p0.childNodes[0]);
}
RTE.RteUtility.$1E($v_0.firstChild, $p0);
}
else {
$p0.innerHTML = '<div>RTE</div>' + $p1;
$p0.removeChild($p0.firstChild);
}
}
The line: "$p0.innerHTML = 'RTE' + $p1" seems to be causing the problem. Well, otherwise, that's a really specific error message, thanks Microsoft. :/
The error seems to happen after CreateChildControls is called by NewsFeed.cs. My best theory right now is maybe something in NewsFeedUserControl.ascx.cs is causing an error, but as I'm a total neophyte at SharePoint I have no idea what that could possibly be. Is it because of this code in Page_Load?
protected void Page_Load(object sender, EventArgs e)
{
list = web.Lists["NewsFeedLI"];
query.Query = "<Where><IsNotNull><FieldRef Name='Headline' /></IsNotNull></Where></Query>" +
"<OrderBy<FieldRef Name='Article_x0020_Date' Ascending='True' /></OrderBy>";
SPListItemCollection result = list.GetItems(query);
foreach (SPListItem item in result)
{
newsList.Text = newsList.Text + item["Headline"].ToString() + Environment.NewLine;
newsList.Text = newsList.Text + item["Summary"].ToString() + Environment.NewLine + Environment.NewLine;
}
}
See, I don't know.
Try predefining the text that you return in your loop. If the web part looks OK with basic text (e.g. "Hello World") but not with more advanced values then that it where your problem lies.
You will want to ensure that you apply the appropriate encoding to any output you are rendering to the screen as this may be causing you issues.

Big websites not loading at all - error

I have created a web browser for windows phone 7. In that am saving the history of browsing also with title of that page. But due to this codes when i tried to load a somewhat big website like thinkdigit,etc. are not loading. At the same time if i delete that particular codes then no history is being recorded in the history page. It shows error for the below highlighted code - "An unknown error has occurred. Error: 80020006". I think its due to big site or else do i need to put milliseconds or what i have to do???
Thanks in advance for your hard work!!!
Below is the codes i have used for it-
private void browsers_Navigated(object sender,System.Windows.Navigation.NavigationEventArgs e)
{
pbarWebClient.Visibility = System.Windows.Visibility.Collapsed;
if (!fromHistory)
{
if (HistoryStack_Index < HistoryStack.Count)
{
HistoryStack.RemoveRange(HistoryStack_Index, HistoryStack.Count - HistoryStack_Index);
}
HistoryStack.Add(e.Uri);
if (!app.incognito)
{
********string title = (string)browsers[this.currentIndex].InvokeScript("eval", "document.title.toString()");********----->This is the error.
stream.WriteLine(title + ";" + e.Uri.ToString());
}
HistoryStack_Index += 1;
}
fromHistory = false;
navigationcancelled = false;
Stop.Visibility = Visibility.Collapsed;
}
I would expect that eval has been overridden or in some other way suppressed on the site(s) in question.
"80020006" is a javascript invocation error code. Simply assuming that a javascript method will be available and work in the same way on any site is not always going to be true.
Finally i got the suitable answer for my own question. Just replace the above codes with this-
if (!app.incognito)
{
Thread.Sleep(100);
Dispatcher.BeginInvoke(() =>
{
string title = (string)browsers[this.currentIndex].InvokeScript("eval", "document.title.toString()");
stream.WriteLine(title + ";" + e.Uri.ToString());
});
}

InterIMAP, Viewing UNREAD IMAP mail and Downloading Attachments in C#

I was wondering if anyone can help me on this cause its driving me mad trying get this working
I was working with the trail of mail.dll from http://www.lesnikowski.com/mail/ which is an extremely fantastic tool which unfortunately i cannot afford being a student (even though its around 150eur, its still very expensive to me :/) and this would be a small module in my thesis and my faculty cannot afford to buy these things for students either :/ so anyway I had to go for a free tool (so please dont suggest any non open source ones - trust me i have tried them ALL)..
Well, i'm trying to explore InterIMAP, and for several hours have been trying to list unread emails from my gmail account but it just doesn't seem to be working. I can connect just fine but finding the unread emails seems to be no easy task.. I have tried countless approaches but non seem to give me unread emails in my inbox (I have loads of emails in my inbox and i just want the unread ones). Would someone please assist me? I have been trying to get this working for ages now, but documentation is rather lacking and my every attempt has resulted in a fail so far.
Please help!!
Some code i currently have:
` IMAPConfig config = new IMAPConfig("myhost", "username", "pass", true, true, "");
config.CacheFile = "";
IMAPClient client = null;
try
{
client = new IMAPClient(config, null, 5);
}
catch (IMAPException e)
{
Console.WriteLine(e.Message);
return;
}
Console.WriteLine(DateTime.Now.ToString());
IMAPFolder f = client.Folders["INBOX"];
IMAPSearchResult sResult = f.Search(IMAPSearchQuery.QuickSearchNew()); // <--- Gives me no results even though i do have unread messages!
If you did't reach your goal, here we go:
You should code in the following way:
1st: Inside your SearchQuery class, add a new property "unread", for example.
2nd: Add a new Method that returns an IMAPSearchQuery. It'll quick search unread mails. Something like that:
public static IMAPSearchQuery QuickSearchUnread()
{
IMAPSearchQuery query = new IMAPSearchQuery();
query.unread = true;
return query;
}
3td: Inside your class IMAPFolder, you have a method called that will return an IMAPSearchResult type and that receives an IMAPSearchQuery as parameter.
This method "build" your query with IMAP command queries (IMAP based protocol).
To the Unread query you should add:
public IMAPSearchResult Search(IMAPSearchQuery query)
{
...
if (query.Unread)
searchTerms.Add("UNSEEN");
.
.
...
}
4th: Call the Search method with the new QuickSearch:
config.CacheFile = "";
IMAPClient client = null;
try
{
client = new IMAPClient(config, null, 5);
}
catch (IMAPException e)
{
Console.WriteLine(e.Message);
return;
}
Console.WriteLine(DateTime.Now.ToString());
IMAPFolder f = client.Folders["INBOX"];
IMAPSearchResult sResult = f.Search(IMAPSearchQuery.QuickSearchUnread());
Let me know about your progress.
I hope it can be helpful.
Bye.
I honestly just ended up using Mail.dll trial version as interIMAP was not working properly for me and way to slow because it indexes the emails for some reason :s

Categories