beantownace
Active member
- Joined
- Feb 15, 2019
- Messages
- 42
- Programming Experience
- 5-10
Hello all,
Quick question not sure what I am doing wrong with this.
I have a NET 8 Web API where I added a ASMX soap reference to the API. I have a worker class where I am going to be calling some of the ASMX reference methods. When I added that it added the interface so for example CustomerSoap and then I have a worked called CustomerWorker I injected it in the constructor as follows:
public class CustomerWorker(CustomerSoap customerSoap) : ICustomerWorker
{
private readonly CustomerSoap _customerSoap = customerSoap;
}
How do I inject this with the program.cs file. I have an AddScoped on this worker in the Program.cs
builder.Services.AddScoped<ICustomerWorker, CustomerWorker>();
It is not liking the CustomerSoap so trying to figure that out. Also I will need to change that ASMX path based on environment dev, prod but just trying to get this running. I can also use credentials as Default Credentials.
Thanks all blanking on this as I don't usually use soap web references.
Quick question not sure what I am doing wrong with this.
I have a NET 8 Web API where I added a ASMX soap reference to the API. I have a worker class where I am going to be calling some of the ASMX reference methods. When I added that it added the interface so for example CustomerSoap and then I have a worked called CustomerWorker I injected it in the constructor as follows:
public class CustomerWorker(CustomerSoap customerSoap) : ICustomerWorker
{
private readonly CustomerSoap _customerSoap = customerSoap;
}
How do I inject this with the program.cs file. I have an AddScoped on this worker in the Program.cs
builder.Services.AddScoped<ICustomerWorker, CustomerWorker>();
It is not liking the CustomerSoap so trying to figure that out. Also I will need to change that ASMX path based on environment dev, prod but just trying to get this running. I can also use credentials as Default Credentials.
Thanks all blanking on this as I don't usually use soap web references.