WinRT client & 1C Web-service

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Just came
Rating: 0
Joined: May 6, 2013
Company:

Hello!

I create client for WinRT and when I try connect to 1C web-service have error like: "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="1C:Enterprise 8.2"'." :(

I use Windows Store template in visual studio 2012 for C#, and Service Reference that I create using Add Service Reference from 1C WSDL.

Code example:

Code
       private void BtnCompany_Click(object sender, RoutedEventArgs e)
        {
            restcoachPortTypeClient Service = new restcoachPortTypeClient();
            Service.ClientCredentials.UserName.UserName = "web";
            Service.ClientCredentials.UserName.Password = "12345";
            
            Service.ClientCredentials.HttpDigest.ClientCredential.UserName = "web";
            Service.ClientCredentials.HttpDigest.ClientCredential.Password = "12345";

            Service.ClientCredentials.Windows.ClientCredential = 
                       new System.Net.NetworkCredential("web","12345","");

            Service.OpenAsync();
            System.Threading.Tasks.Task<PingResponse> PingAsync = 
                       Service.PingAsync();
            PingResponse PingResult = PingAsync.Result;
            Service.CloseAsync();
        }

Please help me to solve this problem.
What I doing wrong?

Best regards, Sergey!

Edited: Sergey Manko - May 06, 2013 11:53 AM
 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

It seems that you are trying to connect to a REST web service, while SOAP web services are supported to be published by 1C:Enterprise.

 
#3
People who like this:0Yes/0No
Just came
Rating: 0
Joined: May 6, 2013
Company:

Thank you for quick answer!

If I understand, I can't use automatic create Service Reference in Visual Studio 2012 to generate classes for 1C web-services?

Could you show example C# code how connect from WinRT to 1C web-service?

Best regards, Sergey!

 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

I'm not sure about automatic Service Reference creation, try to change options to make SOAP web service reference.

 
#5
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jan 23, 2013
Company: OTTO

Quote
The HTTP request is unauthorized with client authentication scheme 'Anonymous'
problem with authentication

example:
C# client send SOAP request (and get results)

 
#6
People who like this:0Yes/0No
Just came
Rating: 0
Joined: May 6, 2013
Company:

Thank you Timofey, but I can't find where I can change options for creating SOAP classes by "Add Service Reference", could you show where?

Thank you Alexey for examples, but this code without authentication and you sure that   is code for WinRT and .NET 4,5?

In old version Visual Studio we can create Web Reference and can using it, but this is type we haven't in Visual Studio 2012 in solution for Windows Store .NET 4,5!
So, I have automatic generated Service Reference from WSDL URI 1C web-service, but I can't using it because this is classes may be not SOAP type and how make it SOAP type I don't know.

I will be very grateful for some real .NET C# examples WinRT client for connecting to 1C SOAP web-service.

Thank for helping!

Best regards, Sergey!

Edited: Sergey Manko - May 08, 2013 12:52 AM
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.