ombre42 / robotframework-sudslibrary

Web service testing library for Robot Framework
Apache License 2.0
28 stars 44 forks source link

How to convert XML to WSDL object during SOAP Update a message? #25

Open GavinCui9 opened 7 years ago

GavinCui9 commented 7 years ago

I need to update an object attributes by reading it and update the response message and convert it to Update message, then call Soap Update method.

The problem is that when I convert a XML string/file to WSDL object, all < and > tags will be turned to < and > Is there a way to avoid this?

For example:

Starting test: Test-Update.case1 20170313 10:03:07.655 : INFO : Using WSDL at http://*.*.*.*/subscribermodel-ws/device?wsdl Suds ( https://fedorahosted.org/suds/ ) version: 0.4.1 (beta) build: R705-20101207

Service ( DeviceWebServiceService ) tns="http://." Prefixes (2) ns0 = "http://" ns3 = "http://" Ports (1): (DeviceWebServicePort) Methods (10): create(device device, ) delete(xs:string deviceId, ) echo(xs:string arg0, ) read(xs:string deviceId, ) update(device device, ) Types (28): device deviceArray deviceIdentity deviceIdentityArray deviceIdentityType deviceType user

20170313 10:03:07.659 : INFO : Sending: <?xml version="1.0" ?>

device-id-test1 20170313 10:03:07.665 : INFO : Received: 1 DefaultDeviceLifeCycle 1 false false cc34d7f6-267f-490a-94c8-2e854391301c true Active DefaultCategory 1489413781965 NORMAL device-id-test1 E164 6137849921 false 0 false 20170313 10:03:07.671 : INFO : ${device} = 1DefaultDeviceLifeCycle1falsefalsecc34d7f6-267f-490a-94c8-2e854391301ctrueActiveDefaultCategory1489413781965NORMALdevice-id-test1E1646137849921false0false 20170313 10:03:07.673 : INFO : ${devicexml} = 1DefaultDeviceLifeCycle1false1DefaultDeviceLifeCycle1falsefalsecc34d7f6-267f-490a-94c8-2e854391301ctrueActiveDefaultCategory1489413781965NORMALdevice-id-test1E1646137849921false0false 20170313 10:03:07.675 : INFO : ${device1} = 20170313 10:03:07.677 : INFO : 20170313 10:03:07.678 : INFO : ${device2} = 1DefaultDeviceLifeCycle1false1DefaultDeviceLifeCycle1falsefalsecc34d7f6-267f-490a-94c8-2e854391301ctrueActiveDefaultCategory1489413781965NORMALdevice-id-test1E16422222222false0falsesubscription-id-test2 20170313 10:03:07.680 : INFO : ${device3} = 1DefaultDeviceLifeCycle1falsefalsecc34d7f6-267f-490a-94c8-2e854391301ctr... 20170313 10:03:07.681 : INFO : 1DefaultDeviceLifeCycle1falsefalsecc34d7f6-267f-490a-94c8-2e854391301ctrueActiveDefaultCategory1489413781965NORMALdevice-id-test1E16422222222false0falsesubscription-id-test2 20170313 10:03:07.682 : INFO : ${device4} = None 20170313 10:03:07.683 : INFO : None 20170313 10:03:07.685 : INFO : Sending: <version>1</version><lifeCycleName>DefaultDeviceLifeCycle</lifeCycleName><state><version>1</version><barring>false</barring><final>false</final><id>cc34d7f6-267f-490a-94c8-2e854391301c</id><initial>true</initial><name>Active</name></state><categoryList>DefaultCategory</categoryList><creationTime>1489413781965</creationTime><customData/><deviceType>NORMAL</deviceType><groups/><id>device-id-test1</id><identities><identityType>E164</identityType><value>22222222</value></identities><pwdEncrypted>false</pwdEncrypted><subscriptionIndex>0</subscriptionIndex><syOCSEnabled>false</syOCSEnabled><subscriptionIds>subscription-id-test2</subscriptionIds> 20170313 10:03:07.692 : ERROR : <version>1</version><lifeCycleName>DefaultDeviceLifeCycle</lifeCycleName><state><version>1</version><barring>false</barring><final>false</final><id>cc34d7f6-267f-490a-94c8-2e854391301c</id><initial>true</initial><name>Active</name></state><categoryList>DefaultCategory</categoryList><creationTime>1489413781965</creationTime><customData/><deviceType>NORMAL</deviceType><groups/><id>device-id-test1</id><identities><identityType>E164</identityType><value>22222222</value></identities><pwdEncrypted>false</pwdEncrypted><subscriptionIndex>0</subscriptionIndex><syOCSEnabled>false</syOCSEnabled><subscriptionIds>subscription-id-test2</subscriptionIds> 20170313 10:03:07.693 : FAIL : WebFault: Server raised fault: 'Entity Id is null.' Ending test: Test-Update.case1
ombre42 commented 7 years ago

Sorry for the late reply. The message log is quite helpful, but I would also need to see the code you are executing to understand what is going on.