Problem adding a web reference to an ASP.NET project in Visual Studio 2019 - visual-studio

I have seen a lot of similar questions on here, but they seem to assume that the creation of the web service is being tested. I need to be able to connect to an existing web service that I did not create, that is already in use and being used by a lot of systems. This service works, and I'm able to enter the URL in the browser, it returns the XML as it should. When I try to add a web reference (right-clicking 'references', selecting add service reference, then clicking 'Advanced' - I put the URL for the service in the URL box and click the arrow. It previews the XML in the box, and it looks great. However, in the section that says Web Services found at this URL, it shows the error:
"The document at the url http://xxx:8090/a/b/list (actual server
address removed for now) was not recognized as a known document type."
The box to add a web reference name and the add reference buttons are both grayed out. How can I get this reference added so I can write an app that browses this service and others (this is the simplest of the ones I need to work with)?

Related

Form has Event handler attached to it from the web resource

I have a marketing list form which has its own OnLoad event attached to it, upon inspecting Form properties I see that there are no libraries added just an event:
this aforementioned .js file does not exist in Web resources.
My question:
Where should I look for it ?
Definitely this is Microsoft OOB web resource library (Internal use only). If this is not bothering you and if you don’t need it, leave it as it is. Even you can remove the event registered in form editor, no harm will be made - possibly some section which is hidden may be shown or vice versa. But, you cannot add it back since library dropdown will be empty when you try to register it back.
It could be mistakenly registered/failed to remove during some upgrades. MS team failure. :(
on a quick search - I see only this reference in internet for that file.
I remember I have seen such mess related to Field service libraries and LinkedIn integration libraries not registered in Account/Contact forms and only events were there.
Even if you try to find the library in default solution, when you open it - it will be condensed and read-only. :)

Where is my exposed root of my webpage in the directory structure of Azure console?

I created a new .NET based web application named shabang using the web client and it displays the default woohoo-page when I browse to shabang.azurewebsites.net. Then, I discovered that there's a console in the web client and when I use it, I can see a directory structure including my login name, home directory etc. However, I can't find the files being served and, since I can see a web page being rendered when browsing, I'm certain they are there, somewhere.
Where is the (or equivalent of) wwwroot?
I've googled it but it's a bit hard to word what I'm asking in a way that Google will understand. Just a bunch of guides that are way too advanced to distill the information from.
By default, it is d:\home\site\wwwroot. It can also be modified using the Azure Portal.
Note that you should use the Kudu Console to see it. e.g. https://shabang.scm.azurewebsites.net

Can't reach Node JS api behind Cloud9

I am creating a simple rest api with hapi and using Cloud9 IDE. I can access the API endpoint within the same browser as the IDE uses but can't reach the api with code. Instead of JSON output I get the Cloud9 sign in page source.
Any ideas to set this up correctly?
Your workspace is probably private. You can choose to make your server public by performing the following steps:
Sign into c9.io and open the workspace in question
Click on the 'Share' menu on the top left of the IDE
When the Share dialog opens, check 'Public' next to the 'Application' row
Close the sharing dialog and test accessing your server from the api again.
Hope this helps!

Make change to a .cshtml file on Windows Azure Cloud Service

We have a custom CMS site in which the admin can make a change to the _Layout.cshtml (since they are making lots of changes). The site was hosted in Azure Web Sites, but now we are moving it to Cloud Services.
Now, the admin panel is reading and showing the contents of _Layout.cshtml (actually, all of the files in the ~/Views/Shared folder can be edited), but when the application is trying to write to a file, it throws this error: Access to the path 'F:sitesrootViewsoasShared_Layout.cshtml' is denied.
We are working on a new way to edit the layout files, but before we get there, we need a quick fix!
I am using this method to write to the file: System.IO.File.WriteAllText(path, fileContents);
Locally, in the windows azure emulator, this is working correctly, but not when it's hosted on Azure.
Thanks!
First of all, I have to say there will be some problems even though you can update your _Layout.cshtml file.
If you have more than one instances of your web role, once admin changed the page, it will only update the file one that instance, but others will NOT be changed by default. You have to somehow sync them.
If your instance had been moved to another virtual machine, for some reasons such as hardware failure or virtual machine resource reallocation, all changes your admin made will be lost.
So I strongly recommend to amend your implementation. How about save the change part into BLOB, table or database, then when the page was rendered you retrieve the content from DB. I think this would be better than just modify the page itself.
HTH.

SPListItem Properties returning wrong URL for Sharepoint Blog Posts and Announcements

I am writing an application that integrates select Sharepoint list items into an Activity Stream. I'm using Sharepoint 2010 and the new Event Receiver solution in Visual Studio.
The problem is that I want to be able to link back to the original items in my client's Sharepoint site, and the URLs that I get for Blog Post and Announcement list items using the SPListItem.Url property don't work.
For example, if my Blog Post is ListItemID #12, the Url that I get from SPListItem.Url is something like:
*Lists/Posts/12_000*
when what I need to actually navigate to the item is:
Lists/Posts/Post.aspx?ID=12
I can, of course, build the URLs myself by taking the List Url and adding '/Post.aspx.ID=' + the ItemID, but in the event a client has modified the out-of-the-box Blog Template and renamed the Post.aspx page the link would fail. Is there a property I'm not aware of that calls the Urls I need?
The same issue applies to Announcements, where getting the Url has become even more complicated in Sharepoint 2010 since they now seem to open in a javascript pop-up.
I had the same issue and I have resolved it by using
listItem.ParentList.DefaultDisplayFormUrl + ?ID=listItem.ID
to get the post url. Seems to resolved it back to Lists/Post/Post.aspx?ID=xxx.

Resources