You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Thilina Gunarathne (JIRA)" <ji...@apache.org> on 2006/09/23 13:10:23 UTC

[jira] Created: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
----------------------------------------------------------------------------------

                 Key: AXIS2-1221
                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: databinding
            Reporter: Thilina Gunarathne
         Assigned To: Thilina Gunarathne
            Priority: Blocker


Schema :
<xsd:element name="image-attachment">
	<xsd:complexType>
		<xsd:simpleContent>
			<xsd:extension	base="xsd:base64Binary">
				<xsd:attribute	ref="xmime:contentType" />
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>
</xsd:element>

Axis2 Generated Message:
<ns1:image-attachment>
                  <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
</ns1:image-attachment>


According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1221?page=all ]

Davanum Srinivas updated AXIS2-1221:
------------------------------------

    Attachment: my.diff

Thilina,

Could you please try this patch? Am able to generate both mtom and non-mtom messages from the generated stub as follows:

public class Main {
    public static void main(String[] args) throws Exception {
        ImageHandlerServiceStub stub = new ImageHandlerServiceStub();
        //stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
        Image image = new Image();
        ImageAttachment_type1 param = new ImageAttachment_type1();
        image.setImageAttachment(param);
        image.setMetaInfo("text/xml");
        param.setBase64Binary(new DataHandler(new FileDataSource(new File("C:/junk/adminmain.jpg"))));
        stub.uploadImage(image);
    }
}

And i can get the full byte array sent on the service skeleton uploadImage method.

thanks,
dims

> ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-1221
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>            Reporter: Thilina Gunarathne
>         Assigned To: Davanum Srinivas
>            Priority: Blocker
>         Attachments: my.diff
>
>
> Schema :
> <xsd:element name="image-attachment">
> 	<xsd:complexType>
> 		<xsd:simpleContent>
> 			<xsd:extension	base="xsd:base64Binary">
> 				<xsd:attribute	ref="xmime:contentType" />
> 			</xsd:extension>
> 		</xsd:simpleContent>
> 	</xsd:complexType>
> </xsd:element>
> Axis2 Generated Message:
> <ns1:image-attachment>
>                   <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
> </ns1:image-attachment>
> According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1221?page=all ]

Davanum Srinivas resolved AXIS2-1221.
-------------------------------------

    Resolution: Fixed

Applied a fix that gets the xmime enabled wsdl at the following url to work:
http://www.wso2.net/articles/axis2/java/2006/08/10/binary-with-adb

(with one fix to the wsdl , basically fix the soap action)

thanks,
dims

> ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-1221
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>            Reporter: Thilina Gunarathne
>         Assigned To: Davanum Srinivas
>            Priority: Blocker
>         Attachments: my.diff
>
>
> Schema :
> <xsd:element name="image-attachment">
> 	<xsd:complexType>
> 		<xsd:simpleContent>
> 			<xsd:extension	base="xsd:base64Binary">
> 				<xsd:attribute	ref="xmime:contentType" />
> 			</xsd:extension>
> 		</xsd:simpleContent>
> 	</xsd:complexType>
> </xsd:element>
> Axis2 Generated Message:
> <ns1:image-attachment>
>                   <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
> </ns1:image-attachment>
> According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1221?page=comments#action_12437184 ] 
            
Davanum Srinivas commented on AXIS2-1221:
-----------------------------------------

Here's a variant using xsd:base64Binary (valid for same test.xml above)

============ test3.xsd ====================
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:tns="http://test/xmime" targetNamespace="http://test/xmime" elementFormDefault="qualified">
	<xsd:import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation="xmime.xsd"/>
	<xsd:element name="image">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="meta-info" type="xsd:string"/>
				<xsd:element name="image-attachment">
					<xsd:complexType>
						<xsd:simpleContent>
							<xsd:extension base="xsd:base64Binary">
								<xsd:attribute ref="xmime:contentType" use="required"/>
							</xsd:extension>
						</xsd:simpleContent>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
============ test3.xsd ====================


> ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-1221
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>            Reporter: Thilina Gunarathne
>         Assigned To: Thilina Gunarathne
>            Priority: Blocker
>
> Schema :
> <xsd:element name="image-attachment">
> 	<xsd:complexType>
> 		<xsd:simpleContent>
> 			<xsd:extension	base="xsd:base64Binary">
> 				<xsd:attribute	ref="xmime:contentType" />
> 			</xsd:extension>
> 		</xsd:simpleContent>
> 	</xsd:complexType>
> </xsd:element>
> Axis2 Generated Message:
> <ns1:image-attachment>
>                   <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
> </ns1:image-attachment>
> According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1221?page=comments#action_12437181 ] 
            
Davanum Srinivas commented on AXIS2-1221:
-----------------------------------------

