<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/soap/fault/test_fault.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -48,6 +48,7 @@ module SOAPType
   attr_accessor :position
   attr_reader :extraattr
   attr_accessor :definedtype
+  attr_accessor :force_typed
 
   def initialize(*arg)
     super
@@ -60,6 +61,7 @@ module SOAPType
     @position = nil
     @definedtype = nil
     @extraattr = {}
+    @force_typed = false
   end
 
   def inspect</diff>
      <filename>lib/soap/baseData.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,8 +29,11 @@ class LiteralHandler &lt; Handler
   def encode_data(generator, ns, data, parent)
     attrs = {}
     name = generator.encode_name(ns, data, attrs)
+    if data.type and data.type.name and
+        (@generate_explicit_type or data.force_typed)
+      data.extraattr[XSD::AttrTypeName] = data.type
+    end
     data.extraattr.each do |key, value|
-      next if !@generate_explicit_type and key == XSD::AttrTypeName
       keytag = key
       if key.is_a?(XSD::QName)
         keytag = encode_attr_key(attrs, ns, key)</diff>
      <filename>lib/soap/encodingstyle/literalHandler.rb</filename>
    </modified>
    <modified>
      <diff>@@ -141,11 +141,8 @@ public
       @reftarget = nil
     else
       if obj.is_a?(SOAPEnvelope)
-        # xsi:nil=&quot;true&quot; can appear even if dumping without explicit type.
         Generator.assign_ns(attrs, ns, XSD::InstanceNamespace)
-        if @generate_explicit_type
-          Generator.assign_ns(attrs, ns, XSD::Namespace)
-        end
+        Generator.assign_ns(attrs, ns, XSD::Namespace)
       end
       obj.encode(self, ns, attrs) do |child|
 	indent_backup, @indent = @indent, @indent + @indentstr</diff>
      <filename>lib/soap/generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -136,9 +136,12 @@ private
       ele = SOAPElement.new(qname)
     end
     ele.qualified = definition.qualified
-    if definition.type and (definition.basetype or Mapping.root_type_hint)
-      Mapping.reset_root_type_hint
-      ele.extraattr[XSD::AttrTypeName] = definition.type
+    if definition.type
+      ele.type = definition.type
+      if definition.basetype or Mapping.root_type_hint
+        Mapping.reset_root_type_hint
+        ele.force_typed = true
+      end
     end
     if qname.nil? and definition.elename
       ele.elename = definition.elename</diff>
      <filename>lib/soap/mapping/literalregistry.rb</filename>
    </modified>
    <modified>
      <diff>@@ -110,6 +110,11 @@ private
       else
         ele = complexobj2soap(obj, type)
       end
+      ele.type = type.name
+      if type.base or Mapping.root_type_hint
+        Mapping.reset_root_type_hint
+        ele.force_typed = true
+      end
       add_definedattributes2soap(obj, ele, type)
     end
     ele</diff>
      <filename>lib/soap/mapping/wsdlliteralregistry.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ public
     # TODO: set to false by default or drop thie option in 1.6.0
     @allow_unqualified_element = true
     @default_encodingstyle = nil
-    @generate_explicit_type = true
+    @generate_explicit_type = nil
     @use_default_namespace = false
     @return_response_as_xml = false
     @headerhandler = Header::HandlerSet.new
@@ -140,6 +140,12 @@ public
       :default_encodingstyle =&gt;
         @default_encodingstyle || op_info.response_default_encodingstyle
     )
+    if reqopt[:generate_explicit_type].nil?
+      reqopt[:generate_explicit_type] = (op_info.request_use == :encoded)
+    end
+    if resopt[:generate_explicit_type].nil?
+      resopt[:generate_explicit_type] = (op_info.response_use == :encoded)
+    end
     env = route(req_header, req_body, reqopt, resopt)
     if op_info.response_use.nil?
       return nil</diff>
      <filename>lib/soap/rpc/proxy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,7 @@ module Mapping
   class Mapper
     MAPPING_OPT = {
       :default_encodingstyle =&gt; SOAP::LiteralNamespace,
+      :generate_explicit_type =&gt; false,
       :root_type_hint =&gt; true
     }.freeze
 </diff>
      <filename>lib/xsd/mapping.rb</filename>
    </modified>
    <modified>
      <diff>@@ -155,7 +155,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_STRING_ARRAY_REQUEST =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoStringArray xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -170,7 +171,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_STRING_ARRAY_RESPONSE =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoStringArrayResponse xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -198,7 +200,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_STRING_ARRAY_INLINE_REQUEST =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoStringArrayInline xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -213,7 +216,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_STRING_ARRAY_INLINE_RESPONSE =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoStringArrayInlineResponse xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -240,7 +244,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_NESTED_STRUCT_REQUEST =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoNestedStruct xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -260,7 +265,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_NESTED_STRUCT_RESPONSE =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoNestedStructResponse xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -299,7 +305,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_NESTED_STRUCT_REQUEST_NIL =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoNestedStruct xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -318,7 +325,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_NESTED_STRUCT_RESPONSE_NIL =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoNestedStructResponse xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -378,7 +386,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_STRUCT_ARRAY_REQUEST =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoStructArray xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;
@@ -400,7 +409,8 @@ class TestRPCLIT &lt; Test::Unit::TestCase
 
   ECHO_STRUCT_ARRAY_RESPONSE =
 %q[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-&lt;env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+&lt;env:Envelope xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
+    xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;env:Body&gt;
     &lt;n1:echoStructArrayResponse xmlns:n1=&quot;http://soapbuilders.org/rpc-lit-test&quot;&gt;</diff>
      <filename>test/wsdl/rpc/test_rpc_lit.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/wsdl/axisArray/itemList.rb</filename>
    </removed>
    <removed>
      <filename>test/wsdl/raa/RAA.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>ff8d79afcdd454f227217045d60d79cdcc2e2d92</id>
    </parent>
  </parents>
  <author>
    <name>nahi</name>
    <email>nahi@23c4dcf6-64ea-0310-84d7-d424c7495ec0</email>
  </author>
  <url>http://github.com/railsfactory/soap4r/commit/0c7f6339c91a1b323d55da275e02bbc3465f5289</url>
  <id>0c7f6339c91a1b323d55da275e02bbc3465f5289</id>
  <committed-date>2008-02-09T17:57:09-08:00</committed-date>
  <authored-date>2008-02-09T17:57:09-08:00</authored-date>
  <message> * merged from 1_5 branch.
   * enabled Sriver#generate_explicit_type for literal services.
   * test added.
   * removed generated files.


git-svn-id: http://dev.ctor.org/svn/soap4r/trunk@2011 23c4dcf6-64ea-0310-84d7-d424c7495ec0</message>
  <tree>0eaefcfe53608e509eecce5d7d5bbff294d4f35c</tree>
  <committer>
    <name>nahi</name>
    <email>nahi@23c4dcf6-64ea-0310-84d7-d424c7495ec0</email>
  </committer>
</commit>
