But when i add this serivce to a azure project and run the solution in azure dev fabric, It does not work. Url that i am Using in this case is
http://127.0.0.1:81/Service1.svc/text/Calc/add/2/3.
I get following error
http://www.freeimagehosting.net/image.php?cb5172ac89.png
I suspect this error is because request is getting forwarded to http://127.0.0.1:5100/Service1.svc/text/Calc/add/2/3 automatically.
Has anyone faced similar issue while working with azure.
Do we need to make any change in configuration of wcf service for using it in azure solution. Here is my code
Contract
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate="/Calc/{operation}/{op1}/{op2}", ResponseFormat=WebMessageFormat.Xml)]
int Calc(string operation, string op1,string op2);
}
Implementation
public class Service1 : IService1
{
public int Calc(string operation, string op1,string op2)
{
int result = 0;
int a = Convert.ToInt32(op1);
int b = Convert.ToInt32(op2);
switch (operation)
{
case "add":
result = a + b;
break;
case "sub":
result = a - b;
break;
case "multi":
result = a * b;
break;
case "div":
result = a / b;
break;
}
return result;
}
}
service model section from web.config
Replies
Know the answer? Post it — somebody with the same question will find it here.