How to take Image with webservice?How do you debug React Native?What's the best way to add a full screen background image in React NativeHow to do logging in React Native?How can you float: right in React Native?How to add icons to React Native appHow to update parent's state in React?How to realize a circle image button with react nativeHow to take image as input in reactnativeReact Native Image prefetch doesn't take headersHow to send request to an asmx webservice

Why is su world executable?

Doesn't the speed of light limit imply the same electron can be annihilated twice?

What should we do with manuals from the 80s?

What would be synonyms for "be into something"?

Deciphering Lunacy Asylum case notes about General appearance / Description of Bodily Symptoms

Is this bar slide trick shown on Cheers real or a visual effect?

Does writing regular diary entries count as writing practice?

Build a mob of suspiciously happy lenny faces ( ͡° ͜ʖ ͡°)

Are there any cons in using rounded corners for bar graphs?

How does the Moon's gravity affect Earth's oceans despite Earth's stronger gravitational pull?

What happens when a person with some edited genetics (like say, eagle eyes) reproduces with a person with regular genetics?

How to train a replacement without them knowing?

Attacking the Hydra

Eric Andre had a dream

global variant of csname…endcsname

What would cause a nuclear power plant to break down after 2000 years, but not sooner?

How to prevent criminal gangs from making/buying guns?

May the tower use the runway while an emergency aircraft is inbound?

What is the question mark?

Why should I pay for an SSL certificate?

Minimum population for language survival

If a person claims to know anything could it be disproven by saying 'prove that we are not in a simulation'?

Problem with GFCI at start of circuit with both lights and two receptacles

Why does this image of cyclocarbon look like a nonagon?



How to take Image with webservice?


How do you debug React Native?What's the best way to add a full screen background image in React NativeHow to do logging in React Native?How can you float: right in React Native?How to add icons to React Native appHow to update parent's state in React?How to realize a circle image button with react nativeHow to take image as input in reactnativeReact Native Image prefetch doesn't take headersHow to send request to an asmx webservice






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have an online database and I put images there.
I use fetch to call webservice but it gives me an error because of images. how to handle this?



 fetch('url', 
method: 'POST',
headers: new Headers(
Accept: 'application/json',
Content-Type': 'application/json', // <-- Specifying the Content-Type
),
)
.then((response) =>
console.log(response);
);


this is my fetch. As I said When call web service it gives me an error because of not fetching images



I serializer in webservice like this :



public class Data

public string Ref get; set;

public int CharacterID get; set;
public string CharacterName get; set;
public string Regions get; set;
public string Rarity get; set;
public char Role get; set;
public string Origin get; set;
public int Power get; set;
public string Tag1 get; set;
public string Tag2 get; set;
public string Tag3 get; set;
public string RareMaterial get; set;
public string EpicMaterial get; set;
public string UniqueMaterial get; set;
public string Image get; set;


[JsonConverter(typeof(ImageConverter))]
public Image Images get; set;



public class ImageConverter : JsonConverter

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

var base64 = (string)reader.Value;
// convert base64 to byte array, put that into memory stream and feed to image
return Image.FromStream(new MemoryStream(Convert.FromBase64String(base64)));


public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

var image = (Image)value;
// save to memory stream in original format
var ms = new MemoryStream();
image.Save(ms, image.RawFormat);
byte[] imageBytes = ms.ToArray();
// write byte array, will be converted to base64 by JSON.NET
writer.WriteValue(imageBytes);


public override bool CanConvert(Type objectType)

return objectType == typeof(Image);




how to deserialize this in react-native ?










share|improve this question


























  • how you store your image on API? a path or format like base64

    – errorau
    Mar 27 at 12:55











  • Can you post the exact error you have ?

    – jgoday
    Mar 27 at 13:07











  • "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="w3.org/2003/05/soap-envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… xml:lang="en">Server was unable to process request. ---&gt; Root element is missing.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>"

    – hakan
    Mar 27 at 13:07











  • SOAP returns a xml. If you want to return a json with SOAP you must added as a CDATA in the response xml. What framework/library are you using in the server side ?

    – jgoday
    Mar 27 at 13:12











  • newtonSoft. By the way, How tO add CDATA ?

    – hakan
    Mar 27 at 13:14

















