MYOBCommunity
Partner Zone
|
|
Partner Zone

Accessing server using .NET SDK from local machine using server ip returns localhost:8080 in Uri

This thread is now closed to new comments.
Some of the links provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
2 REPLIES 2
Experienced Partner Kruts
11 Posts
Experienced Partner
Kruts
Experienced Partner

11Posts

1Kudos

0Solutions

Re: Accessing server using .NET SDK from local machine using server ip returns localhost:8080 in Uri

awesome...thanks for that 

Valued Partner Triboss
89 Posts
Valued Partner
Triboss
Valued Partner

89Posts

45Kudos

13Solutions

Accepted Solution Solved Solution

Re: Accessing server using .NET SDK from local machine using server ip returns localhost:8080 in Uri

Experienced Partner Kruts
11 Posts
Experienced Partner
Kruts
Experienced Partner

11Posts

1Kudos

0Solutions

Solved: Go to Solution

Accessing server using .NET SDK from local machine using server ip returns localhost:8080 in Uri

I am using the .NET SDK. 

 

I have installed the Server version on a network server (192.16.2.127) but it has installed itself as localhost:8080

 

when I get the companyfile usign the .NET SDK 

 

//url pointing to the server
var _configuration = new ApiConfiguration("http://192.168.2.127:8080/accountright"); var companyFileService = new CompanyFileService(_configuration);

//this is fine and finds and returns the company file just fine but
//the Uri is pointing to localhost:8080 instead of 192.168.2.127:8080 (see pic below) - why??  var companyFile = companyFileService.GetRange().FirstOrDefault(x => x.Id.Equals(Guid.Parse("11c48c0a-f3cc-4311-ac05-761cc1164430")));
var service = new EmployeeService(_configuration); var employee = service.Get(_companyFile, _exampleEmployeeGuid, _credentials);

//crashes here because it is calling localhost which is my dev machine instead of the apiconfig I have specified above var pagedCollection = service.GetRange(_companyFile, "$filter=DisplayID eq 'EMP12345'", _credentials);



1. Is there any way to 'configure' how myob to use another name instead of localhost?
2. I suspect when installed on the server it has called itself localhost but why is the .NET SDK substituting the ApiCnofiguration I pass in and returning instead the localhost?

3. When I enter http://192.168.2.127:8080/accountright in the browser from my machine it lists the files just fone so it is connecting ok

 

 

 

 

 

 

 

wrong server4.jpg
Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post