Note: forwarded message attached.
       
---------------------------------
 Now you can chat without downloading messenger. Click here to know how.
--- Begin Message ---
Respected Sir,
  I am sending marketservice wsdl file and marketservice java file in 
attachment. I also sending jndi-config file and namspace to package file in 
attachment.
   
  This error occured when I execute command -line client that is wsrf-query.
   
   
  Thanking you very much.
   
  With Regards,
  Amee Desai
   
   
   
   
  

Zeeshan Ali Shah <[EMAIL PROTECTED]> wrote:
  Hi Desai,
It seems that you are not implemented the exact method on the GT service side 
as it is in the WSDL . Please check the exact name. 
If you can provide code snippet from wsdl-port type and java service , that 
would be very easy to figure out the problem : 
Send also Jndi config file and if any NStoPackage file if you used 

BTW: you get this error on client side right ?

Zeeshan

Ami Desai wrote:     Respected Sir,
   
  When I try to run below mentioned query 
  [EMAIL PROTECTED] bookchapter]$ wsrf-query -s 
http://10.100.84.17:8080/wsrf/services/sws/examples/MarketService 
"//*[local-name()='Entry'][./
*/*/*[local-name()='SellerMarket']/text()='Bhopal' and '2000']"
I will get following error:
  Error: org.globus.wsrf.security.SecurityException: [SEC]Operation name could 
not be determined
  Please solve this problem.
   
  Thanking you very much.
   
  With Regards,
  Amee Desai
  
  
---------------------------------
  Save all your chat conversations. Find them online. 


       
---------------------------------
 Bollywood, fun, friendship, sports and more. You name it,  we have it.
package org.sws.examples.services.market.impl;

import java.rmi.RemoteException;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.addressing.Address;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.types.URI;


import org.globus.wsrf.encoding.ObjectDeserializer;
import org.globus.mds.aggregator.types.AggregatorContent;
import org.globus.mds.aggregator.types.AggregatorData;

import org.sws.examples.stubs.SellerService.SellerPortType;
import org.sws.examples.stubs.BuyerService.BuyerPortType;
import 
org.sws.examples.stubs.BuyerService.service.BuyerServiceAddressingLocator;
import 
org.sws.examples.stubs.SellerService.service.SellerServiceAddressingLocator;

import org.sws.examples.stubs.CropPriceService.CropPricePortType;
import 
org.sws.examples.stubs.CropPriceService.service.CropPriceServiceAddressingLocator;
import org.sws.examples.stubs.CropPriceService.CropPrice;

import org.sws.examples.stubs.VehicleFeeService.VehicleFeePortType;
import 
org.sws.examples.stubs.VehicleFeeService.service.VehicleFeeServiceAddressingLocator;
import org.sws.examples.stubs.VehicleFeeService.VehicleFee;

import org.sws.examples.stubs.MarketFeeService.MarketFeePortType;
import 
org.sws.examples.stubs.MarketFeeService.service.MarketFeeServiceAddressingLocator;
import org.sws.examples.stubs.MarketFeeService.MarketFee;


import org.globus.wsrf.NoSuchResourceException;
import org.globus.wsrf.ResourceContext;
import org.globus.wsrf.ResourceContextException;
import org.sws.examples.stubs.MarketService.MarketPropertiesResponse;
import org.sws.examples.stubs.MarketService.MarketProperties;
import org.oasis.wsrf.properties.QueryExpressionType;
import org.oasis.wsrf.properties.QueryResourcePropertiesResponse;
import org.oasis.wsrf.properties.QueryResourceProperties_Element;
import org.oasis.wsrf.properties.QueryResourceProperties_PortType;
import org.oasis.wsrf.properties.WSResourcePropertiesServiceAddressingLocator;
import org.oasis.wsrf.servicegroup.EntryType;
import org.oasis.wsrf.lifetime.Destroy;
import org.globus.wsrf.WSRFConstants;
import org.globus.wsrf.security.SecurityManager;



import java.util.Vector;
import javax.xml.namespace.*;
import java.io.*;
import org.apache.neethi.PolicyEngine;
import org.apache.neethi.PolicyOperator;
import org.apache.neethi.Policy;
import java.util.*;
import org.apache.neethi.All;
import org.apache.neethi.builders.xml.XmlPrimtiveAssertion;
import org.apache.axiom.om.impl.llom.*;


public class MarketService {


                Vector v=null;
                Vector sellerVector=null;
                Vector buyerVector=null;
                EndpointReferenceType[] sellerEPR;
                EndpointReferenceType[] buyerEPR;
                EndpointReferenceType[] tempEPR;
                String hj;
                String tradingCity="";
                String tradingPolicy="";

        private MarketResource getResource() throws RemoteException {
                Object resource = null;
                try {
                        System.out.println("\n\n\n\nInside getResource() 
Method");
                        resource = 
ResourceContext.getResourceContext().getResource();
                        System.out.println("\n\n\n\nOutside getResource() 
Method");
                } catch (Exception e) {
                        e.printStackTrace();
                }

                MarketResource marketResource = (MarketResource) resource;
                return marketResource;
        }


        public MarketPropertiesResponse setMarketProperties(MarketProperties 
params) throws RemoteException {
                String identity = SecurityManager.getManager().getCaller();
                String marketCity=params.getMarketCity();
                tradingCity=marketCity;
                String marketPolicy=params.getMarketPolicy();
                tradingPolicy=marketPolicy;
                MarketResource marketResource = getResource();

                marketResource.setMarketCityRP(marketCity);
                marketResource.setMarketPolicyRP(marketPolicy);
                                   
                matchBuyerSeller(marketCity,marketPolicy);
                return new MarketPropertiesResponse();
        }


        


        public void matchBuyerSeller(String marketCity,String marketPolicy)
        {
System.out.println("Inside match buyer and seller\n");
//policy1=params.getPolicy();
System.out.println("hellopolicy"+marketPolicy);
try{
                        FileInputStream fis = new 
FileInputStream("/home//sanjay//gbp1//policy.xml");
                        Policy policy = PolicyEngine.getPolicy(fis);
                        Iterator alternatives = policy.getAlternatives();
                        XmlPrimtiveAssertion xmlPrim;
                        Iterator alternatives1;
                        OMAttributeImpl xmlPrim1;
                        String z[];
                        int milli;
                        String k[];
                        String av[];
                        List assertionList = (List) alternatives.next();
                        OMElementImpl imp;
                        Iterator i2;
int expt;
//String market = ;
int expt1;//=2000;
k=new String[assertionList.size()];
av=new String[assertionList.size()];
z=new String[assertionList.size()];
for(int i=0;i<assertionList.size();i++){
av[i]="0";
z[i]="0";
}
                for(int i=0;i<assertionList.size();i++){
                                xmlPrim = 
(XmlPrimtiveAssertion)assertionList.get(i);
                                k[i]=(xmlPrim.getName()).getLocalPart();
                                System.out.println("String:k["+i+"]="+k[i]);
                                //seller.setStatus(k);
                                alternatives1 = 
(xmlPrim.getValue()).getAllAttributes();
                                while(alternatives1.hasNext()){
                                        xmlPrim1 = 
(OMAttributeImpl)alternatives1.next();
                                        
System.out.println("Attribute:"+xmlPrim1.getLocalName());
                                        z[i]=xmlPrim1.getAttributeValue();
                                        System.out.println("fdfsfds");
                                        
System.out.println("Zvalue:z["+i+"]"+z[i]);     
                                                                }
                                        
i2=(xmlPrim.getValue()).getChildElements();
                                        while(i2.hasNext()){
                                                        imp = (OMElementImpl) 
i2.next();
                                                        
av[i]=imp.getLocalName();
                                                        
System.out.println("String:av["+i+"]="+av[i]);
                                                        
System.out.println("Text"+imp.getText());   
                                                                }
                                        hj=(xmlPrim.getValue()).getText();
                                        //System.out.println("hj"+hj);
                                        if(hj!=""){
                                                System.out.println("Text"+hj);}
                                        
System.out.println("------------------------------------------------------");
                                                        }
                                                        
expt1=Integer.parseInt(marketPolicy);
System.out.println("Policy:"+expt1);
expt=Integer.parseInt(hj);
System.out.println("Expiration Time:"+expt);

if(expt>expt1){ 

        tradingCity=marketCity;
        tradingPolicy=marketPolicy;
                QueryResourcePropertiesResponse queryResponse=null;
                
                queryResponse=fireXpathQuery1("seller",marketCity,marketPolicy);

                MessageElement[] sellerEntries = queryResponse.get_any();

                if (sellerEntries == null || sellerEntries.length == 0)
                {
                        System.out.println("No sellers active in this market");

                }
                else
                {
                        storeEntries(queryResponse,"seller",sellerEntries);
                        
                        queryResponse=null;
                        queryResponse=fireXpathQuery("buyer",marketCity);
                        MessageElement[] buyerEntries = queryResponse.get_any();
                        if (buyerEntries == null || buyerEntries.length == 0)
                        {
                                if(sellerEntries!=null ||sellerEntries.length 
!= 0)
                                {
                                        performSellerTrade(sellerEPR);
                                }
                                System.out.println("No buyers active in this 
market");
                                        
                        }
                        else
                        {
                        storeEntries(queryResponse,"buyer",buyerEntries);
                        }
                }
        }
}

catch (FileNotFoundException e) {
                        System.out.println("Cannot get resource: ");// + 
e.getMessage());
                        throw new RuntimeException();
                }

               }    


        QueryResourcePropertiesResponse fireXpathQuery(String type,String 
marketCity)
        {

                String 
indexURI="http://10.100.84.17:8080/wsrf/services/DefaultIndexService";;
                String xpathSellerQuery,xpathBuyerQuery="";
                EndpointReferenceType indexEPR = new EndpointReferenceType();
                try {
                        indexEPR.setAddress(new Address(indexURI));
                } catch (Exception e) {
                        e.printStackTrace();
                }

                WSResourcePropertiesServiceAddressingLocator queryLocator;
                queryLocator = new 
WSResourcePropertiesServiceAddressingLocator();
                QueryResourceProperties_PortType query = null;
                try {
        query = queryLocator.getQueryResourcePropertiesPort(indexEPR);
                } catch (Exception e) {
                        e.printStackTrace();
                }


                

//if(type.equals("buyer"))
//{
xpathSellerQuery 
="//*[local-name()='Entry'][./*/*/*[local-name()='BuyerMarket']/text()='"+ 
marketCity +"']";
//}


                QueryExpressionType queryExpr = new QueryExpressionType();
                try {
                        queryExpr.setDialect(new 
URI(WSRFConstants.XPATH_1_DIALECT));
                } catch (Exception e) {
                        e.printStackTrace();
                }
                queryExpr.setValue(xpathSellerQuery);
                QueryResourceProperties_Element queryRequest = new 
QueryResourceProperties_Element(
                                queryExpr);

                QueryResourcePropertiesResponse queryResponse = null;
                try {
                        queryResponse = 
query.queryResourceProperties(queryRequest);
                } catch (RemoteException e) {
                        e.printStackTrace();
                }
        

                return queryResponse;


                
        }

        QueryResourcePropertiesResponse fireXpathQuery1(String type,String 
marketCity,String marketPolicy)
        {

                String 
indexURI="http://10.100.84.17:8080/wsrf/services/DefaultIndexService";;
                String xpathSellerQuery,xpathBuyerQuery="";
                EndpointReferenceType indexEPR = new EndpointReferenceType();
                try {
                        indexEPR.setAddress(new Address(indexURI));
                } catch (Exception e) {
                        e.printStackTrace();
                }

                WSResourcePropertiesServiceAddressingLocator queryLocator;
                queryLocator = new 
WSResourcePropertiesServiceAddressingLocator();
                QueryResourceProperties_PortType query = null;
                try {
        query = queryLocator.getQueryResourcePropertiesPort(indexEPR);
                } catch (Exception e) {
                        e.printStackTrace();
                }


                

//if(type.equals("seller"))
//{
xpathSellerQuery 
="//*[local-name()='Entry'][./*/*/*[local-name()='SellerMarket']/text()='"+ 
marketCity +"' and /text()='"+ marketPolicy +"']";

System.out.println("SellerQuery\n"+xpathSellerQuery);
//}
        QueryExpressionType queryExpr = new QueryExpressionType();
                try {
                        queryExpr.setDialect(new 
URI(WSRFConstants.XPATH_1_DIALECT));
                } catch (Exception e) {
                        e.printStackTrace();
                }
                queryExpr.setValue(xpathSellerQuery);
                QueryResourceProperties_Element queryRequest = new 
QueryResourceProperties_Element(
                                queryExpr);

                QueryResourcePropertiesResponse queryResponse = null;
                try {
                        queryResponse = 
query.queryResourceProperties(queryRequest);
                } catch (RemoteException e) {
                        e.printStackTrace();
                }
        

                return queryResponse;


                
        }

        void storeEntries(QueryResourcePropertiesResponse queryResponse,String 
type,MessageElement[] entries)
        {

                
                Vector tmpVector=new Vector();


        
                EndpointReferenceType[] tempEPR=new 
EndpointReferenceType[entries.length];
                

                for(int m=0;m<entries.length;m=m+1)
                {
                        
                        tempEPR[m]=new EndpointReferenceType();
                }
                


                                
                System.out.println("\nentries.length"+entries.length+"\n");
                for (int i = 0; i < entries.length; i++)
                {


        
                        try {
                                int j=0;
                                EntryType entry = (EntryType) 
ObjectDeserializer.toObject(
                                                        entries[i], 
EntryType.class);
                                if(type.equals("seller"))
                                {
                                        tempEPR[i]=entry.getMemberServiceEPR();
                                //      System.out.println("\ni 4 
seller"+i+"\n");
                                }       
                                else
                                {
                                        tempEPR[i]=entry.getMemberServiceEPR();
                                //      System.out.println("\n i 4 
buyer"+i+"\n");                                      
                                }
                                AggregatorContent content = (AggregatorContent) 
entry
                                                        .getContent();
                                AggregatorData data = 
content.getAggregatorData();

                                
                                String cropName = data.get_any()[0].getValue();
                                tmpVector.addElement(cropName);
                                j=j+1;

                                String strCropQty = 
data.get_any()[1].getValue();
                                float cropQuantity= 
Float.parseFloat(strCropQty);
                                tmpVector.addElement(new Float(cropQuantity));
                                j=j+1;
        
                                        
                                String cropVariety = 
data.get_any()[2].getValue();
                                tmpVector.addElement(cropVariety);
                                j=j+1;


                                String market = data.get_any()[3].getValue();
                                tmpVector.addElement(market);
                                j=j+1;


                                if(type.equals("seller"))
                                {

                                        String strExpectedPrice = 
data.get_any()[4].getValue();
                                        float expectedPrice= 
Float.parseFloat(strExpectedPrice);
                                        tmpVector.addElement(new 
Float(expectedPrice));
                                        j=j+1;

                                
                                        String tradeMode = 
data.get_any()[5].getValue();
                                        tmpVector.addElement(tradeMode);
                                        j=j+1;

        
                                        /*String indirectTradeCity = 
data.get_any()[6].getValue();
                                        tmpVector.addElement(indirectTradeCity);
                                        j=j+1;*/



                                        String strEarning = 
