You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by "Asankha C. Perera" <as...@wso2.com> on 2007/11/27 12:36:26 UTC

Re: SOAP fault messages

Hi Sihem

Whats the actual synapse.xml you use? The problem is caused by setting
the "To" address to an empty address. Are you replacing it with the
Reply-To where the Reply-To is not available?
> 2007-11-27 09:34:12,133 [127.0.0.1-localhost.localdomain] [HttpCoreNIOSender] DEBUG *HeaderMediator Set SOAP header : To to :*
> 2007-11-27 09:34:12,133 [127.0.0.1-localhost.localdomain] [HttpCoreNIOSender] DEBUG HeaderMediator End : Header mediator
> 2007-11-27 09:34:12,133 [127.0.0.1-localhost.localdomain] [HttpCoreNIOSender] DEBUG SendMediator Start : Send mediator
> 2007-11-27 09:34:12,133 [127.0.0.1-localhost.localdomain] [HttpCoreNIOSender] DEBUG SendMediator Sending response message using implicit message properties..
> *Sending To:*
> SOAPAction: http://calculator.me.org/CalculatorWS/multiplyRequest
> 2007-11-27 09:34:12,153 [127.0.0.1-localhost.localdomain] [HttpCoreNIOSender] ERROR HttpCoreNIOSender Malformed destination EPR :
> *java.net.MalformedURLException: no protocol:*
>         at java.net.URL.<init>(URL.java:567)
>         at java.net.URL.<init>(URL.java:464)
>   
...
> Besides, perhaps due to these exceptions, no message is returned to the client as a SOAP fault. Moreover, I think that the "java.net.MalformedURLException: no protocol:" is due to the fact that the SOAP client does not use the WSA header named "Reply-To" which is empty.
Yes, this is the issue. You can also remove the "To" header from the
message with the header mediator, and this will achieve the same result

asankha

RE : Re: RE : Re: RE : Re: SOAP fault messages

Posted by Sihem <st...@yahoo.fr>.
Ok!! I thought that by default, the value of elementFormDefault was "qualified"
Thanks a lot! I am progressing!
Sihem


             
---------------------------------
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

Re: RE : Re: RE : Re: SOAP fault messages

Posted by indika kumara <in...@gmail.com>.
hi Sihem

When the schema tag did not contain the "elementFormDefault="qualified""
attribute, It is same as defining "elementFormDefault="unqualified"". The
attribute "elementFormDefault="unqualified"" indicates "whether or not
locally declared elements and attributes must be unqualified".Please look at
the following sample explanation. Consider the synapse sample number 7 .In
this sample , we get the first child of the SOAP body as the validation
source (Xml) and it looks like as follow.

<m0:getQuote xmlns:m0="http://services.samples/xsd">

<m0:request>

<m0:symbol>IBM</m0:symbol>

</m0:request>

</m0:getQuote>

If we use the schema as follows , then the validation will be success .

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns="http://services.samples/xsd" elementFormDefault="qualified"

attributeFormDefault="unqualified"

targetNamespace="http://services.samples/xsd">

<xs:element name="getQuote">

<xs:complexType>

<xs:sequence>

<xs:element name="request">

<xs:complexType>

<xs:sequence>

<xs:element name="symbol" type="xs:string"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

if we remove the attribute elementFormDefault="qualified" or set it as
elementFormDefault="unqualified", then validation will be failed , because
validation source (stock quote request – the first child of SOAP BODY)
contains the *qualified* local elements.

If we use attribute elementFormDefault="unqualified" in our schema , then to
success the validation, the request message should be as follows.

<m0:getQuote xmlns:m0="http://services.samples/xsd">

<request>

<symbol>IBM</symbol>

</request>

</m0:getQuote>

But  both of following requests also will be failed.(contains one or more
qualified element )

<m0:getQuote xmlns:m0="http://services.samples/xsd">

<m0:request>

<symbol>IBM<symbol>

</m0:request>

</m0:getQuote>


 <m0:getQuote xmlns:m0="http://services.samples/xsd">

<request>

<m0:symbol>IBM</m0:symbol>

</request>

</m0:getQuote>

Therefore If you have removed the elementFormDefault="qualified" attribute,
then validation must be failed if the source Xml (the first child of SOAP
Body) contains qualified elements. It is the correct behavior .

 thanks

Indika




On Nov 28, 2007 2:01 PM, Sihem <st...@yahoo.fr> wrote:

> Hi Asankha,
> thanks a lot for your answer. It is now clear for me. And you are right,
> the remaining exception was thrown because the secure2 endpoint does not
> exist.
> To finish, I would like to describe you a strange behaviour of synapse
> when I tested the validate schema sample. Indeed I used an xsd file where
> the schema tag did not contain the "elementFormDefault="qualified""
> attribute. As a consequence, the validation did not work. I added this
> attribute and it worked. I thought it was an optional element.
> Sihem
>
>
> ---------------------------------
>  Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
> Mail
>

RE : Re: RE : Re: SOAP fault messages

Posted by Sihem <st...@yahoo.fr>.
Hi Asankha,
thanks a lot for your answer. It is now clear for me. And you are right, the remaining exception was thrown because the secure2 endpoint does not exist.
To finish, I would like to describe you a strange behaviour of synapse when I tested the validate schema sample. Indeed I used an xsd file where the schema tag did not contain the "elementFormDefault="qualified"" attribute. As a consequence, the validation did not work. I added this attribute and it worked. I thought it was an optional element.
Sihem

             
---------------------------------
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

Re: RE : Re: SOAP fault messages

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Sihem
> <header name="To" expression="get-property('ReplyTo')"/>
> I removed this configuration line and this exception is no longer
> thrown. The client receives the error message. So what is the purpose
> of this config line ?
The exact effect of the above line is to replace the "To" address of the
current message with the "ReplyTo" address. Thus this will depend on the
fact whether the current message has a WS-A ReplyTo header or not. The
samples we provide use WS-A in most of the scenarios. An equivalent
statement for the above would be the following - which implies that the
"To" address of the current message should be just removed. Note that
when we change a message in its direction (i.e. a request being
converted into a response due to some error etc) we clear any explicit
"To" address from the message and mark it as a "RESPONSE". This way
Synapse knows that its supposed to go back to the client/requester as a
response (i.e. on the same socket for http/s etc)
<header name="To" action="remove"/>

> The only remaining exception is :
> der]  WARN FaultHandler Fault handler - setting ERROR_MESSAGE :
> java.net.ConnectException: Connection refused
I believe the above happens since you do not have the port 8081 (i.e.
secure2 endpoint) up at the time you ran the configuration?

asankha

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org


RE : Re: SOAP fault messages

Posted by Sihem <st...@yahoo.fr>.
I attached to this mail my synapse configuration. Actually I am replacing the To header by the Reply-To header as shown in the sample:
<header name="To" expression="get-property('ReplyTo')"/>
I removed this configuration line and this exception is no longer thrown. The client receives the error message. So what is the purpose of this config line ?

The only remaining exception is :
der]  WARN FaultHandler Fault handler - setting ERROR_MESSAGE : java.net.ConnectException: Connection refused
2007-11-27 14:05:32,939 [127.0.0.1-localhost.localdomain] [HttpCoreNIOSender]  WARN FaultHandler Fault handler - setting ERROR_DETAIL : java.lang.Exception: <soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soapenv:Server</faultcode><faultstring>java.net.ConnectException: Connection refused</faultstring><detail /></soapenv:Fault>
....

Is it normal ?

Sihem

             
---------------------------------
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail