You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Pedro Salazar <pe...@ptinovacao.pt> on 2003/10/07 19:39:34 UTC

SOAP mime attachments binding: "return" --> MIME TYPE??

Greetings,

I would like to know how to map the "return" message part operation in
WSDL to the specific mime type that will generate a correspondent java
type. 

For example, I define IN/OUT parameters in a operation and the
xsd:string type is mapped to the mime type "text/xml" which will
automatically a javax.xml.transform.Source object. 

--> However, I don't know how can I define the return part inside the
binding of an operation. 

The following wsdl sample:


<portType>

<operation name="testWSAttach" 
	parameterOrder="aXML aString oXML oString">
	<input message="tns:NGINPro_testWSAttachRequest"/>
	<output message="tns:NGINPro_testWSAttachResponse"/>
	<fault name="NGINProException" 
		message="tns:NGINProException" />
</operation>

</portType>

<binding>

    <operation name="testWSAttach">
            <input>
                <mime:multipartRelated>
                    <mime:part>
                        <soap:body parts="aString" 
                        encodingStyle=
                            "http://schemas.xmlsoap.org/soap/encoding/" 
                        use="encoded" 
                        namespace=
                           
"http://www.ptinovacao.pt/nginpro/interfaces/wsdl"/>
                    </mime:part>
                    <mime:part>
                        <mime:content part="aXML" type="text/xml" />
                    </mime:part>
                </mime:multipartRelated>
            </input>
            <output>
                <mime:multipartRelated>
                    <mime:part>
                        <mime:content part="oXML" type="text/xml" />
                    </mime:part>
                    <mime:part>
                        <mime:content part="oString" type="text/plain"
/>
                    </mime:part>
                </mime:multipartRelated>
            </output>
            <fault name="NGINProException">
                <soap:fault 
               
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
                use="encoded" 
               
namespace="http://www.ptinovacao.pt/nginpro/interfaces/wsdl"/>
            </fault>

            <soap:operation soapAction="testWSAttach"/>
    </operation>

<binding>

is mapped to the following java method:

public java.lang.String testWSAttach(javax.xml.transform.Source aXML,
java.lang.String aString, org.apache.axis.holders.SourceHolder oXML,
javax.xml.rpc.holders.StringHolder oString) throws
java.rmi.RemoteException,
pt.ptinovacao.nginpro.interfaces.service.NGINProException {
        oXML.value = new javax.xml.transform.stream.StreamSource();
        oString.value = new java.lang.String();
        return null;
    }


And if I define the type from xsd:string to complex type of
base64Binary[], the return type is byte[][]!!!

Any help is appreciated!!

thanks,
Pedro Salazar.
-- 
PS
pedro-b-salazar@ptinovacao.pt
PGP:0E129E31D803BC61


Custom Serializer and Deserializer

Posted by Tony Opatha <to...@yahoo.com>.
Is it possible to use with AXIS custom serializer and de-serializer in the
handler framework?
 
E.g. will employing such serializer and de-serializer be portable/interoperable
with multiple client run-times?
 
Thanks


 
Rupesh Sharma wrote:

> Can I modify the BeanSerializer.java 
> used by Axis to do bean serialization to change the collection into an 
> array before converting it into xml.

You can write your own serializer, but it won't be portable, as you 
need a deserializer on the other side.

I just write a method called toArray() in my list class, and it 
creates this for me. It's trivial to do, less work than trying to work 
around the problem.

-- 
"We do not lose our identity in our relations with others; in part, at least, we achieve our identity by those relations." Tony Blair, 1993



---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

Re: Collection Passing from Java to C#

Posted by Rupesh Sharma <ru...@yahoo.com>.
Hi James,
              Can u send me a code snippet of what u did.
Rupesh

James Black <jb...@ieee.org> wrote:
Rupesh Sharma wrote:

> Can I modify the BeanSerializer.java 
> used by Axis to do bean serialization to change the collection into an 
> array before converting it into xml.

You can write your own serializer, but it won't be portable, as you 
need a deserializer on the other side.

I just write a method called toArray() in my list class, and it 
creates this for me. It's trivial to do, less work than trying to work 
around the problem.

-- 
"We do not lose our identity in our relations with others; in part, at least, we achieve our identity by those relations." Tony Blair, 1993



---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

Re: Collection Passing from Java to C#

Posted by James Black <jb...@ieee.org>.
Rupesh Sharma wrote:

>                                  Can I modify the BeanSerializer.java 
> used by Axis to do bean serialization to change the collection into an 
> array before converting it into xml.

  You can write your own serializer, but it won't be portable, as you 
need a deserializer on the other side.

  I just write a method called toArray() in my list class, and it 
creates this for me. It's trivial to do, less work than trying to work 
around the problem.

-- 
"We do not lose our identity in our relations with others; in part, at least, we achieve our identity by those relations." Tony Blair, 1993



Re: Collection Passing from Java to C#

Posted by Rupesh Sharma <ru...@yahoo.com>.
Hello James and others,
                                 Can I modify the BeanSerializer.java used by Axis to do bean serialization to change the collection into an array before converting it into xml.
Rupesh

James Black <jb...@ieee.org> wrote:
Rupesh Sharma wrote:

> I am having problems passing Collections from Axis Web Service 
> written in Java to a C# client. However when I change my data 
> structure from collection to an Array of known Object types it goes 
> thrugh. I will apprecite if anybody who had the same problem and 
> resolved it can respond asap.

I find it easier to just pass the collection as an array of javabeans. 
This makes sense since the client can figure out the best way to use the 
results (for example to put it into a TreeView).

AFAIK there is no good way to pass a Collection object to C# from Java.

-- 
"We do not lose our identity in our relations with others; in part, at least, we achieve our identity by those relations." Tony Blair, 1993



---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

Re: Collection Passing from Java to C#

Posted by James Black <jb...@ieee.org>.
Rupesh Sharma wrote:

>     I am having problems passing Collections from Axis Web Service 
> written in Java to a C# client. However when I change my data 
> structure from collection to  an Array of known Object types it goes 
> thrugh. I will apprecite if anybody who had the same problem and 
> resolved it can respond asap.

  I find it easier to just pass the collection as an array of javabeans. 
This makes sense since the client can figure out the best way to use the 
results (for example to put it into a TreeView).

  AFAIK there is no good way to pass a Collection object to C# from Java.

-- 
"We do not lose our identity in our relations with others; in part, at least, we achieve our identity by those relations." Tony Blair, 1993



Collection Passing from Java to C#

Posted by Rupesh Sharma <ru...@yahoo.com>.
Hi,
    I am having problems passing Collections from Axis Web Service written in Java to a C# client. However when I change my data structure from collection to  an Array of known Object types it goes thrugh. I will apprecite if anybody who had the same problem and resolved it can respond asap.
Thanks
Rupesh



---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search