Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hi,

I have implemented Asynchronous webservice that receives response from different Agency. This response will be automatically redirected to my Webservice based on service URL when the request process has been finished by Agency.

I created a VB class file based on WSDL file provided by Agency.
In my Webservice class file Webmethod looks like this:

Public Function ReceiveCourtCaseEventReply(ByVal ReceiveCourtCaseEventReply1 As ReceiveCourtCaseEventReplyType) As ResponseType

Logger.Write(ReceiveCourtCaseEventReply1.ResponseMetadata.UserDefinedTrackingID)
Logger.Write(ReceiveCourtCaseEventReply1.CourtCaseEvent.CaseDocketID.ID)

Dim response As New ResponseType()
response.ResponseStatusCode ="Success"
Return response
End Function

I'm testing Webservice with SOAPUI with sample response and extracting values from given SOAP response.

My SOAP Message Format:
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
XML
<m:ReceiveCourtCaseEventReply >
            <jnet-m:ResponseMetadata>
                <jnet-m:UserDefinedTrackingID>HIT-CP-02-CR-0002432-2010-A2</jnet-m:UserDefinedTrackingID>
                <jnet-m:BackendSystemReturn>
                    <jnet-m:BackendSystemName>AOPC</jnet-m:BackendSystemName>
                    <jnet-m:BackendSystemStatusCode>SUCCESS</jnet-m:BackendSystemStatusCode>
                    <jnet-m:BackendSystemReturnCode>SUCCESS</jnet-m:BackendSystemReturnCode>
                    <jnet-m:BackendSystemReturnText>At least one CCE message returned. More records may follow.</jnet-m:BackendSystemReturnText>
                </jnet-m:BackendSystemReturn>
            </jnet-m:ResponseMetadata>
            <CourtCaseEvent>
<CaseParticipants>

<CaseDefendantParty.Person>
  <j:PersonName >
   <j:PersonGivenName>John</j:PersonGivenName>
  <j:PersonMiddleName>M.</j:PersonMiddleName>
  <j:PersonSurName>Myrla</j:PersonSurName>
  <j:PersonFullName>Myrla,John M</j:PersonFullName>
</j:PersonName>
</CaseDefendantParty.Person></CaseParticipants></CourtCaseEvent>
		</m:ReceiveCourtCaseEventReply>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How to iterate values of <CaseDefendantParty.Person> property element ?
Any solutions Please?
Thanks,
Srinivas Kalagara
Posted
Updated 18-May-11 15:25pm
v7

1 solution

I found the solution myself to this problem.

CaseDefendantParty.person is a choiceType that means its one of the choice in Enumerator.
We can extract it's sub elements by Casting or Typing to its native type, i.e, Ctype(Casedefendantparty,SubjectType).PersonName.PersonGIenName.

Hope this solution gives guys an idea to have little bit clarity in resolving similar kind of issues.


Thanks,
Srinivas Kalagara
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900