public string ExecuteServiceMethod(string strXMLExecRequest)
 {
     return(m_gk.ExecuteServiceMethod(strXMLExecRequest));
 }
Exemplo n.º 2
0
        public static void TestServiceMethods()
        {
            // GateKeeper instance
            GateKeeper g = new GateKeeper();

            g.TraceOn = false;
            object objRes = null;
            //InternalRegistry ireg = new InternalRegistry();
            //ireg.UpdateServiceLocation( "SecurityManagerService", "http://church.psl.cs.columbia.edu:8080/security/SecurityServices.wsdl" );


            // SetupServiceSpace();
            ExecServiceMethodRequestType e = new ExecServiceMethodRequestType();

            // TODO: WeatherConditions testing webservice
            e.TreatyID    = -1820085390;         //-115276743;
            e.ServiceName = "WeatherRetriever";
            e.MethodName  = "GetTemperature";
            e.MethodName  = "GetWeather";
            e.m_ParamValue.Clear();
            e.m_ParamValue.Add("<?xml version=\"1.0\"?><string>10027</string>");

            objRes = g.ExecuteServiceMethod(e.ToXml());

            // TODO: Traffic Conditions in Chicago testing webservice

            /* e.TreatyID = -1820085390;//-115276743;
             * e.ServiceName = "CATrafficService";
             * e.MethodName = "getTraffic";
             * e.m_ParamValue.Clear();
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>209</string>" );
             *
             * objRes = g.ExecuteServiceMethod( e.ToXml() );
             * Console.Write(objRes.ToString());
             *
             * // TODO: Query for 2 different Highways
             * e.m_ParamValue.Clear();
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>5</string>" );
             *
             * objRes = g.ExecuteServiceMethod( e.ToXml() );
             * Console.Write(objRes.ToString());
             *
             *
             * e.TreatyID = -1820085390;//-115276743;
             * e.ServiceName = "GeoPinPoint";
             * e.MethodName = "GetLocation";
             * e.m_ParamValue.Clear();
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>128.59.23.57</string>" );
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>0</string>" ); // license key
             *
             *
             * e.TreatyID = -1820085390;//-115276743;
             * e.ServiceName = "ZipCodeResolver";
             * e.MethodName = "FullZipCode";
             * e.m_ParamValue.Clear();
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>0</string>" ); // license key
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>500 West 120th Street</string>" );
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>New York</string>" );
             * e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>NY</string>" );
             *
             * objRes = g.ExecuteServiceMethod( e.ToXml() );
             * Console.Write(objRes.ToString());
             *
             * //objRes = g.EnlistServicesByName( "<?xml version=\"1.0\"?><Treaty xmlns=\"http://localhost/Discus/Schema/Treaty.xsd\"><TreatyID>1000</TreatyID><ClientServiceSpace>myservicespace</ClientServiceSpace><ProviderServiceSpace>providerss</ProviderServiceSpace><ServiceInfo><ServiceName>service</ServiceName><ServiceMethod><MethodName>method</MethodName><Parameter>foo</Parameter><Parameter>bar</Parameter><NumInvokations>1</NumInvokations><Authorized>true</Authorized></ServiceMethod></ServiceInfo></Treaty>" );
             *
             * // Sql script for service invocation permission table
             * // insert into serviceinvokationpermission values(100,'BNQuoteService','getPrice','isbn',100000,'getPrice');
             * // insert into serviceinvokationpermission values(100,'XMethodsQuery','getAllServiceSummaries','',100000,'getAllServiceSummaries');
             * // insert into serviceinvokationpermission values(100,'XMethodsQuery','getServiceNamesByPublisher','PubName',100000,'getServiceNamesByPublisher');
             * // insert into serviceinvokationpermission values(100,'GeoCash','GetATMLocations','Zipcode',100000,'GetATMLocations');
             * // GeoCash
             * //e.ServiceName = "GeoCash";
             * //e.MethodName = "GetATMLocations";
             * //e.m_ParamValue.Clear();
             * //e.m_ParamValue.Add( "<?xml version=\"1.0\"?><string>10025</string>" );
             * //objRes = g.ExecuteServiceMethod( e.ToXml() );
             *
             * // Google*/
        }