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 Alex A <al...@alex-andr.org> on 2010/11/30 03:41:17 UTC

Need help: large attachments inside SOAP XML request

Hello

I am looking for a way to stream the content of file inside the XML 
element, *without MTOM enabled*.

Because it looks like MTOM is not supported by the Microsoft's IIS.

Axis2/J, only client - wsdl used to generate xmlbeans/stub.

Anyone could give me pointers or even better, examples?

Thanks,
~ Alex.

Re: Need help: large attachments inside SOAP XML request

Posted by Alex A <al...@alex-andr.org>.
Or, on the second thought, may be there something else is wrong with the 
request?
How else can I interpret Microsoft error "The request failed schema 
validation: Data at the root level is invalid. Line 1, position 1."

Axis request and MS IIS response attached below.

Thanks,
  ~ Alex.

POST /EWS/exchange.asmx HTTP/1.1
Content-Type: multipart/related; 
boundary=MIMEBoundaryurn_uuid_93111751F0B81DFF191291088731495; 
type="application/xop+xml"; 
start="<0....@apache.org>"; 
start-info="text/xml"
SOAPAction: 
"http://schemas.microsoft.com/exchange/services/2006/messages/ResolveNames"
User-Agent: Axis2
Authorization: Basic dGVzdHVzZXI6dGVzdHVzZXI=
Host: 192.1.1.243
Content-Length: 639

--MIMEBoundaryurn_uuid_93111751F0B81DFF191291088731495

Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0....@apache.org>

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<mes:ResolveNames ReturnFullContactData="true" 
xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<mes:UnresolvedEntry>testuser</mes:UnresolvedEntry>
</mes:ResolveNames></soapenv:Body></soapenv:Envelope>

--MIMEBoundaryurn_uuid_93111751F0B81DFF191291088731495--

********************************
HTTP/1.1 500 Internal Server Error

Date: Tue, 30 Nov 2010 02:53:10 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Length: 994
Cache-Control: private
Content-Type: text/xml; charset=utf-8

<?xml version="1.0"?>
<soap11:Envelope 
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"><soap11:Header><t:ServerVersionInfo 
MajorVersion="8" MinorVersion="2" MajorBuildNumber="176" 
MinorBuildNumber="2" 
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
/></soap11:Header>
<soap11:Body>
<soap11:Fault><faultcode>soap11:Client</faultcode>
<faultstring>The request failed schema validation: Data at the root 
level is invalid. Line 1, position 
1.</faultstring><detail><e:ResponseCode 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode><e:Message 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">Data at 
the root level is invalid. Line 1, position 1.</e:Message><e:Line 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">1</e:Line><e:Position 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">1</e:Position></detail></soap11:Fault></soap11:Body></soap11:Envelope>

On 11/29/2010 9:41 PM, Alex A wrote:
> Hello
>
> I am looking for a way to stream the content of file inside the XML 
> element, *without MTOM enabled*.
>
> Because it looks like MTOM is not supported by the Microsoft's IIS.
>
> Axis2/J, only client - wsdl used to generate xmlbeans/stub.
>
> Anyone could give me pointers or even better, examples?
>
> Thanks,
> ~ Alex.


Re: AW: Need help: large attachments inside SOAP XML request

Posted by Alex A <al...@alex-andr.org>.
Thanks Josef

By chance, do you have any suggestions how can I "insert" (I am trying 
not to use word "stream") the content of a file inside XML generated via 
Axis2/J?

In particular, I am looking for a direction how to replace wsdl2java - 
generated
"setContent(byte[] content)" to something like 
"setContent(SomeStreamingMechanism source)"

Thanks,
~ Alex.

On 11/30/2010 3:52 AM, Stadelmann Josef wrote:
>
> just a hint !
>
> For those elaborating with-in heterogeneous environments, such as 
> MS-something-client to axis2-services or axis2-client to 
> MS-something-service
>
> MS-something can stand for a ASP.NET or IIS or WCF-based web-service 
> or whatever comes from MS*.
>
> My learning was:
>
> Do it first 1 to 1 by using not a heterogeneous environment that is to say
>
> a)Java to Java -> axis2-client-Java to axis2-service-Java AND
>
> b)Monitor and record traffic using TCPMON or Wire Shark AND THEN
>
> c)If you understand what is going on and how to control it MAKE
>
> d)MS-some-client (ie. ASP.NET-client) to  MS-some-service (i.e. 
> ASP.NET-service or IIS-service) AND
>
> e)Trace and record all traffic using TCPMON or Wire-Shark UNLESS
>
> f) you really know how this two partner in each environment 
> communicate with each other AND UNLESS
>
> g)your are happy and understand the protocol-bits and bytes, THEN
>
> h)figure out the commonalities AND
>
> i)figure out how you can best make your axis2-Client fake to your 
> MS-something-service i.e. IIS BECAUSE YOU SHOULD
>
> *j)**concentrate fully on the protocol traced and recorded by TCPMON 
> or Wire Shark*
>
> k)make your client as independent as possible from the service but 
> make it send and receive to what the service expects to receive and 
> send, AND
>
> l)even MTOM and streaming goes into the same business, BECAUSE
>
> m)if streaming is not supported according to standards by one party 
> forget it AND
>
> n)if MTOM is not supported by one party according to standards forget it
>
> We did that even for  long lasting sessions, between a MS C# .NET WCF 
> 3.5 client and a Axis2/J 1.2 Service in scope="soapsession", passing 
> nested collections trimmed tour needs.
>
> But we would not be able to do it not following the approach and 
> sequence shown above.
>
> Josef. Stadelmann
>
> @axa-winterthur.ch
>
> *Von:*Alex A [mailto:alex@alex-andr.org]
> *Gesendet:* Dienstag, 30. November 2010 03:41
> *An:* java-dev@axis.apache.org
> *Cc:* java-user@axis.apache.org
> *Betreff:* Need help: large attachments inside SOAP XML request
>
> Hello
>
> I am looking for a way to stream the content of file inside the XML 
> element, *without MTOM enabled*.
>
> Because it looks like MTOM is not supported by the Microsoft's IIS.
>
> Axis2/J, only client - wsdl used to generate xmlbeans/stub.
>
> Anyone could give me pointers or even better, examples?
>
> Thanks,
> ~ Alex.
>


Re: AW: Need help: large attachments inside SOAP XML request

Posted by Alex A <al...@alex-andr.org>.
Hi Josef

thanks for replaying

however, my question was rather regarding the Axis2/J API.

I am looking for a way of streaming the large base64 content inside the 
SOAP request. That is, if content does not fit the memory.

Someone also noted that possibly, Axis2/J completes the XML SOAP request 
in memory before sending it out to server. Thus streaming might be not 
an option at all. If that is the case, I would like to confirm it.

Thanks,
~ Alex.

On 11/30/2010 3:52 AM, Stadelmann Josef wrote:
>
> just a hint !
>
> For those elaborating with-in heterogeneous environments, such as 
> MS-something-client to axis2-services or axis2-client to 
> MS-something-service
>
> MS-something can stand for a ASP.NET or IIS or WCF-based web-service 
> or whatever comes from MS*.
>
> My learning was:
>
> Do it first 1 to 1 by using not a heterogeneous environment that is to say
>
> a)Java to Java -> axis2-client-Java to axis2-service-Java AND
>
> b)Monitor and record traffic using TCPMON or Wire Shark AND THEN
>
> c)If you understand what is going on and how to control it MAKE
>
> d)MS-some-client (ie. ASP.NET-client) to  MS-some-service (i.e. 
> ASP.NET-service or IIS-service) AND
>
> e)Trace and record all traffic using TCPMON or Wire-Shark UNLESS
>
> f) you really know how this two partner in each environment 
> communicate with each other AND UNLESS
>
> g)your are happy and understand the protocol-bits and bytes, THEN
>
> h)figure out the commonalities AND
>
> i)figure out how you can best make your axis2-Client fake to your 
> MS-something-service i.e. IIS BECAUSE YOU SHOULD
>
> *j)**concentrate fully on the protocol traced and recorded by TCPMON 
> or Wire Shark*
>
> k)make your client as independent as possible from the service but 
> make it send and receive to what the service expects to receive and 
> send, AND
>
> l)even MTOM and streaming goes into the same business, BECAUSE
>
> m)if streaming is not supported according to standards by one party 
> forget it AND
>
> n)if MTOM is not supported by one party according to standards forget it
>
> We did that even for  long lasting sessions, between a MS C# .NET WCF 
> 3.5 client and a Axis2/J 1.2 Service in scope="soapsession", passing 
> nested collections trimmed tour needs.
>
> But we would not be able to do it not following the approach and 
> sequence shown above.
>
> Josef. Stadelmann
>
> @axa-winterthur.ch
>
> *Von:*Alex A [mailto:alex@alex-andr.org]
> *Gesendet:* Dienstag, 30. November 2010 03:41
> *An:* java-dev@axis.apache.org
> *Cc:* java-user@axis.apache.org
> *Betreff:* Need help: large attachments inside SOAP XML request
>
> Hello
>
> I am looking for a way to stream the content of file inside the XML 
> element, *without MTOM enabled*.
>
> Because it looks like MTOM is not supported by the Microsoft's IIS.
>
> Axis2/J, only client - wsdl used to generate xmlbeans/stub.
>
> Anyone could give me pointers or even better, examples?
>
> Thanks,
> ~ Alex.
>


AW: Need help: large attachments inside SOAP XML request

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
just a hint !

 

For those elaborating with-in heterogeneous environments, such as
MS-something-client to axis2-services or axis2-client to
MS-something-service

 

