users@jax-rpc.java.net

Setting Encryption Target in XWS security config files.

From: Hemant <gahankari_at_hotmail.com>
Date: Mon, 31 Oct 2005 09:11:37 +0530

I am trying to put a encryption target like mentioned below

   <xwss:JAXRPCSecurity xmlns:ans1="http://java.sun.com/blueprints/ns/po" xmlns:xwss="http://java.sun.com/xml/ns/xwss/config" >
    <xwss:Service>
        <xwss:SecurityConfiguration dumpMessages="true">
        <xwss:Encrypt >
         <xwss:X509Token certificateAlias="s1as"/>
                <xwss:Target type="xpath" >//ans1:poId</xwss:Target>
                           </xwss:Encrypt>
        </xwss:SecurityConfiguration>
    </xwss:Service>
    <xwss:SecurityEnvironmentHandler>
        sample.ClientSecurityEnvironmentHandler
    </xwss:SecurityEnvironmentHandler>
</xwss:JAXRPCSecurity>

but I am getting an error --> Caught an exception com.sun.xml.wss.XWSSecurityRuntimeException: javax.xml.transform.TransformerException: Prefix must resolve to a namespace: ans1

For a soap message

        <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoaporg/soap/envelope/" xmlns:enc="http://schemas.xmlsoaporg/soap/encoding/" xmlns:ns0="urn:SchemaDefinedPurchaseOrderService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <env:Body>
      <ns0:submitPO>
      <inputDoc>
      <ans1:poId xmlns:ans1="http://java.sun.com/blueprints/ns/po">123--456</ans1:poId>
      <ans1:createDate xmlns:ans1="http://java.sun.com/blueprints/ns/po">2005-10-30</ans1:createDate>
      <ans1:shipTo xmlns:ans1="http://java.sun.com/blueprints/ns/po">
      <ans1:street>a</ans1:street>
      <ans1:city>b</ans1:city>
      <ans1:state>c</ans1:state>
      <ans1:postalCode>d</ans1:postalCode>
      </ans1:shipTo>
      <ans1:billTo xmlns:ans1="http://java.sun.com/blueprints/ns/po">
      <ans1:street>a</ans1:street>
      <ans1:city>b</ans1:city>
      <ans1:state>c</ans1:state>
      <ans1:postalCode>d</ans1:postalCode>
      </ans1:billTo>
      <ans1:items xmlns:ans1="http://java.sun.com/blueprints/ns/po">
      <ans1:itemId>L1</ans1:itemId>
      <ans1:price>5.5</ans1:price>
      <ans1:quantity>5</ans1:quantity>
      </ans1:items>
      </inputDoc>
      </ns0:submitPO>
      </env:Body>
      </env:Envelope>

Thanks

Hemant