By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

Sending page via WCTP -- Internal Server Error -- Ewe

P: 3
Hi all,

I'm trying to send a page using Perl via the WCTP protocol. For some reason, I cannot connect to the host "wctp.att.net/WCTP" (or any host for that matter). I figure it must be some server configuration that I need to set. I don't think it's a port problem b/c I'm able to send a page via WCTP using the same port using a stand-alone app.

Anyhow, here's the code I'm using:
Expand|Select|Wrap|Line Numbers
  1. sub send_wctp_old{
  2.     #my $url = "http://wctp.cingular.com:80/WCTP";
  3.     my $url = "http://wctp.att.net/WCTP";
  4.     print "TestEPaging::send_wctp_old()--Sending via WCTP to " . $url . " <BR>";
  5.  
  6.     my $body = "<?xml version=\"1.0\"?><!DOCTYPE wctp-Operation SYSTEM \"http://www.skytel.com/protocols/dtds/wctp/wctpv1-0.dtd\">";
  7.     $body = $body . "<wctp-Operation wctpVersion=\"WCTP-DTD-1.1\"><wctp-SubmitClientMessage><wctp-SubmitClientHeader>";
  8.     $body = $body . "<wctp-ClientOriginator senderID=\"";
  9.     $body = $body . $from;
  10.     $body = $body . "\"/><wctp-Recipient recipientID=\"";
  11.     $body = $body . $to;
  12.     $body = $body . "\"/></wctp-SubmitClientHeader><wctp-Payload><wctp-Alphanumeric>";
  13.     $body = $body . $message;
  14.     $body = $body . "</wctp-Alphanumeric></wctp-Payload></wctp-SubmitClientMessage></wctp-Operation>";
  15.  
  16.     #my $ua = LWP::UserAgent->new;
  17.     my $ua=new LWP::UserAgent;
  18.     my $header=new HTTP::Headers;
  19.     print "TestEPaging::send_wctp_old()--Created new UserAgent<BR>";
  20.  
  21.     #my $http_response = $ua->request(POST $url, Content_Type => 'text/xml', Content => $body);    
  22.  
  23.     my $req = new HTTP::Request ("POST", $url, $header, Content => $body );
  24.  
  25.     my $http_response=$ua->request($req);
  26.  
  27.     print "TestEPaging::send_wctp_old()--Sent request<BR>";
  28.  
  29.     if ($http_response->is_success){
  30.         print "TestEPaging::send_wctp_old()--Message sent successfully to " . $to;
  31.     }
  32.     else{
  33.         print "TestEPaging::send_wctp_old()--Message failed - " . $http_response->as_string;
  34.     }
  35. }
And here's the error output I'm seeing:
TestEpaging::main()--to=4255333734
TestEpaging::main()--from=1111111111
TestEpaging::main()--message=Hello
TestEpaging::main()--protocol=WCTP

TestEPaging::send_wctp_old()--Sending via WCTP to http://wctp.att.net/WCTP
TestEPaging::send_wctp_old()--Created new UserAgent
TestEPaging::send_wctp_old()--Sent request
TestEPaging::send_wctp_old()--Message failed - 500 Can't connect to wctp.att.net:80 (connect: Unknown error) Content-Type: text/plain Client-Date: Thu, 28 Jun 2007 16:35:30 GMT Client-Warning: Internal response 500 Can't connect to wctp.att.net:80 (connect: Unknown error)

Any advice is much appreciated.
Thanks!
Karim Varela
Jun 28 '07 #1
Share this Question
Share on Google+
2 Replies


KevinADC
Expert 2.5K+
P: 4,059
Do you normally send data to WCPT via "POST" method?
Jun 28 '07 #2

miller
Expert 100+
P: 1,089
I just want to point out that a lot cleaner way of composing your message would be the following:

Expand|Select|Wrap|Line Numbers
  1.     my $body = <<END;
  2. <?xml version="1.0"?><!DOCTYPE wctp-Operation SYSTEM "http://www.skytel.com/protocols/dtds/wctp/wctpv1-0.dtd">
  3. <wctp-Operation wctpVersion="WCTP-DTD-1.1"><wctp-SubmitClientMessage>
  4. <wctp-SubmitClientHeader>
  5.     <wctp-ClientOriginator senderID="$from"/>
  6.     <wctp-Recipient recipientID="$to"/>
  7. </wctp-SubmitClientHeader>
  8. <wctp-Payload>
  9.     <wctp-Alphanumeric>$message</wctp-Alphanumeric>
  10. </wctp-Payload>
  11. </wctp-SubmitClientMessage></wctp-Operation>
  12. END
  13.  
- Miller
Jun 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.