Advertisement
Guest User

Untitled

a guest
Jun 11th, 2014
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. Failed to load resource: Origin http://localhost:8383 is not allowed by Access-Control-Allow-Origin. at http://HOST_IP:8082/geoserver/test/wfs
  2. XMLHttpRequest cannot load http://HOST_IP:8082/geoserver/test/wfs. Origin http://localhost:8383 is not allowed by Access-Control-Allow-Origin. (13:29:51:925 | error, javascript) at resources/webappv1.html
  3.  
  4. var xmlData =
  5. +'< wfs:Transactionn'
  6. + 'service = "WFS"n'
  7. + 'version = "1.0.0"n'
  8. + 'xmlns:wfs = "http://www.opengis.net/wfs"n'
  9. + 'xmlns:gml = "http://www.opengis.net/gml"n'
  10. + 'xmlns:test = "http://test.org"n'
  11. + 'xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" n'
  12. + 'xsi:schemaLocation = "http://www.opengis.net/wfs n'
  13. + 'http://HOST_IP:8082/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd n'
  14. + 'http://test.org/ n'
  15. + 'http://HOST_IP:8082/geoserver/test/wfs/DescribeFeatureType?
  16.  
  17. typename=test:user_poi">n'
  18. + '< wfs:Insert >n'
  19. + '< test:user_poi >n'
  20. + '< test:gid >' + gid + '< /test:gid>n'
  21. + '< test:id >' + id + '< /test:id>n'
  22. + '< test:tid >' + id + '< /test:tid>n'
  23. + '< test:auid >' + auid + '< /test:auid>n'
  24. + '< test:mdid >' + mdid + '< /test:mdid>n'
  25. + '< test:text >' + text + '< /test:text>n'
  26. + '< test:the_geom >n'
  27. + '< gml:Point srsDimension = "2" srsName = "urn:x-ogc:def:crs:EPSG:3857" n'
  28. + '< gml:coordinates decimal = "." cs = "," ts = " " >' + lat + ',' + long + '< /gml:coordinates>n'
  29. + '< /gml:Point>n'
  30. + '< /test:the_geom>n'
  31. + '< /test:user_poi>n'
  32. + '< /wfs:Insert>n'
  33. + '< /wfs:Transaction>n';
  34.  
  35. $.ajax({
  36. type: "POST",
  37. crossDomain: true,
  38. url: wfsurl,
  39. dataType: "xml",
  40. contentType: "text/xml",
  41. data: xmlData,
  42. xhrFields: {
  43. withCredentials: true
  44. },
  45. username: 'user',
  46. password: 'user',
  47. success: function(data, textStatus, request) {
  48. alert(request.getResponseHeader('some_header'));
  49. },
  50. error: function(request, textStatus, errorThrown) {
  51. alert(request.getResponseHeader('some_header'));
  52. }
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement