Thread Tools Search this Thread
Unread 5th Dec 2017, 08:00 AM   #1
Kishor Patidar
 
patidarkishor777's Avatar
 
Join Date: 2017
Location: Indore India
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Getting a error when parsing SOAP API response a [XOP/XML] using nodejs or javascript
Share on: 
fb share twitter share gplus share more share

I am calling a SOAP API using a node js request api calling successfully and returning a response in a XOP/XML format.

Here is my response

--MIMEBoundary_e6fff532a5484248aea750d25d37bcec820c7 e0a3338bc30
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.f6fff532a5484248aea750d25d37bcec820c7e0a3338bc3 0@apache.org>

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:listContactsResponse xmlns:ns="http://wrappers.webservice.appservices.core.inteqnet.com" ><ns:return xmlns:ax226="http://beans.webservice.components.inteqnet.com/xsd" xmlns:ax224="http://beans.webservice.appservices.core.inteqnet.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax226:DefaultServiceResponse"><ax226:err ors></ax226:errors><ax226:notes></ax226:notes><ax226:resourceName></ax226:resourceName><ax226:responseBean xsi:type="ax226:Bean"/><ax226:responseFormat>JSON</ax226:responseFormat><ax226:responseStatus>OK</ax226:responseStatus><ax226:responseText>[

{
"Email": "testca@test.com",
"Full Name": "CA, tobedeleted EndUser3",
"ID": "84",
"Job Title": "Self Service",
"Phone Details": "Business",
"Phone Number": "284335"
},
{
"Email": "testca@test.com",
"Full Name": "CA, tobedeleted EndUser4",
"ID": "85",
"Job Title": "Self Service",
"Phone Details": "Business",
"Phone Number": "284336"
},
{
"Email": "testca@test.com",
"Full Name": "CA, tobedeleted EndUser5",
"ID": "86",
"Job Title": "Self Service",
"Phone Details": "Business",
"Phone Number": "284337"
},


]</ax226:responseText><ax226:statusCode>000</ax226:statusCode><ax226:statusMessage>Success: The request was successfully fulfilled by the server; the service returned results of the operation.</ax226:statusMessage><ax226:warnings></ax226:warnings></ns:return></ns:listContactsResponse></soapenv:Body></soapenv:Envelope>
--MIMEBoundary_e6fff532a5484248aea750d25d37bcec820c7 e0a3338bc30--



In the response you can see some headers are in a response so when I parsing a this response usning a xml2json node library it returning a invalid xml input. This is because of the response is not in a xml format, it is in binary xop/xml.

I have tried a lot but unable to find a solution.

Can someone please have a look into this and provide me a solution how I can parse this response. I want this solution in a node js or a javascript.

Thanks in advance!

Kishore
patidarkishor777 is offline   Reply With Quote
Unread 12th Dec 2017, 08:04 AM   #2
Warrior Member
 
Join Date: 2017
Posts: 5
Thanks: 1
Thanked 4 Times in 3 Posts
Default
RE: Getting a error when parsing SOAP API response a [XOP/XML] using nodejs or javascript
Share on: 
fb share twitter share gplus share more share

Hi Kishore. I think you probably want a better library that can do more of the work for you instead of plain xml parsing. Have you considered trying something like this npm package?
codexmonkey is offline   Reply With Quote


Bookmarks

Tags
api, error, javascript, nodejs, parsing, response, soap, xop or xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:56 PM.