You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by sa...@pfpc.com on 2002/09/22 23:26:32 UTC

Re: xml-rpc response is not in xml-rpc format.(secure communication)

In my case client and server communication will use XML-RPC over HTTPS.
Apache XML-RPC provides secure client class SecureXmlRpcClient.Can I use
this class like follwoing to impliment secure XmlRpc Client.


SecureXmlRpcClient xmlrpc = new SecureXmlRpcClient ("https://"+hostname+":"
+port+"/RPC2");
Vector params = new Vector (); HashMap creditCardHM = new HashMap();
creditCardHM.add("MerchantID", "1234");
creditCardHM.add("TransactionIdentifier", "101");
...
param.addElement(creditCardHM);


Object result = (Object) xmlrpc.execute ("AuthorizeTransaction", params);


I need to write custom XML response processor to get trasection result.





                                                                                                                     
                    Ryan Hoegg                                                                                       
                    <rhoegg@isisnet        To:     rpc-dev@xml.apache.org                                            
                    works.net>             cc:                                                                       
                                           Subject:     Re: xml-rpc response is not in xml-rpc format.               
                    09/21/2002                                                                                       
                    03:46 PM                                                                                         
                    Please respond                                                                                   
                    to rpc-dev                                                                                       
                                                                                                                     
                                                                                                                     



Hi Sanjeev,

