public void ProcessMessage(ref OpenTrack.WebService.PayloadManifest PayloadManifest, ref OpenTrack.WebService.Payload payload) { OpenTrack.WebService.ProcessMessageRequest inValue = new OpenTrack.WebService.ProcessMessageRequest(); inValue.PayloadManifest = PayloadManifest; inValue.payload = payload; OpenTrack.WebService.ProcessMessageResponse retVal = ((OpenTrack.WebService.starTransport)(this)).ProcessMessage(inValue); PayloadManifest = retVal.PayloadManifest; payload = retVal.payload; }
/// <summary> /// Submit the prepared request to the OpenTrack API and get the response back for processing. /// </summary> /// <param name="request"></param> /// <remarks> /// Some of this is cribbed from http://www.starstandard.org/guidelines/Architecture/QuickStart2011v1/ch05s04.html#NETClient. /// Go ahead and read some of the STAR spec. It'll make you weep for humanity. /// </remarks> internal virtual T SubmitRequest <T>(IRequest <T> request) { // <soap:Envelope> // <soap:Header> // <wsse:Security> // <wsse:UsernameToken> // <wsse:Username>${USERNAME}</wsse:Username> // <wsse:Password>${PASSWORD}</wsse:Password> // </wsse:UsernameToken> // </wsse:Security> // <tran:PayloadManifest> // <tran:manifest contentID="Content0" namespaceURI="CrownDMSInterop" element="1" relatedID="1" version="1.0"/> // </tran:PayloadManifest> // </soap:Header> // <soap:Body> // <tran:ProcessMessage> // <tran:payload> // <tran:content id="Content0"> // ${REQUEST_CONTENT} // </tran:content> // </tran:payload> // </tran:ProcessMessage> // </soap:Body> // </soap:Envelope> using (var svc = GetStarService()) { var xml = new XmlDocument(); // Load up the request XML into a document object. xml.LoadXml(request.XML); // Create a unique request identifier. var requestId = Guid.NewGuid().ToString(); var element = xml.DocumentElement; // Create the message payload that will be processed. var payload = new OpenTrack.WebService.Payload() { content = new OpenTrack.WebService.Content[] { new OpenTrack.WebService.Content() { id = requestId, Any = element } } }; // Tell the web service how to interpret the XML we're sending along. var manifest = new OpenTrack.WebService.PayloadManifest() { manifest = new[] { new OpenTrack.WebService.Manifest() { element = element.LocalName, namespaceURI = element.NamespaceURI, contentID = requestId } } }; // Send the message and it'll load the response into the same object. svc.ProcessMessage(ref manifest, ref payload); // Take the element from the first content item of the response payload. var response = payload.content[0].Any; // Check for errors ErrorCheck(response); // Process the request with the appropriate parser/handler. return(request.ProcessResponse(response)); } }
public ProcessMessageResponse(OpenTrack.WebService.PayloadManifest PayloadManifest, OpenTrack.WebService.Payload payload) { this.PayloadManifest = PayloadManifest; this.payload = payload; }