Skip Menu |

This queue is for tickets about the CORBA-XMLSchemas CPAN distribution.

Report information
The Basics
Id: 30893
Status: resolved
Priority: 0/
Queue: CORBA-XMLSchemas

People
Owner: PERRAD [...] cpan.org
Requestors: ashley.burston [...] thus.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.60
Fixed in: (no value)



Subject: Soap faults appear in no namespace but should probably be put into <soap:fault>
When compiling the wsdl generated by idl2soap (using apache axis 1.4) I get an error when it comes to processing faults in th *binding* file. It complains that the fault is not in the soap namespace. I fixed this by manually editing the binding file and putting in the text: "soap:fault" where ever I found "fault". This worked so I changed the WsdlSoap visitor to fix this and have attached a patch. Could you please check if this is indeed a valid change and if so merge it ASAP or tell me how I should fix it. Here are some xml snippets: Before: <soap:operation soapAction="Thus.Message.Service#ping"/> <input> <soap:body namespace="http://www.omd.org/IDL-WSDL/1.0/" use="literal"/> </input> <output> <soap:body namespace="http://www.omd.org/IDL-WSDL/1.0/" use="literal"/> </output> <fault name="CORBA.SystemException"/> </operation> After: <soap:operation soapAction="Thus.Message.Service#ping"/> <input> <soap:body namespace="http://www.omd.org/IDL-WSDL/1.0/" use="literal"/> </input> <output> <soap:body namespace="http://www.omd.org/IDL-WSDL/1.0/" use="literal"/> </output> <soap:fault name="CORBA.SystemException"/> </operation>
From: ashley.burston [...] thus.net
Here is the file with the patch.
Index: lib/CORBA/XMLSchemas/WsdlSoapBindingVisitor.pm =================================================================== RCS file: /cvsroot/upstream/CORBA-XMLSchemas/lib/CORBA/XMLSchemas/WsdlSoapBindingVisitor.pm,v retrieving revision 1.1.1.1 diff -b -u -r1.1.1.1 WsdlSoapBindingVisitor.pm --- lib/CORBA/XMLSchemas/WsdlSoapBindingVisitor.pm 9 Oct 2007 09:58:26 -0000 1.1.1.1 +++ lib/CORBA/XMLSchemas/WsdlSoapBindingVisitor.pm 20 Nov 2007 16:46:53 -0000 @@ -205,7 +205,7 @@ foreach (@{$node->{list_raise}}) { my $defn = $self->_get_defn($_); - my $fault = $self->{dom_doc}->createElement($self->{wsdl} . 'fault'); + my $fault = $self->{dom_doc}->createElement($self->{soap} . 'fault'); $operation->appendChild($fault); my $soap_body = $self->{dom_doc}->createElement($self->{soap} . 'body'); @@ -215,7 +215,7 @@ } unless (exists $node->{modifier}) { # oneway - my $fault = $self->{dom_doc}->createElement($self->{wsdl} . 'fault'); + my $fault = $self->{dom_doc}->createElement($self->{soap} . 'fault'); $fault->setAttribute('name', 'CORBA.SystemException'); $operation->appendChild($fault); }
The current implementation is conform to the "CORBA to WSDL/SOAP Interworking Specification" v1.1 (see 1.2.9 SOAP Binding). But I think the specification is buggy (and it isn't the first time, see http://www.omg.org/issues/wsdlcorba-rtf.html). Now after reading W3C WSDL v1.1 (see http://www.w3.org/TR/wsdl#_soap:fault), I propose another solution : <soap:operation soapAction="Thus.Message.Service#ping"/> <input> <soap:body namespace="http://www.omd.org/IDL-WSDL/1.0/" use="literal"/> </input> <output> <soap:body namespace="http://www.omd.org/IDL-WSDL/1.0/" use="literal"/> </output> <fault> <soap:fault name="CORBA.SystemException"/> </fault> </operation> Now, could you try my patch and tell me if it works with your implementation (apache axis 1.4). Remark: my patch modifies the behavior only for System exception, so you could have trouble with User exception.
Index: WsdlSoapBindingVisitor.pm =================================================================== --- WsdlSoapBindingVisitor.pm (revision 862) +++ WsdlSoapBindingVisitor.pm (working copy) @@ -216,8 +216,11 @@ unless (exists $node->{modifier}) { # oneway my $fault = $self->{dom_doc}->createElement($self->{wsdl} . 'fault'); - $fault->setAttribute('name', 'CORBA.SystemException'); $operation->appendChild($fault); + + my $soap_fault = $self->{dom_doc}->createElement($self->{soap} . 'fault'); + $soap_fault->setAttribute('name', 'CORBA.SystemException'); + $fault->appendChild($soap_fault); } }
From: ashley.burston [...] thus.net
Testing ----------------------------------------------------------------------- Implemented your patch, got: WSDL snippet: <fault> <soap:fault name="CORBA.SystemException"/> </fault> And then: [ashleyb@ashleyb java-test]$./wsdl2java MessageServicebinding.wsdl java.io.IOException: ERROR: Fault is missing a name= attribute in operation "ping", in binding {http://www.omg.org/IDL-Mapped/}Thus.AgentBinding. at org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2809) at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744) at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495) at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361) at java.lang.Thread.run(Thread.java:534) Then added the name attrib, by adding: unless (exists $node->{modifier}) { # oneway my $fault = $self->{dom_doc}->createElement($self->{wsdl} . 'fault'); + $fault->setAttribute('name', 'CORBA.SystemException'); my $soap_fault = $self->{dom_doc}->createElement($self->{soap} . 'fault'); $soap_fault->setAttribute('name', 'CORBA.SystemException'); $fault->appendChild($soap_fault); $operation->appendChild($fault); Ran the compiler, got WSDL snippet: <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException"/> </fault> Axis 1.4 then failed with the follwoing errors: [ashleyb@ashleyb java-test]$./wsdl2java MessageServicebinding.wsdl Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' Nov 23, 2007 9:07:32 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' [ashleyb@ashleyb java-test]$vi MessageServicebinding.wsdl [ashleyb@ashleyb java-test]$vi MessageServicebinding.wsdl [ashleyb@ashleyb java-test]$./wsdl2java MessageServicebinding.wsdl Nov 23, 2007 9:11:54 AM org.apache.axis.constants.Enum$Type getEnum SEVERE: Unrecognized style: 'null' ----------------------------------------------------------------------- Comment: As you say the standard has been wrong in the past. Is there any other app you could try the original patch I submitted to see if it causes problems with that system? Then if it doesn't we have at least got N=2 for systems it works with. What do you think?
I dug into axis-user mail list, I found : on November 2007 : wsdl2java problems with wsdl that has fault elements on March 2007 : Missing <soap:fault> for soap1.1 binding on September 2007 : Urgent - Exception Mapping with Axis2 So, I propose a new patch that generates : <wsdl:fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"/> </wsdl:fault> If it's ok for you, I upload a new version (2.61).
Index: WsdlSoapBindingVisitor.pm =================================================================== --- WsdlSoapBindingVisitor.pm (revision 862) +++ WsdlSoapBindingVisitor.pm (working copy) @@ -218,6 +218,11 @@ my $fault = $self->{dom_doc}->createElement($self->{wsdl} . 'fault'); $fault->setAttribute('name', 'CORBA.SystemException'); $operation->appendChild($fault); + + my $soap_fault = $self->{dom_doc}->createElement($self->{soap} . 'fault'); + $soap_fault->setAttribute('name', 'CORBA.SystemException'); + $soap_fault->setAttribute('use', 'literal'); + $fault->appendChild($soap_fault); } }
Subject: Re: [rt.cpan.org #30893] Soap faults appear in no namespace but should probably be put into <soap:fault>
Date: Mon, 26 Nov 2007 10:53:00 +0000
To: bug-CORBA-XMLSchemas [...] rt.cpan.org
From: Ashley Burston <ashley.burston [...] thus.net>
Did the attached patch and got the following XML: <operation name="timeoutMessageRetry"> <soap:operation soapAction="Thus.Message.Service#timeoutMessageRetry"/> <input> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </input> <output> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </output> <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </soap:fault> </fault> <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </soap:fault> </fault> <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </soap:fault> </fault> <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </soap:fault> </fault> <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"> <soap:body namespace="http://www.omg.org/IDL-WSDL/1.0/" use="literal"/> </soap:fault> </fault> <fault name="CORBA.SystemException"> <soap:fault name="CORBA.SystemException" use="literal"/> </fault> </operation> This compiles in axis. On Mon, 2007-11-26 at 02:44 -0500, PERRAD via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=30893 > > > I dug into axis-user mail list, I found : > on November 2007 : wsdl2java problems with wsdl that has fault elements > on March 2007 : Missing <soap:fault> for soap1.1 binding > on September 2007 : Urgent - Exception Mapping with Axis2 > > So, I propose a new patch that generates : > <wsdl:fault name="CORBA.SystemException"> > <soap:fault name="CORBA.SystemException" use="literal"/> > </wsdl:fault> > > If it's ok for you, I upload a new version (2.61).
-- Ashley Burston Principal Engineer Thus Plc tel: 020 8495 6236

Message body is not shown because sender requested not to inline it.

version 2.61 uploaded