Click here to Skip to main content
15,922,512 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have create a service for insert value into db. which is works fine when I call that Service Reference from vs2010. but it through error while using mobile app.

Error Message :
VB
error mess : Error Domain=BasicHttpBinding_IEenaduCommentsBindingResponseHTTP Code=415 "unsupported media type"


Service1.Svc
 int id = Convert.ToInt32(Uid);
string SlashRemoving = Token.Replace("wxyzwxyz", "/");
string DeodedTok = System.Web.HttpUtility.UrlDecode(SlashRemoving);
string Enkey = objmenu.EncKey(id).ToString();
string DecTok = Decrypt(DeodedTok, true, Enkey);
DataSet Tok = objmenu.Tok_Checker(id, DecTok);
if (Tok.Tables[0].Rows.Count > 0)
{
    Guid gudArticleId = new Guid(artid);
    objmenu.ArticleId = gudArticleId;
    objmenu.FirstName = name;
    objmenu.Email = email;
    objmenu.Commenttext = txtcmt;
    objmenu.Replyid = null;
    objmenu.InsertComments();
    int intresponse = Convert.ToInt32(objmenu.Userid);
    return intresponse;
}
else
{
    return 0;
}

above code returns 1 when insert successfully, otherwise return 0.
web.config
<service name="MyService" behaviorconfiguration="ServiceBehaviour">
       <!-- Service Endpoints -->
       <endpoint address="http://stgen.eenaduindia.com/EenaduEnglishMobileFeed/EenaduComments/InsertComments" binding="wsHttpBinding" contract="EenaduEnglishMobileFeed.IEenaduComments" behaviorconfiguration="web">
         </endpoint>
        <endpoint>
         address="mex"
         binding="mexHttpBinding"
         contract="IMetadataExchange"/>
         </endpoint></service>
Posted
Updated 14-Oct-14 1:38am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900