"Error: This name may not contain the ':'
character: -->:<--n1/EOleException"
as documented by the 'Unofficial SOAP Fixes' and I applied the modified
procedures to correct this issue.
Now I get a different error message when trying to access the WSDL for an
interface, namely:
Error: Unexpected NameSpace parameter/EOleException
I realize these are error messages generated by the MSXML interpreter
because it does not like the namespace formatting. The 'Unofficial SOAP
Fixes' mentions that the fixes were intended to correct problems when
upgrading to MSXML4.
I am on MSXML6, maybe there are further namespace issues when using this
latest version of MSXML6? I am working on determining what is causing this,
however, I thought I'd ask if there a solution out there already?
One thing I thought of is, maybe there is a way to force the xmldoc.pas to
use the MSXML4 interpreter?
Any help is greatly appreciated.
I am not aware of the issue you mention with MSXML6 but it's very possible
that we just have not run the BCB6 runtime (with the MSXML4 patch) with
MSXML6.
When you say you get this error message "when trying to access the WSDL for
an interface", do you mean this happens when you're trying to import the
WSDL or when you set the WSDLLocation property of an HTTPRIO component? If
it's the later I would recommend against setting the WSDLLocation property.
Instead set the URL property to that of the service endpoint. The importer
should be able to generate this information for you. Matter of fact, if you
have one of the updated importers, it should generate a factory method that
returns the interface.
If you can give me a little more information, I'll be happy to suggest some
steps that might help.
Cheers,
Bruneau.
I have applied the 'Unofficial SOAP fix' for resolving the issue 'Error:
This name may not contain the ':'
character'.
However, it is not working. I am still getting this error.
I have tracked it down to the procedure:
'WebServExp.GenerateArraySchema' in webservexp.pas
There is a call in as follows:
Prefix := GetNodeNameForURI(SchemaDef, Wsdlns);
This returns a null string.
Then it tries to set an attribute for this URI like this:
AttrDef.Attributes[Prefix+':'+'n1'] := Wsdlns;
because Prefix is empty, it tries to create an attribute named ':n1' which
MSXML obviously does not like.
I've tried all day to figure out how to correct this, but to no avail. Can
any one help?
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