Let's start from the beginning:
- targetNamespace for the schema in the sample wsdl (http://www.wso2.net/files/example_image_uploader-xmime.wsdl) is wrong!
- Latest xmime namespace is http://www.w3.org/2005/05/xmlmime as per http://www.w3.org/TR/xml-media-types/ which i found linked from  http://www.w3.org/TR/xop10/#xmlmime
- Looking at Appendix B, we can see the schema for  http://www.w3.org/2005/05/xmlmime namespace which i used to create the xmime.xsd below

=============== xmime.xsd ====================
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" targetNamespace="http://www.w3.org/2005/05/xmlmime">
	<xs:attribute name="contentType">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:minLength value="3"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
	<xs:attribute name="expectedContentTypes" type="xs:string"/>
	<xs:complexType name="base64Binary">
		<xs:simpleContent>
			<xs:extension base="xs:base64Binary">
				<xs:attribute ref="xmime:contentType"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="hexBinary">
		<xs:simpleContent>
			<xs:extension base="xs:hexBinary">
				<xs:attribute ref="xmime:contentType"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
</xs:schema>
=============== xmime.xsd ====================

Next step is to get a valid schema as similar to the one in the example_image_uploader-xmime.wsdl. After some tweaking with xmlspy, got this one - test.xsd:

============ test.xsd ============================
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:tns="http://test/xmime" targetNamespace="http://test/xmime" elementFormDefault="qualified">
	<xsd:import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation="xmime.xsd"/>
	<xsd:element name="image">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="meta-info" type="xsd:string"/>
				<xsd:element name="image-attachment">
					<xsd:complexType>
						<xsd:simpleContent>
							<xsd:extension base="xmime:base64Binary"/>
						</xsd:simpleContent>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
============ test.xsd ============================

Note that we are using xmime:base64Binary and *NOT* xsd:base64Binary. A simpler xsd would be as follows - test2.xsd:

================= test2.xsd =====================
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:tns="http://test/xmime" targetNamespace="http://test/xmime" elementFormDefault="qualified">
	<xsd:import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation="xmime.xsd"/>
	<xsd:element name="image">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="meta-info" type="xsd:string"/>
				<xsd:element name="image-attachment" type="xmime:base64Binary"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
================= test2.xsd =====================

So a valid xml instance that works ok with either test.xsd or test2.xsd is as follows: (ignore the xsi:schemaLocation in the <ns1:image> that was used to test  if the xml is indeed validates correctly according to the schema.
==================== test.xml ===================
<ns1:image xmlns:ns1="http://test/xmime" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://test/xmime
C:\junk\test2.xsd">
<ns1:meta-info>text/xml</ns1:meta-info>
	<ns1:image-attachment xmlns:ns1="http://test/xmime" xmime:contentType="text/xml">UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</ns1:image-attachment>
</ns1:image>
==================== test.xml ===================



> ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-1221
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>            Reporter: Thilina Gunarathne
>         Assigned To: Thilina Gunarathne
>            Priority: Blocker
>
> Schema :
> <xsd:element name="image-attachment">
> 	<xsd:complexType>
> 		<xsd:simpleContent>
> 			<xsd:extension	base="xsd:base64Binary">
> 				<xsd:attribute	ref="xmime:contentType" />
> 			</xsd:extension>
> 		</xsd:simpleContent>
> 	</xsd:complexType>
> </xsd:element>
> Axis2 Generated Message:
> <ns1:image-attachment>
>                   <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
> </ns1:image-attachment>
> According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1221?page=all ]

Davanum Srinivas updated AXIS2-1221:
------------------------------------

    Attachment: mtom.zip

cleaned up mtom wsdl/xsd plus xmime.xsd

> ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-1221
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>            Reporter: Thilina Gunarathne
>         Assigned To: Davanum Srinivas
>            Priority: Blocker
>         Attachments: mtom.zip, my.diff
>
>
> Schema :
> <xsd:element name="image-attachment">
> 	<xsd:complexType>
> 		<xsd:simpleContent>
> 			<xsd:extension	base="xsd:base64Binary">
> 				<xsd:attribute	ref="xmime:contentType" />
> 			</xsd:extension>
> 		</xsd:simpleContent>
> 	</xsd:complexType>
> </xsd:element>
> Axis2 Generated Message:
> <ns1:image-attachment>
>                   <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
> </ns1:image-attachment>
> According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Assigned: (AXIS2-1221) ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1221?page=all ]

Davanum Srinivas reassigned AXIS2-1221:
---------------------------------------

    Assignee: Davanum Srinivas  (was: Thilina Gunarathne)

> ADB Code generation for XMIME (http://www.w3.org/TR/xml-media-types/) is incorrect
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-1221
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1221
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>            Reporter: Thilina Gunarathne
>         Assigned To: Davanum Srinivas
>            Priority: Blocker
>
> Schema :
> <xsd:element name="image-attachment">
> 	<xsd:complexType>
> 		<xsd:simpleContent>
> 			<xsd:extension	base="xsd:base64Binary">
> 				<xsd:attribute	ref="xmime:contentType" />
> 			</xsd:extension>
> 		</xsd:simpleContent>
> 	</xsd:complexType>
> </xsd:element>
> Axis2 Generated Message:
> <ns1:image-attachment>
>                   <ns1:base64Binary xmlns:ns1="http://www.w3.org/2001/XMLSchema">.....Some Base64 characters or XOP:include.........</ns1:base64Binary>
> </ns1:image-attachment>
> According to the http://www.w3.org/TR/xml-media-types/ specification above generated message is incorrect... Image-Attachment element should have the base64 content, not an element with the name of base64Binary....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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