Calling Java service which uses custom policy

Sep 24, 2008 at 11:28 AM

Hi,

 I am working with a customer's Java Web service, which uses a custom policy as below:

 <

wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"

 

 

xmlns:wssp="http://www.bea.com/wls90/security/policy"

 

 

xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

 

 

wsu:Id="SignBody">

 

<

ExactlyOne xmlns="http://schemas.xmlsoap.org/ws/2004/09/policy">

 

<

All>

 

<

wssp:Integrity SignToken="false" xmlns:wls="http://www.bea.com/wls90/security/policy/wsee#part" xmlns:wssp="http://www.bea.com/wls90/security/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

 

<

wssp:SignatureAlgorithm URI="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>

 

<

wssp:CanonicalizationAlgorithm URI="http://www.w3.org/2001/10/xml-exc-c14n#"/>

 

<

wssp:Target>

 

<

wssp:DigestAlgorithm URI="http://www.w3.org/2000/09/xmldsig#sha1"/>

 

<

wssp:MessageParts Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">wsp:Body()</wssp:MessageParts>

 

</

wssp:Target>

 

<

wssp:SupportedTokens>

 

<

wssp:SecurityToken IncludeInMessage="true" TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">

 

</

wssp:SecurityToken>

 

</

wssp:SupportedTokens>

 

</

wssp:Integrity>

 

</

All>

 

</

ExactlyOne>

 

</

wsp:Policy>

 

 

My client app.config is as below:

 

<

basicHttpBinding>

 

<

binding name="SPG180Soap">

 

<

security mode="TransportWithMessageCredential">

 

<

message clientCredentialType="Certificate" />

 

</

security>

 

</

binding>

 

</

basicHttpBinding>

 

But when I make a method call, the call fails and returns an error:

"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail"

 The InnerException message is, 

 "No id attribute on element http://schemas.xmlsoap.org/soap/envelope/:Body"

 

 I am pretty new to WCF, and I don't understand why this occurs. I am seriously stuck with this. Can anyone please help me how to call the service with the above policy configured?

 Thanks in advance,

Imaya