public virtual WsMessage TwoWayAttachment(WsMessage request) { // Build request object TwoWayAttachmentRequestDataContractSerializer reqDcs; reqDcs = new TwoWayAttachmentRequestDataContractSerializer("TwoWayAttachmentRequest", "http://schemas.example.org/AttachmentService"); reqDcs.BodyParts = request.BodyParts; TwoWayAttachmentRequest req; req = ((TwoWayAttachmentRequest)(reqDcs.ReadObject(request.Reader))); // Create response object // Call service operation to process request and return response. TwoWayAttachmentResponse resp; resp = m_service.TwoWayAttachment(req); // Create response header WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/AttachmentService/TwoWayAttachmentResponse", request.Header.MessageID, m_version.AnonymousUri, null, null, null); WsMessage response = new WsMessage(respHeader, resp, WsPrefix.Wsdp); // Create response serializer TwoWayAttachmentResponseDataContractSerializer respDcs; respDcs = new TwoWayAttachmentResponseDataContractSerializer("TwoWayAttachmentResponse", "http://schemas.example.org/AttachmentService"); response.Serializer = respDcs; // Indicate that message is Mtom encoded response.BodyParts = new WsMtomBodyParts(); return(response); }
public virtual TwoWayAttachmentResponse TwoWayAttachment(TwoWayAttachmentRequest req) { // Create request header String action; action = "http://schemas.example.org/AttachmentService/TwoWayAttachment"; WsWsaHeader header; header = new WsWsaHeader(action, null, EndpointAddress, m_version.AnonymousUri, null, null); WsMessage request = new WsMessage(header, req, WsPrefix.None); // Create request serializer TwoWayAttachmentRequestDataContractSerializer reqDcs; reqDcs = new TwoWayAttachmentRequestDataContractSerializer("TwoWayAttachmentRequest", "http://schemas.example.org/AttachmentService"); request.Serializer = reqDcs; request.Method = "TwoWayAttachment"; // Indicate that this message will use Mtom encoding request.BodyParts = new WsMtomBodyParts(); // Send service request m_requestChannel.Open(); WsMessage response = m_requestChannel.Request(request); m_requestChannel.Close(); // Process response TwoWayAttachmentResponseDataContractSerializer respDcs; respDcs = new TwoWayAttachmentResponseDataContractSerializer("TwoWayAttachmentResponse", "http://schemas.example.org/AttachmentService"); respDcs.BodyParts = response.BodyParts; TwoWayAttachmentResponse resp; resp = ((TwoWayAttachmentResponse)(respDcs.ReadObject(response.Reader))); response.Reader.Dispose(); response.Reader = null; return(resp); }
public virtual WsMessage TwoWayAttachment(WsMessage request) { // Build request object TwoWayAttachmentRequestDataContractSerializer reqDcs; reqDcs = new TwoWayAttachmentRequestDataContractSerializer("TwoWayAttachmentRequest", "http://schemas.example.org/AttachmentService"); reqDcs.BodyParts = request.BodyParts; TwoWayAttachmentRequest req; req = ((TwoWayAttachmentRequest)(reqDcs.ReadObject(request.Reader))); request.Reader.Dispose(); request.Reader = null; // Create response object // Call service operation to process request and return response. TwoWayAttachmentResponse resp; resp = m_service.TwoWayAttachment(req); // Create response header WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/AttachmentService/TwoWayAttachmentResponse", request.Header.MessageID, m_version.AnonymousUri, null, null, null); WsMessage response = new WsMessage(respHeader, resp, WsPrefix.Wsdp); // Create response serializer TwoWayAttachmentResponseDataContractSerializer respDcs; respDcs = new TwoWayAttachmentResponseDataContractSerializer("TwoWayAttachmentResponse", "http://schemas.example.org/AttachmentService"); response.Serializer = respDcs; // Indicate that message is Mtom encoded response.BodyParts = new WsMtomBodyParts(); return response; }
public virtual TwoWayAttachmentResponse TwoWayAttachment(TwoWayAttachmentRequest req) { // Create request header String action; action = "http://schemas.example.org/AttachmentService/TwoWayAttachment"; WsWsaHeader header; header = new WsWsaHeader(action, null, EndpointAddress, m_version.AnonymousUri, null, null); WsMessage request = new WsMessage(header, req, WsPrefix.None); // Create request serializer TwoWayAttachmentRequestDataContractSerializer reqDcs; reqDcs = new TwoWayAttachmentRequestDataContractSerializer("TwoWayAttachmentRequest", "http://schemas.example.org/AttachmentService"); request.Serializer = reqDcs; request.Method = "TwoWayAttachment"; // Indicate that this message will use Mtom encoding request.BodyParts = new WsMtomBodyParts(); // Send service request m_requestChannel.Open(); WsMessage response = m_requestChannel.Request(request); m_requestChannel.Close(); // Process response TwoWayAttachmentResponseDataContractSerializer respDcs; respDcs = new TwoWayAttachmentResponseDataContractSerializer("TwoWayAttachmentResponse", "http://schemas.example.org/AttachmentService"); respDcs.BodyParts = response.BodyParts; TwoWayAttachmentResponse resp; resp = ((TwoWayAttachmentResponse)(respDcs.ReadObject(response.Reader))); response.Reader.Dispose(); response.Reader = null; return resp; }