I presume this error occurs when you receive the response. Can you check the
messages using TCP Monitor please and post it here.

Thanks,
Keith.

On 10/22/07, Kimberly Nicholls <[EMAIL PROTECTED]> wrote:
>
>  I am having trouble creating a SOAP message from a generated client when
> the message includes attachments -- the client throws "
> org.apache.axiom.soap.SOAPProcessingException: First Element must contain
> the local name, Envelope , but found html."  I am using axis2 1.3, and I
> can make requests to other methods (without attachments) in the same service
> with no problems.
>
> Here's what I did:
>
> - set enableMTOM to true in axis2.xml
> - created method in my POJO service: public long createAttachment(long
> messageID, DataHandler attData)
> - generated client stub via wsdl2java
> - added these lines to client stub:
>         _serviceClient.getOptions().setProperty(
>                 Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE
> );
>          _serviceClient.getOptions().setTimeOutInMilliSeconds(10000);
> - created client that runs the method like this:
>             DataHandler attData = new DataHandler(new
> FileDataSource(filename));
>             long attachmentID = stub.createAttachment(messageID, attData);
>
> When I run the client, I get
>
> [INFO] OMException in getSOAPBuilder
> org.apache.axiom.soap.SOAPProcessingException: First Element must contain
> the local name, Envelope , but found html
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(
> StAXSOAPModelBuilder.java:219)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
> StAXSOAPModelBuilder.java:177)
>         at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(
> StAXOMBuilder.java:163)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
> StAXSOAPModelBuilder.java:161)
>         at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(
> StAXSOAPModelBuilder.java:110)
>         at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(
> BuilderUtil.java:609)
>         at org.apache.axis2.transport.TransportUtils.createDocumentElement
> (TransportUtils.java:178)
>         at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
> TransportUtils.java:111)
>         at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
> TransportUtils.java:87)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
> OutInAxisOperation.java:326)
>         at org.apache.axis2.description.OutInAxisOperationClient.send(
> OutInAxisOperation.java:389)
>         at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
> OutInAxisOperation.java:211)
>         at org.apache.axis2.client.OperationClient.execute(
> OperationClient.java:163)
> ...
> Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element
> must contain the local name, Envelope , but found html
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(
> StAXSOAPModelBuilder.java:219)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
> StAXSOAPModelBuilder.java:177)
>         at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(
> StAXOMBuilder.java:163)
>         at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
> StAXSOAPModelBuilder.java:161)
>         at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(
> StAXSOAPModelBuilder.java:110)
>         at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(
> BuilderUtil.java:609)
>         at org.apache.axis2.transport.TransportUtils.createDocumentElement
> (TransportUtils.java:178)
>         at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
> TransportUtils.java:111)
>         at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
> TransportUtils.java:87)
>         ... 6 more
>
>
> Running other methods in the same client with the same service work fine,
> if they don't have attachments.  The file I'm trying to send is a 2.5kjpg.  
> What am I doing wrong?
>
> Kimberly
>
>


-- 
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/

Reply via email to