简体   繁体   中英

Does Delphi XE2 correctly import WSDL from Java/Axis2 when function has no return value?

I'm importing a service into Delphi so I can test my front end (delphi) with my back end (java) and when I go to test a server function I get the following error:

XML document must have a top level element.

Line: 0

What I have noticed is that my function does not have aa return value (public void functionName) but if I switch it to say Boolean and just return true, the error no longer comes up.

The function appears to execute regardless of the error message being there or not however.

Here's the function being called (Java):

public void addNewUser(String facility, String username, String password, String status) {
    serviceHelper.addNewUser(facility, username, password, status);
}

And the corresponding call in Delphi:

procedure TForm1.btnAddUserClick(Sender: TObject);
begin
  GetServicePortType.addNewUser(lbledtFacility.Text,
                                lbledtUsername.Text,
                                lbledtPassword.Text,
                                cbb1.Text);
end;

I'm not very comfortable with answering by saying 'Try googling this' but if you're still stuck, try it anyway.

delphi babet "XML document must have a top level element."

Babet was the nom de plume of someone who was (and may still be, for all I know) closely involved in the development of Delphi's SOAP parser and import code and used to appear regularly in EMB's newgroups until about a year ago to help out with SOAP problems. I remember that he (despite using the moniker "Jean-Marie" on the forums) replied to several queries about this error.

The messages usally comes from the underlying MS-XML Parser. It seems that your XML isn't valid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM