Micro Focus QTP (UFT) Forums
Using MTOM with Web services - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Using MTOM with Web services (/Thread-Using-MTOM-with-Web-services)



Using MTOM with Web services - tester_rahul - 07-17-2012

hi ,

I am getting the following error message when i am requesting for a web service using MTOM as attachment.

The importTemplate operation call failed.
The .NET Framework 2.0 WSE 3.0 toolkit returned the following error:
Exception from: Net2ProxyBase
WSE839: An HTTP response was received that used the following content type: text/xml;charset=UTF-8. The following content type was expected: multipart/related; type=application/xop+xml.

Line (13):
Code:
"Set importTemplate = WebService("TemplateService").importTemplate(XMLWarehouse("ImportTemplate"))".

I am using the following lines of code:

Code:
' OCMConnectionService Web service object steps
connect = WebService("OCMConnectionService").connect("<domain name>","uid","pwd")
'WebService("OCMConnectionService").Check CheckPoint("connect")
environment.Value("token") = connect



' TemplateService Web service object steps
Webservice("TemplateService").Attachments.SetType micMTOM
webservice("TemplateService").attachments.add "C:\qtp\QtpWs.zip"


Set importTemplate = WebService("TemplateService").importTemplate(XMLWarehouse("ImportTemplate"))


Can some one provide me help regarding this


RE: Using MTOM with Web services - Tarik Sheth - 07-18-2012

Hi,
Can you please check if import method is available for the webservice that you are using.
You can do so by going through the web service URL and accessing available methods.


RE: Using MTOM with Web services - tester_rahul - 07-18-2012

Yes ,Tarik it is very much there
the method name is importtemplate and it expects a zip file as an attachment
using MTOM in web services for attachments. however this is nto working some how .

I am really confused and have wasted couple of days on this


yes it is


RE: Using MTOM with Web services - Tarik Sheth - 07-18-2012

think your service is set to use MTOM encoding,MTOM is set to Always. and the client is set to Optional. Since it is the client that makes the first request it does not optionally turns on the MTOM encoding but your
service method requires it. You need to programatically set MTOM enconding to On
when you access method.

i.e. if the response is non-MTOM like a SOAP fault, tell the proxy
we don't really need MTOM.


RE: Using MTOM with Web services - tester_rahul - 07-18-2012

I think what you are saying is correct , but what is the work around or code that i need to write to achieve this.
How do i disable MTOM ? Do u have any clue, can i chat on gtalk?
my gmail id is pantrah@gmail.com


RE: Using MTOM with Web services - tester_rahul - 07-19-2012

Does anyone have any solution for this.