python zeep and MessagePack attachments












0















A python rookie here and thank you for taking time to help.



I am sending a SOAP request to download some mp4 recordings from a server using zeep. The server responds by sending the following MessagePack attachments. How do I unpack this and convert to mp4. The multi-part attachment has both the decsription of the file and the actual MP4 file itself. Thanks



<MessagePack(attachments=[<Attachment('<6X3ER09X000X401BEFX91B4FFBD48906>', 'application/octet-stream')>, <Attachment('<0XECXX28CX0RS9DD28BYYA9F2CBA177D>', 'application/octet-stream')>])>


Here is the code I am trying to use



def get_record(client, siteid, username, passwd, ticket):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId': xxxxx, 'ticket':ticket})

def main():

client = Client(wsdl=wsdl)
service = client.create_service(BINDING_NAME, ADDRESS)
resp = update_phone_by_name(service, siteid, username, password, ticket)
pack = client.service.downloadNBRStorageFile
recording = pack.root
description = pack.attachments[0].content
rec_file = pack.attachments[1].content


When I run this I get this error
"recording = pack.root
AttributeError: 'OperationProxy' object has no attribute 'root'"



I am trying to do the same as this post but unable to figure out how to download the attachments



Python SOAP WSDL works in SOAPpy but not ZSI or zeep



----Edit-----Update-----
I have updated the code as below:



def get_ticket(client):
global rec_ticket
global ticket
rec_ticket = client.getStorageAccessTicket(**{'siteId': siteid, 'username': username, 'password': password})
return rec_ticket

def get_record(client):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId':


recordid, 'ticket':rec_ticket})



def main():
client = Client(wsdl=wsdl)
axl = client.create_service(BINDING_NAME, ADDRESS)
resp_ticket = get_ticket(axl)
resp_rec = get_record(axl)
pack = client.service.downloadNBRStorageFile(siteid, recordID, rec_ticket)

record_details = pack.root
record_file = pack.attachments[1].content


However I get the response below:
" raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.224.91.216', port=2001): Max retries exceeded with url: /nbr/services/NBRStorageService (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))"










share|improve this question

























  • What have you tried so far? Have you read through the zeep documentation? There is some example code in the docs.

    – larsks
    Nov 28 '18 at 2:35











  • Thanks larsks. I have looked at that doc but it does not help or I cant seem to understand how to apply it to this scenario. I have updatedmy question to include the code I am trying to use and the error I am getting

    – Dejoskii
    Nov 28 '18 at 4:16











  • Can anyone please help out here.

    – Dejoskii
    Nov 29 '18 at 10:10
















0















A python rookie here and thank you for taking time to help.



I am sending a SOAP request to download some mp4 recordings from a server using zeep. The server responds by sending the following MessagePack attachments. How do I unpack this and convert to mp4. The multi-part attachment has both the decsription of the file and the actual MP4 file itself. Thanks



<MessagePack(attachments=[<Attachment('<6X3ER09X000X401BEFX91B4FFBD48906>', 'application/octet-stream')>, <Attachment('<0XECXX28CX0RS9DD28BYYA9F2CBA177D>', 'application/octet-stream')>])>


Here is the code I am trying to use



def get_record(client, siteid, username, passwd, ticket):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId': xxxxx, 'ticket':ticket})

def main():

client = Client(wsdl=wsdl)
service = client.create_service(BINDING_NAME, ADDRESS)
resp = update_phone_by_name(service, siteid, username, password, ticket)
pack = client.service.downloadNBRStorageFile
recording = pack.root
description = pack.attachments[0].content
rec_file = pack.attachments[1].content


When I run this I get this error
"recording = pack.root
AttributeError: 'OperationProxy' object has no attribute 'root'"



I am trying to do the same as this post but unable to figure out how to download the attachments



Python SOAP WSDL works in SOAPpy but not ZSI or zeep



----Edit-----Update-----
I have updated the code as below:



def get_ticket(client):
global rec_ticket
global ticket
rec_ticket = client.getStorageAccessTicket(**{'siteId': siteid, 'username': username, 'password': password})
return rec_ticket

def get_record(client):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId':


recordid, 'ticket':rec_ticket})



def main():
client = Client(wsdl=wsdl)
axl = client.create_service(BINDING_NAME, ADDRESS)
resp_ticket = get_ticket(axl)
resp_rec = get_record(axl)
pack = client.service.downloadNBRStorageFile(siteid, recordID, rec_ticket)

record_details = pack.root
record_file = pack.attachments[1].content


However I get the response below:
" raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.224.91.216', port=2001): Max retries exceeded with url: /nbr/services/NBRStorageService (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))"










