Larry Brister
asked on
Get response from Soap request
I have a simple page (SOAP Request) I can call in a browser or from SoapUI.org app
http://mywcfClient.com/Service.asmx?op=SendMail
I type in the two variables and it returns a success or fail string
How do I call that in a C# Web Page?
http://mywcfClient.com/Service.asmx?op=SendMail
I type in the two variables and it returns a success or fail string
How do I call that in a C# Web Page?
ASKER
(Domain Name protected...)
http://mywcfClient.com/Service.asmx
Clicking on the SendMail Method brings that link above
Feed in parameters...
Returns string with no problems
I added the service reference in my Web Site
--- INside a public string....
NO red underlines...
using (EWSendGridService.Service SoapClient client = new EWSendGridService.ServiceS oapClient( ))
{
string svc = client.SendMail("myusernam er","mypas sword");
return svc;
}
On the exception I get this
The content type text/plain; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 53 bytes of the response were: 'Request format is invalid: text/xml; charset=utf-8. '.
http://mywcfClient.com/Service.asmx
Clicking on the SendMail Method brings that link above
Feed in parameters...
Returns string with no problems
I added the service reference in my Web Site
--- INside a public string....
NO red underlines...
using (EWSendGridService.Service
{
string svc = client.SendMail("myusernam
return svc;
}
On the exception I get this
The content type text/plain; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 53 bytes of the response were: 'Request format is invalid: text/xml; charset=utf-8. '.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
kaufmed,
Tried that.
Same response... bad request
But this is the interesting thing
If I bring up that wcf directly in my chrome browser locally and ente the paramaters and execute
It returns the proper response
Locally if I execute through SoapUI... again... proper response...
On my live server
If I enter the url in chrome same thing... proper response
If I enter it in live Server Internet explorer OR try and run from code side however... "Bad Request"
Tried that.
Same response... bad request
But this is the interesting thing
If I bring up that wcf directly in my chrome browser locally and ente the paramaters and execute
It returns the proper response
Locally if I execute through SoapUI... again... proper response...
On my live server
If I enter the url in chrome same thing... proper response
If I enter it in live Server Internet explorer OR try and run from code side however... "Bad Request"
ASKER
I went another direction
Used something similar to this process...
Then handled the JSonData with NewtonSoft
Used something similar to this process...
WebRequest request = WebRequest.Create("http://api.openweathermap.org/data/2.5/forecast?lat=25.804453&lon=-80.199015&units=Imperial&APPID=cc64ba34ec4b92a98b753cd0e22eb5d0" + "");
WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
string str = String.Empty;
using (StreamReader sr = new StreamReader(data))
{
str = sr.ReadToEnd();
}
Then handled the JSonData with NewtonSoft
JSON?? SOAP returns only XML..
ASKER
ste5an
That's why I said I went another direction.
That's why I said I went another direction.
ASKER
Terribly sorry for the late get back guys
Was out of country traveling.
This answer worked on the original question
Was out of country traveling.
This answer worked on the original question
What does calling in "Web Page" mean? Consuming it on the client or server side? If it's server-side, than just add a service reference to your project.