Error in generating XML document for SOAP communication

windysky

New member
Joined
Dec 9, 2007
Messages
1
Programming Experience
1-3
Dear all,

I am having a trouble with generating a query request for SOAP communication. I need some help with VB .Net 2005 application.
It needs to send a query and should be able to get response via SOAP interface.

System:
Windows XP Pro SP2
Microsoft .Net 2.0
Visual Basic .Net 2005 (Express)

Object: Implement the following function (Specifically 3.1. Download tasks in the reference document).
This is to get data records from the NCBI's pubchem database (public) 'pccompound' with IDs of '1' and '99'

 Sending query and getting the result through SOAP interface (defined at http://pubchem.ncbi.nlm.nih.gov/pug/pug.wsdl)
 Reference document: ftp://ftp.ncbi.nlm.nih.gov/pubchem/specifications/pubchem_pug.pdf


My code is as following.
In the last step, I am getting an error message saying there was an error in generating XML document.

Please help me.

Thank you in advance,

Mike




VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim pPCTData As New pubchemPUG.PCTData
        Dim pPCTInputData As New pubchemPUG.PCTInputData
        Dim pPCTDownload As New pubchemPUG.PCTDownload

        ' Specify the download components including the query UIDs
        Dim DownloadFormat As New pubchemPUG.PCTDownloadPCTDownload_format
        Dim DownloadCompression As New pubchemPUG.PCTDownloadPCTDownload_compression
        Dim DownloadUIDs As New pubchemPUG.PCTDownloadPCTDownload_uids

        DownloadFormat.vvalue = pubchemPUG.PCTDownloadPCTDownload_formatValue.sdf
        DownloadCompression.vvalue = pubchemPUG.PCTDownloadPCTDownload_compressionValue.gzip

        pPCTDownload.PCTDownload_format = DownloadFormat
        pPCTDownload.PCTDownload_compression = DownloadCompression

        Dim PCTQueryUids As New pubchemPUG.PCTQueryUids
        Dim PCTIDList As New pubchemPUG.PCTIDList
        Dim PCTIDListUIDs As New pubchemPUG.PCTIDListPCTIDList_uids

        ReDim PCTIDListUIDs.PCTIDList_uids_E(1)
        PCTIDListUIDs.PCTIDList_uids_E(0) = "1"
        PCTIDListUIDs.PCTIDList_uids_E(1) = "99"

        PCTIDList.PCTIDList_db = "pccompound"
        PCTIDList.PCTIDList_uids = PCTIDListUIDs

        PCTQueryUids.Item = PCTIDList
        DownloadUIDs.PCTQueryUids = PCTQueryUids
        pPCTDownload.PCTDownload_uids = DownloadUIDs

        pPCTInputData.Item = pPCTDownload
        pPCTData.Item = pPCTInputData

        ' Initialize pugservice
        Dim pubchemServ As New pubchemPUG.PUGService
        Try
            pubchemServ.RunPUG(pPCTData)
        Catch ex As Exception
            MsgBox(ex.Message.ToString)
        End Try


HTML:
<PCT-Data>
	<PCT-Data_input>
		<PCT-InputData>
			<PCT-InputData_download>
				<PCT-Download>
					<PCT-Download_uids>
						<PCT-QueryUids>
							<PCT-QueryUids_ids>
								<PCT-ID-List>
									<PCT-ID-List_db>pccompound</PCT-ID-List_db>
									<PCT-ID-List_uids>
										<PCT-ID-List_uids_E>1</PCT-ID-List_uids_E>
										<PCT-ID-List_uids_E>99</PCT-ID-List_uids_E>
									</PCT-ID-List_uids>
								</PCT-ID-List>
							</PCT-QueryUids_ids>
						</PCT-QueryUids>
					</PCT-Download_uids>
					<PCT-Download_format value="sdf"/>
					<PCT-Download_compression value="gzip"/>
				</PCT-Download>
			</PCT-InputData_download>
		</PCT-InputData>
	</PCT-Data_input>
</PCT-Data>
 
Last edited by a moderator:
Back
Top