none
Calling Web Service from Windows Metro App. RRS feed

  • Question

  • I am trying to access a web service from a Windows Metro App.

    Previously I was able to access this sevice from C# in a Windows Forms application. In order to set the credentials I had to use WSE 2.0 and request the Soap Context

    I created a Proxy in VS2012 from the same WSDL file used previously, After making an asych call, I got the response:

     "The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error"

    Any suggestions?

    Thursday, March 7, 2013 6:07 AM

Answers

  • Hi,

    I would suggest you try to consult the details of the service (and how it works) from third party who design the service. Or you may try some tools such as fiddler to capture the request and response.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 3:48 AM
    Moderator

All replies

  • The issue is a missing security header, I tried setting the security mode to "System.ServiceModel.BasicHttpSecurityMode.TransportWithMessageCredential", this generated a security header but it did not match the one created by the previous windows forms app.

    How do I generate the same header that the Windows Forms App created?

    Friday, March 8, 2013 5:44 AM
  • Hi,

    First of all, please check the service is running or not, if not please rebuild the solution and start a new instance of the service. If this does not work, please try add "<dataContractSerializer maxItemsInObjectGraph="2147483647">) in your config shown in this post.

    If the issue still exists, I would suggest you enable tracing for your service to get the actual issue.

    #How to enable WCF tracing

    http://blogs.msdn.com/b/madhuponduru/archive/2006/05/18/601458.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 8, 2013 6:08 AM
    Moderator
  • The service is a third party service. I can access it successfully from my Windows Forms application.

    The problem appears to be a missing security header, the header is generated in the Windows Forms App, using the Microsoft WSE (Web Services Extensions) to set the "Soap Context".

    How can I get the same security header in Windows 8?

    Wednesday, March 13, 2013 4:28 AM
  • Hi,

    I would suggest you try to consult the details of the service (and how it works) from third party who design the service. Or you may try some tools such as fiddler to capture the request and response.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 3:48 AM
    Moderator