前两天,公司同事在搞IHE测试的内容,在准备其中的两个测试ITI-11与ITI-12时,发现通过VS自带的WSDL命令是无法生成相应代码的。
其具体的WSDL内容,大家可以Google下面的内容来查找:
Appendix A: Web Service Definition for Retrieve Specific Information for Display and Retrieve Document for Display Transaction
经过一些尝试,发现:
1、该附录中,有两个WSDL文件,两个只差一行
2、两个文件格式都是错误的
这标准出的也太坑爹了吧。
具体修改方式如下:
1、字符集修改为utf-8
2、在文件最后,增加节点结束节点“definitions”
3、types节点增加前缀,变为“s:types”
4、所有的mime:content type=”text/html”,都修改为mime:content type=”text/xml”
然后就OK了
修改后的WSDL文件如下:
<?xml version="1.0" encoding="utf-8"?> <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://rsna.org/ihe/IHERetrieveForDisplay" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://rsna.org/ihe/IHERetrieveForDisplay" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Defines the types available for the parameters --> <!-- May also include the return type definitions --> <s:types> <s:schema elementFormDefault="qualified" targetNamespace="http://rsna.org/ihe/IHERetrieveForDisplay"> <!-- Add any items that control the returned values list or type here --> <!-- Add or remove items in the actual supplied WSDL to show the available types. --> <s:simpleType name="summaryRequestType"> <s:restriction base="s:string"> <s:enumeration value="SUMMARY" /> <s:enumeration value="SUMMARY-RADIOLOGY" /> <s:enumeration value="SUMMARY-CARDIOLOGY" /> <s:enumeration value="SUMMARY-LABORATORY" /> <s:enumeration value="SUMMARY-SURGERY" /> <s:enumeration value="SUMMARY-EMERGENCY" /> <s:enumeration value="SUMMARY-DISCHARGE" /> <s:enumeration value="SUMMARY-ICU" /> <s:enumeration value="SUMMARY-RX" /> </s:restriction> </s:simpleType> <s:simpleType name="listRequestType"> <s:restriction base="s:string"> <s:enumeration value="LIST-ALLERGIES" /> <s:enumeration value="LIST-MEDS" /> </s:restriction> </s:simpleType> <!-- Please list all content types available, and remove those not available. --> <s:simpleType name="contentType"> <s:restriction base="s:string"> <s:enumeration value="text/html" /> </s:restriction> </s:simpleType> <!-- Indicates that this item is a returned rows restriction --> <s:simpleType name="ReturnedResultCount" type="s:positiveInteger" /> <!-- Please use the string "Search" as a prefix for all search criteria, and list below --> <!-- Indicates that this item is a search string --> <s:simpleType name="SearchString" type="s:string" /> </s:schema> </s:types> <message name="RetrieveSummaryInfoHttpGetIn"> <!-- Add other parameters here if they are available, using types defined above. --> <part name="requestType" type="summaryRequestType" /> <part name="patientID" type="SearchString" /> <part name="lowerDateTime" type="s:dateTime" /> <part name="upperDateTime" type="s:dateTime" /> <part name="mostRecentResults" type="ReturnedResultCount" /> </message> <message name="RetrieveSummaryInfoHttpGetOut"> <!-- If a complex type is defined for the return value, then it is suggested that --> <!-- it be used here instead of s0:string. If a complex type is allowed as one --> <!-- of the options, but an arbitrarily formatted string is also allowed, then create --> <!-- a union type here that allows either option. --> <part name="Body" element="s0:string" /> </message> <message name="RetrieveListInfoHttpGetIn"> <!-- Add other parameters here if they are available, using types defined above. --> <part name="requestType" type="listRequestType" /> <part name="patientID" type="SearchString" /> </message> <message name="RetrieveListInfoHttpGetOut"> <!-- If a complex type is defined for the return value, then it is suggested that --> <!-- it be used here instead of s0:string. If a complex type is allowed as one --> <!-- of the options, but an arbitrarily formatted string is also allowed, then create --> <!-- a union type here that allows either option. --> <part name="Body" element="s0:string" /> </message> <message name="RetrieveDocumentHttpGetIn"> <!-- Add other parameters here if they are available, using types defined above. --> <!-- It is recommended that one of the sub-types of SearchUID is chosen here --> <!-- Especially if SearchStudyUID is allowed, then the display client can know that --> <!-- it is permissible to use a dicom uid here --> <part name="documentUID" type="SearchString" /> <part name="contentType" type="contentType" /> </message> <message name="RetrieveDocumentHttpGetOut"> <!-- If a complex type is defined for the return value, then it is suggested that --> <!-- it be used here instead of s:string. If a complex type is allowed as one --> <!-- of the options, but an arbitrarily formatted string is also allowed, then create --> <!-- a union type here that allows either option. --> <part name="Body" element="s:string" /> </message> <portType name="IHERetrieveForDisplayHttpGet"> <operation name="RetrieveSummaryInfo"> <input message="s0:RetrieveSummaryInfoHttpGetIn" /> <output message="s0:RetrieveSummaryInfoHttpGetOut" /> </operation> <operation name="RetrieveListInfo"> <input message="s0:RetrieveListInfoHttpGetIn" /> <output message="s0:RetrieveListInfoHttpGetOut" /> </operation> <operation name="RetrieveDocument"> <input message="s0:RetrieveDocumentHttpGetIn" /> <output message="s0:RetrieveDocumentHttpGetOut" /> </operation> </portType> <binding name="IHERetrieveForDisplayHttpGet" type="s0:IHERetrieveForDisplayHttpGet"> <http:binding verb="GET" /> <operation name="RetrieveSummaryInfo"> <http:operation location="/IHERetrieveSummaryInfo" /> <input> <http:urlEncoded /> </input> <output> <mime:content type="text/xml" /> <!--mime:content type="text/html" /--> </output> </operation> <operation name="RetrieveListInfo"> <http:operation location="/IHERetrieveListInfo" /> <input> <http:urlEncoded /> </input> <output> <mime:content type="text/xml" /> <!--mime:content type="text/html" /--> </output> </operation> <operation name="RetrieveDocument"> <http:operation location="/IHERetrieveDocument" /> <input> <http:urlEncoded /> </input> <!-- The type of the output should be restricted on a per-server basis to the types --> <!-- actually provided. --> <output> <mime:content type="text/xml" /> <!--mime:content type="text/html" /> <mime:content type="application/x-hl7-cda-level-one+xml" /> <mime:content type="application/pdf" /> <mime:content type="image/jpeg" /--> </output> </operation> </binding> <!-- Bind the actual service here --> <service name="IHERetrieveForDisplay"> <port name="IHERetrieveForDisplayHttpGet" binding="s0:IHERetrieveForDisplayHttpGet"> <http:address location="http://localhost/" /> </port> </service> </definitions>