share|improve this question

























  • What have you tried so far? Have you read through the zeep documentation? There is some example code in the docs.

    – larsks
    Nov 28 '18 at 2:35











  • Thanks larsks. I have looked at that doc but it does not help or I cant seem to understand how to apply it to this scenario. I have updatedmy question to include the code I am trying to use and the error I am getting

    – Dejoskii
    Nov 28 '18 at 4:16











  • Can anyone please help out here.

    – Dejoskii
    Nov 29 '18 at 10:10














0












0








0








A python rookie here and thank you for taking time to help.



I am sending a SOAP request to download some mp4 recordings from a server using zeep. The server responds by sending the following MessagePack attachments. How do I unpack this and convert to mp4. The multi-part attachment has both the decsription of the file and the actual MP4 file itself. Thanks



<MessagePack(attachments=[<Attachment('<6X3ER09X000X401BEFX91B4FFBD48906>', 'application/octet-stream')>, <Attachment('<0XECXX28CX0RS9DD28BYYA9F2CBA177D>', 'application/octet-stream')>])>


Here is the code I am trying to use



def get_record(client, siteid, username, passwd, ticket):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId': xxxxx, 'ticket':ticket})

def main():

client = Client(wsdl=wsdl)
service = client.create_service(BINDING_NAME, ADDRESS)
resp = update_phone_by_name(service, siteid, username, password, ticket)
pack = client.service.downloadNBRStorageFile
recording = pack.root
description = pack.attachments[0].content
rec_file = pack.attachments[1].content


When I run this I get this error
"recording = pack.root
AttributeError: 'OperationProxy' object has no attribute 'root'"



I am trying to do the same as this post but unable to figure out how to download the attachments



Python SOAP WSDL works in SOAPpy but not ZSI or zeep



----Edit-----Update-----
I have updated the code as below:



def get_ticket(client):
global rec_ticket
global ticket
rec_ticket = client.getStorageAccessTicket(**{'siteId': siteid, 'username': username, 'password': password})
return rec_ticket

def get_record(client):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId':


recordid, 'ticket':rec_ticket})



def main():
client = Client(wsdl=wsdl)
axl = client.create_service(BINDING_NAME, ADDRESS)
resp_ticket = get_ticket(axl)
resp_rec = get_record(axl)
pack = client.service.downloadNBRStorageFile(siteid, recordID, rec_ticket)

record_details = pack.root
record_file = pack.attachments[1].content


However I get the response below:
" raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.224.91.216', port=2001): Max retries exceeded with url: /nbr/services/NBRStorageService (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))"










share|improve this question
















A python rookie here and thank you for taking time to help.



I am sending a SOAP request to download some mp4 recordings from a server using zeep. The server responds by sending the following MessagePack attachments. How do I unpack this and convert to mp4. The multi-part attachment has both the decsription of the file and the actual MP4 file itself. Thanks



<MessagePack(attachments=[<Attachment('<6X3ER09X000X401BEFX91B4FFBD48906>', 'application/octet-stream')>, <Attachment('<0XECXX28CX0RS9DD28BYYA9F2CBA177D>', 'application/octet-stream')>])>


Here is the code I am trying to use



def get_record(client, siteid, username, passwd, ticket):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId': xxxxx, 'ticket':ticket})

def main():

client = Client(wsdl=wsdl)
service = client.create_service(BINDING_NAME, ADDRESS)
resp = update_phone_by_name(service, siteid, username, password, ticket)
pack = client.service.downloadNBRStorageFile
recording = pack.root
description = pack.attachments[0].content
rec_file = pack.attachments[1].content


When I run this I get this error
"recording = pack.root
AttributeError: 'OperationProxy' object has no attribute 'root'"



I am trying to do the same as this post but unable to figure out how to download the attachments



Python SOAP WSDL works in SOAPpy but not ZSI or zeep



----Edit-----Update-----
I have updated the code as below:



def get_ticket(client):
global rec_ticket
global ticket
rec_ticket = client.getStorageAccessTicket(**{'siteId': siteid, 'username': username, 'password': password})
return rec_ticket

def get_record(client):
return client.downloadNBRStorageFile(**{'siteId': 'xxxxx', 'recordId':


recordid, 'ticket':rec_ticket})



def main():
client = Client(wsdl=wsdl)
axl = client.create_service(BINDING_NAME, ADDRESS)
resp_ticket = get_ticket(axl)
resp_rec = get_record(axl)
pack = client.service.downloadNBRStorageFile(siteid, recordID, rec_ticket)

record_details = pack.root
record_file = pack.attachments[1].content


