xml - Java SOAP header tag and namespace only appears into response -
i have webservice deployed server 1 client doing requests aginst it. have client , server certificates established ssl connection and, in server side, build signature , client tries verify it. problem when server signs soap message looks one:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:body> <ns2:responsemessage xmlns="urn:iec62325.504:messages:1:0" xmlns:ns2="http://iec.ch/tc57/2011/schema/message"> <ns2:header> <ns2:verb>reply</ns2:verb> <ns2:noun>querydata</ns2:noun> <ns2:timestamp>2016-11-17t15:44:51z</ns2:timestamp> <signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <signedinfo> <canonicalizationmethod algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <signaturemethod algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> <reference uri=""> <transforms> <transform algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> <transform algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315"/> </transforms> <digestmethod algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> <digestvalue>yldpd7nck0lubdjokhm/uh/icad2v5ghfr+7gtwbnh0=</digestvalue> </reference> </signedinfo> <signaturevalue>iovryxas+uttpjmu+5kzvnq6p7xqhfrfd6negtarcrt/bwsizlo6qyh5nck/m67jcvthcrso0kda o/1yuezli6btlu0i9rnkrlxep7x08zrrg0scqagv//8ak4jnqdj7tr4at0lfjg/jmninaxmtcb3m py6ip5t4lvlvrpveb1g44uczmtjtcsetepj+/k+cisoqq5za4srk05bmdkkse62bgqmpmoqbpu0k 5r29wl0zxre/tit5lj/7el27mtaiqpo+9cgrofjzuiu6p8em5p5/s4c5vknwck2vzvge7vhjhuin vulbvwv0dixhc92jq2ty4btmgabaly40h2v7bg==</signaturevalue> <keyinfo> <x509data> ...
when message catched handle of client, looks this:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:header/> <s:body> <ns2:responsemessage xmlns="urn:iec62325.504:messages:1:0" xmlns:ns2="http://iec.ch/tc57/2011/schema/message"> <ns2:header> <ns2:verb>reply</ns2:verb> <ns2:noun>querydata</ns2:noun> <ns2:timestamp>2016-11-17t15:44:51z</ns2:timestamp> <signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <signedinfo> <canonicalizationmethod algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> ...
something between send , receive insertting namespace:
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
and empty tag:
< env:header/>
and this, client cannot verify signature
the webservice generated netbeans wizard throug wsdl jax-ws:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:cmsg="urn:iec62325.504:messages:1:0" xmlns:wss="urn:iec62325.504:wss:1:0" xmlns:msg="http://iec.ch/tc57/2011/schema/message" targetnamespace="urn:iec62325.504:wss:1:0"> <types> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:import namespace="urn:iec62325.504:messages:1:0" schemalocation="../xsd/urn-iec62325-504-messages-1-0.xsd"/> <xs:import namespace="http://iec.ch/tc57/2011/schema/message" schemalocation="../xsd/http-iec-ch-tc57-2011-schema-message.xsd"/> </xs:schema> </types> <message name="msgrequestmessage"> <part name="parameter" element="msg:requestmessage"/> </message> <message name="msgresponsemessage"> <part name="parameter" element="msg:responsemessage"/> </message> <message name="msgfaultmsg"> <part name="msgfaultmessage" element="msg:faultmessage"/> </message> <porttype name="port_tfedi_type"> <operation name="request"> <input message="wss:msgrequestmessage"/> <output message="wss:msgresponsemessage"/> <fault name="msgfaultmessage" message="wss:msgfaultmsg"/> </operation> </porttype> <binding name="binding_tfedi" type="wss:port_tfedi_type"> <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="request"> <soap12:operation soapactionrequired="false" style="document"/> <input> <soap12:body use="literal"/> </input> <output> <soap12:body use="literal"/> </output> <fault name="msgfaultmessage"> <soap12:fault name="msgfaultmessage" use="literal"/> </fault> </operation> </binding> <service name="serviceeme"> <port name="service_eme_port" binding="wss:binding_tfedi"> <soap12:address location="http://example.com/webservice_eme/service_eme"/> </port> </service> </definitions>
the service working don't know how avoid tag.
thank you
header mandatory field in soap message, , must first element under envelope. has qualified. client needs handle this soap standard.
Comments
Post a Comment