vb.net - Adding a value to a repeating element in my BizTalk Orchestration Message Assignment -


i’m having trouble adding value repeating element in biztalk orchestration message assignment component. here have done. created vb.net class xsd.exe tool schema. create vb.net helper class inherits schema class , added class variable orchestration. trying create new message within assignment component. when setting values non-repeating element working , message created. i’m not sure how set value repeating element. when try code below error “inner exception: object reference not set instance of object.”. error on line “credentialslookuprequestheader.ids[0] = categoryvaluetype;”. categoryvaluetype complex type , can have more one.

-helper class

<serializable> <xmlroot("credentialslookupadaptertype")> _ public class credentialslookupadaptertype     inherits credentialslookuprequestv1_3type      public function toxmldocument() xmldocument         dim serializer new xmlserializer(gettype(credentialslookupadaptertype), new type() {gettype(credentialslookuprequestv1_3type)})         dim sb new stringbuilder         serializer.serialize(new stringwriter(sb, cultureinfo.invariantculture), me)          dim doc new xmldocument()         doc.loadxml(sb.tostring)         return doc     end function end class 

assignment component in biztalk

//create new request message credentialslookuprequest = new credentialslookuprequest_v1_3.credentialslookupadaptertype();  //create header credentialslookuprequestheader = new credentialslookuprequest_v1_3.olmheadertype();  //header values credentialslookuprequestheader.requestcategory = "retrieve"; credentialslookuprequestheader.submittingentityname = "biztalk";  //header ids categoryvaluetype = new credentialslookuprequest_v1_3.categoryvaluetype(); categoryvaluetype.category = "biztalk orchestration id"; categoryvaluetype.value = "bz000001"; credentialslookuprequestheader.ids[0] = categoryvaluetype; credentialslookuprequestheader.messagecategory = "confidential";  credentialslookuprequest.header = credentialslookuprequestheader;  msgrequest = credentialslookuprequest.toxmldocument(); 

you can use xpath assign value.. no need use helper function.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -