We want to create the dll which calls the methods of xLocate that is findAddress to get the geo-coordinates of given address.
So how can we call the method findAddress of xLocate, pass the Address object to that method and at last get the result without using the web service reference.
Is there any way to call the methods of xLocate service via WebClient.
Accessing the methods of xLocate service via WebClient in C#
Re: Accessing the methods of xLocate service via WebClient i
Hello,
here are two links to our Website where you can find Information about how to acces the xlocate Service in C#.
http://xserver.ptvgroup.com/en-uk/cookb ... lications/
http://xserver.ptvgroup.com/en-uk/cookb ... s-classes/
Does that help you?
Best regards,
Lars
here are two links to our Website where you can find Information about how to acces the xlocate Service in C#.
http://xserver.ptvgroup.com/en-uk/cookb ... lications/
http://xserver.ptvgroup.com/en-uk/cookb ... s-classes/
Does that help you?
Best regards,
Lars
Lars Moritz
Technical Consultant
PTV GROUP, Germany
Technical Consultant
PTV GROUP, Germany
Re: Accessing the methods of xLocate service via WebClient i
Dear Dr. Moritz,
Thanks for your help, we are moving ahead and will contact you in case we need any help.
Kind Regards
Ramanan
Thanks for your help, we are moving ahead and will contact you in case we need any help.
Kind Regards
Ramanan
Re: Accessing the methods of xLocate service via WebClient i
Hello,
we have checked the client dlls which you have given to us, but in those dlls, we found only xroute client base available. Do we have to reference any thing else?
also in that dll, we need user id and password to initialize xroute client base. How can we get user id and password or xtoken to use xroute client base.
We have used HttpWebRequest to request xLocate using JSON object to get JSON result.
Sample code,
Is there any other way, we can achieve same result as above?
Kind regards,
Webdirekt Team
we have checked the client dlls which you have given to us, but in those dlls, we found only xroute client base available. Do we have to reference any thing else?
also in that dll, we need user id and password to initialize xroute client base. How can we get user id and password or xtoken to use xroute client base.
We have used HttpWebRequest to request xLocate using JSON object to get JSON result.
Sample code,
Code: Select all
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(domain + "/xlocate/rs/XLocate/findAddress");
webRequest.ContentType = "application/json;charset=\"utf-8\"";
webRequest.Accept = "application/json";
webRequest.Method = "POST";
// get content bytes
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
Byte[] byteArray = encoding.GetBytes(jsonAddress);
webRequest.ContentLength = byteArray.Length;
// add content into request steam
using (Stream dataStream = webRequest.GetRequestStream())
{
dataStream.Write(byteArray, 0, byteArray.Length);
}
// get response
using (HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse())
{
// read response into StreamReader
using (StreamReader rd = new StreamReader(response.GetResponseStream()))
{
// get response into a string variable
string jsonResponse = rd.ReadToEnd();
console.write(jsonResponse);
}
}
Kind regards,
Webdirekt Team
- Bernd Welter
- Site Admin
- Posts: 2695
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Accessing the methods of xLocate service via WebClient i
Hi there,
ON PREMISE: For access to a local xServer you don't have to specify credentials (as long as you use a standard configuration where authentification is disabled by default).
ON CLOUD: For access to xServer INTERNET you need to set Username="xtok" and Password=yourtoken.
The DLLs: you should find the required x...dll's within the /clients folder of each server.
Worst case is to collect the different dll's manually.
Does this answer the question?
Best regards,
Bernd
PS: I usually create my connection classes via WSDL.exe.
ON PREMISE: For access to a local xServer you don't have to specify credentials (as long as you use a standard configuration where authentification is disabled by default).
ON CLOUD: For access to xServer INTERNET you need to set Username="xtok" and Password=yourtoken.
The DLLs: you should find the required x...dll's within the /clients folder of each server.
Worst case is to collect the different dll's manually.
Does this answer the question?
Best regards,
Bernd
PS: I usually create my connection classes via WSDL.exe.
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Re: Accessing the methods of xLocate service via WebClient i
Hi Bernd,
Thanks for the details.
We have now used the xlocate-dotnetclient.dll and xserverbase-dotnet-client.dll in our program and it works fine.
Regards
Ramanan
Thanks for the details.
We have now used the xlocate-dotnetclient.dll and xserverbase-dotnet-client.dll in our program and it works fine.
Regards
Ramanan