MS-something can stand for a ASP.NET or IIS or WCF-based web-service or
whatever comes from MS*.

 

My learning was:

 

Do it first 1 to 1 by using not a heterogeneous environment that is to
say

a)      Java to Java -> axis2-client-Java to axis2-service-Java AND

b)      Monitor and record traffic using TCPMON or Wire Shark AND THEN

c)       If you understand what is going on and how to control it MAKE 

d)      MS-some-client (ie. ASP.NET-client) to  MS-some-service (i.e.
ASP.NET-service or IIS-service) AND

e)      Trace and record all traffic using TCPMON or Wire-Shark UNLESS

f)        you really know how this two partner in each environment
communicate with each other AND UNLESS

g)      your are happy and understand the protocol-bits and bytes, THEN

h)      figure out the commonalities AND

i)        figure out how you can best make your axis2-Client fake to
your MS-something-service i.e. IIS BECAUSE YOU SHOULD

j)        concentrate fully on the protocol traced and recorded by
TCPMON or Wire Shark

k)      make your client as independent as possible from the service but
make it send and receive to what the service expects to receive and
send, AND

l)        even MTOM and streaming goes into the same business, BECAUSE

m)    if streaming is not supported according to standards by one party
forget it AND

n)      if MTOM is not supported by one party according to standards
forget it

 

 

We did that even for  long lasting sessions, between a MS C# .NET WCF
3.5 client and a Axis2/J 1.2 Service in scope="soapsession", passing
nested collections trimmed tour needs.

 

But we would not be able to do it not following the approach and
sequence shown above.

 

Josef. Stadelmann

@axa-winterthur.ch

 

 

Von: Alex A [mailto:alex@alex-andr.org] 
Gesendet: Dienstag, 30. November 2010 03:41
An: java-dev@axis.apache.org
Cc: java-user@axis.apache.org
Betreff: Need help: large attachments inside SOAP XML request

 

Hello

I am looking for a way to stream the content of file inside the XML
element, without MTOM enabled.

Because it looks like MTOM is not supported by the Microsoft's IIS.

Axis2/J, only client - wsdl used to generate xmlbeans/stub.

Anyone could give me pointers or even better, examples?

Thanks,
~ Alex. 


Re: Need help: large attachments inside SOAP XML request

Posted by Alex A <al...@alex-andr.org>.
Or, on the second thought, may be there something else is wrong with the 
request?
How else can I interpret Microsoft error "The request failed schema 
validation: Data at the root level is invalid. Line 1, position 1."

Axis request and MS IIS response attached below.

Thanks,
  ~ Alex.

POST /EWS/exchange.asmx HTTP/1.1
Content-Type: multipart/related; 
boundary=MIMEBoundaryurn_uuid_93111751F0B81DFF191291088731495; 
type="application/xop+xml"; 
start="<0....@apache.org>"; 
start-info="text/xml"
SOAPAction: 
"http://schemas.microsoft.com/exchange/services/2006/messages/ResolveNames"
User-Agent: Axis2
Authorization: Basic dGVzdHVzZXI6dGVzdHVzZXI=
Host: 192.1.1.243
Content-Length: 639

--MIMEBoundaryurn_uuid_93111751F0B81DFF191291088731495

Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0....@apache.org>

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<mes:ResolveNames ReturnFullContactData="true" 
xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
<mes:UnresolvedEntry>testuser</mes:UnresolvedEntry>
</mes:ResolveNames></soapenv:Body></soapenv:Envelope>

--MIMEBoundaryurn_uuid_93111751F0B81DFF191291088731495--

********************************
HTTP/1.1 500 Internal Server Error

Date: Tue, 30 Nov 2010 02:53:10 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Length: 994
Cache-Control: private
Content-Type: text/xml; charset=utf-8

<?xml version="1.0"?>
<soap11:Envelope 
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"><soap11:Header><t:ServerVersionInfo 
MajorVersion="8" MinorVersion="2" MajorBuildNumber="176" 
MinorBuildNumber="2" 
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
/></soap11:Header>
<soap11:Body>
<soap11:Fault><faultcode>soap11:Client</faultcode>
<faultstring>The request failed schema validation: Data at the root 
level is invalid. Line 1, position 
1.</faultstring><detail><e:ResponseCode 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode><e:Message 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">Data at 
the root level is invalid. Line 1, position 1.</e:Message><e:Line 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">1</e:Line><e:Position 
xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">1</e:Position></detail></soap11:Fault></soap11:Body></soap11:Envelope>

On 11/29/2010 9:41 PM, Alex A wrote:
> Hello
>
> I am looking for a way to stream the content of file inside the XML 
> element, *without MTOM enabled*.
>
> Because it looks like MTOM is not supported by the Microsoft's IIS.
>
> Axis2/J, only client - wsdl used to generate xmlbeans/stub.
>
> Anyone could give me pointers or even better, examples?
>
> Thanks,
> ~ Alex.