locked
Error 10013 attempting to connect to SOAP web service from Windows 8 client app RRS feed

  • Question

  • I have used Visual studio 2003, 2008 and 2010 for years to make clients to SOAP web services using web
     references. I am now trying to make a Windows 8 XAML client using VS2012. The
     service reference has no trouble connecting to the web service and it creates all
     the objects successfully. But when I run the app and try to connect to the web
     service, it throws an error "There was no endpoint listening at...",
     and the inner exception is "An attempt was made to access a socket in a
     way forbidden by its access permissions" with SocketErrorCode 10013
     (Access Denied). Now since the service reference created all the objects, it
     obviously was able to retrieve the WSDL from the service. What am I doing
     wrong? I'm also new to async functions, so maybe I'm doing that wrong?

    I run VS2012 As Adminsitrator, so I don't think the account permissions is a problem.

    Note also that I do not use WCF to create the web services; they are all standard SOAP services, which I connect to using a Web Reference in earlier versions of Vsual Studio. 

    Code:

    ' Service reference is MyTestSvc
     Dim MySvcClient As New MyTestSvc.MyServiceSoapClient()
     Dim req As New MyTestSvc.UserReq
     Dim resp As New MyTestSvc.UserRequestResponse
     req.username = “Test”
     req.password = “Test”
     Try
      Dim respTask As Task(Of MyTestSvc.UserInfoRequestResponse) = MySvcClient.GetUserInfo(req)
      resp = Await respTask
      Return True
     Catch ex As Exception
      Return False
     End Try

        

    Davesemm

    Wednesday, December 12, 2012 7:35 AM

Answers

  • Ok, I have gotten around the problem, but need an explanation: I replaced the server name with its IP address, and it works perfectly!

    The question is, why is it not resolving the IP address from the server name when I run the app, but I could create the service reference using the server name, and my .net 4.0 app works with the name, and IE 10 works with the name? What is different about a store app?


    Davesemm

    • Marked as answer by Dave S2 Wednesday, December 12, 2012 3:02 PM
    Wednesday, December 12, 2012 3:01 PM

All replies

  • I've now tried setting the protocol and security, but the result is still the same. (I had assumed that creating the service reference set these anyway.)

    Dim binding As BasicHttpBinding = New BasicHttpBinding(BasicHttpSecurityMode.None)

    Dim ep As EndpointAddress = New EndpointAddress(http://testsvr/MyWebService/WebService.asmx)

    Dim MySvcClient As New MyTestSvc.MyServiceSoapClient(binding, ep)

    I've tried various options here, but my test service doesn't use https (the live ones do), so some of them don't apply.

    I can see with Network Monitor on the server that nothing is received by the server from my client; when I access the site's WSDL with Internet Explorer (from the client PC, still in Windows 8), I can see the request and response (obviously). So it appears that the app is not finding the server at all.

    I've also run one of my test clients, compiled in VS2010 (.Net 4.0) on the Windows 8 PC, and it works. Of course, it won't run on a Windows 8 RT tablet, which is what I'm trying to accomplish.

    I'm stumped.


    Davesemm

    Wednesday, December 12, 2012 2:22 PM
  • Ok, I have gotten around the problem, but need an explanation: I replaced the server name with its IP address, and it works perfectly!

    The question is, why is it not resolving the IP address from the server name when I run the app, but I could create the service reference using the server name, and my .net 4.0 app works with the name, and IE 10 works with the name? What is different about a store app?


    Davesemm

    • Marked as answer by Dave S2 Wednesday, December 12, 2012 3:02 PM
    Wednesday, December 12, 2012 3:01 PM
  • Did you ever find out why this was the case? I haven't tried it yet... just doing a little research.
    Friday, January 17, 2014 5:29 PM