Board index » delphi » bds 2006 against Visual Studio 2005 webservice
|
sean hoffman
Delphi Developer |
bds 2006 against Visual Studio 2005 webservice2006-04-22 11:28:58 PM delphi242 I've got a relatively simple Webservice that is written in C# and .net 2.0 (VS2005). One of the methods is a method that returns an object based on a unique identifier. That method is called "GetContactById", and takes a single long parameter. The webservice is responsible for populating that structure by making the required database calls. I have run the WSDL compiler in both Delphi and C++ Builder 2006, and have breakpoints set in both development environments. The problem is, VS2005 is not correctly receiving the parameter to the GetContactById() call. I am passing a long value of 5, and inside the de{*word*81} on the VS side, it thinks it is getting a 0. If I use another .net client to access the same webservice, the value comes over fine. Since these are all just XML messages being passed back and forth, I ran MS Soap toolkit 3.0 to track the messages and compared the differences between the Borland generated requests and the Microsoft generated requests, and there are some that I am investigating. I was hoping however that someone else had run across what would seem like a basic problem and have a potential suggestion for a solution. Here is the XML that the Borland client is generating for the GetContactById call: <?xml version="1.0" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="www.w3.org/2001/XMLSchema" xmlns:xsi="www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body SOAP-ENV:encodingStyle="schemas.xmlsoap.org/soap/encoding/"> <NS1:GetContactById xmlns:NS1="tempuri.org/"> <Id xsi:type="xsd:long">5</Id> </NS1:GetContactById> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Here is the XML that the Microsoft C# 2.0 client is generating for the GetContactById call: <?xml version="1.0" encoding="utf-8" ?> <soap:Envelope xmlns:soap="schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="www.w3.org/2001/XMLSchema-instance" xmlns:xsd="www.w3.org/2001/XMLSchema"> <soap:Body> <GetContactById xmlns="tempuri.org/"> <id>5</id> </GetContactById> </soap:Body> </soap:Envelope> The first difference I noticed is that the Borland generated client is including type information in the data element for 'id', but that can be turned on or off by toggling the THTTPRIO.Converter.Options.soSendUntyped option. I have tried toggling this flag and it changes the XML message that is sent, but that doesn't seem to affect the behavior. Another difference I noticed is that Microsoft uses simpler soap tags <soap>vs. <SOAP-ENV>. Yet another difference I noticed is that the Borland version includes the namespace as part of the method name. I wouldn't think this to be a problem because inside the Microsoft IDE, I have a breakpoint set in the method I am calling, and when the borland client executes, I am hitting that breakpoint in the Microsoft IDE, so the Microsoft environment is correctly mapping the method to its response. that is all I can see different, and I am while I am new at this, I am admittedly stumped. |
