Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise. Mobile platform > 1c mobile, where to implement webservice?

Forum

Search UsersRules
1c mobile, where to implement webservice?
#1
Just came
Points:: 0
Joined:: Jan 13, 2015

Thank you for your answer! I got codes that I need from there. But, there is occured another question. The question is whether i must implement the webservice part (homework3) in the real server or mobile part. (As i guess, server side must be.) So, what is the answer? And, What should i do on my next steps after that?

Profile
#2
Active user
Points:: 0
Joined:: Jun 25, 2013

Hello,

The web service settings described in the book are implemented in Designer mode on your server (your PC can be a server for the example).

Let me know which part of Homework 3 caused difficulties so I can help you

Profile
#3
Just came
Points:: 0
Joined:: Jan 13, 2015

Hello, thank you for your help and interest. Now, I am at below point

Code
1.row     Address = "http://78.186.69.132/1C_DB/tr_TR/ws/ws1.1cws?wsdl";
2.row   Definitions = New WSDefinitions(Address);
3.row   URI = "http://localhost/ws1";
4.row   Proxy = New WSProxy(Definitions, URI, "WebExchange", "WebExchangeSoap");
   
5.row   Proxy.User = "Hüseyin TEMUR";
6.row   Proxy.Password = "xxxxxxxx";

 When I start the exchange command(that is explained also in homework3) an error occurs at 2. row. I am trying to connect the server at out ip (that is what I have to implement). What should I place to 1st and 3rd  row? When I connect from outside, will there be a problem on 3rd row?

Profile
#4
Active user
Points:: 0
Joined:: Jun 25, 2013

Hello,

In the example described in the book the mobile device and the server should be in the same network.
Does your device in the same network? If it does, provide us with details on the error you ran into.

"http://78.186.69.132/1C_DB/tr_TR/ws/ws1.1cws?wsdl"
This line is the WSDL file location to get the web service definitions from. Check whether you can obtain it through your browser, for example.

"http://localhost/ws1"
This is a namespace described in your configuration (see page 183 of the book), you can find out more about namespaces at http://en.wikipedia.org/wiki/Namespace
There will be no problem with this line in case of outside connection.

Profile
#5
Just came
Points:: 0
Joined:: Jan 13, 2015

Hello, it still gives the error on 2nd row. It says that "User confirmation can not be done" and it is right. To Access the database, when you enter this web address it asks your username and password. But, I can not find any property related to username and password.

 WSDefinitions has 3 properties, but none of them is related to username and password. So, how can i implement this confirmation?

Profile
#6
Just came
Points:: 0
Joined:: Jan 13, 2015

I added this row but still can not confirm the user.

Code
Definitions = New WSDefinitions(Address,"username","password");

Profile
#7
Active user
Points:: 0
Joined:: Sep 1, 2014

Code
WSDLLocation = "http://78.186.69.132/1C_DB/tr_TR/ws/ws1.1cws?wsdl"; 
NamespaceURI = "http://localhost/ws1"; 
WSName = your web service name (ex: "Service" - see xml in browser to get web service name); 
WSPortName = your web service port name (ex: "Port" - see xml in browser to get web service port name); 
WSUser = "Hüseyin TEMUR"; 
WSPassword = "xxxxxxxx"; 

WSDefinition = New WSDefinitions(WSDLLocation, WSUser, WSPassword); 
WS = New WSProxy(WSDefinition, NamespaceURI, WSName, WSPortName ); 
WS.User = WSUser; 
WS.Password = WSPassword;

Profile
#8
Just came
Points:: 0
Joined:: Jan 13, 2015

Thank you for joining Marius, but it also does not work. I could not go next step of these 2 lines. How can I learn my webservice name and port name in detail? As I think, webservice name must be given name on the server and no idea about port, does port get a random number on working time?

Profile
#9
Active user
Points:: 0
Joined:: Sep 1, 2014

Open the web service address in browser and search in the XML for name and namespace.
I think the address is incorrect "http://78.186.69.132/1C_DB/tr_TR/ws/ws1.1cws?wsdl" , "ws1.1cws" part I think.

Profile
#10
Just came
Points:: 0
Joined:: Jan 13, 2015

Hello, I got some more helps and almost solved this problem, it was about publishing on the web. After publication, I reached and saw xml files.

 Now, I have one more problem. There are 2 different applications. 1st application is a 1c application and the 2nd is my mobile application. My mobile application will be the mobile version of 1st applications one part. So, when i try to exchange data between 2 application, it gives error. The error is said to be about different attributes fields of 2 applications. I tried writeattribute function, but unsuccessful, is there any idea or help about this?

 I get "xml data convertion error".

Profile
#11
Guest
Points::
Joined::

Hello, huseyin temur!

This means that data that you send between applications contain objects that are not found in the target database, or they are found, but their attributes do not match same attributes in the source application. Try to compare and merge configurations to see the differences.

Profile
#12
Just came
Points:: 0
Joined:: Jan 13, 2015

Hello, I am a bit improved. I compare docs, catalogs, accuregisters, inforegisters and then try to write attributes. While writing attributes, I am trying to write standart fields of docs, catalogs, etc... But it always gives error at the second row row.

   
        1st row ---> While CanReadXML(XMLReader) Do

2nd ---->        Data = ReadXML(XMLReader);
                                   ..
                                    .
                                    .

How can I compile step by step at server side? I think server side compilation will be solution.

Profile
#13
Guest
Points::
Joined::

You can set a break point and see what it in the XML file. You also can see an offset in the XML file if there is an error reading it.

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.