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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jabdulius
    New Member
    • Jun 2007
    • 3

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

    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.n et/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:
    Code:
    sub send_wctp_old{
    	#my $url = "http://wctp.cingular.com:80/WCTP";
    	my $url = "http://wctp.att.net/WCTP";
    	print "TestEPaging::send_wctp_old()--Sending via WCTP to " . $url . " <BR>";
    
    	my $body = "<?xml version=\"1.0\"?><!DOCTYPE wctp-Operation SYSTEM \"http://www.skytel.com/protocols/dtds/wctp/wctpv1-0.dtd\">";
    	$body = $body . "<wctp-Operation wctpVersion=\"WCTP-DTD-1.1\"><wctp-SubmitClientMessage><wctp-SubmitClientHeader>";
    	$body = $body . "<wctp-ClientOriginator senderID=\"";
    	$body = $body . $from;
    	$body = $body . "\"/><wctp-Recipient recipientID=\"";
    	$body = $body . $to;
    	$body = $body . "\"/></wctp-SubmitClientHeader><wctp-Payload><wctp-Alphanumeric>";
    	$body = $body . $message;
    	$body = $body . "</wctp-Alphanumeric></wctp-Payload></wctp-SubmitClientMessage></wctp-Operation>";
    
    	#my $ua = LWP::UserAgent->new;
    	my $ua=new LWP::UserAgent;
    	my $header=new HTTP::Headers;
    	print "TestEPaging::send_wctp_old()--Created new UserAgent<BR>";
    
    	#my $http_response = $ua->request(POST $url, Content_Type => 'text/xml', Content => $body);	
    	
    	my $req = new HTTP::Request ("POST", $url, $header, Content => $body );
    
    	my $http_response=$ua->request($req);
    
    	print "TestEPaging::send_wctp_old()--Sent request<BR>";
    
    	if ($http_response->is_success){
    		print "TestEPaging::send_wctp_old()--Message sent successfully to " . $to;
    	}
    	else{
    		print "TestEPaging::send_wctp_old()--Message failed - " . $http_response->as_string;
    	}
    }
    And here's the error output I'm seeing:
    TestEpaging::ma in()--to=4255333734
    TestEpaging::ma in()--from=1111111111
    TestEpaging::ma in()--message=Hello
    TestEpaging::ma in()--protocol=WCTP

    TestEPaging::se nd_wctp_old()--Sending via WCTP to http://wctp.att.net/WCTP
    TestEPaging::se nd_wctp_old()--Created new UserAgent
    TestEPaging::se nd_wctp_old()--Sent request
    TestEPaging::se nd_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
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Do you normally send data to WCPT via "POST" method?

    Comment

    • miller
      Recognized Expert Top Contributor
      • Oct 2006
      • 1086

      #3
      I just want to point out that a lot cleaner way of composing your message would be the following:

      [CODE=perl]
      my $body = <<END;
      <?xml version="1.0"?> <!DOCTYPE wctp-Operation SYSTEM "http://www.skytel.com/protocols/dtds/wctp/wctpv1-0.dtd">
      <wctp-Operation wctpVersion="WC TP-DTD-1.1"><wctp-SubmitClientMes sage>
      <wctp-SubmitClientHea der>
      <wctp-ClientOriginato r senderID="$from "/>
      <wctp-Recipient recipientID="$t o"/>
      </wctp-SubmitClientHea der>
      <wctp-Payload>
      <wctp-Alphanumeric>$m essage</wctp-Alphanumeric>
      </wctp-Payload>
      </wctp-SubmitClientMes sage></wctp-Operation>
      END
      [/CODE]

      - Miller

      Comment

      Working...