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

Getting 500 Internal server error #76

Closed
harisainathuni opened this issue Apr 2, 2015 · 4 comments
Closed

Getting 500 Internal server error #76

harisainathuni opened this issue Apr 2, 2015 · 4 comments

Comments

@harisainathuni
Copy link

Hi,
I started using this plugin in one of my application where my application (angular js) deployed on localhost:7001 and the SOAP based web service deployed on the same weblogic server and it is accessible using the following URL

I am using the following code to invoke the service

$.soap({
                url: 'http://localhost:8011/POC/proxy-service/MatchingProxyService?wsdl',
                method: 'Details',
                SOAPAction: 'Details',
                //noPrefix: false,
                namespaceQualifier: 'pol',
                namespaceURL: 'http://api//webservices/matchingservice',
                elementName: 'PolicyMatchingRequest',
                appendMethodToURL: false,
                //async:true,
                data:{

                        searchId:'1',
                        ssnNumber:'100',
                        firstName:'string',
                        lastName:'string',
                        dateOfBirth:'string',
                        address1:'string',
                        address2:'string',
                        city:'string',
                        state:'string',
                        zip:'100'
                },



                  enableLogging: true,
                  //HTTPHeaders: {                                  // additional http headers send with the $.ajax call, will be given to $.ajax({ headers: })
                  //      'X-Requested-With': 'XMLHttpRequest'
                  //  },
                  beforeSend: function (SOAPEnvelope) {
                      console.log("soap-env: " + SOAPEnvelope.toString());
                      alert('SOAPEnvelope::'+ SOAPEnvelope.toString());
                            },
                  success: function (SOAPResponse) {
                      console.log(SOAPResponse);
                      alert('SOAPSuccess::'+ SOAPResponse.toString());                    
                  },
                  error: function(SOAPResponse) {
                      console.log(SOAPResponse);
                      alert('SOAPError::'+ SOAPResponse.toString());
                    },

                    statusCode: {
                        404: function() {
                            console.log('404');
                        },
                        200: function() {
                            console.log('200');
                        }
                    }
                });

Initially I was getting issue related to same origin policy but I enabled CORS on the server . I am still getting 500 internal server.

I enabled logging at the service and I see it is being hit with no SOAP data being passed. Not sure where I am going wrong. Would you please point me in right direction.
Appreciate your help on this

@doedje
Copy link
Owner

doedje commented Apr 2, 2015

Dear harisainathuni,

For me it is always pretty hard to pinpoint the exact problem people experience implementing $.soap due to the overwhelming differences in soap server implementations. I wish it was not this way, but sadly it is.....

So here are a few things to help you out:

  • Your url is pointing to a wsdl, that's not good....
  • Try setting up the call you need in the demo page. It is easy to tweak around with all the options $.soap in there and it gives you some feedback on the request as it is send to the server and the response....

I am afraid that's all I can do for you now.... When you do get a little further and have another question, feel free!

@harisainathuni
Copy link
Author

Thanks for the quick reply. Really Appreciate that. I made the changes suggested by you and according to the console log I was able to see the soap envelope object in the before send method
soap-env:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <pol:PolicyMatchingRequest xmlns:pol="http://api/hms/webservices/policymatchingservice>
    <pol:searchId>1</pol:searchId>
    <pol:ssnNumber>100</pol:ssnNumber>
    <pol:firstName>string</pol:firstName>
    <pol:lastName>string</pol:lastName>
    <pol:dateOfBirth>string</pol:dateOfBirth>
    <pol:address1>string</pol:address1>
    <pol:address2>string</pol:address2>
    <pol:city>string</pol:city>
    <pol:state>string</pol:state>
    <pol:zip>100</pol:zip>
  </pol:PolicyMatchingRequest>
</soap:Body>
</soap:Envelope>

After which I am getting the following errors
OPTIONS http://localhost:8011/ARUIPoc/proxy-service/PolicyMatchingProxyService

XMLHttpRequest cannot load http://localhost:8011/ARUIPoc/proxy-service/PolicyMatchingProxyService. Invalid HTTP status code 500
["jquery.soap - error:", ""]
SOAPResponse {typeOf: "SOAPResponse", status: "error", headers: Array[1], httpCode: 0, httpText: "error"…}

I wonder are there any other parameters that I need to set or did I wrongly set any parameters.

@doedje
Copy link
Owner

doedje commented Apr 4, 2015

what is your $.soap call look like now?

@doedje
Copy link
Owner

doedje commented Apr 4, 2015

And can you see the error the server is throwing at you in the console... There might be some useful info in there....

@doedje doedje closed this as completed May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants