Board index » delphi » Re: Problem passing parms to .NET webservice

Re: Problem passing parms to .NET webservice


2006-06-26 02:14:17 PM
delphi163
Thomas Miller writes:
Quote
The big thing I see different is the NS1 vs the tns and the Item for
the array vs the GUID designation.

====================== Delphi (doesn't work)
========================== <?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/"
xmlns:NS2="microsoft.com/wsdl/types/"
xmlns:NS3="tempuri.org/">

<NS1:GetTestGroupId xmlns:NS1="tempuri.org/">

<subjectExternalId
xsi:type="xsd:string">aSubjectExternalId</subjectExternalId>

<testExternalIds xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:guid[1]">
<item>0dc830ef-49ec-4550-b52f-9a3eb205a4c1</item>
</testExternalIds>

<webServiceParameters xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS3:WebServiceParameter[0]"/>
</NS1:GetTestGroupId>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

================= SOAP Scope (works fine)
============================

<soapenv:Envelope
xmlns:soapenv="schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<tns:GetTestGroupId
xmlns:soapenc="schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="tempuri.org/"
xmlns:xsi="www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="www.w3.org/2001/XMLSchema">

<tns:subjectExternalId>0DC830EF-49EC-4550-B52F-9A3EB205A4C3</tns:subje
ctExternalId><tns:testExternalIds>
<tns:guid>0dc830ef-49ec-4550-b52f-9a3eb205a4c1</tns:guid>
</tns:testExternalIds>
<tns:webServiceParameters />
</tns:GetTestGroupId>
</soapenv:Body>
</soapenv:Envelope>
The tns and NS1 are the same (both aliases point to
"tempuri.org/")
THe item vs. Guid is strange but that can be fixed by tweaking the WSDL
somewhat. Do you have more details that you can share (web server
address etc)
--
Deepak Shenoy (TeamB)
shenoyatwork.blogspot.com
 
 

Re: Problem passing parms to .NET webservice

Doug Maurer writes:
Quote
Is there anyway to disable the inclusion of the NS1, NS2, etc on the
Delphi side ... or, might you have some insight on how to define the
NS1 in the VS Web Service?
Yes, you can modify some of the source code in $(DELPHI)\Source\Soap
(copy it to your project folder and then modify it). If you can give me
a server address, I can give you more details (did it a while back, and
I don't recall what changes I made)
--
Deepak Shenoy (TeamB)
shenoyatwork.blogspot.com
 

Re: Problem passing parms to .NET webservice

Last night I worked through the same thing in Delphi 6 and heres what I found. For me there were two changes I had to make on the client side:
1) I did indeed have to add InvRegistry.RegisterInvokeOptions(TypeInfo(YourSOAPInterface),[ioDocument]); to my initialization clause. For a while I wondered if that made a difference, but I actually stepped through the code, and watched the packets using Ethereal and it did. I later inspected the WSDL from my web service and saw that it said style="document"
2) This was the gotcha for me. I had to change my RegisterInterface from
InvRegistry.RegisterInterface(TypeInfo(CallCopyServicePortType), 'Service', 'UTF-8');
to
InvRegistry.RegisterInterface(TypeInfo(CallCopyServicePortType), 'survey.btc.callcopy', 'UTF-8');
I looked at the examples that .Net studio publishes for you and I noticed that it said xmlns=survey.btc.callcopy . Looking at the packets I noticed I was sending xmlns=Service.
Changing the RegisterInterface declaration removed the references to NS1: for me, and allowed me to send parameters to the .Net web service.
I should also note that throughout all of this I was able to receive values from the .Net service just fine