PDA

View Full Version : web service document-literal


cesar
May 12th, 2006, 03:47 AM
hello,

i have a web application with Spring that in the manager create a xml and sign with enveloped signature, and send it via https with java.net.URL.

i have to expose as a web service, document-literal style, put the xml that cretate the manager ant put in the soap body directly.

how can i do this??? i have find examples that use web service binding object to xml, but i think that i can't use it because i have the signed xml that i want to put in the soap body, not an object.

thanks in advance,
César.

routis
May 12th, 2006, 06:57 AM
Cesar,

What is the form of the digital signature of the XML?
If you use, for instance, XML-Signature then the signature is also XML, so you can define a XML Schema that containes both your original XML and the its signature and use it in your WSDL.

Maybe you can also follow a different approach. Use WS-Security to sign at SOAP envelop level.

cesar
May 12th, 2006, 07:34 AM
hello routis,

yes, i use XML-Signature (apache xmldsig) and the signature is also XML, like this:

<message_signed xmlns="http://.../messages">
<message Id="12345">
...
</message>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
...
<ds:Reference URI="#12345">
...
</ds:Signature>
</message_signed>

i could put the xsd that define this xml in the wsdl,
i have this xml as a String, how put the xml in the soap body???

i have seen spring-ws and axis2, but they use data binding with wsdl2java, and generate classes that mapping the xsd of wsdl... but i have the signed xml yet. how put in the soap body???

yes, ws-security... i could have to change too things.

thanks,
César.

routis
May 12th, 2006, 07:50 AM
i have this xml as a String, how put the xml in the soap body???

Although I don't understand why you have the XML only as String, in this case you can define (in the WSDL) the <xsd:any> as payload or <xsd:string>
You might find this link (http://www-128.ibm.com/developerworks/library/ws-xsdany.html) or better this (http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns3/) useful.

If you adopt the use of <xsd:string> for example, then spring-ws is straightforward