SOAP Envelope can not have children other than SOAP Header and Body - wso2

With the update to version 4.6.0 wso2esb, the error began to occur:
org.apache.axiom.soap.SOAPProcessingException: SOAP Envelope can not have children other than SOAP Header and Body
When using security services.
How do I resolve the error?

Related

Does WSO2 ESB works on soap 1.1 by default?

I just want to know that does WSO2 ESB by default support on soap 1.1? How to make it work on soap 1.2? Is there any global property by which I can change all the deployed services to make it work on soap 1.2?
Thanks in Advance
Regards,
Shri
Hi Thanks for your response. but I get below error when try 1.2 Soap request from the SOAP UI.
[2016-08-10 10:53:41,744] ERROR - NativeWorkerPool [msg_id=urn:uuid:4abc1b45-c6a8-4f92-9559-169d3dab403f] Uncaught exception
org.apache.axiom.om.impl.exception.OMBuilderException: detail unsupported element in SOAPFault element
at org.apache.axiom.soap.impl.builder.SOAP12BuilderHelper.handleEvent(SOAP12BuilderHelper.java:175)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:428)
WSO2 ESB supports both by default. For example, when you create a proxy service in ESB, it exposes both SOAP 1.1 and SOAP 1.2 endpoints.
It seems that this error happens when using SOAP 1.2 while communicating between .Net applications and Axis2. So far the only solution I have seen is to force the use of SOAP 1.1.
See also:
Mention of error
Apparently the definition of the SOAPfault changed slightly between versions, most importantly the capitalisation of certain elements, including the detail element. The error suggests that the received message includes the element, which is in accordance with SOAP 1.1, while in SOAP 1.2 it should be a element. For more detail, check this site

Soap header or http header

Have a Web application which connects to a jax-ws service. Want to send security credentials in the header. But.. I know that there are two types of headers:
1) soap header, which I can set with handler in client side
2) http header in transport layer
Can anybody explain pros and cons of setting additional information in each of these headers? What is the best practice?
SOAP headers and HTTP headers are not the same.
The SOAP headers contain routing information, authentication information and so on. It independent of the transport that SOAP uses. If you send the data to the web service then you should place it inside the SOAP headers.
SOAP message passed to the receiver.
HTTP headers contain the content type, the content length, the cache directives for clients, cookies and so on. It independent of the what actually transmitted with HTTP. HTTP headers is intercepted in the web server.
See Also:
XML Soap
SOAP Headers
Message Headers

WSO2 esb api does not interpret xml when SOAPAction present

I have an Oracle SOA HTTP Binding that sends the XML message into WSO2 ESB. This message (incorrectly) contains a SOAPAction header. When this header is present, ESB gives the error: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found .
How can I fix this?
WSO2 ESB does not have any issues with processing SOAPAction header. According to the error exception you are getting, it is related to the content-type of your request. Please check on the content-type of the message coming in to ESB. If the content type is text/xml, then ESB expects a SOAP message and in this particular scenario, you will get this exception if the message does not contain the soap header. If it is not a SOAP message, then change the content-type to application/xml.

How to turn off Envelope and Body in SOAP request

This is critical to my current project. I have written a client in C++ using Windows web services. This client talks to the Clickatell SMS SOAP web service. I have tested the request using the SOAPUI tool and get correct response. I also receive the SMS message. Now, when I do this programmatically it fails because the WsCall() [in the code generated from WSDL via wsutil.exe) inserts even though the SOAP request I have already includes Envelope and Body. I cannot take out my Envelope since I have namespace specified in it like this:
http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"soap.clickatell.com\">
I know that the additional Envelope and Body are inserted since I see it in the Fiddler tool.
Any help I can get is highly appreciated!
Looks like you are using the older type rpc/encoded soap api.
Have you tried using the document/literal service?
(http://api.clickatell.com/soap/document_literal/webservice.php?wsdl)

WSO2 ESB how to identify the request soap version

I need to return the soapfault accoding to the request soap version (1.1 or 1.2). I use ESB 4.8. Is there a simple way to identify the soap version? Can be automated the proper custom response fault according to the request?
Regards
you can filter the messages based on the namespace used for the versions.
SOAP 1.1 : http://schemas.xmlsoap.org/soap/envelope/
SOAP 1.2 : http://www.w3.org/2003/05/soap-envelope
i.e:
<filter xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xpath="/soapenv:Envelope ">
With that configuration, you can filter and get SOAP 1.1 requests. More information can be find here