SOAP Envelope namespace not seen in response
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 8
- Joined: Wed May 07, 2008 4:43 pm
SOAP Envelope namespace not seen in response
Hello
For logging requirement, i am creating a log message of type SOAP that contains request to our application and response from theapplication. These request and response messages are of type SOAP. The request and response messages are enclosed in CDATA tags.
After the required log message is created as an outcome of a transform action, i am not able to see the namespace of the "soapenv" prefix in the request message that is contained in the log message. (prob because the prefix of "Envelope" in log message and that of request is the same) how to get the namespace in the request message also?
the log request is shown below:
<soapenv:Envelope xmlns:v002="http://www.company.com/schema/app/Loggi ... Types/V001" xmlns:v1="http://www.company.com/wsdl/app/EnterpriseLogging/V1_0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
<soapenv:Header/>
<soapenv:Body>
<v002:verbosityData>
<v002:request>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soapenv:Body>
<!-- request message body -->
</soapenv:Body>
</soapenv:Envelope>
</v002:request>
<v002:response>
<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:osa="http://www.company.com/xmlschema/resour ... cture/v001">
<ns1:Body>
<!-- response message body -->
</ns1:Body>
</ns1:Envelope>
</v002:response>
</v002:verbosityData>
</soapenv:Body>
</soapenv:Envelope>
For logging requirement, i am creating a log message of type SOAP that contains request to our application and response from theapplication. These request and response messages are of type SOAP. The request and response messages are enclosed in CDATA tags.
After the required log message is created as an outcome of a transform action, i am not able to see the namespace of the "soapenv" prefix in the request message that is contained in the log message. (prob because the prefix of "Envelope" in log message and that of request is the same) how to get the namespace in the request message also?
the log request is shown below:
<soapenv:Envelope xmlns:v002="http://www.company.com/schema/app/Loggi ... Types/V001" xmlns:v1="http://www.company.com/wsdl/app/EnterpriseLogging/V1_0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
<soapenv:Header/>
<soapenv:Body>
<v002:verbosityData>
<v002:request>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soapenv:Body>
<!-- request message body -->
</soapenv:Body>
</soapenv:Envelope>
</v002:request>
<v002:response>
<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:osa="http://www.company.com/xmlschema/resour ... cture/v001">
<ns1:Body>
<!-- response message body -->
</ns1:Body>
</ns1:Envelope>
</v002:response>
</v002:verbosityData>
</soapenv:Body>
</soapenv:Envelope>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: SOAP Envelope namespace not seen in response
Post by sorin_ristache »
Hello,
If yes then it seems the "soapenv" prefix is excluded from the output prefixes in your XSLT stylesheet with the attribute exclude-result-prefixes. You should check your stylesheet and allow the "soapenv" prefix to be passed to the output so that the XSLT processor inserts the declaration of this namespace prefix automatically in the output.
If no please give more details about the problem.
Regards,
Sorin
Do you mean that you generate the SOAP message with an XSLT transformation?anboss wrote:After the required log message is created as an outcome of a transform action, i am not able to see the namespace of the "soapenv" prefix in the request message that is contained in the log message.
If yes then it seems the "soapenv" prefix is excluded from the output prefixes in your XSLT stylesheet with the attribute exclude-result-prefixes. You should check your stylesheet and allow the "soapenv" prefix to be passed to the output so that the XSLT processor inserts the declaration of this namespace prefix automatically in the output.
If no please give more details about the problem.
Regards,
Sorin
-
- Posts: 8
- Joined: Wed May 07, 2008 4:43 pm
Re: SOAP Envelope namespace not seen in response
here is my xsl. i am creating a soap message (stored in variable 'test') that contains soap messages as values for tags.
i am able to see the prefix in the output. but what happens is the name space definition for soapenv prefix.. of the soap message present in the v002:request tag is truncated and the namespace definiton is present only once at the top... in the soap message (stored in 'test') that is created.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:template match="/">
<xsl:variable name="test">
<soapenv:Envelope xmlns:dp="http://www.datapower.com/schemas/management" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v002="http://www.company.com/schema/app/Loggi ... Types/V001" xmlns:v1="http://www.company.com/wsdl/app/EnterpriseLogging/V1_0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soapenv:Header/>
<soapenv:Body>
<v002:verbosityData>
<v002:request>
<soapenv:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body/>
</soapenv:Envelope>
</v002:request>
<v002:response>
<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:osa="http://www.company.com/xmlschema/resour ... cture/v001">
<ns1:Body/>
</ns1:Envelope>
</v002:response>
</v002:verbosityData>
</soapenv:Body>
</soapenv:Envelope>
</xsl:variable>
<xsl:copy-of select="$test"/>
</xsl:template>
</xsl:stylesheet>
i am able to see the prefix in the output. but what happens is the name space definition for soapenv prefix.. of the soap message present in the v002:request tag is truncated and the namespace definiton is present only once at the top... in the soap message (stored in 'test') that is created.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:template match="/">
<xsl:variable name="test">
<soapenv:Envelope xmlns:dp="http://www.datapower.com/schemas/management" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v002="http://www.company.com/schema/app/Loggi ... Types/V001" xmlns:v1="http://www.company.com/wsdl/app/EnterpriseLogging/V1_0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soapenv:Header/>
<soapenv:Body>
<v002:verbosityData>
<v002:request>
<soapenv:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body/>
</soapenv:Envelope>
</v002:request>
<v002:response>
<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:osa="http://www.company.com/xmlschema/resour ... cture/v001">
<ns1:Body/>
</ns1:Envelope>
</v002:response>
</v002:verbosityData>
</soapenv:Body>
</soapenv:Envelope>
</xsl:variable>
<xsl:copy-of select="$test"/>
</xsl:template>
</xsl:stylesheet>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: SOAP Envelope namespace not seen in response
Post by sorin_ristache »
Hello,
I think there is no problem with the SOAP message generated by the XSLT stylesheet. It is a well formed XML document in which it is enough to declare the soapenv prefix on the root element soapenv:Envelope. The prefix does not have to be declared again on the v002:request element.
The soapenv prefix must be declared on the root element because the start tag and end tag of that element use it.
Regards,
Sorin
I think there is no problem with the SOAP message generated by the XSLT stylesheet. It is a well formed XML document in which it is enough to declare the soapenv prefix on the root element soapenv:Envelope. The prefix does not have to be declared again on the v002:request element.
The soapenv prefix must be declared on the root element because the start tag and end tag of that element use it.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: SOAP Envelope namespace not seen in response
Post by sorin_ristache »
Hello,
You can just repeat the declaration of the prefix on every XML element of your XML document generated by the XSLT stylesheet:
But I do not understand why you want to repeat the declaration of an XML namespace prefix for every element instead of declaring it once on the root element. The declaration of the soapenv prefix is needed on the root element anyway so repeating it in child elements is redundant.
Regards,
Sorin
You can just repeat the declaration of the prefix on every XML element of your XML document generated by the XSLT stylesheet:
Code: Select all
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
Regards,
Sorin
-
- Posts: 8
- Joined: Wed May 07, 2008 4:43 pm
Re: SOAP Envelope namespace not seen in response
the reason is we are sending the soap message containing soap messages to another web service which extracts the soap messages present inside the big one. and logs that in linux box. the remove webservice extracts the soap messages which ultimately does not contain the namespace. as a result the extracted soap message becomes invalid. we dont want the remote webservice to take the extra task of inserting appropriate namespaces.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service