Jump to content

USING SOAP TO CREATE TRUNKS/DIAL PLANS


Friedom-Tech

Recommended Posts

I’m writing in ASP.NET and sending a simple XML file to set up a basic trunk:

 

strXML &= "POST /soap.xml HTTP/1.0"

strXML &= "Content-Type:application/xml"

strXML &= "Content-Length: 400"

strXML &= "<?xml version='1.0' standalone='yes'?>"

strXML &= "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:sns='http://www.pbxnsip.com/soap/pbx'>"

strXML &= "<env:Body>"

strXML &= "<sns:CreateTrunk>"

strXML &= "<Domain>sip.jivetel.com</Domain>"

strXML &= "<Name>WinnerTest1</Name>"

strXML &= "<Type>register</Type>"

strXML &= "</sns:CreateTrunk>"

strXML &= "</env:Body>"

strXML &= "</env:Envelope>"

 

but i am getting a response "The given path's format is not supported" can anyone help me and tell me what i am doing wrong?

 

thank you;

Link to comment
Share on other sites

Take 'xmlns:sns='http://www.pbxnsip.com/soap/pbx' out and try.

 

The given path's format is not supported

 

If it makes it easier, I’m including the code that I’m using to connect. I’ve connected with SOAP using similar coding, but ever server is different:

 

--

Dim strXML As String = ""

strXML &= "POST /soap.xml HTTP/1.0"

strXML &= "Content-Type:application/xml"

strXML &= "Content-Length: 400"

strXML &= "<?xml version='1.0' standalone='yes'?>"

strXML &= "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"

strXML &= "<env:Body>"

strXML &= "<sns:CreateTrunk>"

strXML &= "<Domain>sip.jivetel.com</Domain>"

strXML &= "<Name>WinnerTest1</Name>"

strXML &= "</sns:CreateTrunk>"

strXML &= "</env:Body>"

strXML &= "</env:Envelope>"

 

'Send

Dim Xml_Returned As String

Try

Dim myWebClient As System.Net.WebClient = New System.Net.WebClient

Dim bytes() As Byte = myWebClient.UploadData("XX.XX.XXX.XXX:8080", "POST", System.Text.Encoding.UTF8.GetBytes(strXML))

myWebClient = Nothing

Xml_Returned = System.Text.Encoding.ASCII.GetString(bytes)

bytes = Nothing

Catch ex As Exception

Xml_Returned = ("<strong>Error returning xml:</strong> " + ex.Message)

End Try

 

 

please advise.

Link to comment
Share on other sites

Looks like the SOAP message is not even reaching the PBX.

Just to verify, try IP address instead of sip.jivetel.com. Also, I am assuming PBX is running at XX.XX.XXX.XXX:8080 (fyi... port 80 is the default port)

 

 

Is there any detailed error on the

 

The given path's format is not supported

 

If it makes it easier, I’m including the code that I’m using to connect. I’ve connected with SOAP using similar coding, but ever server is different:

 

--

Dim strXML As String = ""

strXML &= "POST /soap.xml HTTP/1.0"

strXML &= "Content-Type:application/xml"

strXML &= "Content-Length: 400"

strXML &= "<?xml version='1.0' standalone='yes'?>"

strXML &= "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"

strXML &= "<env:Body>"

strXML &= "<sns:CreateTrunk>"

strXML &= "<Domain>sip.jivetel.com</Domain>"

strXML &= "<Name>WinnerTest1</Name>"

strXML &= "</sns:CreateTrunk>"

strXML &= "</env:Body>"

strXML &= "</env:Envelope>"

 

'Send

Dim Xml_Returned As String

Try

Dim myWebClient As System.Net.WebClient = New System.Net.WebClient

Dim bytes() As Byte = myWebClient.UploadData("XX.XX.XXX.XXX:8080", "POST", System.Text.Encoding.UTF8.GetBytes(strXML))

myWebClient = Nothing

Xml_Returned = System.Text.Encoding.ASCII.GetString(bytes)

bytes = Nothing

Catch ex As Exception

Xml_Returned = ("<strong>Error returning xml:</strong> " + ex.Message)

End Try

 

 

please advise.

Link to comment
Share on other sites

Looks like the SOAP message is not even reaching the PBX.

Just to verify, try IP address instead of sip.jivetel.com. Also, I am assuming PBX is running at XX.XX.XXX.XXX:8080 (fyi... port 80 is the default port)

 

 

Is there any detailed error on the

 

HI;

 

i tried that but still get the same error message.

Link to comment
Share on other sites

I’m writing in ASP.NET and sending a simple XML file to set up a basic trunk:

 

strXML &= "POST /soap.xml HTTP/1.0"

strXML &= "Content-Type:application/xml"

strXML &= "Content-Length: 400"

strXML &= "<?xml version='1.0' standalone='yes'?>"

strXML &= "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:sns='http://www.pbxnsip.com/soap/pbx'>"

strXML &= "<env:Body>"

strXML &= "<sns:CreateTrunk>"

strXML &= "<Domain>sip.jivetel.com</Domain>"

strXML &= "<Name>WinnerTest1</Name>"

strXML &= "<Type>register</Type>"

strXML &= "</sns:CreateTrunk>"

strXML &= "</env:Body>"

strXML &= "</env:Envelope>"

 

but i am getting a response "The given path's format is not supported" can anyone help me and tell me what i am doing wrong?

 

 

 

Try adding a SPACE (CR LF) between these two lines.

 

Before:

strXML &= "Content-Length: 400"

strXML &= "<?xml version='1.0' standalone='yes'?>"

 

After:

strXML &= "Content-Length: 400"

strXML &= What ever equals CR LF in your program

strXML &= "<?xml version='1.0' standalone='yes'?>"

 

In VB6 I use vbCRLF

 

----------------------------------------------------------

 

At the end of the entire message add a CR LF or maybe 2 of them

 

Before:

strXML &= "</env:Body>"

strXML &= "</env:Envelope>"

 

After:

strXML &= "</env:Body>"

strXML &= "</env:Envelope>"

strXML &= What ever equals CR LF in your program

 

 

 

Bill H

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...