2
votes

I have to address a webservice with SOAP.

the WSDL file is http://www.healthconnect.be/sites/default/files/support/ConsultMyCareNet.wsdl

However when I import this WSDL file in my project (Delphi XE3) with file- new - other - WSDL importer there are some faults,

In top of the new *.pas file I find:

The following types, referred to in the WSDL document are not being represented in this file. They are either aliases[@] of other types represented or were referred to but never[!] declared in the document. The types from the latter category typically map to predefined/known XML or Embarcadero types; however, they could also indicate incorrect WSDL documents that failed to declare or import a schema type.*

// !:GetMCNStatusRequest - "urn:be:healthconnect:rrnconnector:ws:1_0:messages"
// !:GetMCNStatusResponse - "urn:be:healthconnect:rrnconnector:ws:1_0:messages"**

and thus the following important and necessary function for addressing the webservice cannot be compiled with the message:

Cannot unwrap:
 - Input part does not refer to an element
 - Output part does not refer to an element*
function getMCNStatus(const parameters: GetMCNStatusRequest): GetMCNStatusResponse; stdcall;

But I need this function 'getMCNStatus' as It is a the first function to call since this function tests if the connection with the webservice is Ok. Without this function the rest does not work.

So how can I make this function work anyway?

Must I define the classes GetMCNStatusRequest and GetMCNStatusResponse myself and what Do I have to define in the classes ? Can I find the answer in the wsdl file ?

1

1 Answers

0
votes

open your wsdl file. Remove following lines within types tag.

   <xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:person"     schemaLocation="person-1-0.xsd" /> 
   <xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:common" schemaLocation="common-1-0.xsd" /> 
   <xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:messages" schemaLocation="messages-1-0.xsd" /> 

Now , you won't get any error while importing wsdl. Update: Reason

Why is it happening? Instead of defining element types in your wsdl file, you are importing these namespaces which has defined xsd files like person-1-0.xsd or common-1-0.xsd Which is not accessible. These namesapaces should be like

"http://healthconnect/example"