Markus O'Reilly Posted October 28, 2009 Report Posted October 28, 2009 I'm trying to perform actions on the DB through the SOAP interface, but am having no luck. Here's what's happening: The computer I'm sending the requests from is not on the same network as the PBXnSIP server. All of my attempts to send SOAP requests to our PBXnSIP server result the server trying to redirect me to the login page. I've tried it on two different servers, but both give me the same result. I've also added my IP to the trusted IPs list on both servers, but still, no go. The requests I'm sending look identical to the ones in the samples. I'm really not sure what else to try. Maybe I'm missing some crucial step. I guess I don't know what I don't know. Has anyone run into this before/know what's going on? EDIT: This is the exact content being sent over to the PBXnSIP server: POST /soap.xml HTTP/1.1 Content-Type: text/xml; charset=utf-8 Host: the host Content-Length: 364 <?xml version="1.0" standalone="yes"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sns="http://www.pbxnsip.com/soap/pbx"> <env:Body> <sns:CreateExtension> <Domain>some domain</Domain> <Extension>555</Extension> <first_name>John</first_name> <display_name>Doe</display_name> </sns:CreateExtension> </env:Body> </env:Envelope> And this is the reply I get. I even get this reply when trying to follow the redirect to /login.htm: HTTP/1.1 302 Moved Temporarily Location: login.htm Content-Type: text/html Cache-Control: no-cache Cache-Control: no-store Set-Cookie: session=rnoyfd1id5s5fnemqf7l Content-Length: 156 <HTML><HEAD> <TITLE>Redirect</TITLE> </HEAD><BODY> If you don't get redirected automatically, please click <a href="login.htm">here</a> </BODY></HTML> I've tried sending requests with content-type text/xml, application/xml, and each with/without charset utf-8. (Note - the Host header doesn't actually say "the host", it has the ip address the request is being sent to). I've also tried it with HTTP/1.1 and HTTP/1.0. I doubt the problem is in what's being sent though. Suggestions? Quote
Vodia PBX Posted October 28, 2009 Report Posted October 28, 2009 Make sure that the content-type is either "application/xml" or "text/xml". Quote
Markus O'Reilly Posted October 28, 2009 Author Report Posted October 28, 2009 Make sure that the content-type is either "application/xml" or "text/xml". I've tried both of them. They both yield the same result. Anything else I can try? Quote
Markus O'Reilly Posted October 28, 2009 Author Report Posted October 28, 2009 Can you post the HTTP packet? You can get it with Wireshark, then follow the TCP traffic. My original post now includes the content being sent and what I get back. Quote
Vodia PBX Posted October 28, 2009 Report Posted October 28, 2009 My original post now includes the content being sent and what I get back. Yea sorry, stupid. I guess the problem is that you need a license key that allows you to do that! The log probably contains something line "SOAP: Need a professional license", right? Log level 5. Quote
pbx support Posted October 28, 2009 Report Posted October 28, 2009 Yea sorry, stupid. I guess the problem is that you need a license key that allows you to do that! The log probably contains something line "SOAP: Need a professional license", right? Log level 5. Also, remember to add this computer's IP address in the 'SOAP trusted IP" list. (Under Admin->Settings page) Quote
Markus O'Reilly Posted October 28, 2009 Author Report Posted October 28, 2009 Well, it's all figured out now. The problem didn't have anything to do with the licensing, we had gotten the trusted IP stuff mixed up a little. As soon as we got that going, it all worked like a charm Thanks for the help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.