Board index » delphi » Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006
Michael Holdgaard
![]() Delphi Developer |
Michael Holdgaard
![]() Delphi Developer |
Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D20062006-09-27 05:06:15 PM delphi145 Hi I have a problem accessing a webservice written in VS 2003 C# from a Delphi 2006 .NET application. I can pass simple parameters (strings) from my D2006 app to the VS2003 webservice, but the webservice also has this type, Person (copied from the proxy-class in D2006): PersonData = class public Name: string; Addresse1: string; Addresse2: string; EMail: string; end; Person = class public CprNr: string; PersonData : PersonData; end; whenever I try to pass a parameter of type Person, the webservice receives null. I can not see why? Any ideas will be appreciated /Michael |
Quentin
![]() Delphi Developer |
2006-10-26 07:20:18 PM
Re:Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006QuoteHi Please Help!! Posted from www.topxml.com/renntp using reNNTP: the website based NNTP reader. |
Jean-Marie Babet
![]() Delphi Developer |
2006-10-28 01:48:18 AM
Re:Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006
Hello,
QuoteI've got exactly the same thing. I only have one param that gets passed to the XML node was not setup properly. More often than not, I have found that it's related to the namespace. Not too long ago someone pointed out here cases where dateTime were not being seen by .NET WebServices because the serialization logic put an incorrect prefix on the node. A more subtle flavor of this issue is related to related to the 'elementFormDefault' attribute of schemas and shows up on non-toplevel (global) items, as in the case mentioned in the case mentioned in this thread - i.e. Quote>Person = class Win32 included, don't pay attention to 'elementFormDefault'; it assumes it's "qualified" and will happily sent something along the lines of <Person xmlns="someNamespaceHere"> <CprNr>The string parameter</CprNr> <PersonData> ...... </PersonData> </Person> The above won't be correctly seen if the receiving service is strict on enforcing valid XML packets. Anyway... without more details, it is not easy to investigate but I would suggest the following: 1. Find out if a C# client can talk to the Service successfully. If yes, compare the XML request packets. 2. Inspect the schema and see if it specifies 'elementFormDefault' and verify if the XML request packet respects the setting 3. Post the WSDL/Schema (the relevant excerpts) here as well as the XML request packet so we may assess. 4. Generate the binding using .NET's WSDL.EXE and compare it to the Pascal binding. 5. Use the PostSOAP sample included with Delphi to post XML packets to the service. This allows you to tweak the packet and find out what the service is after. .NET WebServices often show a sample packet on their default (without the ?WSDL querystring) page. Cheers, Bruneau. "Quentin" <XXXX@XXXXX.COM>writes Quote
|