编程语言

img yuzhouhenan

格式化传送的soap消息

发表于2008/9/30 10:54:00  879人阅读

分类: web service

 call.addParameter("name",org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
 call.setReturnType(org.apache.axis.Constants.XSD_STRING);
 call.addParameter("value",org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
  call.setReturnType(org.apache.axis.Constants.XSD_STRING);

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:print soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost:8080/863/services/Hello">
   <name xsi:type="xsd:string">zcf</name>
   <value xsi:type="xsd:string">123</value>
  </ns1:print>
 </soapenv:Body>
</soapenv:Envelope>
value加密后
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:print soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost:8080/863/services/Hello">
   <name xsi:type="xsd:string">zcf</name>
   <xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><xenc:EncryptedKey><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/><ds:KeyInfo><ds:KeyValue><ds:RSAKeyValue><ds:Modulus>28cwyYW4G08LvAhAgWbEwbFqWUcvZIeCD2JNgwcOuU8pnAxvAjDJqj5SzU2PqBh64XZZ9kjl
m/CNli4z5ScxSB4kmtRX5TUUj1fK1gEEePgzUOyEsBpd0mHMIrejXCUqYtfVVUPiFbdhNovI
9fSyTIeOrxoRaIgMTLLrfbwh8aE=</ds:Modulus><ds:Exponent>AQAB</ds:Exponent></ds:RSAKeyValue></ds:KeyValue><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=Client, OU=ec, O=ec, L=BEIJING, ST=BEIJING, C=CN</ds:X509IssuerName><ds:X509SerialNumber>1206943666</ds:X509SerialNumber></ds:X509IssuerSerial><ds:X509SubjectName>CN=Client, OU=ec, O=ec, L=BEIJING, ST=BEIJING, C=CN</ds:X509SubjectName><ds:X509Certificate>MIICKjCCAZMCBEfwf7IwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQ04xEDAOBgNVBAgT
B0JFSUpJTkcxEDAOBgNVBAcTB0JFSUpJTkcxCzAJBgNVBAoTAmVjMQswCQYDVQQLEwJlYzEP
MA0GA1UEAxMGQ2xpZW50MB4XDTA4MDMzMTA2MDc0NloXDTA4MDYyOTA2MDc0NlowXDELMAkG
A1UEBhMCQ04xEDAOBgNVBAgTB0JFSUpJTkcxEDAOBgNVBAcTB0JFSUpJTkcxCzAJBgNVBAoT
AmVjMQswCQYDVQQLEwJlYzEPMA0GA1UEAxMGQ2xpZW50MIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQDbxzDJhbgbTwu8CECBZsTBsWpZRy9kh4IPYk2DBw65TymcDG8CMMmqPlLNTY+o
GHrhdln2SOWb8I2WLjPlJzFIHiSa1FflNRSPV8rWAQR4+DNQ7ISwGl3SYcwit6NcJSpi19VV
Q+IVt2E2i8j19LJMh46vGhFoiAxMsut9vCHxoQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAB1y
HzAuw8zUr5Sv+6tJK1HOgB5j6JL8AA+47t6JizBKp8AMVFvWX4wsykcbDAajxmFm4ah7ljDn
oEOqe8D5M3U6RChFV1koS0XbC4eX2P9ymszUr1LEdMZE/soM3bM70qUrKhtdT7jyvuzFKLTQ
RVzt2ZKuX9Vgl6pSb8qEqnC3</ds:X509Certificate></ds:X509Data></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>VbnvUWJgRKi+srplHwadqjEGCVJ7FVueZtVn1L9zvw8MpcqOx0iUP6mnIklepE54JfAuGE3n
dRN3rKjxBxFgpz97hKjiwoIE7+P++gNCQSFpXDf03A4qNPN9Y5a9w+dOG5eWEk3gRTz0DZRU
8dZNF80x+JTDH7XUE3DydRS6n+s=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedKey></ds:KeyInfo><xenc:CipherData><xenc:CipherValue>K5cuxfDsrm2M13+g/QqhTQEUUWxRt6LehxaIrc3uzlcm7MVjgWdeDhKky+1YindAvEh09kpA
FoKrCB4P+2o6ABqvN3Q3xRYDJOhnhpj21woahlW/9LMdDd9Yz+FHLN6RxKii3Nf/awUF0qeA
dLcJQjckasjCc3xxV/nIpv8wSGAGqYIPtS9+I2wppoW4FeFxls+VRy4y9RPs99Bci7H8lhQ6
WK3V5euAXaIScj30/4B5Z+AAQsDIpu2QZFOHtgl0UVG1IGgLV148ZxGlvw7r0Lj2M7CRBmYR
dQGVaH0ASEO6P0vJQ5huJ4QpzzAnkcLv2bf8Wzdadj9bYpXpwBiGw2Fbof12Gs+6</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData>
  </ns1:print>
 </soapenv:Body>
</soapenv:Envelope>
解密后:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:print soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost:8080/863/services/Hello">
   <name xsi:type="xsd:string">zcf</name>
   <value xmlns:ns1="http://localhost:8080/863/services/Hello" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">123</value>
  </ns1:print>
 </soapenv:Body>
</soapenv:Envelope>
阅读全文
0 0

相关文章推荐

img
取 消
img