However I get the response below:
" raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.224.91.216', port=2001): Max retries exceeded with url: /nbr/services/NBRStorageService (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))"







python zeep






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 '18 at 15:51







Dejoskii

















asked Nov 28 '18 at 2:07









DejoskiiDejoskii

12




12













  • What have you tried so far? Have you read through the zeep documentation? There is some example code in the docs.

    – larsks
    Nov 28 '18 at 2:35











  • Thanks larsks. I have looked at that doc but it does not help or I cant seem to understand how to apply it to this scenario. I have updatedmy question to include the code I am trying to use and the error I am getting

    – Dejoskii
    Nov 28 '18 at 4:16











  • Can anyone please help out here.

    – Dejoskii
    Nov 29 '18 at 10:10



















  • What have you tried so far? Have you read through the zeep documentation? There is some example code in the docs.

    – larsks
    Nov 28 '18 at 2:35











  • Thanks larsks. I have looked at that doc but it does not help or I cant seem to understand how to apply it to this scenario. I have updatedmy question to include the code I am trying to use and the error I am getting

    – Dejoskii
    Nov 28 '18 at 4:16











  • Can anyone please help out here.

    – Dejoskii
    Nov 29 '18 at 10:10

















What have you tried so far? Have you read through the zeep documentation? There is some example code in the docs.

– larsks
Nov 28 '18 at 2:35





What have you tried so far? Have you read through the zeep documentation? There is some example code in the docs.

– larsks
Nov 28 '18 at 2:35













Thanks larsks. I have looked at that doc but it does not help or I cant seem to understand how to apply it to this scenario. I have updatedmy question to include the code I am trying to use and the error I am getting

– Dejoskii
Nov 28 '18 at 4:16





Thanks larsks. I have looked at that doc but it does not help or I cant seem to understand how to apply it to this scenario. I have updatedmy question to include the code I am trying to use and the error I am getting

– Dejoskii
Nov 28 '18 at 4:16













Can anyone please help out here.

– Dejoskii
Nov 29 '18 at 10:10





Can anyone please help out here.

– Dejoskii
Nov 29 '18 at 10:10












1 Answer
1






active

oldest

votes


















0














You're not actually calling client.service.downloadNBRStorageFile. To actually call the method, you would need:



pack = client.service.downloadNBRStorageFile()


(Note the parentheses on the end.)



Your current code is simply assigning the client.service.downloadNBRStorageFile object to your pack variable, which is why your error message refers to an OperationProxy type.






share|improve this answer
























  • Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

    – Dejoskii
    Nov 29 '18 at 15:52











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53511057%2fpython-zeep-and-messagepack-attachments%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You're not actually calling client.service.downloadNBRStorageFile. To actually call the method, you would need:



pack = client.service.downloadNBRStorageFile()


(Note the parentheses on the end.)



Your current code is simply assigning the client.service.downloadNBRStorageFile object to your pack variable, which is why your error message refers to an OperationProxy type.






share|improve this answer
























  • Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

    – Dejoskii
    Nov 29 '18 at 15:52
















0














You're not actually calling client.service.downloadNBRStorageFile. To actually call the method, you would need:



pack = client.service.downloadNBRStorageFile()


(Note the parentheses on the end.)



Your current code is simply assigning the client.service.downloadNBRStorageFile object to your pack variable, which is why your error message refers to an OperationProxy type.






share|improve this answer
























  • Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

    – Dejoskii
    Nov 29 '18 at 15:52














0












0








0







You're not actually calling client.service.downloadNBRStorageFile. To actually call the method, you would need:



pack = client.service.downloadNBRStorageFile()


(Note the parentheses on the end.)



Your current code is simply assigning the client.service.downloadNBRStorageFile object to your pack variable, which is why your error message refers to an OperationProxy type.






share|improve this answer













You're not actually calling client.service.downloadNBRStorageFile. To actually call the method, you would need:



pack = client.service.downloadNBRStorageFile()


(Note the parentheses on the end.)



Your current code is simply assigning the client.service.downloadNBRStorageFile object to your pack variable, which is why your error message refers to an OperationProxy type.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 29 '18 at 12:20









larskslarsks

119k19199208




119k19199208













  • Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

    – Dejoskii
    Nov 29 '18 at 15:52



















  • Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

    – Dejoskii
    Nov 29 '18 at 15:52

















Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

– Dejoskii
Nov 29 '18 at 15:52





Thank you @larsks for taking time to help me on this. I modified the code as shown above but I just get connection timeout. NB if I remove the pack commands, the server responds with the messagePack attachments

– Dejoskii
Nov 29 '18 at 15:52




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53511057%2fpython-zeep-and-messagepack-attachments%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks