Article View: borland.public.cppbuilder.webservices.soap
Article #35Re: SOAP with BCB6 and MSXML6
From: Benjamin Pratt
Date: Fri, 08 Feb 2008 02:25
Date: Fri, 08 Feb 2008 02:25
94 lines
4570 bytes
4570 bytes
Thank you very much for answering. I have given an update in another post
before I saw that you had replied. I'll give some more detail here now.
I am creating a SOAP server application, with a SOAP data module.
When trying to connect a client to the data module, no DataSetProviders were
showing up, so I had a look at the server interface through a web browser.
(by going to http://localhost/cgi-bin/DataServer.exe)
In the browser, I could see the Data Module interface. However, when I
clicked on the WSDL link, I received the 'Error: This name may not contain
the ':' character' message.
So then I applied the unofficial fix and recompiled. This time, I received a
different error when trying to view the WSDL. The error was: 'Error:
Unexpected NameSpace parameter'
In the debugger, I found that a call to SetAttributeNS was causing the
exception. The exception was due to the call being made with an empty
NodeName parameter.
I traced that problem back to the new version of GetPrefixedName from the
unofficial fixes.
Here is the function from the unofficial fixes:
function TXMLNode.GetPrefixedName(const Name, NamespaceURI: DOMString):
DOMString;
var
NSDecl: IXMLNode;
begin
{ The method adds a prefix to a localname based on the specified URI.
If there is no corresponding namespace already declared or if
the name is already prefixed, then nothing is done. }
if (doAutoPrefix in OwnerDocument.Options) and not IsPrefixed(Name) then
begin
NSDecl := FindNamespaceDecl(NamespaceURI);
if Assigned(NSDecl) and (NSDecl.LocalName <> '') then
if Assigned(NSDecl) and (NSDecl.NodeName <> SXMLNS) then
Result := MakeNodeName(NSDecl.LocalName, Name)
else
Result := Name;
end else
Result := Name;
end;
Notice that the
"if Assigned(NSDecl) and (NSDecl.LocalName <> '') then"
statement does not have a matching else condition.
When this condition is false, the fuction returns with an empty result and
causes the 'Error: Unexpected NameSpace parameter' exception.
So then I added an
else
Result := Name;
to match with the dangling if statment.
That corrected the 'Error: Unexpected NameSpace parameter'.
However, I was now getting the 'Error: This name may not contain the ':'
character' exception again.
So I tracked that to when the schema is being created for the
TWideStringDynArray SAS_GetProviderNames()
method of the SoapDataModule interface. The problem is that when creating
the Array attributes, it does not find the namespace registered for the URI,
and thus tries to create an attribute named ':n1', missing the namespace
before the colon.
It appears that the WSDL is created correctly for interfaces that do not
have arrays in them. For example, the IAppServer schema is fine; it has no
array parameters.
However, the WSDL for IAppServerSOAP, ISoapDataModule, and IWSDLPublish all
fail. All three of these have array paramerters in their methods, and all
three generate the 'Error: This name may not contain the ':' character'
exception when trying to construct the Array schema attributes.
So this is about as far as I can figure out. I've tried to figure out how to
get the namespace for the URI registered, so the prefix would be applied,
but haven't been able to. I'm pretty stuck at this point.
Any help would be greatly appreciated.
Ben
Technical Details
Message-ID:
<47abbdb9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!lightspeed.eweka.nl!81.171.88.9.MISMATCH!ramfeed2.eweka.nl!eweka.nl!hq-usenetpeers.eweka.nl!news.astraweb.com!newsrouter-eu.astraweb.com!newsfeed2.ip.tiscali.net!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47ab6e44$1@newsgroups.borland.com> <47abafe2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11096a,b7facb112412003f X-Google-Attributes: gid11096a,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Benjamin Pratt" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.webservices.soap References: <47ab6e44$1@newsgroups.borland.com> <47abafe2$1@newsgroups.borland.com> Subject: Re: SOAP with BCB6 and MSXML6 Date: Thu, 7 Feb 2008 18:25:46 -0800 Lines: 96 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 67.185.159.22 Message-ID: <47abbdb9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1202437561 67.185.159.22 (7 Feb 2008 18:26:01 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!lightspeed.eweka.nl!81.171.88.9.MISMATCH!ramfeed2.eweka.nl!eweka.nl!hq-usenetpeers.eweka.nl!news.astraweb.com!newsrouter-eu.astraweb.com!newsfeed2.ip.tiscali.net!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail