Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Integration > web service

Forum

Search UsersRules
web service
#1
Just came
Points:: 0
Joined:: Oct 4, 2012

I am trying to post webservice
platform
IIS 7
Visual Studio 2008

my code is

Code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim proxy As System.Net.WebProxy = New WebProxy(
                "https://1c.traffickurye.com/GunServisEkstre/ws/", True)
        proxy.Credentials = New NetworkCredential("WS", "***", 
                "https://1c.traffickurye.com/GunServisEkstre/")

        Dim k As New ServiceReference1.GunServisEkstrePortTypeClient("GunServisEkstreSoap")

        k.ClientCredentials.UserName.UserName = "WS"
        k.ClientCredentials.UserName.Password = "*****"
        k.ClientCredentials.Windows.ClientCredential = proxy.Credentials
        k.ClientCredentials.HttpDigest.ClientCredential = proxy.Credentials
        k.ClientCredentials.Windows.AllowedImpersonationLevel = 
                System.Security.Principal.TokenImpersonationLevel.Impersonation
        Dim data = k.CariHareketleri(2012, 12, "694")

        GridView1.DataSource = data.Evraklar

        GridView1.DataBind()

End Sub

but receive this error:

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="1C:Enterprise 8.2"'.

The remote server returned an error: (401) Unauthorized.

Profile
#2
Active user
Points:: 0
Joined:: Nov 19, 2012

I'm not sure it will help you, but this code works well:

Code
Dim Service = New AutoupdateWebService.Installer
Service.Url = AddressWS
Service.Credentials = New NetworkCredential(UserWS, PasswordWS)
Dim Mess = Service.GetDataList()

Profile
#3
Guest
Points::
Joined::

Try to publish it without of authorization first to check if your web service is configured properly.

Profile
#4
Active user
Points:: 0
Joined:: Feb 26, 2015

[Turkish]
Kardeşim kolay gelsin, ismini görünce cevabıda Türkçe yazayım dedim,
Benzer sorunla bende karşılaşmıştım, olayın çözümü çok basit, datayı 1c tarafında json olarak hazırlatıyosun,
Uygulamaya json olarak çekiyosun, sonrada jsonu datatable ye dönüştürüyosun,
burdaki en önmeli nokta web servise atama yaparken 1c içinde bir kullanıcı oluşturuyosun örneğin adı webuygulamakullanicisi / şifrede 12345 mesela, bunu vb veya c# içinde oluşturduğun network kimliği olarak atıyosun, data sana direk json olarak geliyor.

[English]
1) You must first create a 1C user.
2) Authorize this user in the application. (Such as c # or vb.net ...)
3) The webservice should send you data in JSON format.
4) Convert the webservice data in the application.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.