If you are to send the server an XML-RPC request, but expect something
different back (even if it's in XML) you can't use the vanilla Apache
XML-RPC library to do that.  However, you may want to use the code from
the library to generate your request and then write your own custom XML
response processor to get what you ened from the server's response.

Good luck!

--
Ryan Hoegg
ISIS Networks

sanjeev.tripathi@pfpc.com wrote:

>I want to use apache xml-rpc on client site to talk to xml-rpc server to
>authorize the credit card.
>
>Here is the XML-RPC request to authorize a credit card transaction:
><?xml version="1.0"?>
><methodCall>
><methodName>AuthorizeTransaction</methodName>
><params>
><param>
><struct>
><member>
><name>MerchantID</name>
><value><string>1234</string></value>
></member>
><member>
><name>TransactionIdentifier</name>
><value><int>101</int></value>
></member>
><member>
><name>CreditCardNumber</name>
><value><base64>JfdK3s3392LL</base64></value>
></member>
><member>
><name>PurchaseAmount</name>
><value><double>52.34</double></value> // Amount
></member>
></struct>
></param>
></params>
></methodCall>
>
>The response from XML-RPC server will not be using the XML-RPC response
>format, but instead, will be sending back an XML stream of the object(s)
>requested. For example, the request is made for a credit card
authorization
>using the XML-RPC in the above example request. The response would look
>something like:
>
>
><transaction>
><identifier>101</identifier>
><result>authorized</result>
></transaction>
>
>
>Can i use apache xml-rpc in this case cause response is not in xml-rpc
>formate. if yes then i will access the response and how i will know credit
>card has ben authorized or not. if i can not apache xml-rpc then what i
can
>use to solve this case.
>
>thanks.
>
>Sanjeev Tripathi
>AssetDirections
>PFPC, Inc.
>617-338-5135
>






Re: xml-rpc response is not in xml-rpc format.(secure communication)

Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Hi Sanjeev,

The SecureXmlRpcClient class is a fairly light subclass of XmlRpcClient. 
 For your purposes I would subclass it and override the methods 
startElement and endElement (called by SAX when parsing the response).

--
Ryan Hoegg
ISIS Networks

sanjeev.tripathi@pfpc.com wrote:

>In my case client and server communication will use XML-RPC over HTTPS.
>Apache XML-RPC provides secure client class SecureXmlRpcClient.Can I use
>this class like follwoing to impliment secure XmlRpc Client.
>
>
>SecureXmlRpcClient xmlrpc = new SecureXmlRpcClient ("https://"+hostname+":"
>+port+"/RPC2");
>Vector params = new Vector (); HashMap creditCardHM = new HashMap();
>creditCardHM.add("MerchantID", "1234");
>creditCardHM.add("TransactionIdentifier", "101");
>...
>param.addElement(creditCardHM);
>
>
>Object result = (Object) xmlrpc.execute ("AuthorizeTransaction", params);
>
>
>I need to write custom XML response processor to get trasection result.
>
>
>
>
>
>                                                                                                                     
>                    Ryan Hoegg                                                                                       
>                    <rhoegg@isisnet        To:     rpc-dev@xml.apache.org                                            
>                    works.net>             cc:                                                                       
>                                           Subject:     Re: xml-rpc response is not in xml-rpc format.               
>                    09/21/2002                                                                                       
>                    03:46 PM                                                                                         
>                    Please respond                                                                                   
>                    to rpc-dev                                                                                       
>                                                                                                                     
>                                                                                                                     
>
>
>
>Hi Sanjeev,
>
>If you are to send the server an XML-RPC request, but expect something
>different back (even if it's in XML) you can't use the vanilla Apache
>XML-RPC library to do that.  However, you may want to use the code from
>the library to generate your request and then write your own custom XML
>response processor to get what you ened from the server's response.
>
>Good luck!
>
>--
>Ryan Hoegg
>ISIS Networks
>
>sanjeev.tripathi@pfpc.com wrote:
>
>  
>
>>I want to use apache xml-rpc on client site to talk to xml-rpc server to
>>authorize the credit card.
>>
>>Here is the XML-RPC request to authorize a credit card transaction:
>><?xml version="1.0"?>
>><methodCall>
>><methodName>AuthorizeTransaction</methodName>
>><params>
>><param>
>><struct>
>><member>
>><name>MerchantID</name>
>><value><string>1234</string></value>
>></member>
>><member>
>><name>TransactionIdentifier</name>
>><value><int>101</int></value>
>></member>
>><member>
>><name>CreditCardNumber</name>
>><value><base64>JfdK3s3392LL</base64></value>
>></member>
>><member>
>><name>PurchaseAmount</name>
>><value><double>52.34</double></value> // Amount
>></member>
>></struct>
>></param>
>></params>
>></methodCall>
>>
>>The response from XML-RPC server will not be using the XML-RPC response
>>format, but instead, will be sending back an XML stream of the object(s)
>>requested. For example, the request is made for a credit card
>>    
>>
>authorization
>  
>
>>using the XML-RPC in the above example request. The response would look
>>something like:
>>
>>
>><transaction>
>><identifier>101</identifier>
>><result>authorized</result>
>></transaction>
>>
>>
>>Can i use apache xml-rpc in this case cause response is not in xml-rpc
>>formate. if yes then i will access the response and how i will know credit
>>card has ben authorized or not. if i can not apache xml-rpc then what i
>>    
>>
>can
>  
>
>>use to solve this case.
>>
>>thanks.
>>
>>Sanjeev Tripathi
>>AssetDirections
>>PFPC, Inc.
>>617-338-5135
>>


Re: xml-rpc response is not in xml-rpc format.(secure communication)

Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Hi Sanjeev,

The SecureXmlRpcClient class is a fairly light subclass of XmlRpcClient. 
 For your purposes I would subclass it and override the methods 
startElement and endElement (called by SAX when parsing the response).

--
Ryan Hoegg
ISIS Networks

sanjeev.tripathi@pfpc.com wrote:

>In my case client and server communication will use XML-RPC over HTTPS.
>Apache XML-RPC provides secure client class SecureXmlRpcClient.Can I use
>this class like follwoing to impliment secure XmlRpc Client.
>
>
>SecureXmlRpcClient xmlrpc = new SecureXmlRpcClient ("https://"+hostname+":"
>+port+"/RPC2");
>Vector params = new Vector (); HashMap creditCardHM = new HashMap();
>creditCardHM.add("MerchantID", "1234");
>creditCardHM.add("TransactionIdentifier", "101");
>...
>param.addElement(creditCardHM);
>
>
>Object result = (Object) xmlrpc.execute ("AuthorizeTransaction", params);
>
>
>I need to write custom XML response processor to get trasection result.
>
>
>
>
>
>                                                                                                                     
>                    Ryan Hoegg                                                                                       
>                    <rhoegg@isisnet        To:     rpc-dev@xml.apache.org                                            
>                    works.net>             cc:                                                                       
>                                           Subject:     Re: xml-rpc response is not in xml-rpc format.               
>                    09/21/2002                                                                                       
>                    03:46 PM                                                                                         
>                    Please respond                                                                                   
>                    to rpc-dev                                                                                       
>                                                                                                                     
>                                                                                                                     
>
>
>
>Hi Sanjeev,
>
>If you are to send the server an XML-RPC request, but expect something
>different back (even if it's in XML) you can't use the vanilla Apache
>XML-RPC library to do that.  However, you may want to use the code from
>the library to generate your request and then write your own custom XML
>response processor to get what you ened from the server's response.
>
>Good luck!
>
>--
>Ryan Hoegg
>ISIS Networks
>
>sanjeev.tripathi@pfpc.com wrote:
>
>  
>
>>I want to use apache xml-rpc on client site to talk to xml-rpc server to
>>authorize the credit card.
>>
>>Here is the XML-RPC request to authorize a credit card transaction:
>><?xml version="1.0"?>
>><methodCall>
>><methodName>AuthorizeTransaction</methodName>
>><params>
>><param>
>><struct>
>><member>
>><name>MerchantID</name>
>><value><string>1234</string></value>
>></member>
>><member>
>><name>TransactionIdentifier</name>
>><value><int>101</int></value>
>></member>
>><member>
>><name>CreditCardNumber</name>
>><value><base64>JfdK3s3392LL</base64></value>
>></member>
>><member>
>><name>PurchaseAmount</name>
>><value><double>52.34</double></value> // Amount
>></member>
>></struct>
>></param>
>></params>
>></methodCall>
>>
>>The response from XML-RPC server will not be using the XML-RPC response
>>format, but instead, will be sending back an XML stream of the object(s)
>>requested. For example, the request is made for a credit card
>>    
>>
>authorization
>  
>
>>using the XML-RPC in the above example request. The response would look
>>something like:
>>
>>
>><transaction>
>><identifier>101</identifier>
>><result>authorized</result>
>></transaction>
>>
>>
>>Can i use apache xml-rpc in this case cause response is not in xml-rpc
>>formate. if yes then i will access the response and how i will know credit
>>card has ben authorized or not. if i can not apache xml-rpc then what i
>>    
>>
>can
>  
>
>>use to solve this case.
>>
>>thanks.
>>
>>Sanjeev Tripathi
>>AssetDirections
>>PFPC, Inc.
>>617-338-5135
>>