Guest Pats Posted July 14, 2008 Report Share Posted July 14, 2008 I need the XSD and WSDL definitions for tje SOAP XML coming from the PBXnSIP PBX so I can build a listener service to insert the CDR data into a SQL database. Quote Link to comment Share on other sites More sharing options...
Pradeep Posted July 14, 2008 Report Share Posted July 14, 2008 WSDLs are generally needed only if we(PBX) provide any web services APIs. Since we do not expose any web service APIs, WSDLs are not needed. XSDs are required for the use of web services APIs(for passing arguments and return values). So in our case it too is not needed, but we can probably define the XSDs and make it available for you. I need the XSD and WSDL definitions for tje SOAP XML coming from the PBXnSIP PBX so Ican build a listener service to insert the CDR data into a SQL database. Quote Link to comment Share on other sites More sharing options...
Pradeep Posted July 17, 2008 Report Share Posted July 17, 2008 We have created a wiki page for the schema definition for the CDR. http://wiki.pbxnsip.com/index.php/Processi...DR_from_the_PBX page explains about the SOAP CDR and http://wiki.pbxnsip.com/index.php/Cdr.xsd show the schema definition. WSDLs are generally needed only if we(PBX) provide any web services APIs. Since we do not expose any web service APIs, WSDLs are not needed.XSDs are required for the use of web services APIs(for passing arguments and return values). So in our case it too is not needed, but we can probably define the XSDs and make it available for you. Quote Link to comment Share on other sites More sharing options...
Victor Saldarriaga Posted February 23, 2009 Report Share Posted February 23, 2009 We are having some problems integrating the IVR SOAP interface to an external java app (Concourse Suite CRM). The SOAP marshallers and binding classes are created by a wsdl file we deviced --since it doesn't exist-- but the response we send back with the destination and CallID is not parsed by pbxnsip Soap consumer correctly. Unfortunately, we cannot create a soap endpoint by hand (we have done it in other standalone apps by parsing and generating the soap body like the wiki suggests) in this occasion. Any help would be appreciated. this is the wsdl: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://soap.com/pbx" xmlns:sns="http://www.pbxnsip.com/soap/pbx" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:tns="http://soap.com/pbx" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <!--wsdl:import namespace="http://www.pbxnsip.com/soap/pbx" location="IVROutput.xsd"/--> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sns="http://soap.com/pbx" targetNamespace="http://soap.com/pbx"> <xsd:complexType name="IVRInput"> <xsd:sequence> <xsd:element name="CallID" type="xsd:string"/> <xsd:element name="Output" type="xsd:string"/> <xsd:element name="From" type="xsd:string"/> <xsd:element name="To" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="IVRInput" type="tns:IVRInput"/> </xsd:schema> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.pbxnsip.com/soap/pbx" xmlns="http://www.pbxnsip.com/soap/pbx" elementFormDefault="qualified" attributeFormDefault="qualified"> <xsd:complexType name="IVROutput"> <xsd:sequence> <xsd:element name="CallID" nillable="true" type="xsd:string"/> <xsd:element name="Destination" nillable="true" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:element name="IVROutput" type="IVROutput"/> </xsd:schema> </wsdl:types> <wsdl:message name="IVRInputRequest"> <wsdl:part name="parameters" element="tns:IVRInput"> </wsdl:part> </wsdl:message> <wsdl:message name="IVRInputResponse"> <wsdl:part name="parameters" type="sns:IVROutput"> </wsdl:part> </wsdl:message> <wsdl:portType name="PBXServicePortType"> <wsdl:operation name="IVRInput"> <wsdl:input name="IVRInputRequest" message="tns:IVRInputRequest"> </wsdl:input> <wsdl:output name="IVRInputResponse" message="tns:IVRInputResponse"> </wsdl:output> </wsdl:operation> </wsdl:portType> <wsdl:binding name="PBXServiceHttpBinding" type="tns:PBXServicePortType"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="IVRInput"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="IVRInputRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="IVRInputResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="PBXService"> <wsdl:port name="PBXServiceHttpPort" binding="tns:PBXServiceHttpBinding"> <wsdlsoap:address location="http://192.168.252.62:8084/xfire/services/PBXService"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Quote Link to comment Share on other sites More sharing options...
Victor Saldarriaga Posted February 24, 2009 Report Share Posted February 24, 2009 We finally decided to code a plain servlet that parses the SOAP and generates the response, sometimes simpler is better. If anybody is interested, here is the code: ====== package co.com.vertical.concursive.ivr; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.HashMap; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jdom.Document; import org.jdom.Element; import org.jdom.Namespace; import org.jdom.input.SAXBuilder; import org.jdom.output.DOMOutputter; import org.jdom.output.XMLOutputter; import org.w3c.dom.NodeList; /** * Servlet implementation class SOAPServlet */ public class SOAPServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public SOAPServlet() { super(); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); response.setStatus(500); out.write("HTTP GET - No es soportado."); out.close(); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { OutputStream out = response.getOutputStream(); SAXBuilder builder = new SAXBuilder(); int contentLength = request.getContentLength(); if (contentLength <= 0) { response.setStatus(500);out.close();return; } try { // Read SOAP Request Document doc = builder.build(request.getInputStream()); DOMOutputter converter = new DOMOutputter(); org.w3c.dom.Document domDocument = converter.output(doc); String CallID = ""; String Output = ""; String From = ""; String To = ""; NodeList nodeList = domDocument.getDocumentElement().getElementsByTagName("CallID"); if ( nodeList.getLength() > 0 ) { CallID = nodeList.item(0).getTextContent(); } nodeList = domDocument.getDocumentElement().getElementsByTagName("Output"); if ( nodeList.getLength() > 0 ) { Output = nodeList.item(0).getTextContent(); } nodeList = domDocument.getDocumentElement().getElementsByTagName("From"); if ( nodeList.getLength() > 0 ) { From = nodeList.item(0).getTextContent(); } nodeList = domDocument.getDocumentElement().getElementsByTagName("To"); if ( nodeList.getLength() > 0 ) { To = nodeList.item(0).getTextContent(); } //Buscar Contacto. /* ServletContext app = this.getServletContext(); HashMap<String, IncomingCall> incoming = null; incoming = (HashMap<String, IncomingCall>)app.getAttribute("INCOMING_CALLS"); if ( incoming == null ) { incoming = new HashMap<String, IncomingCall>(); } */ createIncommingCall(Output); System.out.println("====\n"+CallID+"\n"+Output+"\n"+From+"\n"+To+"\n====\n"); //DEBUG// // Send SOAP Response response.setContentType("application/xml"); Namespace nsp1 = Namespace.getNamespace("env", "http://schemas.xmlsoap.org/soap/envelope/"); Namespace nsp2 = Namespace.getNamespace("sns", "http://www.pbxnsip.com/soap/pbx"); Element envelope = new Element("Envelope", nsp1); envelope.addNamespaceDeclaration(nsp2); Element body = new Element("Body", nsp1); Element ivrOutput = new Element("IVROutput", nsp2); Element callID = new Element("CallID").addContent(CallID); Element dest = new Element("Destination").addContent("71"); ivrOutput.addContent(callID); ivrOutput.addContent(dest); body.addContent(ivrOutput); envelope.addContent(body); XMLOutputter outputter = new XMLOutputter(); outputter.output(envelope, System.out); //DEBUG// outputter.output(envelope, out); } catch (Exception e) { e.printStackTrace(); response.setStatus(500); } out.close(); } private void createIncommingCall(String output) { } } Quote Link to comment Share on other sites More sharing options...
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.