Re: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
> Will this method.addChild will not create the proper XML format when I > send in the message? > What I mean by proper XML format is the XMLSchema which your service mandates your request should adhere to.. Do you have a proper WSDL for the service.. Is the service under ur control or something external.. ~Thilina > > > > > msgAttach.setUserId("Test"); > > msgAttach.setPassword("test"); > > msgAttach.setXMLMsg(""); > > msgAttach.setElement(method); > > > > myStub.processWithAttach(msgAttach); > > > > Thanks, > Asmita > > > -- > > *From:* Thilina Gunarathne [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, July 03, 2008 2:48 PM > *To:* axis-user@ws.apache.org > *Subject:* Re: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can > not serialize > > > > Hi, > I'm a bit confused... Why are you creating the XML using Axiom while you > have stubs generated... It would have been better if you fixed your wsdl to > reflect the correct XML elements and code generated.. > > Looks like you are getting the fault from the serverside. A message trace > of the request and the WSDL of the service would help to figure out the > problem clearly.. > >myStub._getServiceClient().getOptions() > > .setProperty(Constants.Configuration.*ENABLE_MTOM*, > Constants.*VALUE_TRUE*); > > > myStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(1); > > File file = *new* File(*INPUT_FILE*); > > FileInputStream fis = *new* FileInputStream(file); > > String base64String = Base64.*encode*(*readFully*(fis)); > //reads the file bitwise before encode is called on it. > > You can just create a DataHandler and create the OMText out of it... > Trying to do the above will put in you in trouble if you are trying to send > a larger attachment. > > > > OMText binaryNode > =fac.createOMText(base64String,"application/pdf",*true*); > > You can use the createOMText() with DataHandler.. > > > > > > Why do I get unknown type cannot serialize? > > Chances are that you are not sending the message in the correct (XML > hierachy) format.. > > thanks, > Thilina > > > > Thanks, > > Asmita > -- > > *From:* Tony Dean [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, July 03, 2008 11:46 AM > *To:* axis-user@ws.apache.org > *Subject:* RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can > not serialize > > > > don't know about your issue, but there are other issues fixed in 1.4 that > were broke in 1.3 so I wouldn't go back there. > > > > *From:* Attharkar, Asmita [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, July 03, 2008 9:40 AM > *To:* axis-user@ws.apache.org > *Subject:* MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not > serialize > > > > All, > > > > I am trying to send a pdf attachment in the soap message but I get this: > > > > > org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) > > > > And the message doesn't come to web services server, it is failing in > OperationClient.execute() method itself. > > The AxisFault message shows "*Unknow type can not serialize*". What could > be the possible reasons for this or is this a known issue with axis2 1.4 > release? Should I use axis2 1.3 release if I need to send an attachment > using MTOM? > > > > Thanks so much for you help! > > > > I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 > 1.4 > > > > Thanks, > > Asmita > > > > > > > -- > Thilina Gunarathne - http://thilinag.blogspot.com > -- Thilina Gunarathne - http://thilinag.blogspot.com
RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
Ok Now I am using File file = new File(INPUT_FILE); FileDataSource fileDataSource = new FileDataSource(file); //--- DataHandler dataHandler = new DataHandler(fileDataSource); // processWithAttach msgAttach = new processWithAttach (); OMFactory fac = OMAbstractFactory.getOMFactory(); OMText binaryNode =fac.createOMText(dataHandler,true); But still the same issue, how can I make sure if I am using the right format. To create my message I am using the standard methods itself: OMElement method = fac.createOMElement("processWithAttach ", omNs); method.addChild(binaryNode); Will this method.addChild will not create the proper XML format when I send in the message? msgAttach.setUserId("Test"); msgAttach.setPassword("test"); msgAttach.setXMLMsg(""); msgAttach.setElement(method); myStub.processWithAttach(msgAttach); Thanks, Asmita From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 2:48 PM To: axis-user@ws.apache.org Subject: Re: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize Hi, I'm a bit confused... Why are you creating the XML using Axiom while you have stubs generated... It would have been better if you fixed your wsdl to reflect the correct XML elements and code generated.. Looks like you are getting the fault from the serverside. A message trace of the request and the WSDL of the service would help to figure out the problem clearly.. myStub._getServiceClient().getOptions() .setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); myStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(1); File file = new File(INPUT_FILE); FileInputStream fis = new FileInputStream(file); String base64String = Base64.encode(readFully(fis)); //reads the file bitwise before encode is called on it. You can just create a DataHandler and create the OMText out of it... Trying to do the above will put in you in trouble if you are trying to send a larger attachment. OMText binaryNode =fac.createOMText(base64String,"application/pdf",true); You can use the createOMText() with DataHandler.. Why do I get unknown type cannot serialize? Chances are that you are not sending the message in the correct (XML hierachy) format.. thanks, Thilina Thanks, Asmita From: Tony Dean [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] Sent: Thursday, July 03, 2008 11:46 AM To: axis-user@ws.apache.org<mailto:axis-user@ws.apache.org> Subject: RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize don't know about your issue, but there are other issues fixed in 1.4 that were broke in 1.3 so I wouldn't go back there. From: Attharkar, Asmita [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] Sent: Thursday, July 03, 2008 9:40 AM To: axis-user@ws.apache.org<mailto:axis-user@ws.apache.org> Subject: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize All, I am trying to send a pdf attachment in the soap message but I get this: org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) And the message doesn't come to web services server, it is failing in OperationClient.execute() method itself. The AxisFault message shows "Unknow type can not serialize". What could be the possible reasons for this or is this a known issue with axis2 1.4 release? Should I use axis2 1.3 release if I need to send an attachment using MTOM? Thanks so much for you help! I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 1.4 Thanks, Asmita -- Thilina Gunarathne - http://thilinag.blogspot.com
Re: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
Hi, I'm a bit confused... Why are you creating the XML using Axiom while you have stubs generated... It would have been better if you fixed your wsdl to reflect the correct XML elements and code generated.. Looks like you are getting the fault from the serverside. A message trace of the request and the WSDL of the service would help to figure out the problem clearly.. > myStub._getServiceClient().getOptions() > > .setProperty(Constants.Configuration.*ENABLE_MTOM*, > Constants.*VALUE_TRUE*); > > > myStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(1); > > File file = *new* File(*INPUT_FILE*); > > FileInputStream fis = *new* FileInputStream(file); > > String base64String = Base64.*encode*(*readFully*(fis)); > //reads the file bitwise before encode is called on it. > You can just create a DataHandler and create the OMText out of it... Trying to do the above will put in you in trouble if you are trying to send a larger attachment. > > OMText binaryNode > =fac.createOMText(base64String,"application/pdf",*true*); > You can use the createOMText() with DataHandler.. Why do I get unknown type cannot serialize? > Chances are that you are not sending the message in the correct (XML hierachy) format.. thanks, Thilina > > Thanks, > > Asmita > -- > > *From:* Tony Dean [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, July 03, 2008 11:46 AM > *To:* axis-user@ws.apache.org > *Subject:* RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can > not serialize > > > > don't know about your issue, but there are other issues fixed in 1.4 that > were broke in 1.3 so I wouldn't go back there. > > > > *From:* Attharkar, Asmita [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, July 03, 2008 9:40 AM > *To:* axis-user@ws.apache.org > *Subject:* MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not > serialize > > > > All, > > > > I am trying to send a pdf attachment in the soap message but I get this: > > > > > org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) > > > > And the message doesn't come to web services server, it is failing in > OperationClient.execute() method itself. > > The AxisFault message shows "*Unknow type can not serialize*". What could > be the possible reasons for this or is this a known issue with axis2 1.4 > release? Should I use axis2 1.3 release if I need to send an attachment > using MTOM? > > > > Thanks so much for you help! > > > > I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 > 1.4 > > > > Thanks, > > Asmita > > > -- Thilina Gunarathne - http://thilinag.blogspot.com
RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
try specifying "application/octet"... I personally use a dataHandler and use streams directly... From: Attharkar, Asmita [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 12:18 PM To: axis-user@ws.apache.org Subject: RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize Hi, Here is my client code: myStub._getServiceClient().getOptions() .setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); myStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(1); File file = new File(INPUT_FILE); FileInputStream fis = new FileInputStream(file); String base64String = Base64.encode(readFully(fis)); //reads the file bitwise before encode is called on it. ServiceMethodWithAttach serviceMsgAttach = new ServiceMethodWithAttach (); OMFactory fac = OMAbstractFactory.getOMFactory(); OMText binaryNode =fac.createOMText(base64String,"application/pdf",true); OMNamespace omNs = fac.createOMNamespace("http://abc.xyz.com";, "ns1"); OMElement method = fac.createOMElement("processNPCMsgWithAttach", omNs); method.addChild(binaryNode); serviceMsgAttach.setUserId("Test"); // String 1 serviceMsgAttach.setPassword("test"); //String 2 serviceMsgAttach.setXMLMsg(""); //String 3 serviceMsgAttach.setElement(method); //Attachment myStub.serviceMethodWithAttach (serviceMsgAttach); System.out.println("done calling service..."); In Services.xml I have added the parameter : true Why do I get unknown type cannot serialize? Thanks, Asmita From: Tony Dean [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 11:46 AM To: axis-user@ws.apache.org Subject: RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize don't know about your issue, but there are other issues fixed in 1.4 that were broke in 1.3 so I wouldn't go back there. From: Attharkar, Asmita [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 9:40 AM To: axis-user@ws.apache.org Subject: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize All, I am trying to send a pdf attachment in the soap message but I get this: org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) And the message doesn't come to web services server, it is failing in OperationClient.execute() method itself. The AxisFault message shows "Unknow type can not serialize". What could be the possible reasons for this or is this a known issue with axis2 1.4 release? Should I use axis2 1.3 release if I need to send an attachment using MTOM? Thanks so much for you help! I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 1.4 Thanks, Asmita
RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
Hi, Here is my client code: myStub._getServiceClient().getOptions() .setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); myStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(1); File file = new File(INPUT_FILE); FileInputStream fis = new FileInputStream(file); String base64String = Base64.encode(readFully(fis)); //reads the file bitwise before encode is called on it. ServiceMethodWithAttach serviceMsgAttach = new ServiceMethodWithAttach (); OMFactory fac = OMAbstractFactory.getOMFactory(); OMText binaryNode =fac.createOMText(base64String,"application/pdf",true); OMNamespace omNs = fac.createOMNamespace("http://abc.xyz.com";, "ns1"); OMElement method = fac.createOMElement("processNPCMsgWithAttach", omNs); method.addChild(binaryNode); serviceMsgAttach.setUserId("Test"); // String 1 serviceMsgAttach.setPassword("test"); //String 2 serviceMsgAttach.setXMLMsg(""); //String 3 serviceMsgAttach.setElement(method); //Attachment myStub.serviceMethodWithAttach (serviceMsgAttach); System.out.println("done calling service..."); In Services.xml I have added the parameter : true Why do I get unknown type cannot serialize? Thanks, Asmita From: Tony Dean [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 11:46 AM To: axis-user@ws.apache.org Subject: RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize don't know about your issue, but there are other issues fixed in 1.4 that were broke in 1.3 so I wouldn't go back there. From: Attharkar, Asmita [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 9:40 AM To: axis-user@ws.apache.org Subject: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize All, I am trying to send a pdf attachment in the soap message but I get this: org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) And the message doesn't come to web services server, it is failing in OperationClient.execute() method itself. The AxisFault message shows "Unknow type can not serialize". What could be the possible reasons for this or is this a known issue with axis2 1.4 release? Should I use axis2 1.3 release if I need to send an attachment using MTOM? Thanks so much for you help! I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 1.4 Thanks, Asmita
RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
don't know about your issue, but there are other issues fixed in 1.4 that were broke in 1.3 so I wouldn't go back there. From: Attharkar, Asmita [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2008 9:40 AM To: axis-user@ws.apache.org Subject: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize All, I am trying to send a pdf attachment in the soap message but I get this: org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) And the message doesn't come to web services server, it is failing in OperationClient.execute() method itself. The AxisFault message shows "Unknow type can not serialize". What could be the possible reasons for this or is this a known issue with axis2 1.4 release? Should I use axis2 1.3 release if I need to send an attachment using MTOM? Thanks so much for you help! I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 1.4 Thanks, Asmita