0















I have an online database and I put images there.
I use fetch to call webservice but it gives me an error because of images. how to handle this?



 fetch('url', 
method: 'POST',
headers: new Headers(
Accept: 'application/json',
Content-Type': 'application/json', // <-- Specifying the Content-Type
),
)
.then((response) =>
console.log(response);
);


this is my fetch. As I said When call web service it gives me an error because of not fetching images



I serializer in webservice like this :



public class Data

public string Ref get; set;

public int CharacterID get; set;
public string CharacterName get; set;
public string Regions get; set;
public string Rarity get; set;
public char Role get; set;
public string Origin get; set;
public int Power get; set;
public string Tag1 get; set;
public string Tag2 get; set;
public string Tag3 get; set;
public string RareMaterial get; set;
public string EpicMaterial get; set;
public string UniqueMaterial get; set;
public string Image get; set;


[JsonConverter(typeof(ImageConverter))]
public Image Images get; set;



public class ImageConverter : JsonConverter

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

var base64 = (string)reader.Value;
// convert base64 to byte array, put that into memory stream and feed to image
return Image.FromStream(new MemoryStream(Convert.FromBase64String(base64)));


public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

var image = (Image)value;
// save to memory stream in original format
var ms = new MemoryStream();
image.Save(ms, image.RawFormat);
byte[] imageBytes = ms.ToArray();
// write byte array, will be converted to base64 by JSON.NET
writer.WriteValue(imageBytes);


public override bool CanConvert(Type objectType)

return objectType == typeof(Image);




how to deserialize this in react-native ?










share|improve this question


























  • how you store your image on API? a path or format like base64

    – errorau
    Mar 27 at 12:55











  • Can you post the exact error you have ?

    – jgoday
    Mar 27 at 13:07











  • "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="w3.org/2003/05/soap-envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… xml:lang="en">Server was unable to process request. ---&gt; Root element is missing.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>"

    – hakan
    Mar 27 at 13:07











  • SOAP returns a xml. If you want to return a json with SOAP you must added as a CDATA in the response xml. What framework/library are you using in the server side ?

    – jgoday
    Mar 27 at 13:12











  • newtonSoft. By the way, How tO add CDATA ?

    – hakan
    Mar 27 at 13:14













0












0








0








I have an online database and I put images there.
I use fetch to call webservice but it gives me an error because of images. how to handle this?



 fetch('url', 
method: 'POST',
headers: new Headers(
Accept: 'application/json',
Content-Type': 'application/json', // <-- Specifying the Content-Type
),
)
.then((response) =>
console.log(response);
);


this is my fetch. As I said When call web service it gives me an error because of not fetching images



I serializer in webservice like this :



public class Data

public string Ref get; set;

public int CharacterID get; set;
public string CharacterName get; set;
public string Regions get; set;
public string Rarity get; set;
public char Role get; set;
public string Origin get; set;
public int Power get; set;
public string Tag1 get; set;
public string Tag2 get; set;
public string Tag3 get; set;
public string RareMaterial get; set;
public string EpicMaterial get; set;
public string UniqueMaterial get; set;
public string Image get; set;


[JsonConverter(typeof(ImageConverter))]
public Image Images get; set;



public class ImageConverter : JsonConverter

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

var base64 = (string)reader.Value;
// convert base64 to byte array, put that into memory stream and feed to image
return Image.FromStream(new MemoryStream(Convert.FromBase64String(base64)));


public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

var image = (Image)value;
// save to memory stream in original format
var ms = new MemoryStream();
image.Save(ms, image.RawFormat);
byte[] imageBytes = ms.ToArray();
// write byte array, will be converted to base64 by JSON.NET
writer.WriteValue(imageBytes);


public override bool CanConvert(Type objectType)

return objectType == typeof(Image);




how to deserialize this in react-native ?










share|improve this question
















I have an online database and I put images there.
I use fetch to call webservice but it gives me an error because of images. how to handle this?



 fetch('url', 
method: 'POST',
headers: new Headers(
Accept: 'application/json',
Content-Type': 'application/json', // <-- Specifying the Content-Type
),
)
.then((response) =>
console.log(response);
);


