public virtual TypeCheckResponse TypeCheckRequest(TypeCheckRequest req) { // Create request header String action; action = "http://schemas.example.org/SimpleService/TypeCheckRequest"; WsWsaHeader header; header = new WsWsaHeader(action, null, ServiceEndpoint, null, EndpointAddress, null); // Create request serializer TypeCheckRequestDataContractSerializer reqDcs; reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService"); // Build soap request message byte[] soapBuffer = SoapMessageBuilder.BuildSoapMessage(header, reqDcs, req); // Send service request DpwsHttpClient httpClient; httpClient = new DpwsHttpClient(); DpwsSoapResponse response; response = httpClient.SendRequest(soapBuffer, ServiceEndpoint, false, false); // Process response TypeCheckResponseDataContractSerializer respDcs; respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService"); TypeCheckResponse resp; resp = ((TypeCheckResponse)(respDcs.ReadObject(response.Reader))); return(resp); }
public virtual Byte[] HelloWorld_SayHelloWorld_InputMessageRequest(WsWsaHeader header, XmlReader reader) { // Build request object MyEnumDataContractSerializer reqDcs; reqDcs = new MyEnumDataContractSerializer("MyEnum", "hello://Microsoft.WCF.Samples.Adapters"); MyEnum req; req = ((MyEnum)(reqDcs.ReadObject(reader))); // Create response object // Call service operation to process request and return response. MyEnum resp; resp = m_service.SayHelloWorld(req); // Create response header WsWsaHeader respHeader = new WsWsaHeader("hello://Microsoft.WCF.Samples.Adapters/HelloWorld/HelloWorld_SayHelloWorld_Output" + "MessageResponse", header.MessageID, WsWellKnownUri.WsaAnonymousUri, null, null, null); // Create response serializer MyEnumDataContractSerializer respDcs; respDcs = new MyEnumDataContractSerializer("MyEnum", "hello://Microsoft.WCF.Samples.Adapters"); // Build response message and return return(SoapMessageBuilder.BuildSoapMessage(respHeader, respDcs, resp)); }
public virtual void OneWay(OneWay req) { // Create request header String action; action = "http://schemas.example.org/SimpleService/OneWay"; WsWsaHeader header; header = new WsWsaHeader(action, null, ServiceEndpoint, null, EndpointAddress, null); // Create request serializer OneWayDataContractSerializer reqDcs; reqDcs = new OneWayDataContractSerializer("OneWay", "http://schemas.example.org/SimpleService"); // Build soap request message byte[] soapBuffer = SoapMessageBuilder.BuildSoapMessage(header, reqDcs, req); // Send service request DpwsHttpClient httpClient; httpClient = new DpwsHttpClient(); DpwsSoapResponse response; response = httpClient.SendRequest(soapBuffer, ServiceEndpoint, true, false); }
public virtual Byte[] TypeCheckRequest(WsWsaHeader header, XmlReader reader) { // Build request object TypeCheckRequestDataContractSerializer reqDcs; reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService"); TypeCheckRequest req; req = ((TypeCheckRequest)(reqDcs.ReadObject(reader))); // Create response object // Call service operation to process request and return response. TypeCheckResponse resp; resp = m_service.TypeCheck(req); // Create response header WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/SimpleService/TypeCheckResponse", header.MessageID, WsWellKnownUri.WsaAnonymousUri, null, null, null); // Create response serializer TypeCheckResponseDataContractSerializer respDcs; respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService"); // Build response message and return return(SoapMessageBuilder.BuildSoapMessage(respHeader, respDcs, resp)); }