I’m using the LoginSerice in a Delphi application the same as in the for example Super TCP Channel chat example.
When I want to use the service as a plain soap service from .NET, this code dos not work since my service has no access to the session of the Login Service. How can I make hat happen?
Thank,
Sample:
private static void testSoap()
{
LoginService.LoginServiceClient lsc = new LoginServiceClient(); lsc = {LoginServiceClient}
bool LoggedIn = lsc.Login(‘mypass’,‘myuser’); loggedin = true
if (LoggedIn)
{
MyService.MyServiceClient msc = new MyServiceClient();
msc.DoSomething -> Now the call has no access to the session variables of the loginservice.
}
}
You need to enable the xsoClientIdInWsdl option in your server app to let it expose required message headers in the WSDL.
After thant you need to generate some random Guid using the Guid.NewGuid() all and to use this guid in all server requests, including login service call
Yest that helps we’re able to access the service now. One more question, is it possible to remove the IsRequired= True value for Objects since in some cases c# does not like an empty object? And is it possible to remove the Order=x?
This code is auto-generated by VS web service import tool based on the WSDL exposed by the server.
AFAIK the Order part cannot be removed at all.
The IsRequired is based on WSDL attributes, so if possible cleate a simple testcase (literally a server with 2 structures and C# client) where this reproduces.
Also I need to mention that Remoting SDK servers provide a feature called HttpAPI. This feature turns them into REST servers that expose Swagger/OpenAPI compatible metadata (so client code can be generated for pretty much any language, from C# or Java to Python or JS). In come cases this might be a better communication option than SOAP.
From our VS developer:
The selected type member doesn’t have minOccurs and maxOccurs elements. It means that this element is required and it’s position is fixed. We want to make an element optional. It should be minOccurs=0 maxOccurs=1.
So in this case when we assign blank values for Name and Contact, VS will raise an error.
Second question for Enum values they are shown as text and not numerical values. Can we adjust this?