I'm trying to consume a SOAP web-service, specifically:
http://api.affiliatewindow.com/v4/AffiliateService?wsdl
However - after using the standard Webservices dialog to add a service reference - none of the operations are available on the generated classes - it's just empty:
I've tried changing all different combinations of options on the 'add reference' dialogue.
Is there another approach to adding references of this type?
(note: in order to actually invoke the operations, the service is expecting a username/password header - Perhaps I need to include that whilst generating the classes? If so - how?)
In the Solution Explorer right-click on YourSolution/YourProject/References. Select "Add Service Reference..." from the context menu. In the Add Service Reference dialog, enter the service metadata endpoint URL in Address line and press Go button. Select a service from the list and specify Namespace.
NET Standard project, this option is available when you right-click on the Dependencies node of the project in Solution Explorer and choose Manage Connected Services.) On the Connected Services page, select Add Service Reference.
I used the Web Services Description Language Utility (Wsdl.exe) to generate the proxy class manually.
wsdl http://api.affiliatewindow.com/v4/AffiliateService?wsdl /namespace:AffiliateWindow
I like using namespace option so none of the objects with have a conflict with my current solution.
Then I can add the resulting code file to your solution. I have attached a screenshot of the Object Browser from the solution:
Now, you can instantiate the service as you wish:
// I don't know anything about Affiliate Window - but I am assuming you would use it
// like the following code below
AffiliateWindow.UserAuthentication auth = new AffiliateWindow.UserAuthentication();
auth.sType = AffiliateWindow.UserType.affiliate;
auth.sPassword = "123456";
AffiliateWindow.ApiService svc = new AffiliateWindow.ApiService();
svc.UserAuthenticationValue = auth;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With