|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2006
Location: Darlington, UK
Posts: 89
|
Noimet EPP service
I'm buildin an interface to work with the Nominet EPP service (http://www.nominet.org.uk/registrars...ms/nominetepp/) and I'm struggling on two seperate issues.
The first is that try as I might, I cannot get the code to communicate over the secure port of 700 on the testbed, it will only work on the non secure port despite me checking my firewall etc... The second issue is actually reading responses from the testbed server. This is what I have so far using a simple login test: PHP Code:
Any ideas? |
|
|
|
|
|
#2 |
|
SitePoint Enthusiast
![]() Join Date: Apr 2009
Location: Wallingford, CT
Posts: 91
|
Well your first issue is you have white space in your XML. Move the CFOutput Tags outside of the cfxml tag and then do not indent the initial xml tag. Do it just like that and it might help a little.
Code:
<cfoutput> <cfxml variable="xmlcommand"><?xml version="1.0" encoding="UTF-8"?> |
|
|
|
|
|
#3 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2006
Location: Darlington, UK
Posts: 89
|
Thanks for the message, I've actually switched to using this custom tag:
http://www.iexp.com/products/cfx_rawsocket/docs.cfm And it's connecting OK on port 700 but not returning any output from the EPP server. I'm still investigating but I've removed the whitespace now by both shifting the cfoutput tags and also applying Trim() to the xml. |
|
|
|
|
|
#4 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Dec 2008
Location: Aberdeen, Scotland
Posts: 228
|
Quote:
Is your Webserver (IIS, Apache) setup to allow incoming / outgoing traffic through port 700? You'll need that before anything will go out or come into ColdFusion. Also make sure that the SSL certificates are recognised by ColdFusion as that can be a problem if you're running version 6 (MX) or above. You need to import them into the keystore and truststore of JRun. Do a Google on it, plenty of example of how this can be done on there. ColdFusion will not make any calls to a domain it doesn't recognise through those stores. You'll be able to tell straight away though if that's the problem when trying to CFHTTP. |
|
|
|
|
|
|
#5 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2006
Location: Darlington, UK
Posts: 89
|
OK using the rawsocket tag I have confirmed everything is working as it should be by doing a simple GET on www.google.co.uk. As expected, the tag grabbed the source code for Google so I know it's working fine.
The server is open on port 700 and after speaking to Nominet they have confirmed that the login command is received and they say they are responding with the appropriate XML but nothing is being received here. This is what the tag is sending: PHP Code:
![]() |
|
|
|
|
|
#6 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Dec 2008
Location: Aberdeen, Scotland
Posts: 228
|
It might be worth downloading an HTTP sniffers (or use the one that comes with JRun) to see what is coming in and going out with your HTTP requests.
Something like Wireshark would do the job. Quote:
|
|
|
|
|
|
|
#7 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2006
Location: Darlington, UK
Posts: 89
|
OK I've gone back to Rays original code as the rawsocket was simply not working.
I've got it talking to the testbed now on a non-ssl basis. I'll figure out the ssl part later. Now. My Input stream is of an undefined length. That is to say, I don't know how long the xml string will be when returned from Nominet. I can enclose this chunk: PHP Code:
In response to the login command I would get: PHP Code:
PHP Code:
How do I find out when I am at the end of my returned stream of xml data? I feel like I am so close yet so far! ![]() |
|
|
|
|
|
#8 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Dec 2008
Location: Aberdeen, Scotland
Posts: 228
|
You should be parsing the string before you try and work with it
xmlParse(returnedString) From there you can use ColdFusion's XML functions to work through the nodes and lengths |
|
|
|
|
|
#9 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2006
Location: Darlington, UK
Posts: 89
|
Working with the xml is not the problem really, it's working out when I am at the end of my returned stream.
For example. If I loop over the stream 43 times (bear with me) I get this: PHP Code:
If I loop 44 times or more, the page hangs as I guess the end of the strem has been reached and CF doesn't know how to proceed. The problem is this line: line = input.readLine(); and I've got to try and figure out of the returned line is valid in which case loop again or not... |
|
|
|
|
|
#10 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Dec 2008
Location: Aberdeen, Scotland
Posts: 228
|
Is that the whole packet being returned there as it's not closed at the end? If not can you put one in here and I'll have look ;-). Bit confused as to where this missing > is from your example and the role of this input().readline.
|
|
|
|
|
|
#11 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2006
Location: Darlington, UK
Posts: 89
|
Well I got the > back by removing one of my trim command. the readLine() function reads that line from the incoming stream from the socket.
|
|
|
|
|
|
#12 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Dec 2008
Location: Aberdeen, Scotland
Posts: 228
|
Ahh ok seeing it all on my laptop. Serves me right for answering on my iPod :-).
I'm still a bit confused from your explanation as to what you're trying to do here. Just to clarify, your original comment of: Quote:
If I take your original example of: Code:
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
epp-1.0.xsd">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<trID>
<clTRID>ABC-12345</clTRID>
<svTRID>54321-XYZ</svTRID>
</trID>
</response>
</epp>
Code:
<cfset packet = '<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
epp-1.0.xsd">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<trID>
<clTRID>ABC-12345</clTRID>
<svTRID>54321-XYZ</svTRID>
</trID>
</response>
</epp>' />
<cfset x = xmlParse(packet) />
<!--- Output for example --->
<cfdump var="#x#" />
Code:
<cfset length = arrayLen(x.epp.response.xmlChildren) /> Nominet will be returning a specific structure from their service. They have a reference to a XSD in your second example so you could look at that for a pattern, but the theory beyond that should be the same as above. In terms of ColdFusion struggling I'm not sure what's the problem there, I'd need to see your code, but this approach shouldn't give it any problems. Cheers, James |
|
|
|
|
|
|
#13 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Dec 2008
Location: Aberdeen, Scotland
Posts: 228
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:01.










Linear Mode