this is my fetch. As I said When call web service it gives me an error because of not fetching images



I serializer in webservice like this :



public class Data

public string Ref get; set;

public int CharacterID get; set;
public string CharacterName get; set;
public string Regions get; set;
public string Rarity get; set;
public char Role get; set;
public string Origin get; set;
public int Power get; set;
public string Tag1 get; set;
public string Tag2 get; set;
public string Tag3 get; set;
public string RareMaterial get; set;
public string EpicMaterial get; set;
public string UniqueMaterial get; set;
public string Image get; set;


[JsonConverter(typeof(ImageConverter))]
public Image Images get; set;



public class ImageConverter : JsonConverter

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

var base64 = (string)reader.Value;
// convert base64 to byte array, put that into memory stream and feed to image
return Image.FromStream(new MemoryStream(Convert.FromBase64String(base64)));


public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

var image = (Image)value;
// save to memory stream in original format
var ms = new MemoryStream();
image.Save(ms, image.RawFormat);
byte[] imageBytes = ms.ToArray();
// write byte array, will be converted to base64 by JSON.NET
writer.WriteValue(imageBytes);


public override bool CanConvert(Type objectType)

return objectType == typeof(Image);




how to deserialize this in react-native ?







react-native






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 13:01







hakan

















asked Mar 27 at 12:22









hakanhakan

5021 gold badge2 silver badges12 bronze badges




5021 gold badge2 silver badges12 bronze badges















  • how you store your image on API? a path or format like base64

    – errorau
    Mar 27 at 12:55











  • Can you post the exact error you have ?

    – jgoday
    Mar 27 at 13:07











  • "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="w3.org/2003/05/soap-envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… xml:lang="en">Server was unable to process request. ---&gt; Root element is missing.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>"

    – hakan
    Mar 27 at 13:07











  • SOAP returns a xml. If you want to return a json with SOAP you must added as a CDATA in the response xml. What framework/library are you using in the server side ?

    – jgoday
    Mar 27 at 13:12











  • newtonSoft. By the way, How tO add CDATA ?

    – hakan
    Mar 27 at 13:14

















  • how you store your image on API? a path or format like base64

    – errorau
    Mar 27 at 12:55











  • Can you post the exact error you have ?

    – jgoday
    Mar 27 at 13:07











  • "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="w3.org/2003/05/soap-envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… xml:lang="en">Server was unable to process request. ---&gt; Root element is missing.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>"

    – hakan
    Mar 27 at 13:07











  • SOAP returns a xml. If you want to return a json with SOAP you must added as a CDATA in the response xml. What framework/library are you using in the server side ?

    – jgoday
    Mar 27 at 13:12











  • newtonSoft. By the way, How tO add CDATA ?

    – hakan
    Mar 27 at 13:14
















how you store your image on API? a path or format like base64

– errorau
Mar 27 at 12:55





how you store your image on API? a path or format like base64

– errorau
Mar 27 at 12:55













Can you post the exact error you have ?

– jgoday
Mar 27 at 13:07





Can you post the exact error you have ?

– jgoday
Mar 27 at 13:07













"<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="w3.org/2003/05/soap-envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… xml:lang="en">Server was unable to process request. ---&gt; Root element is missing.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>"

– hakan
Mar 27 at 13:07





"<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="w3.org/2003/05/soap-envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… xml:lang="en">Server was unable to process request. ---&gt; Root element is missing.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>"

– hakan
Mar 27 at 13:07













SOAP returns a xml. If you want to return a json with SOAP you must added as a CDATA in the response xml. What framework/library are you using in the server side ?

– jgoday
Mar 27 at 13:12





SOAP returns a xml. If you want to return a json with SOAP you must added as a CDATA in the response xml. What framework/library are you using in the server side ?

– jgoday
Mar 27 at 13:12













newtonSoft. By the way, How tO add CDATA ?

– hakan
Mar 27 at 13:14





newtonSoft. By the way, How tO add CDATA ?

– hakan
Mar 27 at 13:14












0






active

oldest

votes










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%2f55377112%2fhow-to-take-image-with-webservice%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















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%2f55377112%2fhow-to-take-image-with-webservice%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

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript