Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request format is invalid #34

Closed
Zethar opened this issue Feb 3, 2014 · 5 comments
Closed

Request format is invalid #34

Zethar opened this issue Feb 3, 2014 · 5 comments
Labels

Comments

@Zethar
Copy link

Zethar commented Feb 3, 2014

Hi,

i have a Problem and nothing i do would help me. Sorry in this case for my bad english.

My Problem is:
I have coded an Cordova App with an simple execution for an existing WebService.
I have implemented

      $.soap({
       url: 'http://wsf.cdyne.com/WeatherWS/Weather.asmx/',
       method: 'GetCityWeatherByZIP',
       namespaceQualifier: 'ns1',
       namespaceUrl: 'http://ws.cdyne.com/WeatherWS/',
       params: {
       ZIP: '3',
       },
      success: function (soapResponse) {
       // do stuff with soapResponse
       // if you want to have the response as JSON use soapResponse.toJSON();
       // or soapResponse.toString() to get XML string
       // or soapResponse.toXML() to get XML DOM
       alert ("GEHT");
       },
       error: function (SOAPResponse) {
       alert (SOAPResponse);
       // show error
       }
       });

The WebService i will to get work with is : http://www.service-repository.com/operation/show?operation=GetCityWeatherByZIP&portType=WeatherSoap&id=58

The Issue that i get is : Request format is invalid : text/xml; charset:UTF-8.

Can any one help with that issue?

@doedje
Copy link
Owner

doedje commented Feb 3, 2014

Where is the error coming from? Is it from you webservice or is it thrown by jquery or jquery.soap? maybe even before something is send to the server? Can you use firebug (or similar) to see WHAT is send to server and what the response is?

just to rule out the number-one error: read and make sure this is not due to same-origin-policy

@Zethar
Copy link
Author

Zethar commented Feb 3, 2014

with jquery ajax call all is running

I think the Error is coming from sending the Information for the Soap Request.

I Use Jquery.Soap to call the Webservice from the Link above. With Cordova (IOS App) i can call Webservices from everyone... no same-origin-policy.

i think the Error is in my $soap code :(

@doedje
Copy link
Owner

doedje commented Feb 3, 2014

I have been toying around with the webservice but it keeps returning me errors.....
I read the docs that go with it and wondered why you don't use:

$.get('http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP?ZIP=23454', function(data) { console.log(data); });

No need to use jquery.soap if you aint gonna send SOAP anyway...

@Zethar
Copy link
Author

Zethar commented Feb 4, 2014

i would like to use the soap plugin. My Endprojekt will get Data from an SOAP Service, so i want to try it this way. Without the Soap Plugin it works, thats the understanding point ...

Anyway, thanks for your help.

@doedje
Copy link
Owner

doedje commented Feb 4, 2014

I did get past the 'Request format is invalid: text/xml; charset:UTF-8' part by omitting sending that in my proxy script (I used the included demo with a php proxy-script to overcome same-origin-policy in the demo/test environment)
But the next error it gives me is a:

Missing parameter: ZIP

Strangly tho, the SOAP message I send is exactly the same as in their demo.... I have never had problems like this with the plugin and I am convinced the problem is with the WebService and not with the plugin.....

Wish you luck, any further questions are welcome! =]

@doedje doedje added the question label Feb 4, 2014
@doedje doedje closed this as completed Feb 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants