Endpoint not found - silverlight-4.0

I have created a new WCF RIA service with OData exposed. I wanted to test it out.
My project name was ChinookSample and the namespace was ChinookSample.Web.Services
When I try to browse...
http://localhost:52878/Services/ChinookSample-Web-services-dsAlbumAndArtist.svc
I get the service page, but the moment I go for...
http://localhost:52878/Services/ChinookSample-Web-services-dsAlbumAndArtist.svc/OData
I get EndPoint not found. I have checked my Web.Config and that has the OData defined.
What is the correct way to troubleshoot this?
Also, <domainServices> tag has a squiggly saying ... System.ServiceModel has invalid Child element domainServices.
Any help is highly appreciated!

Finally got the issue resolved. I missed the trailing / in the URL ...
http://localhost:52878/Services/ChinookSample-Web-services-dsAlbumAndArtist.svc/OData/

Related

Api object in Genexus returns Method Not Allowed

can anyone help me?
It is my first time creating an API Object in Genexus. I've already yaml archive:
I need to test in Postman but I received this error:
If you a re using IIS try this:
How To change the IIS configuration to use PUT and DELETE in API object:
You change the verbs in the IIS configuration, in the "Extensionless-URLHandling-Integrated" you double click, you go to Restrictions / Verbs and you have to add PUT and DELETE (or select ALL verbs)
You have to change it at the Server level (Default Web site)
The problem seems to be that your endpoint doesn't support "post" request. In the image I only see a "get" declaration...so you have to change POST to GET on your Postman.
Thanks for your answers, the API object was defined as GET, that was wrong, so I made it POST and now it is working.

sharepoint object model in webservice

i am creating a webservice to provide one of the user poperty value to another application.
to do the same i am using sharepoint object model to connect to the mysite.
code : spsite site = new site(mysite url)
but i get the below error, kindly help.
error:
System.IO.FileNotFoundException: The Web application at "mysite url" could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
If this is a WCF service then by default there is no httpcontext, ergo, no spcontext. The fix is to enable "asp.net compatibility mode" in web.config. This is done with the following directive:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
I can think of two things that might be the cause of your problem:
-If your SharePoint is 64 bits, your application has to be built in 64 bit. The same applies for x86.
-The Target Framework option in your application needs to be set to 3.5
EDIT: I found an article about it. Maybe you could benefit from it.
http://blogs.technet.com/b/stefan_gossner/archive/2011/09/19/common-issue-new-spsite-returns-quot-the-web-application-at-http-server-port-could-not-be-found-quot.aspx

How to properly handle Axis2 generated exceptions with a REST client

I am using Axis2 v1.6.1 and Resty as a rest client. If I purposely send a malformed request that Axis2 cannot parse, for example, sending "p=0.0" where p is an Integer, then Axis2 will generate 500 HTTP Response and log an error in it's log saying something to the effect of:
[ERROR] Exception occurred while trying to invoke service method createUpdateOrganization
org.apache.axis2.AxisFault: Invalid value "0.0" for element poStart
...
This is great but I need to be able to capture this exception information in order to act upon it as part of our exception management framework.
It seems to be throwing an AxisFault exception but this is before it reaches my service so I'm not sure what I need to configure in order to get this information.
Any ideas?
I found the following article:
http://www.packtpub.com/article/handler-and-phase-in-apache-axis
Which explains exactly what I need to do. The answer is to create a custom handler for the InFaultFlow phase. :) I hope this helps somebody else!

How to detect user agent in WCF web service

How can I detect the user agent in a web service? My web service is implemented using a WCF webservice with basicHTTPBinding. It will be a post from some SOAP clients. I wish to know the user-agent from the clients.
I shall like to see some sample code for this.
I am using a WCF based web service and in the svc.cs, I tried to catch this.Context.Request.UserAgent. But it gives the following error:
this.Context.Request.UserAgent 'MySoapService.MyService' does not contain a definition for 'Context' and no extension method 'Context' accepting a first argument of type 'MySoapService.MyService' could be found (are you missing a using directive or an assembly reference?)
I also tried System.Web.HttpContext.Current.Request.UserAgent and it says:
'System.Web.HttpContext.Current' is null
Edit note:
I tried to activate the ASP.NET compatibility mode. I added <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> in the config file and added [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] on the top of the class that implements the service interface. Then using System.Web.HttpContext.Current.Request.UserAgent gives me the user agent as desired.
There is another way to get the user agent without enabling ASP.NET compatibility in web.config:
string userAgent = WebOperationContext.Current.IncomingRequest.Headers["User-Agent"];
You can use also:
WebOperationContext.Current.IncomingRequest.UserAgent
You can read user agent from the HttpContext.Current.Request object if you enable ASP.NET compatibility in web.config:
What a totally unhelpful response!
This is not a trivial task. Yes it is obviously possible to get te user-agent string but how does one actually do it? I spent 2 hours checking google and so on but found the answer buried in MSDN documentation. In Visual Studio, from within a WebMethod try
this.Context.Request.UserAgent
That should do it!
User-Agent is a standard HTTP header. It'll be available to your web service just like it's available to anything CGI-like.
Did you even bother searching for this before posting your question? There must be millions of hits for it on Google.

WCF Service - The resource cannot be found

I am deployed my published the WCF web service to my server and when i am tryihg to
access it its giving me following error????
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /API/Errors/GeneralError.aspx
It was an application pool issue, on recycling the application pool the issue got resolved.
I would say it has to do with the handlers setup in IIS...
read this http://bloggingabout.net/blogs/jpsmit/archive/2007/01/17/wcf-http-404-when-hosted-in-iis.aspx