data.get_any()[6].getValue();
                                        float earning= 
Float.parseFloat(strEarning);
                                        tmpVector.addElement(new 
Float(earning));
                                        j=j+1;


                                   }
                                   else
                                   {
                                        String strOfferedPrice = 
data.get_any()[4].getValue();          

                                        System.out.println("Offered Price:"+ 
strOfferedPrice);

                                        float offeredPrice= 
Float.parseFloat(strOfferedPrice);
                                        tmpVector.addElement(new 
Float(offeredPrice));
                                                
        
                                        
                                        String strAmountSpent = 
data.get_any()[5].getValue();
                                        System.out.println("Amount Spent:"+ 
strAmountSpent);

                                        float amountSpent= 
Float.parseFloat(strAmountSpent);

                                        tmpVector.addElement(new 
Float(amountSpent));

                                   }    
                                        
                        
                                }
                                catch(Exception e)
                                {
                                        e.printStackTrace();
                                }               
                                        
                }
                if(type.equals("seller"))
                {
                        sellerVector=(Vector)tmpVector.clone();
                        sellerEPR=new EndpointReferenceType[tempEPR.length];
                        System.out.println("\nno of 
sellers::"+tempEPR.length+"\n");
                        for(int k=0;k<tempEPR.length;k=k+1)
                        {
                                sellerEPR[k]=tempEPR[k];
                                
                        }

                }
                
                
                if(type.equals("buyer"))
                {
                        buyerVector=(Vector)tmpVector.clone();
                        System.out.println("\nbuyerVector.size coz 
clone"+buyerVector.size()+"\n");                     
                        buyerEPR=new EndpointReferenceType[tempEPR.length];
                        System.out.println("\nno of 
sellers::"+tempEPR.length+"\n");                    
                        for(int k=0;k<tempEPR.length;k=k+1)
                        {
                                buyerEPR[k]=tempEPR[k];
                        }

                        
                        performTrade(sellerEPR,buyerEPR);
                }
                                

        } 


        void performTrade(EndpointReferenceType[] 
sellerEPR,EndpointReferenceType[] buyerEPR)
        {
                
                float demandDiff=0;
                int sellerCount=sellerVector.size();

                int buyerCount= buyerVector.size();
                int k=-1;
int flag;
int co=0;
String temp;

                for(int i=0;i<sellerCount;i=i+8)
                {
                        k=k+1;
                        String sellerCrop=(String)sellerVector.elementAt(i);
                        String tradeMode=(String)sellerVector.elementAt(i+5);
                

                        if(tradeMode.equals("indirect"))
                        {
                                float 
sellerQuantity=((Float)sellerVector.elementAt(i+1)).floatValue();
                                
performIndirectTrade(sellerEPR[k],sellerCrop,sellerQuantity);
                                continue;
                        }
                        
                        int m=-1;
                        for(int j=0;j<buyerCount;j=j+6)
                        {
                                m=m+1;  
                                String 
buyerCrop=(String)buyerVector.elementAt(j);
String a[]={"sindhi","kamla","dandi"};
flag=0;

for(int bn=0;bn<a.length;bn++){
for(int h=0;h<buyerCrop.length();h++)
{
if(buyerCrop.charAt(h)==a[bn].charAt(h)){co++;System.out.println(co);}
System.out.println("h="+h);
if(a[bn].length()==co){flag=1;
break;
}
}
}
System.out.println("Flag="+flag);
                                  
                                if(sellerCrop.equals(buyerCrop) || flag==1)
                                {
                                        String 
sellerCropVariety=(String)sellerVector.elementAt(i+2);
                
                                        String 
buyerCropVariety=(String)buyerVector.elementAt(j+2);
                


                                        
if(sellerCropVariety.equals(buyerCropVariety))
                                        {
                                                float 
sellerQuantity=((Float)sellerVector.elementAt(i+1)).floatValue();
                
                                                float 
buyerQuantity=((Float)buyerVector.elementAt(j+1)).floatValue();           
                
                                                if(sellerQuantity!=0 && 
buyerQuantity!=0)
                                                {

                                                        
demandDiff=sellerQuantity-buyerQuantity;
                                                        
                                                        if(demandDiff>0)
                                                        {
                                                                
demandDiff=buyerQuantity;
                                                                
sellerVector.setElementAt(new Float(demandDiff),(i+1));
                                                                
buyerVector.setElementAt(new Float(0),(j+1));
                                                        }
                                                        else
                                                        {
                                                                
demandDiff=sellerQuantity;
                                                                
sellerVector.setElementAt(new Float(0),(i+1));
                                                                
buyerVector.setElementAt(new Float(demandDiff),(j+1));
                                                        }

                                                        float 
sellerExpectedAmt=((Float)sellerVector.elementAt(i+4)).floatValue();
                                                        float 
buyerOfferedAmt=((Float)buyerVector.elementAt(j+4)).floatValue();
                                                        
if(sellerExpectedAmt<=buyerOfferedAmt)
                                                        {
                                                                
if(demandDiff==buyerQuantity)
                                                                {
                                                                        j=j+1;
                                                                }
                                                                else
                                                                {
                                                                        i=i+1;
                                                                }       
                        
performDirectTrade(sellerEPR[k],buyerEPR[m],demandDiff,buyerOfferedAmt,sellerQuantity,buyerQuantity);
                                                        }
                                                
                
                                                } 

                                        
                
                                        }

                                }
                                

                        }





                }       

        
        }

        void performIndirectTrade(EndpointReferenceType sellerEPR,String 
cropName,float cropQuantity)
        {
                try
                {       
                        CropPriceServiceAddressingLocator cropPriceLocator=new 
CropPriceServiceAddressingLocator();
                        String cropPriceServiceURI 
="http://10.100.84.17:8080/wsrf/services/sws/examples/CropPriceService"; ;

                        EndpointReferenceType cropPriceServiceEndpoint = new 
EndpointReferenceType();
                        cropPriceServiceEndpoint.setAddress(new 
Address(cropPriceServiceURI));



                        CropPricePortType 
cropPricePortType=cropPriceLocator.getCropPricePortTypePort(cropPriceServiceEndpoint);
        
                        CropPrice cp=new 
CropPrice(cropName,cropQuantity,sellerEPR);
                        cropPricePortType.setCropPrice(cp);
                        

                        VehicleFeeServiceAddressingLocator 
vehicleFeeLocator=new VehicleFeeServiceAddressingLocator();
                        String vehicleFeeServiceURI 
="http://10.100.84.17:8080/wsrf/services/sws/examples/VehicleFeeService"; ;

                        EndpointReferenceType vehicleServiceEndpoint = new 
EndpointReferenceType();
                        vehicleServiceEndpoint.setAddress(new 
Address(vehicleFeeServiceURI));



                        VehicleFeePortType 
vehicleFeePortType=vehicleFeeLocator.getVehicleFeePortTypePort(vehicleServiceEndpoint);
      
                        VehicleFee vehicleFeeObj=new 
VehicleFee(cropQuantity,sellerEPR);
                        vehicleFeePortType.setVehicleFee(vehicleFeeObj);
                        
                        MarketFeeServiceAddressingLocator marketFeeLocator=new 
MarketFeeServiceAddressingLocator();
                        String marketFeeServiceURI 
="http://10.100.84.17:8080/wsrf/services/sws/examples/MarketFeeService"; ;

                        EndpointReferenceType marketServiceEndpoint = new 
EndpointReferenceType();
                        marketServiceEndpoint.setAddress(new 
Address(marketFeeServiceURI));



                        MarketFeePortType 
marketFeePortType=marketFeeLocator.getMarketFeePortTypePort(marketServiceEndpoint);
   
                        MarketFee marketFeeObj=new MarketFee(sellerEPR);
                        marketFeePortType.setMarketFee(marketFeeObj);
                        
                        SellerServiceAddressingLocator sellerInstance = new 
SellerServiceAddressingLocator();
                        SellerPortType 
seller=sellerInstance.getSellerPortTypePort(sellerEPR);          
                        seller.setStatus("Resource Instance will be deleted 
since your trading has been completed");
                        seller.destroy(new Destroy());
                        
                }
                catch(Exception e)
                {
                        e.printStackTrace();
                }



        }


        void performDirectTrade(EndpointReferenceType 
sellerEPR,EndpointReferenceType buyerEPR,float quantity,float earning,float 
sellerQuantity,float buyerQuantity)
        {

                BuyerServiceAddressingLocator buyerInstanceLocator = new 
BuyerServiceAddressingLocator();
try
                {               
                        SellerServiceAddressingLocator sellerInstance = new 
SellerServiceAddressingLocator();
                        
                        SellerPortType 
seller=sellerInstance.getSellerPortTypePort(sellerEPR);                         
         
                        BuyerPortType 
buyer=buyerInstanceLocator.getBuyerPortTypePort(buyerEPR);

                        
                        seller.setStatus("\nCrop Quantity Which will be purched 
by a buyer is "+ quantity + "Kg");
                        seller.setCropQuantity(quantity);
                        
                        seller.setStatus("\nAmount Offered to you per Kg is 
Rs"+ earning);
                        seller.setStatus("\nYour Earning is Rs"+ 
quantity*earning);
                        seller.setEarning(quantity*earning);
                
                        
                        buyer.setStatus("\nThe Crop Quantity which you will 
purchase from a seller is "+ quantity + "Kg");
                        buyer.setCropQuantity(quantity);
                        buyer.setStatus("\nAmount Offered by you per Kg is:Rs"+ 
earning);
                        buyer.setStatus("\nAmount spent by you in current 
purchase is Rs"+ quantity*earning);
                        buyer.setAmountSpent(quantity*earning);
                        
                        if(sellerQuantity==buyerQuantity)
                        {
                                buyer.setStatus("\nOne seller is getting 
destroyed..............1");
                                seller.setStatus("\nOne buyer is getting 
destroyed..............1");
                                buyer.setStatus("\nYour purchasing is over!Your 
resource instance will be destroyed");
                                seller.setStatus("\nYour crop is sold!Your 
resource instance will be destroyed");
                                seller.destroy(new Destroy());
                                buyer.destroy(new Destroy());
                        }       
                        else
                        {
                                if(sellerQuantity>buyerQuantity)
                                {
                                        seller.setStatus("\nOne buyer is 
getting destroyed.......2.");
                                        buyer.setStatus("\nYour purchasing is 
over!Your resource instance will be destroyed");
                                        buyer.destroy(new Destroy());
                                }
                                else
                                {
                                        buyer.setStatus("\nOne seller is 
getting destroyed.......3.");
                                        seller.setStatus("\nYour crop is 
sold!Your resource instance will be destroyed");
                                        seller.destroy(new Destroy());
                                }
                        }
                        
                }
                catch(Exception e)
                {
                        e.printStackTrace();
                }

                




        }                               

    
        void performSellerTrade(EndpointReferenceType[] sellerEPR)
        {
                int sellerCount=sellerVector.size();
                int k=-1;
                
                for(int i=0;i<sellerCount;i=i+8)
                {
                        k=k+1;
                        String sellerCrop=(String)sellerVector.elementAt(i);
                        String tradeMode=(String)sellerVector.elementAt(i+5);
                

                        if(tradeMode.equals("indirect"))
                        {
                                float 
sellerQuantity=((Float)sellerVector.elementAt(i+1)).floatValue();
                                
performIndirectTrade(sellerEPR[k],sellerCrop,sellerQuantity);
                        }
                        

                }               
                
        }
        


}
<?xml version="1.0" encoding="UTF-8"?>
<jndiConfig xmlns="http://wsrf.globus.org/jndi/config";>

<!-- Instance service -->
<service name="sws/examples/MarketService">
	<resource name="home" type="org.sws.examples.services.market.impl.MarketResourceHome">
	<resourceParams>

		<parameter>
			<name>resourceClass</name>
			<value>org.sws.examples.services.market.impl.MarketResource</value>
		</parameter>

		<parameter>
			<name>factory</name>
			<value>org.globus.wsrf.jndi.BeanFactory</value>
		</parameter>

		<parameter>
			<name>resourceKeyType</name>
			<value>java.lang.String</value>
		</parameter>

		<parameter>
			<name>resourceKeyName</name>
			<value>{http://www.securingwebservices.org/namespaces/examples/MarketService}MarketResourceKey</value>
		</parameter>

		<parameter>
			<name>instanceServicePath</name>
			<value>sws/examples/MarketService</value>
		</parameter>

	</resourceParams>
	</resource>
</service>


</jndiConfig>
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MarketService"
    
targetNamespace="http://www.securingwebservices.org/namespaces/examples/MarketService";
    xmlns="http://schemas.xmlsoap.org/wsdl/";
    
xmlns:tns="http://www.securingwebservices.org/namespaces/examples/MarketService";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    
xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
   
xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl";
    
  xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor";
        
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

<wsdl:import 
    namespace=
    
"http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl";
    location="../../wsrf/properties/WS-ResourceProperties.wsdl" />

    


<!--============================================================

                      T Y P E S
                      
  ============================================================-->
<types>
<xsd:schema 
targetNamespace="http://www.securingwebservices.org/namespaces/examples/MarketService";
    
xmlns:tns="http://www.securingwebservices.org/namespaces/examples/MarketService";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    

        <!-- REQUESTS AND RESPONSES -->
        
        <xsd:element name="marketProperties">
        <xsd:complexType>
                <xsd:sequence>
                        <xsd:element ref="marketCity" type="xsd:string"/>
                        <xsd:element ref="marketPolicy" type="xsd:string"/>
                <!--    <xsd:element ref="cropQuantity" type="xsd:float"/>
                        <xsd:element ref="cropVariety" type="xsd:string"/>
                        <xsd:element ref="market" type="xsd:string"/>
                        <xsd:element ref="offeredPrice" type="xsd:float"/>
                        <xsd:element ref="amountSpent" type="xsd:float"/>-->
                </xsd:sequence>
        </xsd:complexType>
        </xsd:element>

        

        <xsd:element name="marketPropertiesResponse">
                <xsd:complexType/>
        </xsd:element>

        
<!--    <xsd:element name="getCropNameRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getCropNameRPResponse" type="xsd:string"/>

        <xsd:element name="getCropQuantityRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getCropQuantityRPResponse" type="xsd:float"/>

        <xsd:element name="getCropVarietyRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getCropVarietyRPResponse" type="xsd:string"/>


        <xsd:element name="getMarketRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getMarketRPResponse" type="xsd:string"/>

        <xsd:element name="getOfferedPriceRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getOfferedPriceRPResponse" type="xsd:float"/>
        
        
        <xsd:element name="getAmountSpentRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getAmountSpentRPResponse" type="xsd:float"/>-->
        


        <!-- RESOURCE PROPERTIES -->

        <xsd:element name="MarketCity" type="xsd:string"/>
        <xsd:element name="MarketPolicy" type="xsd:string"/>
<!--    <xsd:element name="CropName" type="xsd:string"/>
        <xsd:element name="CropQuantity" type="xsd:float"/>
        <xsd:element name="CropVariety" type="xsd:string"/>
        <xsd:element name="Market" type="xsd:string"/>
        <xsd:element name="OfferedPrice" type="xsd:float"/>
        <xsd:element name="AmountSpent" type="xsd:float"/>-->




        <xsd:element name="MarketResourceProperties">
        <xsd:complexType>
                <xsd:sequence>
                        <xsd:element ref="tns:MarketCity" minOccurs="1" 
maxOccurs="1"/>
                        <xsd:element ref="tns:MarketPolicy" minOccurs="1" 
maxOccurs="1"/>
<!--                    <xsd:element ref="tns:CropName" minOccurs="1" 
maxOccurs="1"/>
                        <xsd:element ref="tns:CropQuantity" minOccurs="1" 
maxOccurs="1"/>
                        <xsd:element ref="tns:CropVariety" minOccurs="1" 
maxOccurs="1"/>
                        <xsd:element ref="tns:Market" minOccurs="1" 
maxOccurs="1"/>
                        <xsd:element ref="tns:OfferedPrice" minOccurs="1" 
maxOccurs="1"/>
                        <xsd:element ref="tns:AmountSpent" minOccurs="1" 
maxOccurs="1"/>-->
                </xsd:sequence>
        </xsd:complexType>
        </xsd:element>
        
</xsd:schema>
</types>


<!--============================================================

                       M E S S A G E S
                      
  ============================================================-->
<message name="MarketInputMessage">
        <part name="parameters" element="tns:marketProperties"/>
</message>
<message name="MarketOutputMessage">
        <part name="parameters" element="tns:marketPropertiesResponse"/>
</message>

<!-- <message name="GetCropNameRPInputMessage">
        <part name="parameters" element="tns:getCropNameRP"/>
</message>
<message name="GetCropNameRPOutputMessage">
        <part name="parameters" element="tns:getCropNameRPResponse"/>
</message>

<message name="GetCropQuantityRPInputMessage">
        <part name="parameters" element="tns:getCropQuantityRP"/>
</message>
<message name="GetCropQuantityRPOutputMessage">
        <part name="parameters" element="tns:getCropQuantityRPResponse"/>
</message>

<message name="GetCropVarietyRPInputMessage">
        <part name="parameters" element="tns:getCropVarietyRP"/>
</message>
<message name="GetCropVarietyRPOutputMessage">
        <part name="parameters" element="tns:getCropNameRPResponse"/>
</message>


<message name="GetMarketRPInputMessage">
        <part name="parameters" element="tns:getMarketRP"/>
</message>
<message name="GetMarketRPOutputMessage">
        <part name="parameters" element="tns:getMarketRPResponse"/>
</message>

<message name="GetOfferedPriceRPInputMessage">
        <part name="parameters" element="tns:getOfferedPriceRP"/>
</message>
<message name="GetOfferedPriceRPOutputMessage">
        <part name="parameters" element="tns:getOfferedPriceRPResponse"/>
</message>

<message name="GetAmountSpentRPInputMessage">
        <part name="parameters" element="tns:getAmountSpentRP"/>
</message>
<message name="GetAmountSpentRPOutputMessage">
        <part name="parameters" element="tns:getAmountSpentRPResponse"/>
</message> -->




<!--============================================================

                       P O R T T Y P E
                      
  ============================================================-->
<portType name="MarketPortType" 
         wsdlpp:extends="wsrpw:GetResourceProperty"
        wsrp:ResourceProperties="tns:MarketResourceProperties">

        <operation name="setMarketProperties">
                <input message="tns:MarketInputMessage"/>
                <output message="tns:MarketOutputMessage"/>
        </operation>
        


<!--    <operation name="setBuyerProperties">
                <input message="tns:BuyerInputMessage"/>
                <output message="tns:BuyerOutputMessage"/>
        </operation>
        
        
        <operation name="getCropNameRP">
                <input message="tns:GetCropNameRPInputMessage"/>
                <output message="tns:GetCropNameRPOutputMessage"/>
        </operation>

        <operation name="getCropQuantityRP">
                <input message="tns:GetCropQuantityRPInputMessage"/>
                <output message="tns:GetCropQuantityRPOutputMessage"/>
        </operation>

        <operation name="getCropVarietyRP">
                <input message="tns:GetCropVarietyRPInputMessage"/>
                <output message="tns:GetCropVarietyRPOutputMessage"/>
        </operation>



        <operation name="getMarketRP">
                <input message="tns:GetMarketRPInputMessage"/>
                <output message="tns:GetMarketRPOutputMessage"/>
        </operation>

        <operation name="getOfferedPriceRP">
                <input message="tns:GetOfferedPriceRPInputMessage"/>
                <output message="tns:GetOfferedPriceRPOutputMessage"/>
        </operation>

        
        
        <operation name="getAmountSpentRP">
                <input message="tns:GetAmountSpentRPInputMessage"/>
                <output message="tns:GetAmountSpentRPOutputMessage"/>
        </operation>-->


</portType>

</definitions>
http\://www.securingwebservices.org/namespaces/examples/SellerService=org.sws.examples.stubs.SellerService
http\://www.securingwebservices.org/namespaces/examples/SellerService/bindings=org.sws.examples.stubs.SellerService.bindings
http\://www.securingwebservices.org/namespaces/examples/SellerService/service=org.sws.examples.stubs.SellerService.service

http\://www.securingwebservices.org/namespaces/examples/BuyerService=org.sws.examples.stubs.BuyerService
http\://www.securingwebservices.org/namespaces/examples/BuyerService/bindings=org.sws.examples.stubs.BuyerService.bindings
http\://www.securingwebservices.org/namespaces/examples/BuyerService/service=org.sws.examples.stubs.BuyerService.service

http\://www.securingwebservices.org/namespaces/examples/GridManagerService=org.sws.examples.stubs.GridManagerService
http\://www.securingwebservices.org/namespaces/examples/GridManagerService/bindings=org.sws.examples.stubs.GridManagerService.bindings
http\://www.securingwebservices.org/namespaces/examples/GridManagerService/service=org.sws.examples.stubs.GridManagerService.service

http\://www.securingwebservices.org/namespaces/examples/MarketService=org.sws.examples.stubs.MarketService
http\://www.securingwebservices.org/namespaces/examples/MarketService/bindings=org.sws.examples.stubs.MarketService.bindings
http\://www.securingwebservices.org/namespaces/examples/MarketService/service=org.sws.examples.stubs.MarketService.service

http\://www.securingwebservices.org/namespaces/examples/CropPriceService=org.sws.examples.stubs.CropPriceService
http\://www.securingwebservices.org/namespaces/examples/CropPriceService/bindings=org.sws.examples.stubs.CropPriceService.bindings
http\://www.securingwebservices.org/namespaces/examples/CropPriceService/service=org.sws.examples.stubs.CropPriceService.service

http\://www.securingwebservices.org/namespaces/examples/VehicleFeeService=org.sws.examples.stubs.VehicleFeeService
http\://www.securingwebservices.org/namespaces/examples/VehicleFeeService/bindings=org.sws.examples.stubs.VehicleFeeService.bindings
http\://www.securingwebservices.org/namespaces/examples/VehicleFeeService/service=org.sws.examples.stubs.VehicleFeeService.service

http\://www.securingwebservices.org/namespaces/examples/MarketFeeService=org.sws.examples.stubs.MarketFeeService
http\://www.securingwebservices.org/namespaces/examples/MarketFeeService/bindings=org.sws.examples.stubs.MarketFeeService.bindings
http\://www.securingwebservices.org/namespaces/examples/MarketFeeService/service=org.sws.examples.stubs.MarketFeeService.service

--- End Message ---

Reply via email to