WCF JSON

caltranenricocaltranenrico ITMember
edited October 2014 in Cross Platform with Xamarin

Service:

    [OperationContract]
    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    string TestJSON3(Utente utente);            

Client:

        EndpointAddress endPointAddress;
        endPointAddress = new EndpointAddress(@"http://192.168.80.58:8741/MyMB/Service/web");

        WebHttpBinding binding = new WebHttpBinding
        {
            MaxBufferSize = 2147483647,
            MaxReceivedMessageSize = 2147483647
        };

        // Web
        MyMBWebClient m = new MyMBWebClient(binding, endPointAddress);
        Utente u = new Utente() { Codice = "aaa" };
        m.TestJSON3Completed += (object sender3, TestJSON3CompletedEventArgs e) => {
            string r = e.Result;
        };
        m.TestJSON3Async(u);

I get an exception in result:

"When manual addressing is enabled on the transport, every request messages must be set its destination address."

Thanks.

Posts

  • kentucker.8475kentucker.8475 USUniversity, Developer Group Leader ✭✭

    It looks like you created a rest service using WCF. Can you call it with the HttpClient class?

  • I used WebRequest and Newton.Json, it works well.

    MyMBWebService is a shared class generated by VisualStudio 2013 (Service Reference)

  • Nicolas.6089Nicolas.6089 USMember

    I have the same problem.. suggestion?

    do you have solved ?

    thanks

  • Thammapat.CThammapat.C THMember

    I got the same problem too.

  • @caltranenrico said:
    I used WebRequest and Newton.Json, it works well.

    MyMBWebService is a shared class generated by VisualStudio 2013 (Service Reference)

    can you share your code.

Sign In or Register to comment.